From 748b77807730bf004eff2ddce7702a8677156c60 Mon Sep 17 00:00:00 2001 From: "jacob.leygonie" Date: Fri, 2 Jun 2023 13:31:22 +0200 Subject: [PATCH 001/213] add_liquidity protection: always check the two amounts deposited are bigger than expected --- dex/pair/src/liquidity_pool.rs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/dex/pair/src/liquidity_pool.rs b/dex/pair/src/liquidity_pool.rs index ba8d460f0..5666b5729 100644 --- a/dex/pair/src/liquidity_pool.rs +++ b/dex/pair/src/liquidity_pool.rs @@ -139,11 +139,6 @@ pub trait LiquidityPoolModule: ); if &second_token_amount_optimal <= second_token_amount_desired { - require!( - second_token_amount_optimal >= context.second_token_amount_min, - ERROR_INSUFFICIENT_SECOND_TOKEN - ); - context.first_token_optimal_amount = first_token_amount_desired.clone(); context.second_token_optimal_amount = second_token_amount_optimal; } else { @@ -156,14 +151,17 @@ pub trait LiquidityPoolModule: &first_token_amount_optimal <= first_token_amount_desired, ERROR_OPTIMAL_GRATER_THAN_PAID ); - require!( - first_token_amount_optimal >= context.first_token_amount_min, - ERROR_INSUFFICIENT_FIRST_TOKEN - ); - context.first_token_optimal_amount = first_token_amount_optimal; context.second_token_optimal_amount = second_token_amount_desired.clone(); } + require!( + context.first_token_optimal_amount >= context.first_token_amount_min, + ERROR_INSUFFICIENT_FIRST_TOKEN + ); + require!( + context.second_token_optimal_amount >= context.second_token_amount_min, + ERROR_INSUFFICIENT_SECOND_TOKEN + ); } fn get_token_for_given_position( From e1f99c4e34d71afd2da8333a295360fd06f06b1f Mon Sep 17 00:00:00 2001 From: "jacob.leygonie" Date: Fri, 2 Jun 2023 13:34:39 +0200 Subject: [PATCH 002/213] Fixed spacing --- dex/pair/src/liquidity_pool.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dex/pair/src/liquidity_pool.rs b/dex/pair/src/liquidity_pool.rs index 5666b5729..5e292e199 100644 --- a/dex/pair/src/liquidity_pool.rs +++ b/dex/pair/src/liquidity_pool.rs @@ -159,8 +159,8 @@ pub trait LiquidityPoolModule: ERROR_INSUFFICIENT_FIRST_TOKEN ); require!( - context.second_token_optimal_amount >= context.second_token_amount_min, - ERROR_INSUFFICIENT_SECOND_TOKEN + context.second_token_optimal_amount >= context.second_token_amount_min, + ERROR_INSUFFICIENT_SECOND_TOKEN ); } From cee042eff96d0545e4ae270380552d7d1285bff8 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Tue, 4 Jul 2023 11:37:17 +0300 Subject: [PATCH 003/213] router pair map migration --- dex/router/src/contract.rs | 16 ++++++++++++++++ dex/router/src/factory.rs | 14 +++++++++++--- dex/router/tests/router_setup/mod.rs | 13 +++++++++++++ dex/router/tests/router_test.rs | 5 +++++ 4 files changed, 45 insertions(+), 3 deletions(-) diff --git a/dex/router/src/contract.rs b/dex/router/src/contract.rs index 693c7fe23..a2305d6ee 100644 --- a/dex/router/src/contract.rs +++ b/dex/router/src/contract.rs @@ -322,6 +322,8 @@ pub trait Router: .unwrap_or_else(ManagedAddress::zero); } + self.address_pair_map().remove(&pair_address); + pair_address } @@ -394,6 +396,20 @@ pub trait Router: self.pair_creation_enabled().set(enabled); } + #[only_owner] + #[endpoint(migratePairMap)] + fn migrate_pair_map(&self) { + let pair_map = self.pair_map(); + let mut address_pair_map = self.address_pair_map(); + require!( + address_pair_map.is_empty(), + "The destination mapper must be empty" + ); + for (pair_tokens, address) in pair_map.iter() { + address_pair_map.insert(address, pair_tokens); + } + } + #[view(getPairCreationEnabled)] #[storage_mapper("pair_creation_enabled")] fn pair_creation_enabled(&self) -> SingleValueMapper; diff --git a/dex/router/src/factory.rs b/dex/router/src/factory.rs index bd4b803ca..c0badf49c 100644 --- a/dex/router/src/factory.rs +++ b/dex/router/src/factory.rs @@ -69,6 +69,13 @@ pub trait FactoryModule { }, new_address.clone(), ); + self.address_pair_map().insert( + new_address.clone(), + PairTokens { + first_token_id: first_token_id.clone(), + second_token_id: second_token_id.clone(), + }, + ); self.pair_temporary_owner().insert( new_address.clone(), ( @@ -167,9 +174,7 @@ pub trait FactoryModule { fn check_is_pair_sc(&self, pair_address: &ManagedAddress) { require!( - self.pair_map() - .values() - .any(|address| &address == pair_address), + self.address_pair_map().contains_key(pair_address), "Not a pair SC" ); } @@ -215,6 +220,9 @@ pub trait FactoryModule { #[storage_mapper("pair_map")] fn pair_map(&self) -> MapMapper, ManagedAddress>; + #[storage_mapper("address_pair_map")] + fn address_pair_map(&self) -> MapMapper>; + #[view(getPairTemplateAddress)] #[storage_mapper("pair_template_address")] fn pair_template_address(&self) -> SingleValueMapper; diff --git a/dex/router/tests/router_setup/mod.rs b/dex/router/tests/router_setup/mod.rs index a7cd6c14c..5ae289138 100644 --- a/dex/router/tests/router_setup/mod.rs +++ b/dex/router/tests/router_setup/mod.rs @@ -282,4 +282,17 @@ where ) .assert_ok(); } + + pub fn migrate_pair_map(&mut self) { + self.blockchain_wrapper + .execute_tx( + &self.owner_address, + &self.router_wrapper, + &rust_biguint!(0u64), + |sc| { + sc.migrate_pair_map(); + }, + ) + .assert_ok(); + } } diff --git a/dex/router/tests/router_test.rs b/dex/router/tests/router_test.rs index 5c3e50812..83bd772d3 100644 --- a/dex/router/tests/router_test.rs +++ b/dex/router/tests/router_test.rs @@ -33,6 +33,7 @@ fn test_router_setup() { #[test] fn test_multi_pair_swap() { let mut router_setup = RouterSetup::new(router::contract_obj, pair::contract_obj); + router_setup.migrate_pair_map(); router_setup.add_liquidity(); @@ -153,6 +154,8 @@ fn user_enable_pair_swaps_through_router_test() { managed_address!(pair_wrapper.address_ref()), ); + sc.migrate_pair_map(); + sc.add_common_tokens_for_user_pairs(MultiValueEncoded::from(ManagedVec::from(vec![ managed_token_id!(USDC_TOKEN_ID), ]))); @@ -338,6 +341,8 @@ fn user_enable_pair_swaps_fail_test() { managed_address!(pair_wrapper.address_ref()), ); + sc.migrate_pair_map(); + sc.add_common_tokens_for_user_pairs(MultiValueEncoded::from(ManagedVec::from(vec![ managed_token_id!(USDC_TOKEN_ID), ]))); From 76be30a2e64f668fdae587419dd9ddace16c667b Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Mon, 10 Jul 2023 15:59:00 +0300 Subject: [PATCH 004/213] safe price v2 README documentation --- dex/pair/README.md | 170 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 170 insertions(+) diff --git a/dex/pair/README.md b/dex/pair/README.md index 77c109533..6c8954d9b 100644 --- a/dex/pair/README.md +++ b/dex/pair/README.md @@ -213,3 +213,173 @@ The interaction scripts are located in the _dex/interaction_ directory. The scri ## Deployment The deployment of this contract is done by the Router smart contract but it can be done also in a standalone manner using the erdpy interaction scripts for deploy/upgrade. + + +# Safe Price V2 + +## General overview + +The new safe price mechanism is an updated module of the __Pair SC__, designed to stabilize prices over a number of rounds, creating a smoother, more predictable pricing pattern in the __xExchange__ liquidity pools. The mechanism achieves this by storing accumulated reserves over time, with each recorded round representing a snapshot of token reserves at that point in time. This collection of reserve data is then processed through a variety of algorithms to compute and retrieve the safe price. Notably, the mechanism operates through a central view factory contract, which manages requests for all active smart contract pairs. The view factory contract accepts the address of the desired pair as a parameter in its view functions, simplifying the process of querying for data. + +__Important. The Safe Price module retrieves data independently of the liquidity pool's state. As such, even if a pair smart contract is paused, the safe price module will continue to return data. If an external contract requires more control or context concerning the data, it needs to first check the liquidity pool's status manually and subsequently utilize the safe price data according to its needs.__ + +## Features + +- __Accumulated Reserves:__ The mechanism consistently stores the accumulated reserves over time. Each round creates a snapshot of the token reserves for that time, with the weight of a __PriceObservation__ for a round being the difference between the last saved round and the current one. +- __Price Observations:__ Each round's reserves, once calculated and stored, are then saved in a __PriceObservation__ struct for the subsequent round (n+1). This allows for a clear record of price changes and liquidity over time. +- __Circular List Storage and Binary Search:__ Price observations are stored in a circular list, which is an efficient data structure for storing the rolling price data. A binary search algorithm is used to find specific __PriceObservations__ in this list. +- __Linear Interpolation:__ If a price observation was not saved for a requested round, the algorithm will perform a linear interpolation between the nearest price observations to estimate the price for that round. +- __Error Handling:__ To maintain data integrity, a request for a price observation older than the oldest stored observation will result in a SC error. This mechanism helps to prevent the use of outdated or non-existent data. +- __Versatile Safe Price Request Inputs:__ The mechanism offers several view functions, each providing a different way to request the safe price. These views give users flexibility in querying the safe price by either providing all necessary parameters or using default ones. + +## Endpoints + +### getSafePrice + +```rust + #[view(getSafePrice)] + fn get_safe_price( + &self, + pair_address: ManagedAddress, + start_round: Round, + end_round: Round, + input_payment: EsdtTokenPayment, + ) -> EsdtTokenPayment +``` + +This function allows you to retrieve the safe price by specifying the pair address, start round, end round, and input payment. +It returns the corresponding output payment computed at the safe price. + +### getSafePriceByRoundOffset + +```rust + #[view(getSafePriceByRoundOffset)] + fn get_safe_price_by_round_offset( + &self, + pair_address: ManagedAddress, + round_offset: u64, + input_payment: EsdtTokenPayment, + ) -> EsdtTokenPayment +``` + +This function allows you to retrieve the safe price by specifying the pair address, round offset, and input payment. It calls the generic __getSafePrice__ endpoint, by automatically computing the end_round parameter as the current block round, and the start_round as the difference between the current_round and the provided round_offset. +It returns the corresponding output payment computed at the safe price. + +### getSafePriceByDefaultOffset + +```rust + #[view(getSafePriceByDefaultOffset)] + fn get_safe_price_by_default_offset( + &self, + pair_address: ManagedAddress, + input_payment: EsdtTokenPayment, + ) -> EsdtTokenPayment +``` + +This function allows you to retrieve the safe price by specifying the pair address and input payment. It works in the same way as __getSafePriceByRoundOffset__ endpoint, but instead of using a provided round_offset parameter, it uses a default one, which at this moment is set to 600 rounds (which translates in an one hour window). +It returns the corresponding output payment computed at the safe price. + +### getSafePriceByTimestampOffset + +```rust + #[view(getSafePriceByTimestampOffset)] + fn get_safe_price_by_timestamp_offset( + &self, + pair_address: ManagedAddress, + timestamp_offset: u64, + input_payment: EsdtTokenPayment, + ) -> EsdtTokenPayment +``` + +A more specific view function, it allows you to retrieve the safe price by specifying the pair address, a timestamp offset, and input payment. It basically converts the timestamp_offset value to a generic round_offset, by dividing it with the constant value __SECONDS_PER_ROUND__. +It returns the corresponding output payment computed at the safe price. + +### getLpTokensSafePrice + +```rust + #[view(getLpTokensSafePrice)] + fn get_lp_tokens_safe_price( + &self, + pair_address: ManagedAddress, + start_round: Round, + end_round: Round, + liquidity: BigUint, + ) -> MultiValue2 +``` + +This function allows you to simulate the value of both tokens within a liquidity pool based on a provided LP token amount. It receives the pair address, the start and end rounds, and the amount of LP tokens as parameters. +The function returns two output payments, one for each token in the pair, with their values computed at the safe price. + +### getLpTokensSafePriceByRoundOffset + +```rust + #[view(getLpTokensSafePriceByRoundOffset)] + fn get_lp_tokens_safe_price_by_round_offset( + &self, + pair_address: ManagedAddress, + round_offset: Round, + liquidity: BigUint, + ) -> MultiValue2 +``` + +This function allows you to simulate the value of both tokens within a liquidity pool based on a provided LP token amount. It receives the pair address, a round_offset, and the amount of LP tokens as parameters. It works in the same way as the __getSafePriceByRoundOffset__ function for the round_offset, by computing the end round and the start round automatically, using the current block round and the round offset variable. +The function returns two output payments, one for each token in the pair, with their values computed at the safe price. + +### getLpTokensSafePriceByDefaultOffset + +```rust + #[view(getLpTokensSafePriceByDefaultOffset)] + fn get_lp_tokens_safe_price_by_default_offset( + &self, + pair_address: ManagedAddress, + liquidity: BigUint, + ) -> MultiValue2 +``` + +This function allows you to simulate the value of both tokens within a liquidity pool based on a provided LP token amount. It receives the pair address and the amount of LP tokens as parameters and works similarly to __getLpTokensSafePriceByRoundOffset__ endpoint, but instead of using a provided round_offset variable, it uses a default one which at this moment is set to 600 rounds (which translates in an one hour window). +The function returns two output payments, one for each token in the pair, with their values computed at the safe price. + +### getLpTokensSafePriceByTimestampOffset + +```rust + #[view(getLpTokensSafePriceByTimestampOffset)] + fn get_lp_tokens_safe_price_by_timestamp_offset( + &self, + pair_address: ManagedAddress, + timestamp_offset: u64, + liquidity: BigUint, + ) -> MultiValue2 +``` + +This function allows you to simulate the value of both tokens within a liquidity pool based on a provided LP token amount. It receives the pair address, a timestamp_offset and the amount of LP tokens as parameters. Again, like the __getLpTokensSafePriceByRoundOffset__ endpoint, which automatically computes the start and end rounds of the query, this function calculates the round offset by dividing the timestamp_offset to a generic __SECONDS_PER_ROUND__ constant value. +The function returns two output payments, one for each token in the pair, with their values computed at the safe price. + +## Legacy endpoints + +In order to avoid backwards compatibility issues, the two legacy endpoints from Safe Price V1 were kept, but they now use the new Safe Price V2 logic. One important aspect here is that they are not part of the Safe Price V2 view factory contract, but instead they are actual endpoints in the __Pair SC__. + +### updateAndGetTokensForGivenPositionWithSafePrice + +```rust + #[endpoint(updateAndGetTokensForGivenPositionWithSafePrice)] + fn update_and_get_tokens_for_given_position_with_safe_price( + &self, + liquidity: BigUint, + ) -> MultiValue2, EsdtTokenPayment> +``` + +This legacy endpoint is kept for backwards compatibility purposes, but it now works the same as the __getLpTokensSafePriceByDefaultOffset__ view function, by using the contract address as the pair_address. It receives only one parameter, the amount of LP tokens. +The function returns two output payments, one for each token in the pair, with their values computed at the safe price. + +### updateAndGetSafePrice + +```rust + #[endpoint(updateAndGetSafePrice)] + fn update_and_get_safe_price( + &self, + input: EsdtTokenPayment, + ) -> EsdtTokenPayment +``` + +This legacy endpoint is kept for backwards compatibility purposes, but it now works the same as the __getSafePriceByDefaultOffset__ view function, by using the contract address as the pair_address. It receives only one parameter, the input payment. +It returns the corresponding output payment computed at the safe price. From 8a679a584c94df3ab807b4034ef897efbf13bae6 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Thu, 10 Aug 2023 11:21:34 +0300 Subject: [PATCH 005/213] text fixes --- dex/pair/README.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/dex/pair/README.md b/dex/pair/README.md index 6c8954d9b..076cffdf6 100644 --- a/dex/pair/README.md +++ b/dex/pair/README.md @@ -225,14 +225,14 @@ __Important. The Safe Price module retrieves data independently of the liquidity ## Features -- __Accumulated Reserves:__ The mechanism consistently stores the accumulated reserves over time. Each round creates a snapshot of the token reserves for that time, with the weight of a __PriceObservation__ for a round being the difference between the last saved round and the current one. +- __Accumulated Reserves:__ The mechanism consistently stores the accumulated reserves over time. Each round in which the liquidity pool contract is used creates a snapshot of the token reserves for that time, with the weight of a __PriceObservation__ for a round being the difference between the last saved round and the current one. - __Price Observations:__ Each round's reserves, once calculated and stored, are then saved in a __PriceObservation__ struct for the subsequent round (n+1). This allows for a clear record of price changes and liquidity over time. - __Circular List Storage and Binary Search:__ Price observations are stored in a circular list, which is an efficient data structure for storing the rolling price data. A binary search algorithm is used to find specific __PriceObservations__ in this list. -- __Linear Interpolation:__ If a price observation was not saved for a requested round, the algorithm will perform a linear interpolation between the nearest price observations to estimate the price for that round. -- __Error Handling:__ To maintain data integrity, a request for a price observation older than the oldest stored observation will result in a SC error. This mechanism helps to prevent the use of outdated or non-existent data. -- __Versatile Safe Price Request Inputs:__ The mechanism offers several view functions, each providing a different way to request the safe price. These views give users flexibility in querying the safe price by either providing all necessary parameters or using default ones. +- __Linear Interpolation:__ If a price observation is not available for a queried round, the algorithm will perform a linear interpolation between the nearest price observations to estimate the price for that round. +- __Error Handling:__ To maintain data integrity, a query for a price observation older than the oldest stored observation will result in a SC error. This mechanism helps to prevent the use of outdated or non-existent data. +- __Versatile Safe Price Request Inputs:__ The mechanism offers several view functions, each providing a different way to query the safe price. These views give users flexibility in querying the safe price by either providing all necessary parameters or using default ones. -## Endpoints +## Endpoints available on the View factory contract ### getSafePrice @@ -293,6 +293,8 @@ It returns the corresponding output payment computed at the safe price. A more specific view function, it allows you to retrieve the safe price by specifying the pair address, a timestamp offset, and input payment. It basically converts the timestamp_offset value to a generic round_offset, by dividing it with the constant value __SECONDS_PER_ROUND__. It returns the corresponding output payment computed at the safe price. +__Important. The output of this endpoint (and any timestamp related endpoint) will return reliable data as long as the timestamp constant will remain unchanged at the protocol level.__ + ### getLpTokensSafePrice @@ -357,6 +359,7 @@ The function returns two output payments, one for each token in the pair, with t ## Legacy endpoints In order to avoid backwards compatibility issues, the two legacy endpoints from Safe Price V1 were kept, but they now use the new Safe Price V2 logic. One important aspect here is that they are not part of the Safe Price V2 view factory contract, but instead they are actual endpoints in the __Pair SC__. +__Important. These endpoints are planned to be phased out at any point in future, thus we consider them as deprecated and we recommend the usage of the ones available in the View factory contract.__ ### updateAndGetTokensForGivenPositionWithSafePrice From 4ad9758127e3c21c095175411105d5fcd8eb83da Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Tue, 15 Aug 2023 01:31:04 +0300 Subject: [PATCH 006/213] farm position functionality --- common/modules/farm/farm_base_impl/Cargo.toml | 3 + .../farm/farm_base_impl/src/claim_rewards.rs | 7 +- .../farm_base_impl/src/compound_rewards.rs | 7 +- .../farm/farm_base_impl/src/enter_farm.rs | 6 + .../farm/farm_base_impl/src/exit_farm.rs | 5 +- common/modules/farm/farm_base_impl/src/lib.rs | 1 + common/modules/farm/farm_position/Cargo.toml | 27 +++++ .../farm/farm_position/src/farm_position.rs | 103 ++++++++++++++++++ dex/farm-with-locked-rewards/Cargo.toml | 3 + dex/farm-with-locked-rewards/elrond.json | 3 - dex/farm-with-locked-rewards/src/lib.rs | 1 + dex/farm-with-locked-rewards/wasm/Cargo.lock | 15 +++ dex/farm-with-locked-rewards/wasm/src/lib.rs | 7 +- dex/farm/Cargo.toml | 3 + dex/farm/src/base_functions.rs | 13 ++- dex/farm/src/claim_boost_only.rs | 32 ++++++ dex/farm/src/lib.rs | 1 + dex/farm/wasm/Cargo.lock | 14 +++ dex/farm/wasm/src/lib.rs | 7 +- 19 files changed, 246 insertions(+), 12 deletions(-) create mode 100644 common/modules/farm/farm_position/Cargo.toml create mode 100644 common/modules/farm/farm_position/src/farm_position.rs delete mode 100644 dex/farm-with-locked-rewards/elrond.json diff --git a/common/modules/farm/farm_base_impl/Cargo.toml b/common/modules/farm/farm_base_impl/Cargo.toml index db5644507..91ac14e3d 100644 --- a/common/modules/farm/farm_base_impl/Cargo.toml +++ b/common/modules/farm/farm_base_impl/Cargo.toml @@ -12,6 +12,9 @@ path = "../config" [dependencies.farm_token] path = "../farm_token" +[dependencies.farm_position] +path = "../farm_position" + [dependencies.rewards] path = "../rewards" diff --git a/common/modules/farm/farm_base_impl/src/claim_rewards.rs b/common/modules/farm/farm_base_impl/src/claim_rewards.rs index 256828ca3..a00eb7fac 100644 --- a/common/modules/farm/farm_base_impl/src/claim_rewards.rs +++ b/common/modules/farm/farm_base_impl/src/claim_rewards.rs @@ -26,6 +26,7 @@ pub trait BaseClaimRewardsModule: + config::ConfigModule + token_send::TokenSendModule + farm_token::FarmTokenModule + + farm_position::FarmPositionModule + pausable::PausableModule + permissions_module::PermissionsModule + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule @@ -58,11 +59,15 @@ pub trait BaseClaimRewardsModule: self.validate_contract_state(storage_cache.contract_state, &storage_cache.farm_token_id); let claim_rewards_context = ClaimRewardsContext::::new( - payments, + payments.clone(), &storage_cache.farm_token_id, self.blockchain(), ); + for payment in &payments { + self.check_and_update_user_farm_position(&caller, &payment); + } + FC::generate_aggregated_rewards(self, &mut storage_cache); let farm_token_amount = &claim_rewards_context.first_farm_token.payment.amount; diff --git a/common/modules/farm/farm_base_impl/src/compound_rewards.rs b/common/modules/farm/farm_base_impl/src/compound_rewards.rs index 0b17976f4..db4221970 100644 --- a/common/modules/farm/farm_base_impl/src/compound_rewards.rs +++ b/common/modules/farm/farm_base_impl/src/compound_rewards.rs @@ -27,6 +27,7 @@ pub trait BaseCompoundRewardsModule: + config::ConfigModule + token_send::TokenSendModule + farm_token::FarmTokenModule + + farm_position::FarmPositionModule + pausable::PausableModule + permissions_module::PermissionsModule + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule @@ -46,11 +47,15 @@ pub trait BaseCompoundRewardsModule: ); let compound_rewards_context = CompoundRewardsContext::::new( - payments, + payments.clone(), &storage_cache.farm_token_id, self.blockchain(), ); + for payment in &payments { + self.check_and_update_user_farm_position(&caller, &payment); + } + FC::generate_aggregated_rewards(self, &mut storage_cache); let farm_token_amount = &compound_rewards_context.first_farm_token.payment.amount; diff --git a/common/modules/farm/farm_base_impl/src/enter_farm.rs b/common/modules/farm/farm_base_impl/src/enter_farm.rs index 79f9e5df9..a7b763eac 100644 --- a/common/modules/farm/farm_base_impl/src/enter_farm.rs +++ b/common/modules/farm/farm_base_impl/src/enter_farm.rs @@ -24,6 +24,7 @@ pub trait BaseEnterFarmModule: + config::ConfigModule + token_send::TokenSendModule + farm_token::FarmTokenModule + + farm_position::FarmPositionModule + pausable::PausableModule + permissions_module::PermissionsModule + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule @@ -44,6 +45,11 @@ pub trait BaseEnterFarmModule: &storage_cache.farm_token_id, ); + for additional_payment in &enter_farm_context.additional_farm_tokens { + self.check_and_update_user_farm_position(&caller, &additional_payment); + } + self.increase_user_farm_position(&caller, &enter_farm_context.farming_token_payment.amount); + FC::generate_aggregated_rewards(self, &mut storage_cache); storage_cache.farm_token_supply += &enter_farm_context.farming_token_payment.amount; diff --git a/common/modules/farm/farm_base_impl/src/exit_farm.rs b/common/modules/farm/farm_base_impl/src/exit_farm.rs index c60dd7a73..a058f6a55 100644 --- a/common/modules/farm/farm_base_impl/src/exit_farm.rs +++ b/common/modules/farm/farm_base_impl/src/exit_farm.rs @@ -24,6 +24,7 @@ pub trait BaseExitFarmModule: + config::ConfigModule + token_send::TokenSendModule + farm_token::FarmTokenModule + + farm_position::FarmPositionModule + pausable::PausableModule + permissions_module::PermissionsModule + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule @@ -39,11 +40,13 @@ pub trait BaseExitFarmModule: self.validate_contract_state(storage_cache.contract_state, &storage_cache.farm_token_id); let exit_farm_context = ExitFarmContext::::new( - payment, + payment.clone(), &storage_cache.farm_token_id, self.blockchain(), ); + self.decrease_user_farm_position(&payment); + FC::generate_aggregated_rewards(self, &mut storage_cache); let farm_token_amount = &exit_farm_context.farm_token.payment.amount; diff --git a/common/modules/farm/farm_base_impl/src/lib.rs b/common/modules/farm/farm_base_impl/src/lib.rs index f63df2820..a3449779a 100644 --- a/common/modules/farm/farm_base_impl/src/lib.rs +++ b/common/modules/farm/farm_base_impl/src/lib.rs @@ -21,6 +21,7 @@ pub trait FarmBaseImpl: + config::ConfigModule + token_send::TokenSendModule + farm_token::FarmTokenModule + + farm_position::FarmPositionModule + pausable::PausableModule + permissions_module::PermissionsModule + events::EventsModule diff --git a/common/modules/farm/farm_position/Cargo.toml b/common/modules/farm/farm_position/Cargo.toml new file mode 100644 index 000000000..c3b8beda4 --- /dev/null +++ b/common/modules/farm/farm_position/Cargo.toml @@ -0,0 +1,27 @@ +[package] +name = "farm_position" +version = "0.0.0" +authors = ["MultiversX "] +edition = "2021" + +[lib] +path = "src/farm_position.rs" + +[dependencies.multiversx-sc] +version = "=0.39.4" +features = ["esdt-token-payment-legacy-decode"] + +[dependencies.multiversx-sc-modules] +version = "=0.39.4" + +[dependencies.farm_token] +path = "../farm_token" + +[dependencies.utils] +path = "../../utils" + +[dependencies.permissions_module] +path = "../../permissions_module" + +[dependencies.common_structs] +path = "../../../common_structs" diff --git a/common/modules/farm/farm_position/src/farm_position.rs b/common/modules/farm/farm_position/src/farm_position.rs new file mode 100644 index 000000000..24a998a8a --- /dev/null +++ b/common/modules/farm/farm_position/src/farm_position.rs @@ -0,0 +1,103 @@ +#![no_std] + +multiversx_sc::imports!(); +multiversx_sc::derive_imports!(); + +use common_structs::FarmTokenAttributes; + +#[multiversx_sc::module] +pub trait FarmPositionModule: + farm_token::FarmTokenModule + + utils::UtilsModule + + permissions_module::PermissionsModule + + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule +{ + #[payable("*")] + #[endpoint(updateTotalFarmPosition)] + fn update_total_farm_position(&self) { + let caller = self.blockchain().get_caller(); + let payments = self.get_non_empty_payments(); + let farm_token_mapper = self.farm_token(); + let farm_token_id = farm_token_mapper.get_token_id(); + let mut new_total_farm_position = BigUint::zero(); + for farm_position in &payments { + require!( + farm_position.token_identifier == farm_token_id, + "Bad payment token" + ); + let token_attributes: FarmTokenAttributes = + farm_token_mapper.get_token_attributes(farm_position.token_nonce); + + if &token_attributes.original_owner != &caller { + self.user_total_farm_position(&token_attributes.original_owner) + .update(|user_farm_position| { + if *user_farm_position > farm_position.amount { + *user_farm_position -= &farm_position.amount; + } else { + *user_farm_position = BigUint::zero(); + } + }); + } + + new_total_farm_position += farm_position.amount; + } + + let user_current_farm_position = self.user_total_farm_position(&caller).get(); + if new_total_farm_position > user_current_farm_position { + self.user_total_farm_position(&caller) + .set(new_total_farm_position) + } + } + + fn check_and_update_user_farm_position( + &self, + user: &ManagedAddress, + farm_position: &EsdtTokenPayment, + ) { + let farm_token_mapper = self.farm_token(); + let token_attributes: FarmTokenAttributes = + farm_token_mapper.get_token_attributes(farm_position.token_nonce); + + if &token_attributes.original_owner != user { + self.user_total_farm_position(&token_attributes.original_owner) + .update(|user_farm_position| { + if *user_farm_position > farm_position.amount { + *user_farm_position -= &farm_position.amount; + } else { + *user_farm_position = BigUint::zero(); + } + }); + + self.user_total_farm_position(user) + .update(|user_farm_position| *user_farm_position += &farm_position.amount); + } + } + + fn increase_user_farm_position( + &self, + user: &ManagedAddress, + new_farm_position_amount: &BigUint, + ) { + self.user_total_farm_position(user) + .update(|user_farm_position| *user_farm_position += new_farm_position_amount); + } + + fn decrease_user_farm_position(&self, farm_position: &EsdtTokenPayment) { + let farm_token_mapper = self.farm_token(); + let token_attributes: FarmTokenAttributes = + farm_token_mapper.get_token_attributes(farm_position.token_nonce); + + self.user_total_farm_position(&token_attributes.original_owner) + .update(|user_farm_position| { + if *user_farm_position > farm_position.amount { + *user_farm_position -= &farm_position.amount; + } else { + *user_farm_position = BigUint::zero(); + } + }); + } + + #[view(getUserTotalFarmPosition)] + #[storage_mapper("userTotalFarmPosition")] + fn user_total_farm_position(&self, user: &ManagedAddress) -> SingleValueMapper; +} diff --git a/dex/farm-with-locked-rewards/Cargo.toml b/dex/farm-with-locked-rewards/Cargo.toml index 3052499d2..b5abb39a5 100644 --- a/dex/farm-with-locked-rewards/Cargo.toml +++ b/dex/farm-with-locked-rewards/Cargo.toml @@ -16,6 +16,9 @@ path = "../../common/modules/farm/config" [dependencies.farm_token] path = "../../common/modules/farm/farm_token" +[dependencies.farm_position] +path = "../../common/modules/farm/farm_position" + [dependencies.rewards] path = "../../common/modules/farm/rewards" diff --git a/dex/farm-with-locked-rewards/elrond.json b/dex/farm-with-locked-rewards/elrond.json deleted file mode 100644 index 736553962..000000000 --- a/dex/farm-with-locked-rewards/elrond.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "language": "rust" -} \ No newline at end of file diff --git a/dex/farm-with-locked-rewards/src/lib.rs b/dex/farm-with-locked-rewards/src/lib.rs index 0bfbff59b..663d51783 100644 --- a/dex/farm-with-locked-rewards/src/lib.rs +++ b/dex/farm-with-locked-rewards/src/lib.rs @@ -26,6 +26,7 @@ pub trait Farm: + token_send::TokenSendModule + locking_module::lock_with_energy_module::LockWithEnergyModule + farm_token::FarmTokenModule + + farm_position::FarmPositionModule + utils::UtilsModule + pausable::PausableModule + permissions_module::PermissionsModule diff --git a/dex/farm-with-locked-rewards/wasm/Cargo.lock b/dex/farm-with-locked-rewards/wasm/Cargo.lock index 83649b5f2..9242ee202 100644 --- a/dex/farm-with-locked-rewards/wasm/Cargo.lock +++ b/dex/farm-with-locked-rewards/wasm/Cargo.lock @@ -154,6 +154,7 @@ dependencies = [ "events", "farm-boosted-yields", "farm_base_impl", + "farm_position", "farm_token", "fixed-supply-token", "mergeable", @@ -198,6 +199,7 @@ dependencies = [ "farm", "farm-boosted-yields", "farm_base_impl", + "farm_position", "farm_token", "fixed-supply-token", "locking_module", @@ -231,6 +233,7 @@ dependencies = [ "config", "contexts", "events", + "farm_position", "farm_token", "fixed-supply-token", "mergeable", @@ -244,6 +247,18 @@ dependencies = [ "utils", ] +[[package]] +name = "farm_position" +version = "0.0.0" +dependencies = [ + "common_structs", + "farm_token", + "multiversx-sc", + "multiversx-sc-modules", + "permissions_module", + "utils", +] + [[package]] name = "farm_token" version = "0.0.0" diff --git a/dex/farm-with-locked-rewards/wasm/src/lib.rs b/dex/farm-with-locked-rewards/wasm/src/lib.rs index d4f9e0650..906ec4642 100644 --- a/dex/farm-with-locked-rewards/wasm/src/lib.rs +++ b/dex/farm-with-locked-rewards/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 62 +// Endpoints: 65 // Async Callback: 1 -// Total number of exported functions: 64 +// Total number of exported functions: 67 #![no_std] #![feature(alloc_error_handler, lang_items)] @@ -40,6 +40,8 @@ multiversx_sc_wasm_adapter::endpoints! { registerFarmToken getFarmTokenId getFarmTokenSupply + updateTotalFarmPosition + getUserTotalFarmPosition addToPauseWhitelist removeFromPauseWhitelist pause @@ -59,6 +61,7 @@ multiversx_sc_wasm_adapter::endpoints! { getMinimumFarmingEpoch getBurnGasLimit getPairContractManagedAddress + claimBoostedRewards setBoostedYieldsRewardsPercentage collectUndistributedBoostedRewards getBoostedYieldsRewardsPercentage diff --git a/dex/farm/Cargo.toml b/dex/farm/Cargo.toml index f2cca8bf7..4e30b4394 100644 --- a/dex/farm/Cargo.toml +++ b/dex/farm/Cargo.toml @@ -16,6 +16,9 @@ path = "../../common/modules/farm/config" [dependencies.farm_token] path = "../../common/modules/farm/farm_token" +[dependencies.farm_position] +path = "../../common/modules/farm/farm_position" + [dependencies.rewards] path = "../../common/modules/farm/rewards" diff --git a/dex/farm/src/base_functions.rs b/dex/farm/src/base_functions.rs index 317ae4c1c..9108dd5cb 100644 --- a/dex/farm/src/base_functions.rs +++ b/dex/farm/src/base_functions.rs @@ -47,6 +47,7 @@ pub trait BaseFunctionsModule: + config::ConfigModule + token_send::TokenSendModule + farm_token::FarmTokenModule + + farm_position::FarmPositionModule + pausable::PausableModule + permissions_module::PermissionsModule + events::EventsModule @@ -186,6 +187,11 @@ pub trait BaseFunctionsModule: let token_mapper = self.farm_token(); token_mapper.require_all_same_token(&payments); + let caller = self.blockchain().get_caller(); + for payment in &payments { + self.check_and_update_user_farm_position(&caller, &payment); + } + let output_attributes: FC::AttributesType = self.merge_from_payments_and_burn(payments, &token_mapper); let new_token_amount = output_attributes.get_total_supply(); @@ -236,15 +242,18 @@ where sc: &::FarmSc, caller: &ManagedAddress<<::FarmSc as ContractBase>::Api>, token_attributes: &::AttributesType, - farm_token_amount: BigUint<<::FarmSc as ContractBase>::Api>, + _farm_token_amount: BigUint<<::FarmSc as ContractBase>::Api>, ) -> BigUint<<::FarmSc as ContractBase>::Api> { if &token_attributes.original_owner != caller { sc.update_energy_and_progress(caller); + } + let user_total_farm_position_mapper = sc.user_total_farm_position(caller); + if user_total_farm_position_mapper.is_empty() { return BigUint::zero(); } - sc.claim_boosted_yields_rewards(caller, farm_token_amount) + sc.claim_boosted_yields_rewards(caller, user_total_farm_position_mapper.get()) } } diff --git a/dex/farm/src/claim_boost_only.rs b/dex/farm/src/claim_boost_only.rs index 88d445df8..6cd8c2ca1 100644 --- a/dex/farm/src/claim_boost_only.rs +++ b/dex/farm/src/claim_boost_only.rs @@ -7,6 +7,7 @@ pub trait ClaimBoostOnlyModule: config::ConfigModule + rewards::RewardsModule + farm_token::FarmTokenModule + + farm_position::FarmPositionModule + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule + week_timekeeping::WeekTimekeepingModule + pausable::PausableModule @@ -31,6 +32,37 @@ pub trait ClaimBoostOnlyModule: + farm_boosted_yields::boosted_yields_factors::BoostedYieldsFactorsModule + crate::base_functions::BaseFunctionsModule { + #[payable("*")] + #[endpoint(claimBoostedRewards)] + fn claim_boosted_rewards( + &self, + opt_orig_caller: OptionalValue, + ) -> EsdtTokenPayment { + let orig_caller = match opt_orig_caller { + OptionalValue::Some(orig_caller) => orig_caller, + OptionalValue::None => self.blockchain().get_caller(), + }; + + let reward_token_id = self.reward_token_id().get(); + let user_total_farm_position_mapper = self.user_total_farm_position(&orig_caller); + if user_total_farm_position_mapper.is_empty() { + return EsdtTokenPayment::new(reward_token_id, 0, BigUint::zero()); + } + + let reward = + self.claim_boosted_yields_rewards(&orig_caller, user_total_farm_position_mapper.get()); + if reward > 0 { + self.reward_reserve().update(|reserve| *reserve -= &reward); + } + + let boosted_rewards = EsdtTokenPayment::new(reward_token_id, 0, reward); + self.send_payment_non_zero(&orig_caller, &boosted_rewards); + + self.update_energy_and_progress(&orig_caller); + + boosted_rewards + } + fn claim_only_boosted_payment( &self, caller: &ManagedAddress, diff --git a/dex/farm/src/lib.rs b/dex/farm/src/lib.rs index 34975a2a5..e2a4fe30d 100644 --- a/dex/farm/src/lib.rs +++ b/dex/farm/src/lib.rs @@ -30,6 +30,7 @@ pub trait Farm: + config::ConfigModule + token_send::TokenSendModule + farm_token::FarmTokenModule + + farm_position::FarmPositionModule + pausable::PausableModule + permissions_module::PermissionsModule + sc_whitelist_module::SCWhitelistModule diff --git a/dex/farm/wasm/Cargo.lock b/dex/farm/wasm/Cargo.lock index 97ea7e292..210fdddf6 100644 --- a/dex/farm/wasm/Cargo.lock +++ b/dex/farm/wasm/Cargo.lock @@ -154,6 +154,7 @@ dependencies = [ "events", "farm-boosted-yields", "farm_base_impl", + "farm_position", "farm_token", "fixed-supply-token", "mergeable", @@ -201,6 +202,7 @@ dependencies = [ "config", "contexts", "events", + "farm_position", "farm_token", "fixed-supply-token", "mergeable", @@ -214,6 +216,18 @@ dependencies = [ "utils", ] +[[package]] +name = "farm_position" +version = "0.0.0" +dependencies = [ + "common_structs", + "farm_token", + "multiversx-sc", + "multiversx-sc-modules", + "permissions_module", + "utils", +] + [[package]] name = "farm_token" version = "0.0.0" diff --git a/dex/farm/wasm/src/lib.rs b/dex/farm/wasm/src/lib.rs index 9ec1c0a1c..00b4b4931 100644 --- a/dex/farm/wasm/src/lib.rs +++ b/dex/farm/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 59 +// Endpoints: 62 // Async Callback: 1 -// Total number of exported functions: 61 +// Total number of exported functions: 64 #![no_std] #![feature(alloc_error_handler, lang_items)] @@ -37,6 +37,8 @@ multiversx_sc_wasm_adapter::endpoints! { registerFarmToken getFarmTokenId getFarmTokenSupply + updateTotalFarmPosition + getUserTotalFarmPosition addToPauseWhitelist removeFromPauseWhitelist pause @@ -56,6 +58,7 @@ multiversx_sc_wasm_adapter::endpoints! { getMinimumFarmingEpoch getBurnGasLimit getPairContractManagedAddress + claimBoostedRewards setBoostedYieldsRewardsPercentage collectUndistributedBoostedRewards getBoostedYieldsRewardsPercentage From b4c924cd09aead57509216246c8f4d8f145776d1 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Tue, 15 Aug 2023 01:37:26 +0300 Subject: [PATCH 007/213] updateTotalFarmPosition endpoint fix --- common/modules/farm/farm_position/src/farm_position.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/modules/farm/farm_position/src/farm_position.rs b/common/modules/farm/farm_position/src/farm_position.rs index 24a998a8a..60cba3c2c 100644 --- a/common/modules/farm/farm_position/src/farm_position.rs +++ b/common/modules/farm/farm_position/src/farm_position.rs @@ -47,6 +47,8 @@ pub trait FarmPositionModule: self.user_total_farm_position(&caller) .set(new_total_farm_position) } + + self.send().direct_multi(&caller, &payments); } fn check_and_update_user_farm_position( From 667c19ad806606b3d0010ca4dd326ad3f06bfd3d Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Tue, 15 Aug 2023 01:44:12 +0300 Subject: [PATCH 008/213] clippy fix --- common/modules/farm/farm_position/src/farm_position.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/modules/farm/farm_position/src/farm_position.rs b/common/modules/farm/farm_position/src/farm_position.rs index 60cba3c2c..d5bb3e009 100644 --- a/common/modules/farm/farm_position/src/farm_position.rs +++ b/common/modules/farm/farm_position/src/farm_position.rs @@ -28,7 +28,7 @@ pub trait FarmPositionModule: let token_attributes: FarmTokenAttributes = farm_token_mapper.get_token_attributes(farm_position.token_nonce); - if &token_attributes.original_owner != &caller { + if token_attributes.original_owner != caller { self.user_total_farm_position(&token_attributes.original_owner) .update(|user_farm_position| { if *user_farm_position > farm_position.amount { From 8348f525323835ae6e4d5baa504f4ee3fa8a99f3 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Tue, 15 Aug 2023 16:59:01 +0300 Subject: [PATCH 009/213] fixes after review --- .../farm/farm_base_impl/src/claim_rewards.rs | 4 +- .../farm_base_impl/src/compound_rewards.rs | 4 +- .../farm/farm_base_impl/src/enter_farm.rs | 8 ++-- .../farm/farm_position/src/farm_position.rs | 48 ++++++++++++------- dex/farm-with-locked-rewards/wasm/src/lib.rs | 6 ++- dex/farm/src/base_functions.rs | 12 +---- dex/farm/src/claim_boost_only.rs | 30 ++++++------ dex/farm/wasm/src/lib.rs | 6 ++- 8 files changed, 63 insertions(+), 55 deletions(-) diff --git a/common/modules/farm/farm_base_impl/src/claim_rewards.rs b/common/modules/farm/farm_base_impl/src/claim_rewards.rs index a00eb7fac..11ba65338 100644 --- a/common/modules/farm/farm_base_impl/src/claim_rewards.rs +++ b/common/modules/farm/farm_base_impl/src/claim_rewards.rs @@ -64,9 +64,7 @@ pub trait BaseClaimRewardsModule: self.blockchain(), ); - for payment in &payments { - self.check_and_update_user_farm_position(&caller, &payment); - } + self.check_and_update_user_farm_position(&caller, &payments); FC::generate_aggregated_rewards(self, &mut storage_cache); diff --git a/common/modules/farm/farm_base_impl/src/compound_rewards.rs b/common/modules/farm/farm_base_impl/src/compound_rewards.rs index db4221970..5fbed98d4 100644 --- a/common/modules/farm/farm_base_impl/src/compound_rewards.rs +++ b/common/modules/farm/farm_base_impl/src/compound_rewards.rs @@ -52,9 +52,7 @@ pub trait BaseCompoundRewardsModule: self.blockchain(), ); - for payment in &payments { - self.check_and_update_user_farm_position(&caller, &payment); - } + self.check_and_update_user_farm_position(&caller, &payments); FC::generate_aggregated_rewards(self, &mut storage_cache); diff --git a/common/modules/farm/farm_base_impl/src/enter_farm.rs b/common/modules/farm/farm_base_impl/src/enter_farm.rs index a7b763eac..15bc9c2fa 100644 --- a/common/modules/farm/farm_base_impl/src/enter_farm.rs +++ b/common/modules/farm/farm_base_impl/src/enter_farm.rs @@ -45,9 +45,11 @@ pub trait BaseEnterFarmModule: &storage_cache.farm_token_id, ); - for additional_payment in &enter_farm_context.additional_farm_tokens { - self.check_and_update_user_farm_position(&caller, &additional_payment); - } + // The order is important - first check and update, then increase position + self.check_and_update_user_farm_position( + &caller, + &enter_farm_context.additional_farm_tokens, + ); self.increase_user_farm_position(&caller, &enter_farm_context.farming_token_payment.amount); FC::generate_aggregated_rewards(self, &mut storage_cache); diff --git a/common/modules/farm/farm_position/src/farm_position.rs b/common/modules/farm/farm_position/src/farm_position.rs index d5bb3e009..ad34e4147 100644 --- a/common/modules/farm/farm_position/src/farm_position.rs +++ b/common/modules/farm/farm_position/src/farm_position.rs @@ -3,7 +3,7 @@ multiversx_sc::imports!(); multiversx_sc::derive_imports!(); -use common_structs::FarmTokenAttributes; +use common_structs::{FarmTokenAttributes, PaymentsVec}; #[multiversx_sc::module] pub trait FarmPositionModule: @@ -51,27 +51,36 @@ pub trait FarmPositionModule: self.send().direct_multi(&caller, &payments); } + #[endpoint(setAllowExternalClaimBoostedRewards)] + fn set_allow_external_claim_boosted_rewards(&self, allow: bool) { + let caller = self.blockchain().get_caller(); + self.allow_external_claim_boosted_rewards(&caller) + .set(allow); + } + fn check_and_update_user_farm_position( &self, user: &ManagedAddress, - farm_position: &EsdtTokenPayment, + farm_positions: &PaymentsVec, ) { let farm_token_mapper = self.farm_token(); - let token_attributes: FarmTokenAttributes = - farm_token_mapper.get_token_attributes(farm_position.token_nonce); + let mut total_farm_position = BigUint::zero(); + let mut farm_position_increase = BigUint::zero(); + for farm_position in farm_positions { + total_farm_position += &farm_position.amount; + let token_attributes: FarmTokenAttributes = + farm_token_mapper.get_token_attributes(farm_position.token_nonce); - if &token_attributes.original_owner != user { - self.user_total_farm_position(&token_attributes.original_owner) - .update(|user_farm_position| { - if *user_farm_position > farm_position.amount { - *user_farm_position -= &farm_position.amount; - } else { - *user_farm_position = BigUint::zero(); - } - }); - - self.user_total_farm_position(user) - .update(|user_farm_position| *user_farm_position += &farm_position.amount); + if &token_attributes.original_owner != user { + self.decrease_user_farm_position(&farm_position); + farm_position_increase += &farm_position.amount; + } + } + + if self.user_total_farm_position(user).get() == 0 { + self.increase_user_farm_position(user, &total_farm_position); + } else if farm_position_increase > 0 { + self.increase_user_farm_position(user, &farm_position_increase); } } @@ -102,4 +111,11 @@ pub trait FarmPositionModule: #[view(getUserTotalFarmPosition)] #[storage_mapper("userTotalFarmPosition")] fn user_total_farm_position(&self, user: &ManagedAddress) -> SingleValueMapper; + + #[view(getAllowExternalClaimBoostedRewards)] + #[storage_mapper("allowExternalClaimBoostedRewards")] + fn allow_external_claim_boosted_rewards( + &self, + user: &ManagedAddress, + ) -> SingleValueMapper; } diff --git a/dex/farm-with-locked-rewards/wasm/src/lib.rs b/dex/farm-with-locked-rewards/wasm/src/lib.rs index 906ec4642..e679e068f 100644 --- a/dex/farm-with-locked-rewards/wasm/src/lib.rs +++ b/dex/farm-with-locked-rewards/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 65 +// Endpoints: 67 // Async Callback: 1 -// Total number of exported functions: 67 +// Total number of exported functions: 69 #![no_std] #![feature(alloc_error_handler, lang_items)] @@ -41,7 +41,9 @@ multiversx_sc_wasm_adapter::endpoints! { getFarmTokenId getFarmTokenSupply updateTotalFarmPosition + setAllowExternalClaimBoostedRewards getUserTotalFarmPosition + getAllowExternalClaimBoostedRewards addToPauseWhitelist removeFromPauseWhitelist pause diff --git a/dex/farm/src/base_functions.rs b/dex/farm/src/base_functions.rs index 9108dd5cb..4557de643 100644 --- a/dex/farm/src/base_functions.rs +++ b/dex/farm/src/base_functions.rs @@ -188,9 +188,7 @@ pub trait BaseFunctionsModule: token_mapper.require_all_same_token(&payments); let caller = self.blockchain().get_caller(); - for payment in &payments { - self.check_and_update_user_farm_position(&caller, &payment); - } + self.check_and_update_user_farm_position(&caller, &payments); let output_attributes: FC::AttributesType = self.merge_from_payments_and_burn(payments, &token_mapper); @@ -242,7 +240,6 @@ where sc: &::FarmSc, caller: &ManagedAddress<<::FarmSc as ContractBase>::Api>, token_attributes: &::AttributesType, - _farm_token_amount: BigUint<<::FarmSc as ContractBase>::Api>, ) -> BigUint<<::FarmSc as ContractBase>::Api> { if &token_attributes.original_owner != caller { sc.update_energy_and_progress(caller); @@ -297,12 +294,7 @@ where token_attributes, storage_cache, ); - let boosted_yield_rewards = Self::calculate_boosted_rewards( - sc, - caller, - token_attributes, - farm_token_amount.clone(), - ); + let boosted_yield_rewards = Self::calculate_boosted_rewards(sc, caller, token_attributes); base_farm_reward + boosted_yield_rewards } diff --git a/dex/farm/src/claim_boost_only.rs b/dex/farm/src/claim_boost_only.rs index 6cd8c2ca1..7d8c320b5 100644 --- a/dex/farm/src/claim_boost_only.rs +++ b/dex/farm/src/claim_boost_only.rs @@ -34,31 +34,34 @@ pub trait ClaimBoostOnlyModule: { #[payable("*")] #[endpoint(claimBoostedRewards)] - fn claim_boosted_rewards( - &self, - opt_orig_caller: OptionalValue, - ) -> EsdtTokenPayment { - let orig_caller = match opt_orig_caller { - OptionalValue::Some(orig_caller) => orig_caller, + fn claim_boosted_rewards(&self, opt_user: OptionalValue) -> EsdtTokenPayment { + let user = match opt_user { + OptionalValue::Some(user) => { + require!( + self.allow_external_claim_boosted_rewards(&user).get(), + "Cannot claim rewards for this address" + ); + user + } OptionalValue::None => self.blockchain().get_caller(), }; let reward_token_id = self.reward_token_id().get(); - let user_total_farm_position_mapper = self.user_total_farm_position(&orig_caller); + let user_total_farm_position_mapper = self.user_total_farm_position(&user); if user_total_farm_position_mapper.is_empty() { return EsdtTokenPayment::new(reward_token_id, 0, BigUint::zero()); } let reward = - self.claim_boosted_yields_rewards(&orig_caller, user_total_farm_position_mapper.get()); + self.claim_boosted_yields_rewards(&user, user_total_farm_position_mapper.get()); if reward > 0 { self.reward_reserve().update(|reserve| *reserve -= &reward); } let boosted_rewards = EsdtTokenPayment::new(reward_token_id, 0, reward); - self.send_payment_non_zero(&orig_caller, &boosted_rewards); + self.send_payment_non_zero(&user, &boosted_rewards); - self.update_energy_and_progress(&orig_caller); + self.update_energy_and_progress(&user); boosted_rewards } @@ -73,12 +76,7 @@ pub trait ClaimBoostOnlyModule: let token_attributes = self.get_attributes_as_part_of_fixed_supply(payment, &farm_token_mapper); - let reward = Wrapper::::calculate_boosted_rewards( - self, - caller, - &token_attributes, - payment.amount.clone(), - ); + let reward = Wrapper::::calculate_boosted_rewards(self, caller, &token_attributes); if reward > 0 { self.reward_reserve().update(|reserve| *reserve -= &reward); } diff --git a/dex/farm/wasm/src/lib.rs b/dex/farm/wasm/src/lib.rs index 00b4b4931..9b312e5e1 100644 --- a/dex/farm/wasm/src/lib.rs +++ b/dex/farm/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 62 +// Endpoints: 64 // Async Callback: 1 -// Total number of exported functions: 64 +// Total number of exported functions: 66 #![no_std] #![feature(alloc_error_handler, lang_items)] @@ -38,7 +38,9 @@ multiversx_sc_wasm_adapter::endpoints! { getFarmTokenId getFarmTokenSupply updateTotalFarmPosition + setAllowExternalClaimBoostedRewards getUserTotalFarmPosition + getAllowExternalClaimBoostedRewards addToPauseWhitelist removeFromPauseWhitelist pause From f8fa3d80745b1eed8de7ecd00a3063cfa5cfcf22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Thu, 17 Aug 2023 00:44:15 +0300 Subject: [PATCH 010/213] Governance-v2: Small refactor --- .../governance-v2/src/configurable.rs | 8 +++--- .../governance-v2/src/errors.rs | 7 +++++ energy-integration/governance-v2/src/lib.rs | 27 +++++++------------ .../governance-v2/tests/gov_rust_test.rs | 8 +++--- .../governance-v2/wasm/src/lib.rs | 2 +- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/energy-integration/governance-v2/src/configurable.rs b/energy-integration/governance-v2/src/configurable.rs index 5ed97fefc..c7982e68a 100644 --- a/energy-integration/governance-v2/src/configurable.rs +++ b/energy-integration/governance-v2/src/configurable.rs @@ -60,9 +60,9 @@ pub trait ConfigurablePropertiesModule: } #[only_owner] - #[endpoint(changeQuorum)] - fn change_quorum(&self, new_value: BigUint) { - self.try_change_quorum(new_value); + #[endpoint(changeQuorumPercentage)] + fn change_quorum_percentage(&self, new_value: BigUint) { + self.try_change_quorum_percentage(new_value); } #[only_owner] @@ -96,7 +96,7 @@ pub trait ConfigurablePropertiesModule: self.min_fee_for_propose().set(&new_value); } - fn try_change_quorum(&self, new_value: BigUint) { + fn try_change_quorum_percentage(&self, new_value: BigUint) { require!( new_value > MIN_QUORUM && new_value < MAX_QUORUM, "Not valid value for Quorum!" diff --git a/energy-integration/governance-v2/src/errors.rs b/energy-integration/governance-v2/src/errors.rs index ff552346b..9f92b6bf1 100644 --- a/energy-integration/governance-v2/src/errors.rs +++ b/energy-integration/governance-v2/src/errors.rs @@ -4,3 +4,10 @@ pub const NOT_ENOUGH_ENERGY: &[u8] = b"Not enough energy for propose"; pub const TOO_MUCH_GAS: &[u8] = b"Actions require too much gas to be executed"; pub const PROPOSAL_NOT_ACTIVE: &[u8] = b"Proposal is not active"; pub const ERROR_NOT_AN_ESDT: &[u8] = b"Not a valid esdt id"; +pub const ALREADY_VOTED_ERR_MSG: &[u8] = b"Already voted for this proposal"; +pub const PROPOSAL_NO_ACTION: &[u8] = b"Proposal has no actions"; +pub const EXEEDED_MAX_ACTIONS: &[u8] = b"Exceeded max actions per proposal"; +pub const ONLY_PROPOSER_CANCEL: &[u8] = b"Only original proposer may cancel a pending proposal"; +pub const ONLY_PROPOSER_WITHDRAW: &[u8] = b"Only original proposer may withdraw a pending proposal"; +pub const NO_PROPOSAL: &[u8] = b"Proposal does not exist"; +pub const WITHDRAW_NOT_ALLOWED: &[u8] = b"You may not withdraw funds from this proposal!"; diff --git a/energy-integration/governance-v2/src/lib.rs b/energy-integration/governance-v2/src/lib.rs index 0bf7b3d28..fa70e41fa 100644 --- a/energy-integration/governance-v2/src/lib.rs +++ b/energy-integration/governance-v2/src/lib.rs @@ -20,7 +20,6 @@ use crate::proposal_storage::ProposalVotes; const MAX_GAS_LIMIT_PER_BLOCK: u64 = 600_000_000; const FULL_PERCENTAGE: u64 = 10_000; -static ALREADY_VOTED_ERR_MSG: &[u8] = b"Already voted for this proposal"; /// An empty contract. To be used as a template when starting a new contract from scratch. #[multiversx_sc::contract] @@ -55,7 +54,7 @@ pub trait GovernanceV2: ) { self.try_change_min_energy_for_propose(min_energy_for_propose); self.try_change_min_fee_for_propose(min_fee_for_propose); - self.try_change_quorum(quorum_percentage); + self.try_change_quorum_percentage(quorum_percentage); self.try_change_voting_delay_in_blocks(voting_delay_in_blocks); self.try_change_voting_period_in_blocks(voting_period_in_blocks); self.try_change_withdraw_percentage_defeated(withdraw_percentage_defeated); @@ -67,16 +66,10 @@ pub trait GovernanceV2: /// Propose a list of actions. /// A maximum of MAX_GOVERNANCE_PROPOSAL_ACTIONS can be proposed at a time. /// - /// An action has the following format: - /// - gas limit for action execution - /// - destination address - /// - a fee payment for proposal (if smaller than min_fee_for_propose, state: WaitForFee) - /// - endpoint to be called on the destination - /// - a vector of arguments for the endpoint, in the form of ManagedVec - /// /// The proposer's energy is NOT automatically used for voting. A separate vote is needed. /// /// Returns the ID of the newly created proposal. + #[only_owner] #[payable("*")] #[endpoint] fn propose( @@ -85,10 +78,10 @@ pub trait GovernanceV2: actions: MultiValueEncoded>, ) -> ProposalId { self.require_caller_not_self(); - require!(!actions.is_empty(), "Proposal has no actions"); + require!(!actions.is_empty(), PROPOSAL_NO_ACTION); require!( actions.len() <= MAX_GOVERNANCE_PROPOSAL_ACTIONS, - "Exceeded max actions per proposal" + EXEEDED_MAX_ACTIONS ); let proposer = self.blockchain().get_caller(); @@ -230,7 +223,7 @@ pub trait GovernanceV2: match self.get_proposal_status(proposal_id) { GovernanceProposalStatus::None => { - sc_panic!("Proposal does not exist"); + sc_panic!(NO_PROPOSAL); } GovernanceProposalStatus::Pending => { let proposal = self.proposals().get(proposal_id); @@ -238,7 +231,7 @@ pub trait GovernanceV2: require!( caller == proposal.proposer, - "Only original proposer may cancel a pending proposal" + ONLY_PROPOSER_CANCEL ); self.refund_proposal_fee(proposal_id, &proposal.fee_payment.amount); self.clear_proposal(proposal_id); @@ -259,14 +252,14 @@ pub trait GovernanceV2: match self.get_proposal_status(proposal_id) { GovernanceProposalStatus::None => { - sc_panic!("Proposal does not exist"); + sc_panic!(NO_PROPOSAL); } GovernanceProposalStatus::Succeeded | GovernanceProposalStatus::Defeated => { let proposal = self.proposals().get(proposal_id); require!( caller == proposal.proposer, - "Only original proposer may cancel a pending proposal" + ONLY_PROPOSER_WITHDRAW ); self.refund_proposal_fee(proposal_id, &proposal.fee_payment.amount); @@ -279,7 +272,7 @@ pub trait GovernanceV2: require!( caller == proposal.proposer, - "Only original proposer may cancel a pending proposal" + ONLY_PROPOSER_WITHDRAW ); self.refund_proposal_fee(proposal_id, &refund_amount); @@ -294,7 +287,7 @@ pub trait GovernanceV2: }); } _ => { - sc_panic!("You may not withdraw funds from this proposal!"); + sc_panic!(WITHDRAW_NOT_ALLOWED); } } self.proposal_withdraw_after_defeated_event(proposal_id); diff --git a/energy-integration/governance-v2/tests/gov_rust_test.rs b/energy-integration/governance-v2/tests/gov_rust_test.rs index 4f8c391ad..5c2329a3d 100644 --- a/energy-integration/governance-v2/tests/gov_rust_test.rs +++ b/energy-integration/governance-v2/tests/gov_rust_test.rs @@ -295,7 +295,7 @@ fn gov_modify_quorum_after_end_vote_test() { sc.get_proposal_status(1) == GovernanceProposalStatus::Defeated, "Action should have been Defeated" ); - sc.try_change_quorum(managed_biguint!(QUORUM_PERCENTAGE / 2)); + sc.try_change_quorum_percentage(managed_biguint!(QUORUM_PERCENTAGE / 2)); assert!(sc.quorum_percentage().get() == managed_biguint!(QUORUM_PERCENTAGE / 2)); assert!( @@ -360,7 +360,7 @@ fn gov_withdraw_defeated_proposal_test() { // Other user (not proposer) try to withdraw the fee -> Fail gov_setup .withdraw_after_defeated(&third_user_addr, proposal_id) - .assert_error(4, "Only original proposer may cancel a pending proposal"); + .assert_error(4, "Only original proposer may withdraw a pending proposal"); // Proposer withdraw gov_setup @@ -435,7 +435,7 @@ fn gov_modify_withdraw_defeated_proposal_test() { // Other user (not proposer) try to withdraw the fee -> Fail gov_setup .withdraw_after_defeated(&third_user_addr, proposal_id) - .assert_error(4, "Only original proposer may cancel a pending proposal"); + .assert_error(4, "Only original proposer may withdraw a pending proposal"); // Proposer withdraw gov_setup @@ -506,7 +506,7 @@ fn gov_withdraw_no_with_veto_defeated_proposal_test() { // Other user (not proposer) try to withdraw the fee -> Fail gov_setup .withdraw_after_defeated(&third_user_addr, proposal_id) - .assert_error(4, "Only original proposer may cancel a pending proposal"); + .assert_error(4, "Only original proposer may withdraw a pending proposal"); // Proposer withdraw gov_setup diff --git a/energy-integration/governance-v2/wasm/src/lib.rs b/energy-integration/governance-v2/wasm/src/lib.rs index e70fd2cb9..6c2f6e7e2 100644 --- a/energy-integration/governance-v2/wasm/src/lib.rs +++ b/energy-integration/governance-v2/wasm/src/lib.rs @@ -24,7 +24,7 @@ multiversx_sc_wasm_adapter::endpoints! { withdrawDeposit changeMinEnergyForProposal changeMinFeeForProposal - changeQuorum + changeQuorumPercentage changeVotingDelayInBlocks changeVotingPeriodInBlocks getMinEnergyForPropose From eacc946c14a6dd5c06b98e0aed818d5828a085b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Thu, 17 Aug 2023 00:53:13 +0300 Subject: [PATCH 011/213] Governance-v2: Add views for user voting power --- energy-integration/governance-v2/src/views.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/energy-integration/governance-v2/src/views.rs b/energy-integration/governance-v2/src/views.rs index a2a069cef..7f61b2352 100644 --- a/energy-integration/governance-v2/src/views.rs +++ b/energy-integration/governance-v2/src/views.rs @@ -45,6 +45,21 @@ pub trait ViewsModule: } } + #[view(getUserVotingPower)] + fn get_user_voting_power(&self, user_address: ManagedAddress) -> BigUint { + let user_quorum = self.get_energy_amount_non_zero(&user_address); + let voting_power = user_quorum.sqrt(); + + voting_power + } + + #[view(getVotingPowerEquivalent)] + fn get_voting_power_equivalent(&self, quorum: BigUint) -> BigUint { + quorum.sqrt() + } + + // private + fn vote_reached(&self, proposal_id: ProposalId) -> bool { let proposal_votes = self.proposal_votes(proposal_id).get(); let total_votes = proposal_votes.get_total_votes(); From d44895b5e74658e1dd91789cd5327c229c4f9c6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Thu, 17 Aug 2023 01:02:04 +0300 Subject: [PATCH 012/213] Governance-v2: Clippy fix --- energy-integration/governance-v2/src/lib.rs | 15 +++------------ energy-integration/governance-v2/src/views.rs | 4 +--- energy-integration/governance-v2/wasm/src/lib.rs | 6 ++++-- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/energy-integration/governance-v2/src/lib.rs b/energy-integration/governance-v2/src/lib.rs index fa70e41fa..538cb5a8e 100644 --- a/energy-integration/governance-v2/src/lib.rs +++ b/energy-integration/governance-v2/src/lib.rs @@ -229,10 +229,7 @@ pub trait GovernanceV2: let proposal = self.proposals().get(proposal_id); let caller = self.blockchain().get_caller(); - require!( - caller == proposal.proposer, - ONLY_PROPOSER_CANCEL - ); + require!(caller == proposal.proposer, ONLY_PROPOSER_CANCEL); self.refund_proposal_fee(proposal_id, &proposal.fee_payment.amount); self.clear_proposal(proposal_id); self.proposal_canceled_event(proposal_id); @@ -257,10 +254,7 @@ pub trait GovernanceV2: GovernanceProposalStatus::Succeeded | GovernanceProposalStatus::Defeated => { let proposal = self.proposals().get(proposal_id); - require!( - caller == proposal.proposer, - ONLY_PROPOSER_WITHDRAW - ); + require!(caller == proposal.proposer, ONLY_PROPOSER_WITHDRAW); self.refund_proposal_fee(proposal_id, &proposal.fee_payment.amount); } @@ -270,10 +264,7 @@ pub trait GovernanceV2: let refund_amount = refund_percentage * proposal.fee_payment.amount.clone() / FULL_PERCENTAGE; - require!( - caller == proposal.proposer, - ONLY_PROPOSER_WITHDRAW - ); + require!(caller == proposal.proposer, ONLY_PROPOSER_WITHDRAW); self.refund_proposal_fee(proposal_id, &refund_amount); let remaining_fee = proposal.fee_payment.amount - refund_amount; diff --git a/energy-integration/governance-v2/src/views.rs b/energy-integration/governance-v2/src/views.rs index 7f61b2352..90a43828b 100644 --- a/energy-integration/governance-v2/src/views.rs +++ b/energy-integration/governance-v2/src/views.rs @@ -48,9 +48,7 @@ pub trait ViewsModule: #[view(getUserVotingPower)] fn get_user_voting_power(&self, user_address: ManagedAddress) -> BigUint { let user_quorum = self.get_energy_amount_non_zero(&user_address); - let voting_power = user_quorum.sqrt(); - - voting_power + user_quorum.sqrt() } #[view(getVotingPowerEquivalent)] diff --git a/energy-integration/governance-v2/wasm/src/lib.rs b/energy-integration/governance-v2/wasm/src/lib.rs index 6c2f6e7e2..5115397b6 100644 --- a/energy-integration/governance-v2/wasm/src/lib.rs +++ b/energy-integration/governance-v2/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 27 +// Endpoints: 29 // Async Callback (empty): 1 -// Total number of exported functions: 29 +// Total number of exported functions: 31 #![no_std] #![feature(alloc_error_handler, lang_items)] @@ -38,6 +38,8 @@ multiversx_sc_wasm_adapter::endpoints! { getUserVotedProposals getProposalVotes getProposalStatus + getUserVotingPower + getVotingPowerEquivalent getFeesCollectorAddress setEnergyFactoryAddress getEnergyFactoryAddress From ac8d2d2b1d9343dd1bfea5a360a677063aaae9f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Thu, 17 Aug 2023 12:30:35 +0300 Subject: [PATCH 013/213] Governance-v2: Add smoothing_function --- energy-integration/governance-v2/src/configurable.rs | 5 +++++ energy-integration/governance-v2/src/lib.rs | 2 +- energy-integration/governance-v2/src/views.rs | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/energy-integration/governance-v2/src/configurable.rs b/energy-integration/governance-v2/src/configurable.rs index c7982e68a..e193bf474 100644 --- a/energy-integration/governance-v2/src/configurable.rs +++ b/energy-integration/governance-v2/src/configurable.rs @@ -137,6 +137,11 @@ pub trait ConfigurablePropertiesModule: self.fee_token_id().set_if_empty(&fee_token_id); } + + fn smoothing_function(&self, input: &BigUint) -> BigUint { + input.sqrt() + } + #[view(getMinEnergyForPropose)] #[storage_mapper("minEnergyForPropose")] fn min_energy_for_propose(&self) -> SingleValueMapper; diff --git a/energy-integration/governance-v2/src/lib.rs b/energy-integration/governance-v2/src/lib.rs index 538cb5a8e..19ab8add1 100644 --- a/energy-integration/governance-v2/src/lib.rs +++ b/energy-integration/governance-v2/src/lib.rs @@ -180,7 +180,7 @@ pub trait GovernanceV2: } let user_quorum = self.get_energy_amount_non_zero(&voter); - let voting_power = user_quorum.sqrt(); + let voting_power = self.smoothing_function(&user_quorum); match vote { VoteType::UpVote => { diff --git a/energy-integration/governance-v2/src/views.rs b/energy-integration/governance-v2/src/views.rs index 90a43828b..ff7c621f2 100644 --- a/energy-integration/governance-v2/src/views.rs +++ b/energy-integration/governance-v2/src/views.rs @@ -48,12 +48,12 @@ pub trait ViewsModule: #[view(getUserVotingPower)] fn get_user_voting_power(&self, user_address: ManagedAddress) -> BigUint { let user_quorum = self.get_energy_amount_non_zero(&user_address); - user_quorum.sqrt() + self.smoothing_function(&user_quorum) } #[view(getVotingPowerEquivalent)] fn get_voting_power_equivalent(&self, quorum: BigUint) -> BigUint { - quorum.sqrt() + self.smoothing_function(&quorum) } // private From 5ea4678ee5ab7b43ff513e07564b94e1d28d333d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Thu, 17 Aug 2023 12:34:15 +0300 Subject: [PATCH 014/213] Governance-v2: format --- energy-integration/governance-v2/src/configurable.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/energy-integration/governance-v2/src/configurable.rs b/energy-integration/governance-v2/src/configurable.rs index e193bf474..cccbede16 100644 --- a/energy-integration/governance-v2/src/configurable.rs +++ b/energy-integration/governance-v2/src/configurable.rs @@ -137,7 +137,6 @@ pub trait ConfigurablePropertiesModule: self.fee_token_id().set_if_empty(&fee_token_id); } - fn smoothing_function(&self, input: &BigUint) -> BigUint { input.sqrt() } From a09a5fbd72750e01fdb818b4ece9f13993300ba7 Mon Sep 17 00:00:00 2001 From: Rebegea Dragos-Alexandru <42241923+dragos-rebegea@users.noreply.github.com> Date: Fri, 18 Aug 2023 09:50:38 +0300 Subject: [PATCH 015/213] claim multi event only if there are payments --- .../common-modules/weekly-rewards-splitting/src/events.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/energy-integration/common-modules/weekly-rewards-splitting/src/events.rs b/energy-integration/common-modules/weekly-rewards-splitting/src/events.rs index d7ae843ba..46a441df6 100644 --- a/energy-integration/common-modules/weekly-rewards-splitting/src/events.rs +++ b/energy-integration/common-modules/weekly-rewards-splitting/src/events.rs @@ -14,6 +14,9 @@ pub trait WeeklyRewardsSplittingEventsModule { energy: &Energy, all_payments: &ManagedVec>, ) { + if all_payments.len() == 0 { + return; + } self.claim_multi_event(user, current_week, energy, all_payments); } From 3e8c56d6297df6b2254c7b860c1a64787d84e9ba Mon Sep 17 00:00:00 2001 From: Rebegea Dragos-Alexandru <42241923+dragos-rebegea@users.noreply.github.com> Date: Fri, 18 Aug 2023 09:54:43 +0300 Subject: [PATCH 016/213] fix clippy --- .../common-modules/weekly-rewards-splitting/src/events.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/energy-integration/common-modules/weekly-rewards-splitting/src/events.rs b/energy-integration/common-modules/weekly-rewards-splitting/src/events.rs index 46a441df6..8d2b27f23 100644 --- a/energy-integration/common-modules/weekly-rewards-splitting/src/events.rs +++ b/energy-integration/common-modules/weekly-rewards-splitting/src/events.rs @@ -14,7 +14,7 @@ pub trait WeeklyRewardsSplittingEventsModule { energy: &Energy, all_payments: &ManagedVec>, ) { - if all_payments.len() == 0 { + if all_payments.is_empty() { return; } self.claim_multi_event(user, current_week, energy, all_payments); From 5a1753dd80da2af24889ba422c37d3bf75759067 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Fri, 18 Aug 2023 11:25:34 +0300 Subject: [PATCH 017/213] Governance-v2: Handle "No energy" error --- energy-integration/governance-v2/src/views.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/energy-integration/governance-v2/src/views.rs b/energy-integration/governance-v2/src/views.rs index ff7c621f2..19016f537 100644 --- a/energy-integration/governance-v2/src/views.rs +++ b/energy-integration/governance-v2/src/views.rs @@ -47,7 +47,7 @@ pub trait ViewsModule: #[view(getUserVotingPower)] fn get_user_voting_power(&self, user_address: ManagedAddress) -> BigUint { - let user_quorum = self.get_energy_amount_non_zero(&user_address); + let user_quorum = self.get_energy_amount(&user_address); self.smoothing_function(&user_quorum) } From e83174386da35f4f8f1e978e68f311d82b7612a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Fri, 18 Aug 2023 11:30:50 +0300 Subject: [PATCH 018/213] Governance-v2: Fix comments + actions requirement --- energy-integration/governance-v2/src/errors.rs | 1 - energy-integration/governance-v2/src/lib.rs | 10 ++++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/energy-integration/governance-v2/src/errors.rs b/energy-integration/governance-v2/src/errors.rs index 9f92b6bf1..cb399e14e 100644 --- a/energy-integration/governance-v2/src/errors.rs +++ b/energy-integration/governance-v2/src/errors.rs @@ -5,7 +5,6 @@ pub const TOO_MUCH_GAS: &[u8] = b"Actions require too much gas to be executed"; pub const PROPOSAL_NOT_ACTIVE: &[u8] = b"Proposal is not active"; pub const ERROR_NOT_AN_ESDT: &[u8] = b"Not a valid esdt id"; pub const ALREADY_VOTED_ERR_MSG: &[u8] = b"Already voted for this proposal"; -pub const PROPOSAL_NO_ACTION: &[u8] = b"Proposal has no actions"; pub const EXEEDED_MAX_ACTIONS: &[u8] = b"Exceeded max actions per proposal"; pub const ONLY_PROPOSER_CANCEL: &[u8] = b"Only original proposer may cancel a pending proposal"; pub const ONLY_PROPOSER_WITHDRAW: &[u8] = b"Only original proposer may withdraw a pending proposal"; diff --git a/energy-integration/governance-v2/src/lib.rs b/energy-integration/governance-v2/src/lib.rs index 19ab8add1..584d43008 100644 --- a/energy-integration/governance-v2/src/lib.rs +++ b/energy-integration/governance-v2/src/lib.rs @@ -34,11 +34,13 @@ pub trait GovernanceV2: { /// - `min_energy_for_propose` - the minimum energy required for submitting a proposal /// - `min_fee_for_propose` - the minimum fee required for submitting a proposal - /// - `quorum` - the minimum number of (`votes` minus `downvotes`) at the end of voting period - /// - `maxActionsPerProposal` - Maximum number of actions (transfers and/or smart contract calls) that a proposal may have + /// - `quorum_percentage` - the minimum number of (`votes` minus `downvotes`) at the end of voting period /// - `votingDelayInBlocks` - Number of blocks to wait after a block is proposed before being able to vote/downvote that proposal /// - `votingPeriodInBlocks` - Number of blocks the voting period lasts (voting delay does not count towards this) - /// - `lockTimeAfterVotingEndsInBlocks` - Number of blocks to wait before a successful proposal can be executed + /// - `withdraw_percentage_defeated` - Percetange of the fee to be returned if proposal defetead + /// - `energy_factory_address` + /// - `fees_collector_address` + /// - `fee_token` - The token used to pay the fee #[init] fn init( &self, @@ -78,7 +80,7 @@ pub trait GovernanceV2: actions: MultiValueEncoded>, ) -> ProposalId { self.require_caller_not_self(); - require!(!actions.is_empty(), PROPOSAL_NO_ACTION); + require!( actions.len() <= MAX_GOVERNANCE_PROPOSAL_ACTIONS, EXEEDED_MAX_ACTIONS From 5d2d0201205d5af40cc91edfcf3ebc3a1dcc9741 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Tue, 22 Aug 2023 11:54:56 +0300 Subject: [PATCH 019/213] Fixes after review --- .../farm/farm_position/src/farm_position.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/common/modules/farm/farm_position/src/farm_position.rs b/common/modules/farm/farm_position/src/farm_position.rs index ad34e4147..3762698c4 100644 --- a/common/modules/farm/farm_position/src/farm_position.rs +++ b/common/modules/farm/farm_position/src/farm_position.rs @@ -29,14 +29,7 @@ pub trait FarmPositionModule: farm_token_mapper.get_token_attributes(farm_position.token_nonce); if token_attributes.original_owner != caller { - self.user_total_farm_position(&token_attributes.original_owner) - .update(|user_farm_position| { - if *user_farm_position > farm_position.amount { - *user_farm_position -= &farm_position.amount; - } else { - *user_farm_position = BigUint::zero(); - } - }); + self.decrease_user_farm_position(&farm_position); } new_total_farm_position += farm_position.amount; @@ -64,9 +57,15 @@ pub trait FarmPositionModule: farm_positions: &PaymentsVec, ) { let farm_token_mapper = self.farm_token(); + let farm_token_id = farm_token_mapper.get_token_id(); let mut total_farm_position = BigUint::zero(); let mut farm_position_increase = BigUint::zero(); for farm_position in farm_positions { + require!( + farm_position.token_identifier == farm_token_id, + "Bad payment token" + ); + total_farm_position += &farm_position.amount; let token_attributes: FarmTokenAttributes = farm_token_mapper.get_token_attributes(farm_position.token_nonce); From 0655a1414916262882019b31052c478ded63256c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Tue, 22 Aug 2023 11:56:17 +0300 Subject: [PATCH 020/213] Governance-v2: Remove unnecessary views --- energy-integration/governance-v2/src/views.rs | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/energy-integration/governance-v2/src/views.rs b/energy-integration/governance-v2/src/views.rs index 19016f537..770f3b210 100644 --- a/energy-integration/governance-v2/src/views.rs +++ b/energy-integration/governance-v2/src/views.rs @@ -45,17 +45,6 @@ pub trait ViewsModule: } } - #[view(getUserVotingPower)] - fn get_user_voting_power(&self, user_address: ManagedAddress) -> BigUint { - let user_quorum = self.get_energy_amount(&user_address); - self.smoothing_function(&user_quorum) - } - - #[view(getVotingPowerEquivalent)] - fn get_voting_power_equivalent(&self, quorum: BigUint) -> BigUint { - self.smoothing_function(&quorum) - } - // private fn vote_reached(&self, proposal_id: ProposalId) -> bool { From 5e05e327c85116333a48a47ad3dbca81f7ec7962 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Tue, 22 Aug 2023 12:40:11 +0300 Subject: [PATCH 021/213] farm-staking: Fixed module dependencies --- farm-staking/farm-staking/Cargo.toml | 3 +++ farm-staking/farm-staking/src/claim_stake_farm_rewards.rs | 1 + farm-staking/farm-staking/src/compound_stake_farm_rewards.rs | 1 + farm-staking/farm-staking/src/lib.rs | 1 + farm-staking/farm-staking/src/stake_farm.rs | 1 + farm-staking/farm-staking/src/unstake_farm.rs | 1 + 6 files changed, 8 insertions(+) diff --git a/farm-staking/farm-staking/Cargo.toml b/farm-staking/farm-staking/Cargo.toml index d4d155aee..d8e0202f1 100644 --- a/farm-staking/farm-staking/Cargo.toml +++ b/farm-staking/farm-staking/Cargo.toml @@ -31,6 +31,9 @@ path = "../../common/modules/farm/farm_base_impl" [dependencies.farm_token] path = "../../common/modules/farm/farm_token" +[dependencies.farm_position] +path = "../../common/modules/farm/farm_position" + [dependencies.rewards] path = "../../common/modules/farm/rewards" diff --git a/farm-staking/farm-staking/src/claim_stake_farm_rewards.rs b/farm-staking/farm-staking/src/claim_stake_farm_rewards.rs index f8bef0283..831e70564 100644 --- a/farm-staking/farm-staking/src/claim_stake_farm_rewards.rs +++ b/farm-staking/farm-staking/src/claim_stake_farm_rewards.rs @@ -16,6 +16,7 @@ pub trait ClaimStakeFarmRewardsModule: + pausable::PausableModule + permissions_module::PermissionsModule + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule + + farm_position::FarmPositionModule + farm_base_impl::base_farm_init::BaseFarmInitModule + farm_base_impl::base_farm_validation::BaseFarmValidationModule + farm_base_impl::claim_rewards::BaseClaimRewardsModule diff --git a/farm-staking/farm-staking/src/compound_stake_farm_rewards.rs b/farm-staking/farm-staking/src/compound_stake_farm_rewards.rs index e51f3b66e..e2e08485f 100644 --- a/farm-staking/farm-staking/src/compound_stake_farm_rewards.rs +++ b/farm-staking/farm-staking/src/compound_stake_farm_rewards.rs @@ -14,6 +14,7 @@ pub trait CompoundStakeFarmRewardsModule: + pausable::PausableModule + permissions_module::PermissionsModule + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule + + farm_position::FarmPositionModule + farm_base_impl::base_farm_init::BaseFarmInitModule + farm_base_impl::base_farm_validation::BaseFarmValidationModule + farm_base_impl::compound_rewards::BaseCompoundRewardsModule diff --git a/farm-staking/farm-staking/src/lib.rs b/farm-staking/farm-staking/src/lib.rs index d1874d0b4..256013d52 100644 --- a/farm-staking/farm-staking/src/lib.rs +++ b/farm-staking/farm-staking/src/lib.rs @@ -34,6 +34,7 @@ pub trait FarmStaking: + pausable::PausableModule + permissions_module::PermissionsModule + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule + + farm_position::FarmPositionModule + farm_base_impl::base_farm_init::BaseFarmInitModule + farm_base_impl::base_farm_validation::BaseFarmValidationModule + farm_base_impl::enter_farm::BaseEnterFarmModule diff --git a/farm-staking/farm-staking/src/stake_farm.rs b/farm-staking/farm-staking/src/stake_farm.rs index a50dca4b8..d662c81a6 100644 --- a/farm-staking/farm-staking/src/stake_farm.rs +++ b/farm-staking/farm-staking/src/stake_farm.rs @@ -18,6 +18,7 @@ pub trait StakeFarmModule: + pausable::PausableModule + permissions_module::PermissionsModule + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule + + farm_position::FarmPositionModule + farm_base_impl::base_farm_init::BaseFarmInitModule + farm_base_impl::base_farm_validation::BaseFarmValidationModule + farm_base_impl::enter_farm::BaseEnterFarmModule diff --git a/farm-staking/farm-staking/src/unstake_farm.rs b/farm-staking/farm-staking/src/unstake_farm.rs index 4c9675153..4b9af2666 100644 --- a/farm-staking/farm-staking/src/unstake_farm.rs +++ b/farm-staking/farm-staking/src/unstake_farm.rs @@ -18,6 +18,7 @@ pub trait UnstakeFarmModule: + pausable::PausableModule + permissions_module::PermissionsModule + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule + + farm_position::FarmPositionModule + farm_base_impl::base_farm_init::BaseFarmInitModule + farm_base_impl::base_farm_validation::BaseFarmValidationModule + farm_base_impl::exit_farm::BaseExitFarmModule From 4f6bbd3682bb215e22faf8733129a1a2e94160e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Wed, 23 Aug 2023 09:19:29 +0300 Subject: [PATCH 022/213] farm-staking: farm position functionality --- .../farm/farm_position/src/farm_position.rs | 13 ++----- .../farm-staking/src/base_impl_wrapper.rs | 9 ++--- .../src/claim_only_boosted_staking_rewards.rs | 36 ++++++++++++++++++- .../farm-staking/src/custom_rewards.rs | 2 ++ farm-staking/farm-staking/src/unbond_farm.rs | 1 + 5 files changed, 46 insertions(+), 15 deletions(-) diff --git a/common/modules/farm/farm_position/src/farm_position.rs b/common/modules/farm/farm_position/src/farm_position.rs index 3762698c4..739f7e9e3 100644 --- a/common/modules/farm/farm_position/src/farm_position.rs +++ b/common/modules/farm/farm_position/src/farm_position.rs @@ -18,13 +18,10 @@ pub trait FarmPositionModule: let caller = self.blockchain().get_caller(); let payments = self.get_non_empty_payments(); let farm_token_mapper = self.farm_token(); - let farm_token_id = farm_token_mapper.get_token_id(); let mut new_total_farm_position = BigUint::zero(); for farm_position in &payments { - require!( - farm_position.token_identifier == farm_token_id, - "Bad payment token" - ); + farm_token_mapper.require_same_token(&farm_position.token_identifier); + let token_attributes: FarmTokenAttributes = farm_token_mapper.get_token_attributes(farm_position.token_nonce); @@ -57,14 +54,10 @@ pub trait FarmPositionModule: farm_positions: &PaymentsVec, ) { let farm_token_mapper = self.farm_token(); - let farm_token_id = farm_token_mapper.get_token_id(); let mut total_farm_position = BigUint::zero(); let mut farm_position_increase = BigUint::zero(); for farm_position in farm_positions { - require!( - farm_position.token_identifier == farm_token_id, - "Bad payment token" - ); + farm_token_mapper.require_same_token(&farm_position.token_identifier); total_farm_position += &farm_position.amount; let token_attributes: FarmTokenAttributes = diff --git a/farm-staking/farm-staking/src/base_impl_wrapper.rs b/farm-staking/farm-staking/src/base_impl_wrapper.rs index 1d25e1cdc..4165a2314 100644 --- a/farm-staking/farm-staking/src/base_impl_wrapper.rs +++ b/farm-staking/farm-staking/src/base_impl_wrapper.rs @@ -13,6 +13,7 @@ pub trait FarmStakingTraits = + rewards::RewardsModule + config::ConfigModule + farm_token::FarmTokenModule + + farm_position::FarmPositionModule + pausable::PausableModule + permissions_module::PermissionsModule + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule @@ -47,15 +48,16 @@ where sc: &::FarmSc, caller: &ManagedAddress<<::FarmSc as ContractBase>::Api>, token_attributes: &::AttributesType, - farm_token_amount: BigUint<<::FarmSc as ContractBase>::Api>, ) -> BigUint<<::FarmSc as ContractBase>::Api> { if &token_attributes.original_owner != caller { sc.update_energy_and_progress(caller); - + } + let user_total_farm_position_mapper = sc.user_total_farm_position(caller); + if user_total_farm_position_mapper.is_empty() { return BigUint::zero(); } - sc.claim_boosted_yields_rewards(caller, farm_token_amount) + sc.claim_boosted_yields_rewards(caller, user_total_farm_position_mapper.get()) } } @@ -138,7 +140,6 @@ where sc, caller, token_attributes, - farm_token_amount.clone(), ); base_farm_reward + boosted_yield_rewards diff --git a/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs b/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs index a41cb1249..e58669a04 100644 --- a/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs +++ b/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs @@ -7,6 +7,7 @@ pub trait ClaimOnlyBoostedStakingRewardsModule: config::ConfigModule + rewards::RewardsModule + farm_token::FarmTokenModule + + farm_position::FarmPositionModule + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule + week_timekeeping::WeekTimekeepingModule + pausable::PausableModule @@ -24,6 +25,40 @@ pub trait ClaimOnlyBoostedStakingRewardsModule: + farm_boosted_yields::boosted_yields_factors::BoostedYieldsFactorsModule + crate::custom_rewards::CustomRewardsModule { + #[payable("*")] + #[endpoint(claimBoostedRewards)] + fn claim_boosted_rewards(&self, opt_user: OptionalValue) -> EsdtTokenPayment { + let user = match opt_user { + OptionalValue::Some(user) => { + require!( + self.allow_external_claim_boosted_rewards(&user).get(), + "Cannot claim rewards for this address" + ); + user + } + OptionalValue::None => self.blockchain().get_caller(), + }; + + let reward_token_id = self.reward_token_id().get(); + let user_total_farm_position_mapper = self.user_total_farm_position(&user); + if user_total_farm_position_mapper.is_empty() { + return EsdtTokenPayment::new(reward_token_id, 0, BigUint::zero()); + } + + let reward = + self.claim_boosted_yields_rewards(&user, user_total_farm_position_mapper.get()); + if reward > 0 { + self.reward_reserve().update(|reserve| *reserve -= &reward); + } + + let boosted_rewards = EsdtTokenPayment::new(reward_token_id, 0, reward); + self.send_payment_non_zero(&user, &boosted_rewards); + + self.update_energy_and_progress(&user); + + boosted_rewards + } + // Cannot import the one from farm, as the Wrapper struct has different dependencies fn claim_only_boosted_payment( &self, @@ -39,7 +74,6 @@ pub trait ClaimOnlyBoostedStakingRewardsModule: self, caller, &token_attributes, - payment.amount.clone(), ); if reward > 0 { self.reward_reserve().update(|reserve| *reserve -= &reward); diff --git a/farm-staking/farm-staking/src/custom_rewards.rs b/farm-staking/farm-staking/src/custom_rewards.rs index 64bf431ee..79689b96b 100644 --- a/farm-staking/farm-staking/src/custom_rewards.rs +++ b/farm-staking/farm-staking/src/custom_rewards.rs @@ -17,6 +17,8 @@ pub trait CustomRewardsModule: + config::ConfigModule + token_send::TokenSendModule + farm_token::FarmTokenModule + + farm_position::FarmPositionModule + + utils::UtilsModule + pausable::PausableModule + permissions_module::PermissionsModule + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule diff --git a/farm-staking/farm-staking/src/unbond_farm.rs b/farm-staking/farm-staking/src/unbond_farm.rs index 7e85a2a2c..f6ee2d96c 100644 --- a/farm-staking/farm-staking/src/unbond_farm.rs +++ b/farm-staking/farm-staking/src/unbond_farm.rs @@ -12,6 +12,7 @@ pub trait UnbondFarmModule: + events::EventsModule + token_send::TokenSendModule + farm_token::FarmTokenModule + + farm_position::FarmPositionModule + sc_whitelist_module::SCWhitelistModule + pausable::PausableModule + permissions_module::PermissionsModule From 97b52fabfa773ddb235cbf822de9f2eed704ea57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Wed, 23 Aug 2023 09:34:35 +0300 Subject: [PATCH 023/213] farm_position: compilation dependencies --- dex/pair-mock/wasm/src/lib.rs | 2 +- dex/proxy-deployer/wasm/Cargo.lock | 14 ++++++++++++++ energy-integration/energy-update/wasm/Cargo.lock | 14 ++++++++++++++ farm-staking/farm-staking-proxy/wasm/Cargo.lock | 15 +++++++++++++++ farm-staking/farm-staking/wasm/Cargo.lock | 15 +++++++++++++++ farm-staking/farm-staking/wasm/src/lib.rs | 9 +++++++-- locked-asset/proxy_dex/wasm/Cargo.lock | 15 +++++++++++++++ 7 files changed, 81 insertions(+), 3 deletions(-) diff --git a/dex/pair-mock/wasm/src/lib.rs b/dex/pair-mock/wasm/src/lib.rs index 0634dae52..54b9b427e 100644 --- a/dex/pair-mock/wasm/src/lib.rs +++ b/dex/pair-mock/wasm/src/lib.rs @@ -19,7 +19,7 @@ multiversx_sc_wasm_adapter::endpoints! { pair_mock ( addInitialLiquidity - updateAndGetTokensForGivenPositionWithSafePrice + getTokensForGivenPositionWithSafePrice ) } diff --git a/dex/proxy-deployer/wasm/Cargo.lock b/dex/proxy-deployer/wasm/Cargo.lock index 3d762a9be..63cde5917 100644 --- a/dex/proxy-deployer/wasm/Cargo.lock +++ b/dex/proxy-deployer/wasm/Cargo.lock @@ -154,6 +154,7 @@ dependencies = [ "events", "farm-boosted-yields", "farm_base_impl", + "farm_position", "farm_token", "fixed-supply-token", "mergeable", @@ -193,6 +194,7 @@ dependencies = [ "config", "contexts", "events", + "farm_position", "farm_token", "fixed-supply-token", "mergeable", @@ -206,6 +208,18 @@ dependencies = [ "utils", ] +[[package]] +name = "farm_position" +version = "0.0.0" +dependencies = [ + "common_structs", + "farm_token", + "multiversx-sc", + "multiversx-sc-modules", + "permissions_module", + "utils", +] + [[package]] name = "farm_token" version = "0.0.0" diff --git a/energy-integration/energy-update/wasm/Cargo.lock b/energy-integration/energy-update/wasm/Cargo.lock index 5173db1ce..55e0dd4b1 100644 --- a/energy-integration/energy-update/wasm/Cargo.lock +++ b/energy-integration/energy-update/wasm/Cargo.lock @@ -172,6 +172,7 @@ dependencies = [ "events", "farm-boosted-yields", "farm_base_impl", + "farm_position", "farm_token", "fixed-supply-token", "mergeable", @@ -211,6 +212,7 @@ dependencies = [ "config", "contexts", "events", + "farm_position", "farm_token", "fixed-supply-token", "mergeable", @@ -224,6 +226,18 @@ dependencies = [ "utils", ] +[[package]] +name = "farm_position" +version = "0.0.0" +dependencies = [ + "common_structs", + "farm_token", + "multiversx-sc", + "multiversx-sc-modules", + "permissions_module", + "utils", +] + [[package]] name = "farm_token" version = "0.0.0" diff --git a/farm-staking/farm-staking-proxy/wasm/Cargo.lock b/farm-staking/farm-staking-proxy/wasm/Cargo.lock index 6b8cfa51d..d4a937ad4 100644 --- a/farm-staking/farm-staking-proxy/wasm/Cargo.lock +++ b/farm-staking/farm-staking-proxy/wasm/Cargo.lock @@ -154,6 +154,7 @@ dependencies = [ "events", "farm-boosted-yields", "farm_base_impl", + "farm_position", "farm_token", "fixed-supply-token", "mergeable", @@ -198,6 +199,7 @@ dependencies = [ "farm", "farm-boosted-yields", "farm_base_impl", + "farm_position", "farm_token", "fixed-supply-token", "math", @@ -254,6 +256,7 @@ dependencies = [ "config", "contexts", "events", + "farm_position", "farm_token", "fixed-supply-token", "mergeable", @@ -267,6 +270,18 @@ dependencies = [ "utils", ] +[[package]] +name = "farm_position" +version = "0.0.0" +dependencies = [ + "common_structs", + "farm_token", + "multiversx-sc", + "multiversx-sc-modules", + "permissions_module", + "utils", +] + [[package]] name = "farm_token" version = "0.0.0" diff --git a/farm-staking/farm-staking/wasm/Cargo.lock b/farm-staking/farm-staking/wasm/Cargo.lock index 4584bdf1a..0d71b7fcd 100644 --- a/farm-staking/farm-staking/wasm/Cargo.lock +++ b/farm-staking/farm-staking/wasm/Cargo.lock @@ -154,6 +154,7 @@ dependencies = [ "events", "farm-boosted-yields", "farm_base_impl", + "farm_position", "farm_token", "fixed-supply-token", "mergeable", @@ -198,6 +199,7 @@ dependencies = [ "farm", "farm-boosted-yields", "farm_base_impl", + "farm_position", "farm_token", "fixed-supply-token", "math", @@ -232,6 +234,7 @@ dependencies = [ "config", "contexts", "events", + "farm_position", "farm_token", "fixed-supply-token", "mergeable", @@ -245,6 +248,18 @@ dependencies = [ "utils", ] +[[package]] +name = "farm_position" +version = "0.0.0" +dependencies = [ + "common_structs", + "farm_token", + "multiversx-sc", + "multiversx-sc-modules", + "permissions_module", + "utils", +] + [[package]] name = "farm_token" version = "0.0.0" diff --git a/farm-staking/farm-staking/wasm/src/lib.rs b/farm-staking/farm-staking/wasm/src/lib.rs index f168969c1..da5f11351 100644 --- a/farm-staking/farm-staking/wasm/src/lib.rs +++ b/farm-staking/farm-staking/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 64 +// Endpoints: 69 // Async Callback: 1 -// Total number of exported functions: 66 +// Total number of exported functions: 71 #![no_std] #![feature(alloc_error_handler, lang_items)] @@ -52,6 +52,10 @@ multiversx_sc_wasm_adapter::endpoints! { removeAdmin updateOwnerOrAdmin getPermissions + updateTotalFarmPosition + setAllowExternalClaimBoostedRewards + getUserTotalFarmPosition + getAllowExternalClaimBoostedRewards setBurnRoleForAddress stakeFarmThroughProxy stakeFarm @@ -61,6 +65,7 @@ multiversx_sc_wasm_adapter::endpoints! { unstakeFarm unstakeFarmThroughProxy unbondFarm + claimBoostedRewards setBoostedYieldsRewardsPercentage collectUndistributedBoostedRewards getBoostedYieldsRewardsPercentage diff --git a/locked-asset/proxy_dex/wasm/Cargo.lock b/locked-asset/proxy_dex/wasm/Cargo.lock index fe099d430..7ff19d6d2 100644 --- a/locked-asset/proxy_dex/wasm/Cargo.lock +++ b/locked-asset/proxy_dex/wasm/Cargo.lock @@ -154,6 +154,7 @@ dependencies = [ "events", "farm-boosted-yields", "farm_base_impl", + "farm_position", "farm_token", "fixed-supply-token", "mergeable", @@ -198,6 +199,7 @@ dependencies = [ "farm", "farm-boosted-yields", "farm_base_impl", + "farm_position", "farm_token", "fixed-supply-token", "locking_module", @@ -223,6 +225,7 @@ dependencies = [ "config", "contexts", "events", + "farm_position", "farm_token", "fixed-supply-token", "mergeable", @@ -236,6 +239,18 @@ dependencies = [ "utils", ] +[[package]] +name = "farm_position" +version = "0.0.0" +dependencies = [ + "common_structs", + "farm_token", + "multiversx-sc", + "multiversx-sc-modules", + "permissions_module", + "utils", +] + [[package]] name = "farm_token" version = "0.0.0" From b70b0de3308c1d8c66d2cad8ce55d3461a279aa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Wed, 23 Aug 2023 15:05:41 +0300 Subject: [PATCH 024/213] farm-staking: Fix tests --- common/modules/farm/config/src/config.rs | 12 ++ .../farm_base_impl/src/base_traits_impl.rs | 56 +++++ .../farm/farm_base_impl/src/claim_rewards.rs | 3 +- .../farm_base_impl/src/compound_rewards.rs | 3 +- .../farm/farm_base_impl/src/enter_farm.rs | 5 +- .../farm/farm_base_impl/src/exit_farm.rs | 3 +- common/modules/farm/farm_base_impl/src/lib.rs | 1 - .../farm/farm_position/src/farm_position.rs | 197 +++++++++--------- dex/farm-with-locked-rewards/src/lib.rs | 1 - dex/farm-with-locked-rewards/wasm/src/lib.rs | 10 +- dex/farm/src/base_functions.rs | 4 +- dex/farm/src/claim_boost_only.rs | 9 +- dex/farm/src/lib.rs | 1 - dex/farm/wasm/src/lib.rs | 10 +- .../governance-v2/wasm/src/lib.rs | 6 +- .../farm-staking/src/base_impl_wrapper.rs | 59 +++++- .../src/claim_only_boosted_staking_rewards.rs | 1 - .../src/claim_stake_farm_rewards.rs | 1 - .../src/compound_stake_farm_rewards.rs | 1 - .../farm-staking/src/custom_rewards.rs | 1 - farm-staking/farm-staking/src/lib.rs | 1 - farm-staking/farm-staking/src/stake_farm.rs | 1 - farm-staking/farm-staking/src/unbond_farm.rs | 1 - farm-staking/farm-staking/src/unstake_farm.rs | 1 - farm-staking/farm-staking/wasm/src/lib.rs | 10 +- 25 files changed, 252 insertions(+), 146 deletions(-) diff --git a/common/modules/farm/config/src/config.rs b/common/modules/farm/config/src/config.rs index 38606f280..bd80456ff 100644 --- a/common/modules/farm/config/src/config.rs +++ b/common/modules/farm/config/src/config.rs @@ -38,4 +38,16 @@ pub trait ConfigModule: pausable::PausableModule + permissions_module::Permissio #[view(getDivisionSafetyConstant)] #[storage_mapper("division_safety_constant")] fn division_safety_constant(&self) -> SingleValueMapper; + + #[view(getUserTotalFarmPosition)] + #[storage_mapper("userTotalFarmPosition")] + fn user_total_farm_position(&self, user: &ManagedAddress) -> SingleValueMapper; + + #[view(getAllowExternalClaimBoostedRewards)] + #[storage_mapper("allowExternalClaimBoostedRewards")] + fn allow_external_claim_boosted_rewards( + &self, + user: &ManagedAddress, + ) -> SingleValueMapper; + } diff --git a/common/modules/farm/farm_base_impl/src/base_traits_impl.rs b/common/modules/farm/farm_base_impl/src/base_traits_impl.rs index eaa86c5ac..7839efbbf 100644 --- a/common/modules/farm/farm_base_impl/src/base_traits_impl.rs +++ b/common/modules/farm/farm_base_impl/src/base_traits_impl.rs @@ -6,6 +6,7 @@ use contexts::storage_cache::StorageCache; use core::marker::PhantomData; use fixed_supply_token::FixedSupplyToken; use mergeable::Mergeable; +use multiversx_sc_modules::transfer_role_proxy::PaymentsVec; use rewards::RewardsModule; pub trait AllBaseFarmImplTraits = @@ -187,6 +188,61 @@ pub trait FarmContract { _storage_cache: &StorageCache, ) { } + + fn check_and_update_user_farm_position( + sc: &Self::FarmSc, + user: &ManagedAddress<::Api>, + farm_positions: &PaymentsVec<::Api>, + ) { + let farm_token_mapper = sc.farm_token(); + let mut total_farm_position = BigUint::zero(); + let mut farm_position_increase = BigUint::zero(); + for farm_position in farm_positions { + farm_token_mapper.require_same_token(&farm_position.token_identifier); + + total_farm_position += &farm_position.amount; + let token_attributes: FarmTokenAttributes<::Api> = + farm_token_mapper.get_token_attributes(farm_position.token_nonce); + + if &token_attributes.original_owner != user { + Self::decrease_user_farm_position(sc, &farm_position); + farm_position_increase += &farm_position.amount; + } + } + + if sc.user_total_farm_position(user).get() == 0 { + Self::increase_user_farm_position(sc, user, &total_farm_position); + } else if farm_position_increase > 0 { + Self::increase_user_farm_position(sc, user, &farm_position_increase); + } + } + + fn increase_user_farm_position( + sc: &Self::FarmSc, + user: &ManagedAddress<::Api>, + new_farm_position_amount: &BigUint<::Api>, + ) { + sc.user_total_farm_position(user) + .update(|user_farm_position| *user_farm_position += new_farm_position_amount); + } + + fn decrease_user_farm_position( + sc: &Self::FarmSc, + farm_position: &EsdtTokenPayment<::Api>, + ) { + let farm_token_mapper = sc.farm_token(); + let token_attributes: FarmTokenAttributes<::Api> = + farm_token_mapper.get_token_attributes(farm_position.token_nonce); + + sc.user_total_farm_position(&token_attributes.original_owner) + .update(|user_farm_position| { + if *user_farm_position > farm_position.amount { + *user_farm_position -= &farm_position.amount; + } else { + *user_farm_position = BigUint::zero(); + } + }); + } } pub struct DefaultFarmWrapper diff --git a/common/modules/farm/farm_base_impl/src/claim_rewards.rs b/common/modules/farm/farm_base_impl/src/claim_rewards.rs index 11ba65338..85b0e7ef6 100644 --- a/common/modules/farm/farm_base_impl/src/claim_rewards.rs +++ b/common/modules/farm/farm_base_impl/src/claim_rewards.rs @@ -26,7 +26,6 @@ pub trait BaseClaimRewardsModule: + config::ConfigModule + token_send::TokenSendModule + farm_token::FarmTokenModule - + farm_position::FarmPositionModule + pausable::PausableModule + permissions_module::PermissionsModule + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule @@ -64,7 +63,7 @@ pub trait BaseClaimRewardsModule: self.blockchain(), ); - self.check_and_update_user_farm_position(&caller, &payments); + FC::check_and_update_user_farm_position(self, &caller, &payments); FC::generate_aggregated_rewards(self, &mut storage_cache); diff --git a/common/modules/farm/farm_base_impl/src/compound_rewards.rs b/common/modules/farm/farm_base_impl/src/compound_rewards.rs index 5fbed98d4..6a00848a4 100644 --- a/common/modules/farm/farm_base_impl/src/compound_rewards.rs +++ b/common/modules/farm/farm_base_impl/src/compound_rewards.rs @@ -27,7 +27,6 @@ pub trait BaseCompoundRewardsModule: + config::ConfigModule + token_send::TokenSendModule + farm_token::FarmTokenModule - + farm_position::FarmPositionModule + pausable::PausableModule + permissions_module::PermissionsModule + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule @@ -52,7 +51,7 @@ pub trait BaseCompoundRewardsModule: self.blockchain(), ); - self.check_and_update_user_farm_position(&caller, &payments); + FC::check_and_update_user_farm_position(self, &caller, &payments); FC::generate_aggregated_rewards(self, &mut storage_cache); diff --git a/common/modules/farm/farm_base_impl/src/enter_farm.rs b/common/modules/farm/farm_base_impl/src/enter_farm.rs index 15bc9c2fa..e7628cf76 100644 --- a/common/modules/farm/farm_base_impl/src/enter_farm.rs +++ b/common/modules/farm/farm_base_impl/src/enter_farm.rs @@ -24,7 +24,6 @@ pub trait BaseEnterFarmModule: + config::ConfigModule + token_send::TokenSendModule + farm_token::FarmTokenModule - + farm_position::FarmPositionModule + pausable::PausableModule + permissions_module::PermissionsModule + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule @@ -46,11 +45,11 @@ pub trait BaseEnterFarmModule: ); // The order is important - first check and update, then increase position - self.check_and_update_user_farm_position( + FC::check_and_update_user_farm_position(self, &caller, &enter_farm_context.additional_farm_tokens, ); - self.increase_user_farm_position(&caller, &enter_farm_context.farming_token_payment.amount); + FC::increase_user_farm_position(self, &caller, &enter_farm_context.farming_token_payment.amount); FC::generate_aggregated_rewards(self, &mut storage_cache); diff --git a/common/modules/farm/farm_base_impl/src/exit_farm.rs b/common/modules/farm/farm_base_impl/src/exit_farm.rs index a058f6a55..eefe7c65f 100644 --- a/common/modules/farm/farm_base_impl/src/exit_farm.rs +++ b/common/modules/farm/farm_base_impl/src/exit_farm.rs @@ -24,7 +24,6 @@ pub trait BaseExitFarmModule: + config::ConfigModule + token_send::TokenSendModule + farm_token::FarmTokenModule - + farm_position::FarmPositionModule + pausable::PausableModule + permissions_module::PermissionsModule + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule @@ -45,7 +44,7 @@ pub trait BaseExitFarmModule: self.blockchain(), ); - self.decrease_user_farm_position(&payment); + FC::decrease_user_farm_position(self, &payment); FC::generate_aggregated_rewards(self, &mut storage_cache); diff --git a/common/modules/farm/farm_base_impl/src/lib.rs b/common/modules/farm/farm_base_impl/src/lib.rs index a3449779a..f63df2820 100644 --- a/common/modules/farm/farm_base_impl/src/lib.rs +++ b/common/modules/farm/farm_base_impl/src/lib.rs @@ -21,7 +21,6 @@ pub trait FarmBaseImpl: + config::ConfigModule + token_send::TokenSendModule + farm_token::FarmTokenModule - + farm_position::FarmPositionModule + pausable::PausableModule + permissions_module::PermissionsModule + events::EventsModule diff --git a/common/modules/farm/farm_position/src/farm_position.rs b/common/modules/farm/farm_position/src/farm_position.rs index 739f7e9e3..a7e12663c 100644 --- a/common/modules/farm/farm_position/src/farm_position.rs +++ b/common/modules/farm/farm_position/src/farm_position.rs @@ -3,7 +3,6 @@ multiversx_sc::imports!(); multiversx_sc::derive_imports!(); -use common_structs::{FarmTokenAttributes, PaymentsVec}; #[multiversx_sc::module] pub trait FarmPositionModule: @@ -12,102 +11,102 @@ pub trait FarmPositionModule: + permissions_module::PermissionsModule + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule { - #[payable("*")] - #[endpoint(updateTotalFarmPosition)] - fn update_total_farm_position(&self) { - let caller = self.blockchain().get_caller(); - let payments = self.get_non_empty_payments(); - let farm_token_mapper = self.farm_token(); - let mut new_total_farm_position = BigUint::zero(); - for farm_position in &payments { - farm_token_mapper.require_same_token(&farm_position.token_identifier); - - let token_attributes: FarmTokenAttributes = - farm_token_mapper.get_token_attributes(farm_position.token_nonce); - - if token_attributes.original_owner != caller { - self.decrease_user_farm_position(&farm_position); - } - - new_total_farm_position += farm_position.amount; - } - - let user_current_farm_position = self.user_total_farm_position(&caller).get(); - if new_total_farm_position > user_current_farm_position { - self.user_total_farm_position(&caller) - .set(new_total_farm_position) - } - - self.send().direct_multi(&caller, &payments); - } - - #[endpoint(setAllowExternalClaimBoostedRewards)] - fn set_allow_external_claim_boosted_rewards(&self, allow: bool) { - let caller = self.blockchain().get_caller(); - self.allow_external_claim_boosted_rewards(&caller) - .set(allow); - } - - fn check_and_update_user_farm_position( - &self, - user: &ManagedAddress, - farm_positions: &PaymentsVec, - ) { - let farm_token_mapper = self.farm_token(); - let mut total_farm_position = BigUint::zero(); - let mut farm_position_increase = BigUint::zero(); - for farm_position in farm_positions { - farm_token_mapper.require_same_token(&farm_position.token_identifier); - - total_farm_position += &farm_position.amount; - let token_attributes: FarmTokenAttributes = - farm_token_mapper.get_token_attributes(farm_position.token_nonce); - - if &token_attributes.original_owner != user { - self.decrease_user_farm_position(&farm_position); - farm_position_increase += &farm_position.amount; - } - } - - if self.user_total_farm_position(user).get() == 0 { - self.increase_user_farm_position(user, &total_farm_position); - } else if farm_position_increase > 0 { - self.increase_user_farm_position(user, &farm_position_increase); - } - } - - fn increase_user_farm_position( - &self, - user: &ManagedAddress, - new_farm_position_amount: &BigUint, - ) { - self.user_total_farm_position(user) - .update(|user_farm_position| *user_farm_position += new_farm_position_amount); - } - - fn decrease_user_farm_position(&self, farm_position: &EsdtTokenPayment) { - let farm_token_mapper = self.farm_token(); - let token_attributes: FarmTokenAttributes = - farm_token_mapper.get_token_attributes(farm_position.token_nonce); - - self.user_total_farm_position(&token_attributes.original_owner) - .update(|user_farm_position| { - if *user_farm_position > farm_position.amount { - *user_farm_position -= &farm_position.amount; - } else { - *user_farm_position = BigUint::zero(); - } - }); - } - - #[view(getUserTotalFarmPosition)] - #[storage_mapper("userTotalFarmPosition")] - fn user_total_farm_position(&self, user: &ManagedAddress) -> SingleValueMapper; - - #[view(getAllowExternalClaimBoostedRewards)] - #[storage_mapper("allowExternalClaimBoostedRewards")] - fn allow_external_claim_boosted_rewards( - &self, - user: &ManagedAddress, - ) -> SingleValueMapper; + // #[payable("*")] + // #[endpoint(updateTotalFarmPosition)] + // fn update_total_farm_position(&self) { + // let caller = self.blockchain().get_caller(); + // let payments = self.get_non_empty_payments(); + // let farm_token_mapper = self.farm_token(); + // let mut new_total_farm_position = BigUint::zero(); + // for farm_position in &payments { + // farm_token_mapper.require_same_token(&farm_position.token_identifier); + + // let token_attributes: FarmTokenAttributes = + // farm_token_mapper.get_token_attributes(farm_position.token_nonce); + + // if token_attributes.original_owner != caller { + // self.decrease_user_farm_position(&farm_position); + // } + + // new_total_farm_position += farm_position.amount; + // } + + // let user_current_farm_position = self.user_total_farm_position(&caller).get(); + // if new_total_farm_position > user_current_farm_position { + // self.user_total_farm_position(&caller) + // .set(new_total_farm_position) + // } + + // self.send().direct_multi(&caller, &payments); + // } + + // #[endpoint(setAllowExternalClaimBoostedRewards)] + // fn set_allow_external_claim_boosted_rewards(&self, allow: bool) { + // let caller = self.blockchain().get_caller(); + // self.allow_external_claim_boosted_rewards(&caller) + // .set(allow); + // } + + // fn check_and_update_user_farm_position( + // &self, + // user: &ManagedAddress, + // farm_positions: &PaymentsVec, + // ) { + // let farm_token_mapper = self.farm_token(); + // let mut total_farm_position = BigUint::zero(); + // let mut farm_position_increase = BigUint::zero(); + // for farm_position in farm_positions { + // farm_token_mapper.require_same_token(&farm_position.token_identifier); + + // total_farm_position += &farm_position.amount; + // let token_attributes: FarmTokenAttributes = + // farm_token_mapper.get_token_attributes(farm_position.token_nonce); + + // if &token_attributes.original_owner != user { + // self.decrease_user_farm_position(&farm_position); + // farm_position_increase += &farm_position.amount; + // } + // } + + // if self.user_total_farm_position(user).get() == 0 { + // self.increase_user_farm_position(user, &total_farm_position); + // } else if farm_position_increase > 0 { + // self.increase_user_farm_position(user, &farm_position_increase); + // } + // } + + // fn increase_user_farm_position( + // &self, + // user: &ManagedAddress, + // new_farm_position_amount: &BigUint, + // ) { + // self.user_total_farm_position(user) + // .update(|user_farm_position| *user_farm_position += new_farm_position_amount); + // } + + // fn decrease_user_farm_position(&self, farm_position: &EsdtTokenPayment) { + // let farm_token_mapper = self.farm_token(); + // let token_attributes: FarmTokenAttributes = + // farm_token_mapper.get_token_attributes(farm_position.token_nonce); + + // self.user_total_farm_position(&token_attributes.original_owner) + // .update(|user_farm_position| { + // if *user_farm_position > farm_position.amount { + // *user_farm_position -= &farm_position.amount; + // } else { + // *user_farm_position = BigUint::zero(); + // } + // }); + // } + + // #[view(getUserTotalFarmPosition)] + // #[storage_mapper("userTotalFarmPosition")] + // fn user_total_farm_position(&self, user: &ManagedAddress) -> SingleValueMapper; + + // #[view(getAllowExternalClaimBoostedRewards)] + // #[storage_mapper("allowExternalClaimBoostedRewards")] + // fn allow_external_claim_boosted_rewards( + // &self, + // user: &ManagedAddress, + // ) -> SingleValueMapper; } diff --git a/dex/farm-with-locked-rewards/src/lib.rs b/dex/farm-with-locked-rewards/src/lib.rs index 663d51783..0bfbff59b 100644 --- a/dex/farm-with-locked-rewards/src/lib.rs +++ b/dex/farm-with-locked-rewards/src/lib.rs @@ -26,7 +26,6 @@ pub trait Farm: + token_send::TokenSendModule + locking_module::lock_with_energy_module::LockWithEnergyModule + farm_token::FarmTokenModule - + farm_position::FarmPositionModule + utils::UtilsModule + pausable::PausableModule + permissions_module::PermissionsModule diff --git a/dex/farm-with-locked-rewards/wasm/src/lib.rs b/dex/farm-with-locked-rewards/wasm/src/lib.rs index e679e068f..48baeb9fc 100644 --- a/dex/farm-with-locked-rewards/wasm/src/lib.rs +++ b/dex/farm-with-locked-rewards/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 67 +// Endpoints: 65 // Async Callback: 1 -// Total number of exported functions: 69 +// Total number of exported functions: 67 #![no_std] #![feature(alloc_error_handler, lang_items)] @@ -33,6 +33,8 @@ multiversx_sc_wasm_adapter::endpoints! { getPerBlockRewardAmount getLastRewardBlockNonce getDivisionSafetyConstant + getUserTotalFarmPosition + getAllowExternalClaimBoostedRewards setLockingScAddress setLockEpochs getLockingScAddress @@ -40,10 +42,6 @@ multiversx_sc_wasm_adapter::endpoints! { registerFarmToken getFarmTokenId getFarmTokenSupply - updateTotalFarmPosition - setAllowExternalClaimBoostedRewards - getUserTotalFarmPosition - getAllowExternalClaimBoostedRewards addToPauseWhitelist removeFromPauseWhitelist pause diff --git a/dex/farm/src/base_functions.rs b/dex/farm/src/base_functions.rs index 4557de643..a243bac15 100644 --- a/dex/farm/src/base_functions.rs +++ b/dex/farm/src/base_functions.rs @@ -13,6 +13,7 @@ use contexts::storage_cache::StorageCache; use farm_base_impl::base_traits_impl::{DefaultFarmWrapper, FarmContract}; use fixed_supply_token::FixedSupplyToken; + use crate::exit_penalty; pub type DoubleMultiPayment = MultiValue2, EsdtTokenPayment>; @@ -47,7 +48,6 @@ pub trait BaseFunctionsModule: + config::ConfigModule + token_send::TokenSendModule + farm_token::FarmTokenModule - + farm_position::FarmPositionModule + pausable::PausableModule + permissions_module::PermissionsModule + events::EventsModule @@ -188,7 +188,7 @@ pub trait BaseFunctionsModule: token_mapper.require_all_same_token(&payments); let caller = self.blockchain().get_caller(); - self.check_and_update_user_farm_position(&caller, &payments); + FC::check_and_update_user_farm_position(self, &caller, &payments); let output_attributes: FC::AttributesType = self.merge_from_payments_and_burn(payments, &token_mapper); diff --git a/dex/farm/src/claim_boost_only.rs b/dex/farm/src/claim_boost_only.rs index 7d8c320b5..15fe9cb5a 100644 --- a/dex/farm/src/claim_boost_only.rs +++ b/dex/farm/src/claim_boost_only.rs @@ -1,5 +1,7 @@ multiversx_sc::imports!(); + + use crate::base_functions::Wrapper; #[multiversx_sc::module] @@ -7,7 +9,6 @@ pub trait ClaimBoostOnlyModule: config::ConfigModule + rewards::RewardsModule + farm_token::FarmTokenModule - + farm_position::FarmPositionModule + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule + week_timekeeping::WeekTimekeepingModule + pausable::PausableModule @@ -34,7 +35,10 @@ pub trait ClaimBoostOnlyModule: { #[payable("*")] #[endpoint(claimBoostedRewards)] - fn claim_boosted_rewards(&self, opt_user: OptionalValue) -> EsdtTokenPayment { + fn claim_boosted_rewards( + &self, + opt_user: OptionalValue + ) -> EsdtTokenPayment { let user = match opt_user { OptionalValue::Some(user) => { require!( @@ -47,6 +51,7 @@ pub trait ClaimBoostOnlyModule: }; let reward_token_id = self.reward_token_id().get(); + let user_total_farm_position_mapper = self.user_total_farm_position(&user); if user_total_farm_position_mapper.is_empty() { return EsdtTokenPayment::new(reward_token_id, 0, BigUint::zero()); diff --git a/dex/farm/src/lib.rs b/dex/farm/src/lib.rs index e2a4fe30d..34975a2a5 100644 --- a/dex/farm/src/lib.rs +++ b/dex/farm/src/lib.rs @@ -30,7 +30,6 @@ pub trait Farm: + config::ConfigModule + token_send::TokenSendModule + farm_token::FarmTokenModule - + farm_position::FarmPositionModule + pausable::PausableModule + permissions_module::PermissionsModule + sc_whitelist_module::SCWhitelistModule diff --git a/dex/farm/wasm/src/lib.rs b/dex/farm/wasm/src/lib.rs index 9b312e5e1..dbb8e6d3d 100644 --- a/dex/farm/wasm/src/lib.rs +++ b/dex/farm/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 64 +// Endpoints: 62 // Async Callback: 1 -// Total number of exported functions: 66 +// Total number of exported functions: 64 #![no_std] #![feature(alloc_error_handler, lang_items)] @@ -34,13 +34,11 @@ multiversx_sc_wasm_adapter::endpoints! { getPerBlockRewardAmount getLastRewardBlockNonce getDivisionSafetyConstant + getUserTotalFarmPosition + getAllowExternalClaimBoostedRewards registerFarmToken getFarmTokenId getFarmTokenSupply - updateTotalFarmPosition - setAllowExternalClaimBoostedRewards - getUserTotalFarmPosition - getAllowExternalClaimBoostedRewards addToPauseWhitelist removeFromPauseWhitelist pause diff --git a/energy-integration/governance-v2/wasm/src/lib.rs b/energy-integration/governance-v2/wasm/src/lib.rs index 5115397b6..6c2f6e7e2 100644 --- a/energy-integration/governance-v2/wasm/src/lib.rs +++ b/energy-integration/governance-v2/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 29 +// Endpoints: 27 // Async Callback (empty): 1 -// Total number of exported functions: 31 +// Total number of exported functions: 29 #![no_std] #![feature(alloc_error_handler, lang_items)] @@ -38,8 +38,6 @@ multiversx_sc_wasm_adapter::endpoints! { getUserVotedProposals getProposalVotes getProposalStatus - getUserVotingPower - getVotingPowerEquivalent getFeesCollectorAddress setEnergyFactoryAddress getEnergyFactoryAddress diff --git a/farm-staking/farm-staking/src/base_impl_wrapper.rs b/farm-staking/farm-staking/src/base_impl_wrapper.rs index 4165a2314..25b41733d 100644 --- a/farm-staking/farm-staking/src/base_impl_wrapper.rs +++ b/farm-staking/farm-staking/src/base_impl_wrapper.rs @@ -5,6 +5,7 @@ use core::marker::PhantomData; use common_structs::FarmToken; use contexts::storage_cache::StorageCache; use farm_base_impl::base_traits_impl::FarmContract; +use multiversx_sc_modules::transfer_role_proxy::PaymentsVec; use crate::token_attributes::StakingFarmTokenAttributes; @@ -13,7 +14,6 @@ pub trait FarmStakingTraits = + rewards::RewardsModule + config::ConfigModule + farm_token::FarmTokenModule - + farm_position::FarmPositionModule + pausable::PausableModule + permissions_module::PermissionsModule + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule @@ -189,4 +189,61 @@ where original_owner: caller, } } + + + fn check_and_update_user_farm_position( + sc: &Self::FarmSc, + user: &ManagedAddress<::Api>, + farm_positions: &PaymentsVec<::Api>, + ) { + let farm_token_mapper = sc.farm_token(); + let mut total_farm_position = BigUint::zero(); + let mut farm_position_increase = BigUint::zero(); + for farm_position in farm_positions { + farm_token_mapper.require_same_token(&farm_position.token_identifier); + + total_farm_position += &farm_position.amount; + let token_attributes: StakingFarmTokenAttributes<::Api> = + farm_token_mapper.get_token_attributes(farm_position.token_nonce); + + if &token_attributes.original_owner != user { + Self::decrease_user_farm_position(sc, &farm_position); + farm_position_increase += &farm_position.amount; + } + } + + if sc.user_total_farm_position(user).get() == 0 { + Self::increase_user_farm_position(sc, user, &total_farm_position); + } else if farm_position_increase > 0 { + Self::increase_user_farm_position(sc, user, &farm_position_increase); + } + } + + fn increase_user_farm_position( + sc: &Self::FarmSc, + user: &ManagedAddress<::Api>, + new_farm_position_amount: &BigUint<::Api>, + ) { + sc.user_total_farm_position(user) + .update(|user_farm_position| *user_farm_position += new_farm_position_amount); + } + + fn decrease_user_farm_position( + sc: &Self::FarmSc, + farm_position: &EsdtTokenPayment<::Api>, + ) { + let farm_token_mapper = sc.farm_token(); + let token_attributes: StakingFarmTokenAttributes<::Api> = + farm_token_mapper.get_token_attributes(farm_position.token_nonce); + + sc.user_total_farm_position(&token_attributes.original_owner) + .update(|user_farm_position| { + if *user_farm_position > farm_position.amount { + *user_farm_position -= &farm_position.amount; + } else { + *user_farm_position = BigUint::zero(); + } + }); + } + } diff --git a/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs b/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs index e58669a04..f69569933 100644 --- a/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs +++ b/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs @@ -7,7 +7,6 @@ pub trait ClaimOnlyBoostedStakingRewardsModule: config::ConfigModule + rewards::RewardsModule + farm_token::FarmTokenModule - + farm_position::FarmPositionModule + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule + week_timekeeping::WeekTimekeepingModule + pausable::PausableModule diff --git a/farm-staking/farm-staking/src/claim_stake_farm_rewards.rs b/farm-staking/farm-staking/src/claim_stake_farm_rewards.rs index 831e70564..f8bef0283 100644 --- a/farm-staking/farm-staking/src/claim_stake_farm_rewards.rs +++ b/farm-staking/farm-staking/src/claim_stake_farm_rewards.rs @@ -16,7 +16,6 @@ pub trait ClaimStakeFarmRewardsModule: + pausable::PausableModule + permissions_module::PermissionsModule + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule - + farm_position::FarmPositionModule + farm_base_impl::base_farm_init::BaseFarmInitModule + farm_base_impl::base_farm_validation::BaseFarmValidationModule + farm_base_impl::claim_rewards::BaseClaimRewardsModule diff --git a/farm-staking/farm-staking/src/compound_stake_farm_rewards.rs b/farm-staking/farm-staking/src/compound_stake_farm_rewards.rs index e2e08485f..e51f3b66e 100644 --- a/farm-staking/farm-staking/src/compound_stake_farm_rewards.rs +++ b/farm-staking/farm-staking/src/compound_stake_farm_rewards.rs @@ -14,7 +14,6 @@ pub trait CompoundStakeFarmRewardsModule: + pausable::PausableModule + permissions_module::PermissionsModule + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule - + farm_position::FarmPositionModule + farm_base_impl::base_farm_init::BaseFarmInitModule + farm_base_impl::base_farm_validation::BaseFarmValidationModule + farm_base_impl::compound_rewards::BaseCompoundRewardsModule diff --git a/farm-staking/farm-staking/src/custom_rewards.rs b/farm-staking/farm-staking/src/custom_rewards.rs index 79689b96b..4677cae1d 100644 --- a/farm-staking/farm-staking/src/custom_rewards.rs +++ b/farm-staking/farm-staking/src/custom_rewards.rs @@ -17,7 +17,6 @@ pub trait CustomRewardsModule: + config::ConfigModule + token_send::TokenSendModule + farm_token::FarmTokenModule - + farm_position::FarmPositionModule + utils::UtilsModule + pausable::PausableModule + permissions_module::PermissionsModule diff --git a/farm-staking/farm-staking/src/lib.rs b/farm-staking/farm-staking/src/lib.rs index 256013d52..d1874d0b4 100644 --- a/farm-staking/farm-staking/src/lib.rs +++ b/farm-staking/farm-staking/src/lib.rs @@ -34,7 +34,6 @@ pub trait FarmStaking: + pausable::PausableModule + permissions_module::PermissionsModule + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule - + farm_position::FarmPositionModule + farm_base_impl::base_farm_init::BaseFarmInitModule + farm_base_impl::base_farm_validation::BaseFarmValidationModule + farm_base_impl::enter_farm::BaseEnterFarmModule diff --git a/farm-staking/farm-staking/src/stake_farm.rs b/farm-staking/farm-staking/src/stake_farm.rs index d662c81a6..a50dca4b8 100644 --- a/farm-staking/farm-staking/src/stake_farm.rs +++ b/farm-staking/farm-staking/src/stake_farm.rs @@ -18,7 +18,6 @@ pub trait StakeFarmModule: + pausable::PausableModule + permissions_module::PermissionsModule + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule - + farm_position::FarmPositionModule + farm_base_impl::base_farm_init::BaseFarmInitModule + farm_base_impl::base_farm_validation::BaseFarmValidationModule + farm_base_impl::enter_farm::BaseEnterFarmModule diff --git a/farm-staking/farm-staking/src/unbond_farm.rs b/farm-staking/farm-staking/src/unbond_farm.rs index f6ee2d96c..7e85a2a2c 100644 --- a/farm-staking/farm-staking/src/unbond_farm.rs +++ b/farm-staking/farm-staking/src/unbond_farm.rs @@ -12,7 +12,6 @@ pub trait UnbondFarmModule: + events::EventsModule + token_send::TokenSendModule + farm_token::FarmTokenModule - + farm_position::FarmPositionModule + sc_whitelist_module::SCWhitelistModule + pausable::PausableModule + permissions_module::PermissionsModule diff --git a/farm-staking/farm-staking/src/unstake_farm.rs b/farm-staking/farm-staking/src/unstake_farm.rs index 4b9af2666..4c9675153 100644 --- a/farm-staking/farm-staking/src/unstake_farm.rs +++ b/farm-staking/farm-staking/src/unstake_farm.rs @@ -18,7 +18,6 @@ pub trait UnstakeFarmModule: + pausable::PausableModule + permissions_module::PermissionsModule + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule - + farm_position::FarmPositionModule + farm_base_impl::base_farm_init::BaseFarmInitModule + farm_base_impl::base_farm_validation::BaseFarmValidationModule + farm_base_impl::exit_farm::BaseExitFarmModule diff --git a/farm-staking/farm-staking/wasm/src/lib.rs b/farm-staking/farm-staking/wasm/src/lib.rs index da5f11351..f054fa567 100644 --- a/farm-staking/farm-staking/wasm/src/lib.rs +++ b/farm-staking/farm-staking/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 69 +// Endpoints: 67 // Async Callback: 1 -// Total number of exported functions: 71 +// Total number of exported functions: 69 #![no_std] #![feature(alloc_error_handler, lang_items)] @@ -37,6 +37,8 @@ multiversx_sc_wasm_adapter::endpoints! { getPerBlockRewardAmount getLastRewardBlockNonce getDivisionSafetyConstant + getUserTotalFarmPosition + getAllowExternalClaimBoostedRewards registerFarmToken getFarmTokenId getFarmTokenSupply @@ -52,10 +54,6 @@ multiversx_sc_wasm_adapter::endpoints! { removeAdmin updateOwnerOrAdmin getPermissions - updateTotalFarmPosition - setAllowExternalClaimBoostedRewards - getUserTotalFarmPosition - getAllowExternalClaimBoostedRewards setBurnRoleForAddress stakeFarmThroughProxy stakeFarm From 8997f70e4913ae7c5621538aef6479362dccd03b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Wed, 23 Aug 2023 17:55:05 +0300 Subject: [PATCH 025/213] Remove farm-position code --- common/modules/farm/farm_base_impl/Cargo.toml | 3 - common/modules/farm/farm_position/Cargo.toml | 27 ----- .../farm/farm_position/src/farm_position.rs | 112 ------------------ dex/farm-with-locked-rewards/Cargo.toml | 3 - dex/farm-with-locked-rewards/wasm/Cargo.lock | 15 --- dex/farm/Cargo.toml | 3 - dex/farm/wasm/Cargo.lock | 14 --- dex/proxy-deployer/wasm/Cargo.lock | 14 --- .../energy-update/wasm/Cargo.lock | 14 --- .../farm-staking-proxy/wasm/Cargo.lock | 15 --- farm-staking/farm-staking/Cargo.toml | 3 - farm-staking/farm-staking/wasm/Cargo.lock | 15 --- locked-asset/proxy_dex/wasm/Cargo.lock | 15 --- 13 files changed, 253 deletions(-) delete mode 100644 common/modules/farm/farm_position/Cargo.toml delete mode 100644 common/modules/farm/farm_position/src/farm_position.rs diff --git a/common/modules/farm/farm_base_impl/Cargo.toml b/common/modules/farm/farm_base_impl/Cargo.toml index 91ac14e3d..db5644507 100644 --- a/common/modules/farm/farm_base_impl/Cargo.toml +++ b/common/modules/farm/farm_base_impl/Cargo.toml @@ -12,9 +12,6 @@ path = "../config" [dependencies.farm_token] path = "../farm_token" -[dependencies.farm_position] -path = "../farm_position" - [dependencies.rewards] path = "../rewards" diff --git a/common/modules/farm/farm_position/Cargo.toml b/common/modules/farm/farm_position/Cargo.toml deleted file mode 100644 index c3b8beda4..000000000 --- a/common/modules/farm/farm_position/Cargo.toml +++ /dev/null @@ -1,27 +0,0 @@ -[package] -name = "farm_position" -version = "0.0.0" -authors = ["MultiversX "] -edition = "2021" - -[lib] -path = "src/farm_position.rs" - -[dependencies.multiversx-sc] -version = "=0.39.4" -features = ["esdt-token-payment-legacy-decode"] - -[dependencies.multiversx-sc-modules] -version = "=0.39.4" - -[dependencies.farm_token] -path = "../farm_token" - -[dependencies.utils] -path = "../../utils" - -[dependencies.permissions_module] -path = "../../permissions_module" - -[dependencies.common_structs] -path = "../../../common_structs" diff --git a/common/modules/farm/farm_position/src/farm_position.rs b/common/modules/farm/farm_position/src/farm_position.rs deleted file mode 100644 index a7e12663c..000000000 --- a/common/modules/farm/farm_position/src/farm_position.rs +++ /dev/null @@ -1,112 +0,0 @@ -#![no_std] - -multiversx_sc::imports!(); -multiversx_sc::derive_imports!(); - - -#[multiversx_sc::module] -pub trait FarmPositionModule: - farm_token::FarmTokenModule - + utils::UtilsModule - + permissions_module::PermissionsModule - + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule -{ - // #[payable("*")] - // #[endpoint(updateTotalFarmPosition)] - // fn update_total_farm_position(&self) { - // let caller = self.blockchain().get_caller(); - // let payments = self.get_non_empty_payments(); - // let farm_token_mapper = self.farm_token(); - // let mut new_total_farm_position = BigUint::zero(); - // for farm_position in &payments { - // farm_token_mapper.require_same_token(&farm_position.token_identifier); - - // let token_attributes: FarmTokenAttributes = - // farm_token_mapper.get_token_attributes(farm_position.token_nonce); - - // if token_attributes.original_owner != caller { - // self.decrease_user_farm_position(&farm_position); - // } - - // new_total_farm_position += farm_position.amount; - // } - - // let user_current_farm_position = self.user_total_farm_position(&caller).get(); - // if new_total_farm_position > user_current_farm_position { - // self.user_total_farm_position(&caller) - // .set(new_total_farm_position) - // } - - // self.send().direct_multi(&caller, &payments); - // } - - // #[endpoint(setAllowExternalClaimBoostedRewards)] - // fn set_allow_external_claim_boosted_rewards(&self, allow: bool) { - // let caller = self.blockchain().get_caller(); - // self.allow_external_claim_boosted_rewards(&caller) - // .set(allow); - // } - - // fn check_and_update_user_farm_position( - // &self, - // user: &ManagedAddress, - // farm_positions: &PaymentsVec, - // ) { - // let farm_token_mapper = self.farm_token(); - // let mut total_farm_position = BigUint::zero(); - // let mut farm_position_increase = BigUint::zero(); - // for farm_position in farm_positions { - // farm_token_mapper.require_same_token(&farm_position.token_identifier); - - // total_farm_position += &farm_position.amount; - // let token_attributes: FarmTokenAttributes = - // farm_token_mapper.get_token_attributes(farm_position.token_nonce); - - // if &token_attributes.original_owner != user { - // self.decrease_user_farm_position(&farm_position); - // farm_position_increase += &farm_position.amount; - // } - // } - - // if self.user_total_farm_position(user).get() == 0 { - // self.increase_user_farm_position(user, &total_farm_position); - // } else if farm_position_increase > 0 { - // self.increase_user_farm_position(user, &farm_position_increase); - // } - // } - - // fn increase_user_farm_position( - // &self, - // user: &ManagedAddress, - // new_farm_position_amount: &BigUint, - // ) { - // self.user_total_farm_position(user) - // .update(|user_farm_position| *user_farm_position += new_farm_position_amount); - // } - - // fn decrease_user_farm_position(&self, farm_position: &EsdtTokenPayment) { - // let farm_token_mapper = self.farm_token(); - // let token_attributes: FarmTokenAttributes = - // farm_token_mapper.get_token_attributes(farm_position.token_nonce); - - // self.user_total_farm_position(&token_attributes.original_owner) - // .update(|user_farm_position| { - // if *user_farm_position > farm_position.amount { - // *user_farm_position -= &farm_position.amount; - // } else { - // *user_farm_position = BigUint::zero(); - // } - // }); - // } - - // #[view(getUserTotalFarmPosition)] - // #[storage_mapper("userTotalFarmPosition")] - // fn user_total_farm_position(&self, user: &ManagedAddress) -> SingleValueMapper; - - // #[view(getAllowExternalClaimBoostedRewards)] - // #[storage_mapper("allowExternalClaimBoostedRewards")] - // fn allow_external_claim_boosted_rewards( - // &self, - // user: &ManagedAddress, - // ) -> SingleValueMapper; -} diff --git a/dex/farm-with-locked-rewards/Cargo.toml b/dex/farm-with-locked-rewards/Cargo.toml index b5abb39a5..3052499d2 100644 --- a/dex/farm-with-locked-rewards/Cargo.toml +++ b/dex/farm-with-locked-rewards/Cargo.toml @@ -16,9 +16,6 @@ path = "../../common/modules/farm/config" [dependencies.farm_token] path = "../../common/modules/farm/farm_token" -[dependencies.farm_position] -path = "../../common/modules/farm/farm_position" - [dependencies.rewards] path = "../../common/modules/farm/rewards" diff --git a/dex/farm-with-locked-rewards/wasm/Cargo.lock b/dex/farm-with-locked-rewards/wasm/Cargo.lock index 9242ee202..83649b5f2 100644 --- a/dex/farm-with-locked-rewards/wasm/Cargo.lock +++ b/dex/farm-with-locked-rewards/wasm/Cargo.lock @@ -154,7 +154,6 @@ dependencies = [ "events", "farm-boosted-yields", "farm_base_impl", - "farm_position", "farm_token", "fixed-supply-token", "mergeable", @@ -199,7 +198,6 @@ dependencies = [ "farm", "farm-boosted-yields", "farm_base_impl", - "farm_position", "farm_token", "fixed-supply-token", "locking_module", @@ -233,7 +231,6 @@ dependencies = [ "config", "contexts", "events", - "farm_position", "farm_token", "fixed-supply-token", "mergeable", @@ -247,18 +244,6 @@ dependencies = [ "utils", ] -[[package]] -name = "farm_position" -version = "0.0.0" -dependencies = [ - "common_structs", - "farm_token", - "multiversx-sc", - "multiversx-sc-modules", - "permissions_module", - "utils", -] - [[package]] name = "farm_token" version = "0.0.0" diff --git a/dex/farm/Cargo.toml b/dex/farm/Cargo.toml index 4e30b4394..f2cca8bf7 100644 --- a/dex/farm/Cargo.toml +++ b/dex/farm/Cargo.toml @@ -16,9 +16,6 @@ path = "../../common/modules/farm/config" [dependencies.farm_token] path = "../../common/modules/farm/farm_token" -[dependencies.farm_position] -path = "../../common/modules/farm/farm_position" - [dependencies.rewards] path = "../../common/modules/farm/rewards" diff --git a/dex/farm/wasm/Cargo.lock b/dex/farm/wasm/Cargo.lock index 210fdddf6..97ea7e292 100644 --- a/dex/farm/wasm/Cargo.lock +++ b/dex/farm/wasm/Cargo.lock @@ -154,7 +154,6 @@ dependencies = [ "events", "farm-boosted-yields", "farm_base_impl", - "farm_position", "farm_token", "fixed-supply-token", "mergeable", @@ -202,7 +201,6 @@ dependencies = [ "config", "contexts", "events", - "farm_position", "farm_token", "fixed-supply-token", "mergeable", @@ -216,18 +214,6 @@ dependencies = [ "utils", ] -[[package]] -name = "farm_position" -version = "0.0.0" -dependencies = [ - "common_structs", - "farm_token", - "multiversx-sc", - "multiversx-sc-modules", - "permissions_module", - "utils", -] - [[package]] name = "farm_token" version = "0.0.0" diff --git a/dex/proxy-deployer/wasm/Cargo.lock b/dex/proxy-deployer/wasm/Cargo.lock index 63cde5917..3d762a9be 100644 --- a/dex/proxy-deployer/wasm/Cargo.lock +++ b/dex/proxy-deployer/wasm/Cargo.lock @@ -154,7 +154,6 @@ dependencies = [ "events", "farm-boosted-yields", "farm_base_impl", - "farm_position", "farm_token", "fixed-supply-token", "mergeable", @@ -194,7 +193,6 @@ dependencies = [ "config", "contexts", "events", - "farm_position", "farm_token", "fixed-supply-token", "mergeable", @@ -208,18 +206,6 @@ dependencies = [ "utils", ] -[[package]] -name = "farm_position" -version = "0.0.0" -dependencies = [ - "common_structs", - "farm_token", - "multiversx-sc", - "multiversx-sc-modules", - "permissions_module", - "utils", -] - [[package]] name = "farm_token" version = "0.0.0" diff --git a/energy-integration/energy-update/wasm/Cargo.lock b/energy-integration/energy-update/wasm/Cargo.lock index 55e0dd4b1..5173db1ce 100644 --- a/energy-integration/energy-update/wasm/Cargo.lock +++ b/energy-integration/energy-update/wasm/Cargo.lock @@ -172,7 +172,6 @@ dependencies = [ "events", "farm-boosted-yields", "farm_base_impl", - "farm_position", "farm_token", "fixed-supply-token", "mergeable", @@ -212,7 +211,6 @@ dependencies = [ "config", "contexts", "events", - "farm_position", "farm_token", "fixed-supply-token", "mergeable", @@ -226,18 +224,6 @@ dependencies = [ "utils", ] -[[package]] -name = "farm_position" -version = "0.0.0" -dependencies = [ - "common_structs", - "farm_token", - "multiversx-sc", - "multiversx-sc-modules", - "permissions_module", - "utils", -] - [[package]] name = "farm_token" version = "0.0.0" diff --git a/farm-staking/farm-staking-proxy/wasm/Cargo.lock b/farm-staking/farm-staking-proxy/wasm/Cargo.lock index d4a937ad4..6b8cfa51d 100644 --- a/farm-staking/farm-staking-proxy/wasm/Cargo.lock +++ b/farm-staking/farm-staking-proxy/wasm/Cargo.lock @@ -154,7 +154,6 @@ dependencies = [ "events", "farm-boosted-yields", "farm_base_impl", - "farm_position", "farm_token", "fixed-supply-token", "mergeable", @@ -199,7 +198,6 @@ dependencies = [ "farm", "farm-boosted-yields", "farm_base_impl", - "farm_position", "farm_token", "fixed-supply-token", "math", @@ -256,7 +254,6 @@ dependencies = [ "config", "contexts", "events", - "farm_position", "farm_token", "fixed-supply-token", "mergeable", @@ -270,18 +267,6 @@ dependencies = [ "utils", ] -[[package]] -name = "farm_position" -version = "0.0.0" -dependencies = [ - "common_structs", - "farm_token", - "multiversx-sc", - "multiversx-sc-modules", - "permissions_module", - "utils", -] - [[package]] name = "farm_token" version = "0.0.0" diff --git a/farm-staking/farm-staking/Cargo.toml b/farm-staking/farm-staking/Cargo.toml index d8e0202f1..d4d155aee 100644 --- a/farm-staking/farm-staking/Cargo.toml +++ b/farm-staking/farm-staking/Cargo.toml @@ -31,9 +31,6 @@ path = "../../common/modules/farm/farm_base_impl" [dependencies.farm_token] path = "../../common/modules/farm/farm_token" -[dependencies.farm_position] -path = "../../common/modules/farm/farm_position" - [dependencies.rewards] path = "../../common/modules/farm/rewards" diff --git a/farm-staking/farm-staking/wasm/Cargo.lock b/farm-staking/farm-staking/wasm/Cargo.lock index 0d71b7fcd..4584bdf1a 100644 --- a/farm-staking/farm-staking/wasm/Cargo.lock +++ b/farm-staking/farm-staking/wasm/Cargo.lock @@ -154,7 +154,6 @@ dependencies = [ "events", "farm-boosted-yields", "farm_base_impl", - "farm_position", "farm_token", "fixed-supply-token", "mergeable", @@ -199,7 +198,6 @@ dependencies = [ "farm", "farm-boosted-yields", "farm_base_impl", - "farm_position", "farm_token", "fixed-supply-token", "math", @@ -234,7 +232,6 @@ dependencies = [ "config", "contexts", "events", - "farm_position", "farm_token", "fixed-supply-token", "mergeable", @@ -248,18 +245,6 @@ dependencies = [ "utils", ] -[[package]] -name = "farm_position" -version = "0.0.0" -dependencies = [ - "common_structs", - "farm_token", - "multiversx-sc", - "multiversx-sc-modules", - "permissions_module", - "utils", -] - [[package]] name = "farm_token" version = "0.0.0" diff --git a/locked-asset/proxy_dex/wasm/Cargo.lock b/locked-asset/proxy_dex/wasm/Cargo.lock index 7ff19d6d2..fe099d430 100644 --- a/locked-asset/proxy_dex/wasm/Cargo.lock +++ b/locked-asset/proxy_dex/wasm/Cargo.lock @@ -154,7 +154,6 @@ dependencies = [ "events", "farm-boosted-yields", "farm_base_impl", - "farm_position", "farm_token", "fixed-supply-token", "mergeable", @@ -199,7 +198,6 @@ dependencies = [ "farm", "farm-boosted-yields", "farm_base_impl", - "farm_position", "farm_token", "fixed-supply-token", "locking_module", @@ -225,7 +223,6 @@ dependencies = [ "config", "contexts", "events", - "farm_position", "farm_token", "fixed-supply-token", "mergeable", @@ -239,18 +236,6 @@ dependencies = [ "utils", ] -[[package]] -name = "farm_position" -version = "0.0.0" -dependencies = [ - "common_structs", - "farm_token", - "multiversx-sc", - "multiversx-sc-modules", - "permissions_module", - "utils", -] - [[package]] name = "farm_token" version = "0.0.0" From d37f593aa91da6d7a2c8d01381991307a7323e4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Thu, 24 Aug 2023 09:02:37 +0300 Subject: [PATCH 026/213] farm-staking: Remove merge for dual staking --- farm-staking/farm-staking-proxy/src/lib.rs | 1 - .../src/proxy_actions/merge_pos.rs | 108 ----- .../src/proxy_actions/mod.rs | 1 - .../tests/composed_pos_test.rs | 453 ------------------ .../farm-staking-proxy/wasm/src/lib.rs | 5 +- 5 files changed, 2 insertions(+), 566 deletions(-) delete mode 100644 farm-staking/farm-staking-proxy/src/proxy_actions/merge_pos.rs delete mode 100644 farm-staking/farm-staking-proxy/tests/composed_pos_test.rs diff --git a/farm-staking/farm-staking-proxy/src/lib.rs b/farm-staking/farm-staking-proxy/src/lib.rs index 8f97fd0a6..f9c5d5e2f 100644 --- a/farm-staking/farm-staking-proxy/src/lib.rs +++ b/farm-staking/farm-staking-proxy/src/lib.rs @@ -20,7 +20,6 @@ pub trait FarmStakingProxy: + proxy_actions::stake::ProxyStakeModule + proxy_actions::claim::ProxyClaimModule + proxy_actions::unstake::ProxyUnstakeModule - + proxy_actions::merge_pos::ProxyMergePosModule { #[init] fn init( diff --git a/farm-staking/farm-staking-proxy/src/proxy_actions/merge_pos.rs b/farm-staking/farm-staking-proxy/src/proxy_actions/merge_pos.rs deleted file mode 100644 index 4a0f89031..000000000 --- a/farm-staking/farm-staking-proxy/src/proxy_actions/merge_pos.rs +++ /dev/null @@ -1,108 +0,0 @@ -use common_structs::PaymentsVec; - -use crate::{dual_yield_token::DualYieldTokenAttributes, result_types::MergeResult}; - -use mergeable::Mergeable; -use unwrappable::Unwrappable; - -multiversx_sc::imports!(); -multiversx_sc::derive_imports!(); - -#[multiversx_sc::module] -pub trait ProxyMergePosModule: - crate::dual_yield_token::DualYieldTokenModule - + crate::external_contracts_interactions::ExternalContractsInteractionsModule - + crate::lp_farm_token::LpFarmTokenModule - + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule - + utils::UtilsModule - + token_send::TokenSendModule - + sc_whitelist_module::SCWhitelistModule - + super::claim::ProxyClaimModule -{ - #[payable("*")] - #[endpoint(mergeMetastakingWithStakingToken)] - fn merge_metastaking_with_staking_token(&self) -> MergeResult { - let mut payments = self.call_value().all_esdt_transfers(); - require!( - payments.len() >= 2, - "Must send metastaking token and at least a staking token" - ); - - let dual_yield_token = self.pop_first_payment(&mut payments); - let dual_yield_token_mapper = self.dual_yield_token(); - dual_yield_token_mapper.require_same_token(&dual_yield_token.token_identifier); - - let mut attributes: DualYieldTokenAttributes = self - .get_attributes_as_part_of_fixed_supply(&dual_yield_token, &dual_yield_token_mapper); - dual_yield_token_mapper.nft_burn(dual_yield_token.token_nonce, &dual_yield_token.amount); - - let caller = self.blockchain().get_caller(); - let staking_farm_rewards = self.claim_staking_rewards_before_merge(&caller, &payments); - - let staking_amount_before_merge = attributes.get_total_staking_token_amount(); - for farm_staking_token in &payments { - attributes.real_pos_token_amount += &farm_staking_token.amount; - } - - let mut dual_yield_claim_result = self.claim_dual_yield( - &caller, - OptionalValue::None, - staking_amount_before_merge, - attributes, - ); - dual_yield_claim_result - .staking_farm_rewards - .merge_with(staking_farm_rewards); - - let new_dual_yield_tokens = self.create_dual_yield_tokens( - &dual_yield_token_mapper, - &dual_yield_claim_result.new_dual_yield_attributes, - ); - let merge_result = MergeResult { - lp_farm_rewards: dual_yield_claim_result.lp_farm_rewards, - staking_farm_rewards: dual_yield_claim_result.staking_farm_rewards, - new_dual_yield_tokens, - }; - - merge_result.send_and_return(self, &caller) - } - - fn claim_staking_rewards_before_merge( - &self, - caller: &ManagedAddress, - farm_staking_tokens: &PaymentsVec, - ) -> EsdtTokenPayment { - let staking_farm_token_id = self.staking_farm_token_id().get(); - let mut opt_staking_farm_rewards = Option::::None; - for farm_staking_token in farm_staking_tokens { - require!( - farm_staking_token.token_identifier == staking_farm_token_id, - "Invalid staking farm token" - ); - - let staking_claim_result = self.staking_farm_claim_rewards( - caller.clone(), - farm_staking_token.token_identifier, - farm_staking_token.token_nonce, - farm_staking_token.amount.clone(), - farm_staking_token.amount, - ); - - match &mut opt_staking_farm_rewards { - Some(rew) => rew.merge_with(staking_claim_result.staking_farm_rewards), - None => { - opt_staking_farm_rewards = Some(staking_claim_result.staking_farm_rewards); - } - }; - - let new_staking_farm_tokens = staking_claim_result.new_staking_farm_tokens; - self.send().esdt_local_burn( - &new_staking_farm_tokens.token_identifier, - new_staking_farm_tokens.token_nonce, - &new_staking_farm_tokens.amount, - ); - } - - opt_staking_farm_rewards.unwrap_or_panic::() - } -} diff --git a/farm-staking/farm-staking-proxy/src/proxy_actions/mod.rs b/farm-staking/farm-staking-proxy/src/proxy_actions/mod.rs index 59916511b..3270b0f79 100644 --- a/farm-staking/farm-staking-proxy/src/proxy_actions/mod.rs +++ b/farm-staking/farm-staking-proxy/src/proxy_actions/mod.rs @@ -1,4 +1,3 @@ pub mod claim; -pub mod merge_pos; pub mod stake; pub mod unstake; diff --git a/farm-staking/farm-staking-proxy/tests/composed_pos_test.rs b/farm-staking/farm-staking-proxy/tests/composed_pos_test.rs deleted file mode 100644 index 76b13a8f8..000000000 --- a/farm-staking/farm-staking-proxy/tests/composed_pos_test.rs +++ /dev/null @@ -1,453 +0,0 @@ -pub mod constants; -pub mod staking_farm_with_lp_external_contracts; -pub mod staking_farm_with_lp_staking_contract_interactions; -pub mod staking_farm_with_lp_staking_contract_setup; - -multiversx_sc::imports!(); - -use constants::*; -use farm_staking::stake_farm::StakeFarmModule; -use farm_staking_proxy::dual_yield_token::DualYieldTokenAttributes; -use farm_staking_proxy::proxy_actions::claim::ProxyClaimModule; -use farm_staking_proxy::proxy_actions::merge_pos::ProxyMergePosModule; - -use farm_staking_proxy::proxy_actions::unstake::ProxyUnstakeModule; -use multiversx_sc::codec::Empty; -use multiversx_sc_scenario::{ - managed_biguint, rust_biguint, testing_framework::TxTokenTransfer, DebugApi, -}; -use staking_farm_with_lp_staking_contract_interactions::*; - -#[test] -fn combine_metastaking_with_staking_pos_test() { - let _ = DebugApi::dummy(); - let mut setup = FarmStakingSetup::new( - pair::contract_obj, - farm::contract_obj, - farm_staking::contract_obj, - farm_staking_proxy::contract_obj, - ); - - let expected_staking_token_amount = 1_001_000_000; // safe price of USER_TOTAL_LP_TOKENS in RIDE tokens - let _ = setup.stake_farm_lp_proxy(1, USER_TOTAL_LP_TOKENS, 1, expected_staking_token_amount); - - let user_addr = setup.user_addr.clone(); - let composed_pos_full_amount = 1_000_000; - setup.b_mock.set_esdt_balance( - &user_addr, - STAKING_TOKEN_ID, - &rust_biguint!(composed_pos_full_amount), - ); - - // proxy needs the burn role now the tokens - setup.b_mock.set_esdt_local_roles( - setup.proxy_wrapper.address_ref(), - STAKING_FARM_TOKEN_ID, - &[EsdtLocalRole::NftBurn], - ); - - // stake 1/4 and then 3/4 of the tokens - setup - .b_mock - .execute_esdt_transfer( - &user_addr, - &setup.staking_farm_wrapper, - STAKING_TOKEN_ID, - 0, - &rust_biguint!(composed_pos_full_amount / 4), - |sc| { - sc.stake_farm_endpoint(OptionalValue::None); - }, - ) - .assert_ok(); - - setup - .b_mock - .execute_esdt_transfer( - &user_addr, - &setup.staking_farm_wrapper, - STAKING_TOKEN_ID, - 0, - &rust_biguint!(composed_pos_full_amount * 3 / 4), - |sc| { - sc.stake_farm_endpoint(OptionalValue::None); - }, - ) - .assert_ok(); - - setup.b_mock.check_nft_balance::( - &user_addr, - STAKING_FARM_TOKEN_ID, - 2, - &rust_biguint!(composed_pos_full_amount / 4), - None, - ); - setup.b_mock.check_nft_balance::( - &user_addr, - STAKING_FARM_TOKEN_ID, - 3, - &rust_biguint!(composed_pos_full_amount * 3 / 4), - None, - ); - - // merge metastaking pos with two staking tokens - let merge_payments = vec![ - TxTokenTransfer { - token_identifier: DUAL_YIELD_TOKEN_ID.to_vec(), - nonce: 1, - value: rust_biguint!(expected_staking_token_amount), - }, - TxTokenTransfer { - token_identifier: STAKING_FARM_TOKEN_ID.to_vec(), - nonce: 2, - value: rust_biguint!(composed_pos_full_amount / 4), - }, - TxTokenTransfer { - token_identifier: STAKING_FARM_TOKEN_ID.to_vec(), - nonce: 3, - value: rust_biguint!(composed_pos_full_amount * 3 / 4), - }, - ]; - setup - .b_mock - .execute_esdt_multi_transfer(&user_addr, &setup.proxy_wrapper, &merge_payments, |sc| { - sc.merge_metastaking_with_staking_token(); - }) - .assert_ok(); - - setup.b_mock.check_nft_balance( - &user_addr, - DUAL_YIELD_TOKEN_ID, - 2, - &rust_biguint!(expected_staking_token_amount), - Some(&DualYieldTokenAttributes:: { - lp_farm_token_nonce: 2, - lp_farm_token_amount: managed_biguint!(USER_TOTAL_LP_TOKENS), - virtual_pos_token_nonce: 6, - virtual_pos_token_amount: managed_biguint!(expected_staking_token_amount), - real_pos_token_amount: managed_biguint!(composed_pos_full_amount), - }), - ); - - // claim rewards with composed pos - setup - .b_mock - .execute_esdt_transfer( - &user_addr, - &setup.proxy_wrapper, - DUAL_YIELD_TOKEN_ID, - 2, - &rust_biguint!(expected_staking_token_amount), - |sc| { - sc.claim_dual_yield_endpoint(OptionalValue::None); - }, - ) - .assert_ok(); - - setup.b_mock.check_nft_balance( - &user_addr, - DUAL_YIELD_TOKEN_ID, - 3, - &rust_biguint!(expected_staking_token_amount), - Some(&DualYieldTokenAttributes:: { - lp_farm_token_nonce: 3, - lp_farm_token_amount: managed_biguint!(USER_TOTAL_LP_TOKENS), - virtual_pos_token_nonce: 7, - virtual_pos_token_amount: managed_biguint!(expected_staking_token_amount), - real_pos_token_amount: managed_biguint!(composed_pos_full_amount), - }), - ); - - // claim again - setup - .b_mock - .execute_esdt_transfer( - &user_addr, - &setup.proxy_wrapper, - DUAL_YIELD_TOKEN_ID, - 3, - &rust_biguint!(expected_staking_token_amount), - |sc| { - sc.claim_dual_yield_endpoint(OptionalValue::None); - }, - ) - .assert_ok(); - - setup.b_mock.check_nft_balance( - &user_addr, - DUAL_YIELD_TOKEN_ID, - 4, - &rust_biguint!(expected_staking_token_amount), - Some(&DualYieldTokenAttributes:: { - lp_farm_token_nonce: 4, - lp_farm_token_amount: managed_biguint!(USER_TOTAL_LP_TOKENS), - virtual_pos_token_nonce: 8, - virtual_pos_token_amount: managed_biguint!(expected_staking_token_amount), - real_pos_token_amount: managed_biguint!(composed_pos_full_amount), - }), - ); - - setup - .b_mock - .set_block_nonce(BLOCK_NONCE_AFTER_PAIR_SETUP + 20); - setup.b_mock.set_block_epoch(20); - - // unstake - setup - .b_mock - .execute_esdt_transfer( - &user_addr, - &setup.proxy_wrapper, - DUAL_YIELD_TOKEN_ID, - 4, - &rust_biguint!(expected_staking_token_amount), - |sc| { - let unstake_result = sc.unstake_farm_tokens( - managed_biguint!(1), - managed_biguint!(1), - managed_biguint!(expected_staking_token_amount), - OptionalValue::None, - ); - assert_eq!( - unstake_result - .opt_unbond_staking_farm_token_for_user_pos - .unwrap() - .amount, - composed_pos_full_amount - ); - assert_eq!( - unstake_result.unbond_staking_farm_token.amount, - expected_staking_token_amount - ); - }, - ) - .assert_ok(); -} - -#[test] -fn combine_metastaking_with_staking_pos_partial_actions_test() { - let _ = DebugApi::dummy(); - let mut setup = FarmStakingSetup::new( - pair::contract_obj, - farm::contract_obj, - farm_staking::contract_obj, - farm_staking_proxy::contract_obj, - ); - - let expected_staking_token_amount = 1_001_000_000; // safe price of USER_TOTAL_LP_TOKENS in RIDE tokens - let _ = setup.stake_farm_lp_proxy(1, USER_TOTAL_LP_TOKENS, 1, expected_staking_token_amount); - - let user_addr = setup.user_addr.clone(); - let composed_pos_full_amount = 1_000_000; - setup.b_mock.set_esdt_balance( - &user_addr, - STAKING_TOKEN_ID, - &rust_biguint!(composed_pos_full_amount), - ); - - // proxy needs the burn role now the tokens - setup.b_mock.set_esdt_local_roles( - setup.proxy_wrapper.address_ref(), - STAKING_FARM_TOKEN_ID, - &[EsdtLocalRole::NftBurn], - ); - - // stake 1/4 and then 3/4 of the tokens - setup - .b_mock - .execute_esdt_transfer( - &user_addr, - &setup.staking_farm_wrapper, - STAKING_TOKEN_ID, - 0, - &rust_biguint!(composed_pos_full_amount / 4), - |sc| { - sc.stake_farm_endpoint(OptionalValue::None); - }, - ) - .assert_ok(); - - setup - .b_mock - .execute_esdt_transfer( - &user_addr, - &setup.staking_farm_wrapper, - STAKING_TOKEN_ID, - 0, - &rust_biguint!(composed_pos_full_amount * 3 / 4), - |sc| { - sc.stake_farm_endpoint(OptionalValue::None); - }, - ) - .assert_ok(); - - setup.b_mock.check_nft_balance::( - &user_addr, - STAKING_FARM_TOKEN_ID, - 2, - &rust_biguint!(composed_pos_full_amount / 4), - None, - ); - setup.b_mock.check_nft_balance::( - &user_addr, - STAKING_FARM_TOKEN_ID, - 3, - &rust_biguint!(composed_pos_full_amount * 3 / 4), - None, - ); - - // merge half of metastaking pos with two staking tokens - let merge_payments = vec![ - TxTokenTransfer { - token_identifier: DUAL_YIELD_TOKEN_ID.to_vec(), - nonce: 1, - value: rust_biguint!(expected_staking_token_amount / 2), - }, - TxTokenTransfer { - token_identifier: STAKING_FARM_TOKEN_ID.to_vec(), - nonce: 2, - value: rust_biguint!(composed_pos_full_amount / 4), - }, - TxTokenTransfer { - token_identifier: STAKING_FARM_TOKEN_ID.to_vec(), - nonce: 3, - value: rust_biguint!(composed_pos_full_amount * 3 / 4), - }, - ]; - setup - .b_mock - .execute_esdt_multi_transfer(&user_addr, &setup.proxy_wrapper, &merge_payments, |sc| { - sc.merge_metastaking_with_staking_token(); - }) - .assert_ok(); - - setup.b_mock.check_nft_balance( - &user_addr, - DUAL_YIELD_TOKEN_ID, - 2, - &rust_biguint!(expected_staking_token_amount / 2), - Some(&DualYieldTokenAttributes:: { - lp_farm_token_nonce: 2, - lp_farm_token_amount: managed_biguint!(USER_TOTAL_LP_TOKENS / 2), - virtual_pos_token_nonce: 6, - virtual_pos_token_amount: managed_biguint!(expected_staking_token_amount / 2), - real_pos_token_amount: managed_biguint!(composed_pos_full_amount), - }), - ); - - // claim rewards with part of composed pos - setup - .b_mock - .execute_esdt_transfer( - &user_addr, - &setup.proxy_wrapper, - DUAL_YIELD_TOKEN_ID, - 2, - &rust_biguint!(expected_staking_token_amount / 4), - |sc| { - sc.claim_dual_yield_endpoint(OptionalValue::None); - }, - ) - .assert_ok(); - - setup.b_mock.check_nft_balance( - &user_addr, - DUAL_YIELD_TOKEN_ID, - 3, - &rust_biguint!(expected_staking_token_amount / 4), - Some(&DualYieldTokenAttributes:: { - lp_farm_token_nonce: 3, - lp_farm_token_amount: managed_biguint!(USER_TOTAL_LP_TOKENS / 4), - virtual_pos_token_nonce: 7, - virtual_pos_token_amount: managed_biguint!(expected_staking_token_amount / 4), - real_pos_token_amount: managed_biguint!(composed_pos_full_amount / 2), - }), - ); - - setup - .b_mock - .set_block_nonce(BLOCK_NONCE_AFTER_PAIR_SETUP + 20); - setup.b_mock.set_block_epoch(20); - - // unstake partial - setup - .b_mock - .execute_esdt_transfer( - &user_addr, - &setup.proxy_wrapper, - DUAL_YIELD_TOKEN_ID, - 3, - &rust_biguint!(expected_staking_token_amount / 4), - |sc| { - let unstake_result = sc.unstake_farm_tokens( - managed_biguint!(1), - managed_biguint!(1), - managed_biguint!(expected_staking_token_amount / 8), - OptionalValue::None, - ); - assert_eq!( - unstake_result - .opt_unbond_staking_farm_token_for_user_pos - .unwrap() - .amount, - composed_pos_full_amount / 4 - ); - assert_eq!( - unstake_result.unbond_staking_farm_token.amount, - expected_staking_token_amount / 8 - ); - assert_eq!( - unstake_result.opt_new_dual_yield_tokens.unwrap().amount, - expected_staking_token_amount / 8 - ); - }, - ) - .assert_ok(); - - // check leftover token attributes - setup.b_mock.check_nft_balance( - &user_addr, - DUAL_YIELD_TOKEN_ID, - 4, - &rust_biguint!(expected_staking_token_amount / 8), - Some(&DualYieldTokenAttributes:: { - lp_farm_token_nonce: 3, - lp_farm_token_amount: managed_biguint!(USER_TOTAL_LP_TOKENS / 8), - virtual_pos_token_nonce: 7, - virtual_pos_token_amount: managed_biguint!(expected_staking_token_amount / 8), - real_pos_token_amount: managed_biguint!(composed_pos_full_amount / 4), - }), - ); - - // unstake remaining pos - setup - .b_mock - .execute_esdt_transfer( - &user_addr, - &setup.proxy_wrapper, - DUAL_YIELD_TOKEN_ID, - 4, - &rust_biguint!(expected_staking_token_amount / 8), - |sc| { - let unstake_result = sc.unstake_farm_tokens( - managed_biguint!(1), - managed_biguint!(1), - managed_biguint!(expected_staking_token_amount / 8), - OptionalValue::None, - ); - assert_eq!( - unstake_result - .opt_unbond_staking_farm_token_for_user_pos - .unwrap() - .amount, - composed_pos_full_amount / 4 - ); - assert_eq!( - unstake_result.unbond_staking_farm_token.amount, - expected_staking_token_amount / 8 - ); - assert!(unstake_result.opt_new_dual_yield_tokens.is_none(),); - }, - ) - .assert_ok(); -} diff --git a/farm-staking/farm-staking-proxy/wasm/src/lib.rs b/farm-staking/farm-staking-proxy/wasm/src/lib.rs index 5aea5b134..57bdc0840 100644 --- a/farm-staking/farm-staking-proxy/wasm/src/lib.rs +++ b/farm-staking/farm-staking-proxy/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 16 +// Endpoints: 15 // Async Callback: 1 -// Total number of exported functions: 18 +// Total number of exported functions: 17 #![no_std] #![feature(alloc_error_handler, lang_items)] @@ -33,7 +33,6 @@ multiversx_sc_wasm_adapter::endpoints! { stakeFarmTokens claimDualYield unstakeFarmTokens - mergeMetastakingWithStakingToken callBack ) } From dd45715def85267a9c67e66613f21dce0d94edc5 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Fri, 14 Jul 2023 16:10:01 +0300 Subject: [PATCH 027/213] energy factory & proxy lp merging testing --- .../energy-factory/src/lock_options.rs | 3 + .../tests/token_merging_test.rs | 59 +++++ .../proxy_dex/tests/proxy_farm_test.rs | 2 +- locked-asset/proxy_dex/tests/proxy_lp_test.rs | 241 +++++++++++++++++- 4 files changed, 296 insertions(+), 9 deletions(-) diff --git a/locked-asset/energy-factory/src/lock_options.rs b/locked-asset/energy-factory/src/lock_options.rs index 4c9be44e5..2237d2f92 100644 --- a/locked-asset/energy-factory/src/lock_options.rs +++ b/locked-asset/energy-factory/src/lock_options.rs @@ -44,6 +44,9 @@ pub trait LockOptionsModule { fn unlock_epoch_to_start_of_month_upper_estimate(&self, unlock_epoch: Epoch) -> Epoch { let lower_bound_unlock = self.unlock_epoch_to_start_of_month(unlock_epoch); + if unlock_epoch == lower_bound_unlock { + return lower_bound_unlock; + } let new_unlock_epoch = lower_bound_unlock + EPOCHS_PER_MONTH; let current_epoch = self.blockchain().get_block_epoch(); if current_epoch >= new_unlock_epoch { diff --git a/locked-asset/energy-factory/tests/token_merging_test.rs b/locked-asset/energy-factory/tests/token_merging_test.rs index d83b6da09..559c03a10 100644 --- a/locked-asset/energy-factory/tests/token_merging_test.rs +++ b/locked-asset/energy-factory/tests/token_merging_test.rs @@ -365,3 +365,62 @@ fn test_specific_tokens_merge() { }), ); } + +#[test] +fn merge_same_schedule_test() { + let _ = DebugApi::dummy(); + let mut setup = SimpleLockEnergySetup::new(energy_factory::contract_obj); + let user = setup.first_user.clone(); + let unlock_epoch = to_start_of_month(LOCK_OPTIONS[0]); + + let first_token_amount = 400_000; + setup + .lock( + &user, + BASE_ASSET_TOKEN_ID, + first_token_amount, + LOCK_OPTIONS[0], + ) + .assert_ok(); + + let second_token_amount = 100_000; + setup + .lock( + &user, + BASE_ASSET_TOKEN_ID, + second_token_amount, + LOCK_OPTIONS[0], + ) + .assert_ok(); + + let payments = [ + TxTokenTransfer { + token_identifier: LOCKED_TOKEN_ID.to_vec(), + nonce: 1, + value: rust_biguint!(400_000), + }, + TxTokenTransfer { + token_identifier: LOCKED_TOKEN_ID.to_vec(), + nonce: 1, + value: rust_biguint!(100_000), + }, + ]; + setup + .b_mock + .execute_esdt_multi_transfer(&user, &setup.sc_wrapper, &payments[..], |sc| { + let _ = sc.merge_tokens_endpoint(OptionalValue::None); + }) + .assert_ok(); + + setup.b_mock.check_nft_balance( + &user, + LOCKED_TOKEN_ID, + 1, + &rust_biguint!(first_token_amount + second_token_amount), + Some(&LockedTokenAttributes:: { + original_token_id: managed_token_id_wrapped!(BASE_ASSET_TOKEN_ID), + original_token_nonce: 0, + unlock_epoch: unlock_epoch, + }), + ); +} diff --git a/locked-asset/proxy_dex/tests/proxy_farm_test.rs b/locked-asset/proxy_dex/tests/proxy_farm_test.rs index 9fb12d6f4..49ba77977 100644 --- a/locked-asset/proxy_dex/tests/proxy_farm_test.rs +++ b/locked-asset/proxy_dex/tests/proxy_farm_test.rs @@ -208,7 +208,7 @@ fn farm_proxy_actions_test() { Some(&WrappedFarmTokenAttributes:: { proxy_farming_token: EsdtTokenPayment { token_identifier: managed_token_id!(LOCKED_TOKEN_ID), - token_nonce: 3, + token_nonce: 1, amount: managed_biguint!(USER_BALANCE), }, farm_token: EsdtTokenPayment { diff --git a/locked-asset/proxy_dex/tests/proxy_lp_test.rs b/locked-asset/proxy_dex/tests/proxy_lp_test.rs index 69237f7ff..030fb12dc 100644 --- a/locked-asset/proxy_dex/tests/proxy_lp_test.rs +++ b/locked-asset/proxy_dex/tests/proxy_lp_test.rs @@ -1,14 +1,14 @@ mod proxy_dex_test_setup; -use energy_factory::energy::EnergyModule; +use energy_factory::{energy::EnergyModule, SimpleLockEnergy}; use energy_query::Energy; use multiversx_sc::{ - codec::Empty, + codec::{multi_types::OptionalValue, Empty}, types::{BigInt, EsdtTokenPayment}, }; use multiversx_sc_scenario::{ - managed_address, managed_biguint, managed_token_id, rust_biguint, whitebox::TxTokenTransfer, - DebugApi, + managed_address, managed_biguint, managed_token_id, managed_token_id_wrapped, rust_biguint, + whitebox::TxTokenTransfer, DebugApi, }; use num_traits::ToPrimitive; use proxy_dex::{ @@ -16,6 +16,7 @@ use proxy_dex::{ wrapped_lp_token_merge::WrappedLpTokenMerge, }; use proxy_dex_test_setup::*; +use simple_lock::locked_token::LockedTokenAttributes; #[test] fn setup_test() { @@ -494,7 +495,7 @@ fn tripple_add_liquidity_proxy_test() { } #[test] -fn wrapped_lp_token_merge_test() { +fn wrapped_same_nonce_lp_token_merge_test() { let mut setup = ProxySetup::new( proxy_dex::contract_obj, pair::contract_obj, @@ -539,12 +540,12 @@ fn wrapped_lp_token_merge_test() { TxTokenTransfer { token_identifier: WRAPPED_LP_TOKEN_ID.to_vec(), nonce: 1, - value: first_amount, + value: first_amount.clone(), }, TxTokenTransfer { token_identifier: WRAPPED_LP_TOKEN_ID.to_vec(), nonce: 1, - value: second_amount, + value: second_amount.clone(), }, ]; @@ -563,11 +564,235 @@ fn wrapped_lp_token_merge_test() { Some(&WrappedLpTokenAttributes:: { locked_tokens: EsdtTokenPayment { token_identifier: managed_token_id!(LOCKED_TOKEN_ID), - token_nonce: 3, + token_nonce: 1, amount: managed_biguint!(800_001_600), // out of 1_000_000_000 }, lp_token_id: managed_token_id!(LP_TOKEN_ID), lp_token_amount: managed_biguint!(400_000_000), }), ); + + let liquidity_token_amount = (&first_amount + &second_amount) * rust_biguint!(2u64); // parity 1 EGLD -> 2 MEX + let expected_locked_token_balance_before = rust_biguint!(USER_BALANCE) - locked_token_amount; + let expected_locked_token_balance_after = + &expected_locked_token_balance_before + &liquidity_token_amount; + + setup.b_mock.check_nft_balance( + &first_user, + LOCKED_TOKEN_ID, + 1, + &(expected_locked_token_balance_before), + Some(&LockedTokenAttributes:: { + original_token_id: managed_token_id_wrapped!(MEX_TOKEN_ID), + original_token_nonce: 0, + unlock_epoch: LOCK_OPTIONS[0], + }), + ); + + setup + .b_mock + .execute_esdt_transfer( + &first_user, + &setup.proxy_wrapper, + WRAPPED_LP_TOKEN_ID, + 2, + &(first_amount + second_amount), + |sc| { + sc.remove_liquidity_proxy( + managed_address!(&pair_addr), + managed_biguint!(1), + managed_biguint!(1), + ); + }, + ) + .assert_ok(); + + setup.b_mock.check_nft_balance( + &first_user, + LOCKED_TOKEN_ID, + 1, + &expected_locked_token_balance_after, + Some(&LockedTokenAttributes:: { + original_token_id: managed_token_id_wrapped!(MEX_TOKEN_ID), + original_token_nonce: 0, + unlock_epoch: LOCK_OPTIONS[0], + }), + ); +} + +#[test] +fn wrapped_different_nonce_lp_token_merge_test() { + let mut setup = ProxySetup::new( + proxy_dex::contract_obj, + pair::contract_obj, + farm_with_locked_rewards::contract_obj, + energy_factory::contract_obj, + ); + let user = setup.first_user.clone(); + let user_balance = rust_biguint!(USER_BALANCE); + setup + .b_mock + .set_esdt_balance(&user, MEX_TOKEN_ID, &user_balance); + + // users lock tokens + setup + .b_mock + .execute_esdt_transfer( + &user, + &setup.simple_lock_wrapper, + MEX_TOKEN_ID, + 0, + &user_balance, + |sc| { + let user_payment = sc.lock_tokens_endpoint(LOCK_OPTIONS[1], OptionalValue::None); + assert_eq!(user_payment.token_nonce, 2); + assert_eq!(user_payment.amount, managed_biguint!(USER_BALANCE)); + }, + ) + .assert_ok(); + + let locked_token_amount = rust_biguint!(1_000_000_000); + let other_token_amount = rust_biguint!(500_000_000); + + // set the price to 1 EGLD = 2 MEX + let payments1 = vec![ + TxTokenTransfer { + token_identifier: LOCKED_TOKEN_ID.to_vec(), + nonce: 1, + value: locked_token_amount.clone(), // for MIN_LP_AMOUNT + }, + TxTokenTransfer { + token_identifier: WEGLD_TOKEN_ID.to_vec(), + nonce: 0, + value: other_token_amount.clone(), // for MIN_LP_AMOUNT + }, + ]; + + // add liquidity + let pair_addr = setup.pair_wrapper.address_ref().clone(); + setup + .b_mock + .execute_esdt_multi_transfer(&user, &setup.proxy_wrapper, &payments1, |sc| { + let output_lp_token = sc.add_liquidity_proxy( + managed_address!(&pair_addr), + managed_biguint!(locked_token_amount.to_u64().unwrap()), + managed_biguint!(other_token_amount.to_u64().unwrap()), + ); + + assert_eq!(output_lp_token.to_vec().get(0).token_nonce, 1); + assert_eq!( + output_lp_token.to_vec().get(0).amount, + managed_biguint!(500_000_000u64 - 1_000u64) + ); + }) + .assert_ok(); + + // set the price to 1 EGLD = 2 MEX + let payments2 = vec![ + TxTokenTransfer { + token_identifier: LOCKED_TOKEN_ID.to_vec(), + nonce: 2, + value: locked_token_amount.clone(), + }, + TxTokenTransfer { + token_identifier: WEGLD_TOKEN_ID.to_vec(), + nonce: 0, + value: other_token_amount.clone(), + }, + ]; + + // add liquidity + let pair_addr = setup.pair_wrapper.address_ref().clone(); + setup + .b_mock + .execute_esdt_multi_transfer(&user, &setup.proxy_wrapper, &payments2, |sc| { + let output_lp_token = sc.add_liquidity_proxy( + managed_address!(&pair_addr), + managed_biguint!(locked_token_amount.to_u64().unwrap()), + managed_biguint!(other_token_amount.to_u64().unwrap()), + ); + assert_eq!(output_lp_token.to_vec().get(0).token_nonce, 2); + assert_eq!( + output_lp_token.to_vec().get(0).amount, + managed_biguint!(500_000_000u64) + ); + }) + .assert_ok(); + + let min_lp_amount = 1_000u64; + let first_amount = other_token_amount.clone() - rust_biguint!(min_lp_amount); + let second_amount = other_token_amount.clone(); + let user_lp_amount = 999_999_000u64; // first_amount + second_amount; + let tokens_to_merge = vec![ + TxTokenTransfer { + token_identifier: WRAPPED_LP_TOKEN_ID.to_vec(), + nonce: 1, + value: first_amount.clone(), + }, + TxTokenTransfer { + token_identifier: WRAPPED_LP_TOKEN_ID.to_vec(), + nonce: 2, + value: second_amount.clone(), + }, + ]; + + setup + .b_mock + .execute_esdt_multi_transfer(&user, &setup.proxy_wrapper, &tokens_to_merge, |sc| { + let output_lp_token = sc.merge_wrapped_lp_tokens_endpoint(); + assert_eq!(output_lp_token.token_nonce, 3); + assert_eq!(output_lp_token.amount, managed_biguint!(user_lp_amount)); + }) + .assert_ok(); + + setup.b_mock.check_nft_balance( + &user, + WRAPPED_LP_TOKEN_ID, + 3, + &rust_biguint!(user_lp_amount), + Some(&WrappedLpTokenAttributes:: { + locked_tokens: EsdtTokenPayment { + token_identifier: managed_token_id!(LOCKED_TOKEN_ID), + token_nonce: 3, + amount: managed_biguint!(2_000_000_000u64), + }, + lp_token_id: managed_token_id!(LP_TOKEN_ID), + lp_token_amount: managed_biguint!(1_000_000_000u64 - min_lp_amount), + }), + ); + + let min_locked_lp_token_amount = rust_biguint!(min_lp_amount); + let expected_locked_token_balance = + &(locked_token_amount - min_locked_lp_token_amount) * rust_biguint!(2); // parity 1 EGLD -> 2 MEX + + setup + .b_mock + .execute_esdt_transfer( + &user, + &setup.proxy_wrapper, + WRAPPED_LP_TOKEN_ID, + 3, + &rust_biguint!(user_lp_amount), + |sc| { + sc.remove_liquidity_proxy( + managed_address!(&pair_addr), + managed_biguint!(1), + managed_biguint!(1), + ); + }, + ) + .assert_ok(); + + let expected_unlock_epoch = (LOCK_OPTIONS[0] + LOCK_OPTIONS[1]) / 2; + setup.b_mock.check_nft_balance( + &user, + LOCKED_TOKEN_ID, + 3, + &expected_locked_token_balance, + Some(&LockedTokenAttributes:: { + original_token_id: managed_token_id_wrapped!(MEX_TOKEN_ID), + original_token_nonce: 0, + unlock_epoch: expected_unlock_epoch, + }), + ); } From 63d00e4a478928f90f68573f7ab1b1f989b1501a Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Fri, 14 Jul 2023 16:50:20 +0300 Subject: [PATCH 028/213] proxy farm tests --- .../tests/token_merging_test.rs | 2 +- .../proxy_dex/tests/proxy_farm_test.rs | 221 +++++++++++++++++- locked-asset/proxy_dex/tests/proxy_lp_test.rs | 4 +- 3 files changed, 220 insertions(+), 7 deletions(-) diff --git a/locked-asset/energy-factory/tests/token_merging_test.rs b/locked-asset/energy-factory/tests/token_merging_test.rs index 559c03a10..fd81bb2d7 100644 --- a/locked-asset/energy-factory/tests/token_merging_test.rs +++ b/locked-asset/energy-factory/tests/token_merging_test.rs @@ -420,7 +420,7 @@ fn merge_same_schedule_test() { Some(&LockedTokenAttributes:: { original_token_id: managed_token_id_wrapped!(BASE_ASSET_TOKEN_ID), original_token_nonce: 0, - unlock_epoch: unlock_epoch, + unlock_epoch, }), ); } diff --git a/locked-asset/proxy_dex/tests/proxy_farm_test.rs b/locked-asset/proxy_dex/tests/proxy_farm_test.rs index 49ba77977..f363483e9 100644 --- a/locked-asset/proxy_dex/tests/proxy_farm_test.rs +++ b/locked-asset/proxy_dex/tests/proxy_farm_test.rs @@ -2,16 +2,16 @@ mod proxy_dex_test_setup; use common_structs::FarmTokenAttributes; use config::ConfigModule; -use energy_factory::energy::EnergyModule; +use energy_factory::{energy::EnergyModule, SimpleLockEnergy}; use energy_query::Energy; use farm::exit_penalty::{DEFAULT_PENALTY_PERCENT, MAX_PERCENT}; use multiversx_sc::{ - codec::Empty, + codec::{multi_types::OptionalValue, Empty}, types::{BigInt, EsdtLocalRole, EsdtTokenPayment}, }; use multiversx_sc_scenario::{ - managed_address, managed_biguint, managed_token_id, rust_biguint, whitebox::TxTokenTransfer, - DebugApi, + managed_address, managed_biguint, managed_token_id, managed_token_id_wrapped, rust_biguint, + whitebox::TxTokenTransfer, DebugApi, }; use num_traits::ToPrimitive; use proxy_dex::{ @@ -21,6 +21,7 @@ use proxy_dex::{ wrapped_lp_attributes::WrappedLpTokenAttributes, }; use proxy_dex_test_setup::*; +use simple_lock::locked_token::LockedTokenAttributes; #[test] fn farm_proxy_setup_test() { @@ -218,6 +219,46 @@ fn farm_proxy_actions_test() { }, }), ); + + // Check balance before exit farm proxy + setup.b_mock.check_nft_balance::( + &first_user, + LOCKED_TOKEN_ID, + 1, + &rust_biguint!(0), + None, + ); + + setup + .b_mock + .execute_esdt_transfer( + &first_user, + &setup.proxy_wrapper, + WRAPPED_FARM_TOKEN_ID, + 3, + &rust_biguint!(USER_BALANCE), + |sc| { + let output = sc + .exit_farm_proxy(managed_address!(&farm_addr), managed_biguint!(USER_BALANCE)); + let output_lp_token = output.0 .0; + assert_eq!(output_lp_token.token_nonce, 1); + assert_eq!(output_lp_token.amount, USER_BALANCE); + }, + ) + .assert_ok(); + + // Check balance after exit farm proxy + setup.b_mock.check_nft_balance( + &first_user, + LOCKED_TOKEN_ID, + 1, + &rust_biguint!(USER_BALANCE), + Some(&LockedTokenAttributes:: { + original_token_id: managed_token_id_wrapped!(MEX_TOKEN_ID), + original_token_nonce: 0, + unlock_epoch: LOCK_OPTIONS[0], + }), + ); } #[test] @@ -965,3 +1006,175 @@ fn farm_proxy_partial_exit_with_penalty_test() { &rust_biguint!(USER_BALANCE / 2), ); } + +#[test] +fn different_farm_locked_token_nonce_merging_test() { + let mut setup = ProxySetup::new( + proxy_dex::contract_obj, + pair::contract_obj, + farm_with_locked_rewards::contract_obj, + energy_factory::contract_obj, + ); + let first_user = setup.first_user.clone(); + let farm_addr = setup.farm_locked_wrapper.address_ref().clone(); + let user_balance = rust_biguint!(USER_BALANCE); + setup + .b_mock + .set_esdt_balance(&first_user, MEX_TOKEN_ID, &user_balance); + + // users lock tokens + setup + .b_mock + .execute_esdt_transfer( + &first_user, + &setup.simple_lock_wrapper, + MEX_TOKEN_ID, + 0, + &user_balance, + |sc| { + let user_payment = sc.lock_tokens_endpoint(LOCK_OPTIONS[1], OptionalValue::None); + assert_eq!(user_payment.token_nonce, 2); + assert_eq!(user_payment.amount, managed_biguint!(USER_BALANCE)); + }, + ) + .assert_ok(); + + //////////////////////////////////////////// ENTER FARM ///////////////////////////////////// + + setup + .b_mock + .execute_esdt_transfer( + &first_user, + &setup.proxy_wrapper, + LOCKED_TOKEN_ID, + 1, + &rust_biguint!(USER_BALANCE), + |sc| { + sc.enter_farm_proxy_endpoint(managed_address!(&farm_addr)); + }, + ) + .assert_ok(); + + setup + .b_mock + .execute_esdt_transfer( + &first_user, + &setup.proxy_wrapper, + LOCKED_TOKEN_ID, + 2, + &rust_biguint!(USER_BALANCE), + |sc| { + sc.enter_farm_proxy_endpoint(managed_address!(&farm_addr)); + }, + ) + .assert_ok(); + + setup.b_mock.check_nft_balance( + &first_user, + WRAPPED_FARM_TOKEN_ID, + 1, + &rust_biguint!(USER_BALANCE), + Some(&WrappedFarmTokenAttributes:: { + proxy_farming_token: EsdtTokenPayment { + token_identifier: managed_token_id!(LOCKED_TOKEN_ID), + token_nonce: 1, + amount: managed_biguint!(USER_BALANCE), + }, + farm_token: EsdtTokenPayment { + token_identifier: managed_token_id!(FARM_LOCKED_TOKEN_ID), + token_nonce: 1, + amount: managed_biguint!(USER_BALANCE), + }, + }), + ); + + setup.b_mock.check_nft_balance( + &first_user, + WRAPPED_FARM_TOKEN_ID, + 2, + &rust_biguint!(USER_BALANCE), + Some(&WrappedFarmTokenAttributes:: { + proxy_farming_token: EsdtTokenPayment { + token_identifier: managed_token_id!(LOCKED_TOKEN_ID), + token_nonce: 2, + amount: managed_biguint!(USER_BALANCE), + }, + farm_token: EsdtTokenPayment { + token_identifier: managed_token_id!(FARM_LOCKED_TOKEN_ID), + token_nonce: 2, + amount: managed_biguint!(USER_BALANCE), + }, + }), + ); + + //////////////////////////////////////////// MERGE TOKENS ///////////////////////////////////// + + let payments = vec![ + TxTokenTransfer { + token_identifier: WRAPPED_FARM_TOKEN_ID.to_vec(), + nonce: 1, + value: rust_biguint!(USER_BALANCE), + }, + TxTokenTransfer { + token_identifier: WRAPPED_FARM_TOKEN_ID.to_vec(), + nonce: 2, + value: rust_biguint!(USER_BALANCE), + }, + ]; + setup + .b_mock + .execute_esdt_multi_transfer(&first_user, &setup.proxy_wrapper, &payments, |sc| { + sc.merge_wrapped_farm_tokens_endpoint(managed_address!(&farm_addr)); + }) + .assert_ok(); + + // check user balance + setup.b_mock.check_nft_balance( + &first_user, + WRAPPED_FARM_TOKEN_ID, + 3, + &rust_biguint!(USER_BALANCE * 2), + Some(&WrappedFarmTokenAttributes:: { + proxy_farming_token: EsdtTokenPayment { + token_identifier: managed_token_id!(LOCKED_TOKEN_ID), + token_nonce: 3, + amount: managed_biguint!(USER_BALANCE * 2), + }, + farm_token: EsdtTokenPayment { + token_identifier: managed_token_id!(FARM_LOCKED_TOKEN_ID), + token_nonce: 3, + amount: managed_biguint!(USER_BALANCE * 2), + }, + }), + ); + + setup + .b_mock + .execute_esdt_transfer( + &first_user, + &setup.proxy_wrapper, + WRAPPED_FARM_TOKEN_ID, + 3, + &rust_biguint!(USER_BALANCE * 2), + |sc| { + sc.exit_farm_proxy( + managed_address!(&farm_addr), + managed_biguint!(USER_BALANCE * 2), + ); + }, + ) + .assert_ok(); + + let expected_unlock_epoch = (LOCK_OPTIONS[0] + LOCK_OPTIONS[1]) / 2; + setup.b_mock.check_nft_balance( + &first_user, + LOCKED_TOKEN_ID, + 3, + &rust_biguint!(1_980_000_000_000_000_000u64), + Some(&LockedTokenAttributes:: { + original_token_id: managed_token_id_wrapped!(MEX_TOKEN_ID), + original_token_nonce: 0, + unlock_epoch: expected_unlock_epoch, + }), + ); +} diff --git a/locked-asset/proxy_dex/tests/proxy_lp_test.rs b/locked-asset/proxy_dex/tests/proxy_lp_test.rs index 030fb12dc..c96323a50 100644 --- a/locked-asset/proxy_dex/tests/proxy_lp_test.rs +++ b/locked-asset/proxy_dex/tests/proxy_lp_test.rs @@ -727,12 +727,12 @@ fn wrapped_different_nonce_lp_token_merge_test() { TxTokenTransfer { token_identifier: WRAPPED_LP_TOKEN_ID.to_vec(), nonce: 1, - value: first_amount.clone(), + value: first_amount, }, TxTokenTransfer { token_identifier: WRAPPED_LP_TOKEN_ID.to_vec(), nonce: 2, - value: second_amount.clone(), + value: second_amount, }, ]; From 95c897cb3665cd5986ba2ecbc3eed63653ee7e89 Mon Sep 17 00:00:00 2001 From: ovidiuolteanu Date: Fri, 25 Aug 2023 13:49:47 +0300 Subject: [PATCH 029/213] updated actions rust version --- .github/workflows/actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 756046163..edce63ab7 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -22,7 +22,7 @@ jobs: name: Contracts uses: multiversx/mx-sc-actions/.github/workflows/contracts.yml@v2 with: - rust-toolchain: nightly-2022-12-08 + rust-toolchain: nightly-2023-04-23 vmtools-version: v1.4.60 secrets: token: ${{ secrets.GITHUB_TOKEN }} From b1fe6098d3deb76adee780fcd7e1b751fe78d7aa Mon Sep 17 00:00:00 2001 From: Andrei Marinica Date: Fri, 25 Aug 2023 17:00:20 +0300 Subject: [PATCH 030/213] upgrade to framework version 0.40.0 --- Cargo.toml | 2 ++ common/common_errors/Cargo.toml | 2 +- common/common_structs/Cargo.toml | 2 +- common/modules/farm/config/Cargo.toml | 2 +- common/modules/farm/contexts/Cargo.toml | 4 ++-- common/modules/farm/events/Cargo.toml | 2 +- common/modules/farm/farm_base_impl/Cargo.toml | 6 +++--- common/modules/farm/farm_token/Cargo.toml | 4 ++-- .../modules/farm/farm_token/src/farm_token.rs | 2 +- .../modules/farm/farm_token_merge/Cargo.toml | 4 ++-- common/modules/farm/rewards/Cargo.toml | 4 ++-- .../legacy_token_decode_module/Cargo.toml | 2 +- common/modules/locking_module/Cargo.toml | 2 +- common/modules/math/Cargo.toml | 2 +- common/modules/pausable/Cargo.toml | 2 +- common/modules/permissions_module/Cargo.toml | 2 +- common/modules/sc_whitelist_module/Cargo.toml | 2 +- common/modules/token_merge_helper/Cargo.toml | 2 +- common/modules/token_send/Cargo.toml | 2 +- common/modules/utils/Cargo.toml | 2 +- common/modules/utils/src/lib.rs | 2 +- common/traits/fixed-supply-token/Cargo.toml | 2 +- common/traits/mergeable/Cargo.toml | 2 +- common/traits/unwrappable/Cargo.toml | 2 +- dex/Cargo.toml | 6 +++--- dex/farm-with-locked-rewards/Cargo.toml | 6 +++--- dex/farm-with-locked-rewards/meta/Cargo.toml | 2 +- dex/farm-with-locked-rewards/src/lib.rs | 2 +- dex/farm-with-locked-rewards/wasm/Cargo.toml | 2 +- dex/farm/Cargo.toml | 6 +++--- dex/farm/meta/Cargo.toml | 2 +- dex/farm/src/base_functions.rs | 6 +++--- dex/farm/wasm/Cargo.toml | 2 +- dex/fuzz/Cargo.toml | 4 ++-- dex/governance/Cargo.toml | 4 ++-- dex/governance/meta/Cargo.toml | 2 +- dex/governance/wasm/Cargo.toml | 2 +- dex/pair-mock/Cargo.toml | 4 ++-- dex/pair-mock/meta/Cargo.toml | 2 +- dex/pair-mock/wasm/Cargo.toml | 2 +- dex/pair/Cargo.toml | 4 ++-- dex/pair/meta/Cargo.toml | 2 +- dex/pair/wasm-pair-full/Cargo.toml | 2 +- dex/pair/wasm-safe-price-view/Cargo.toml | 2 +- dex/pair/wasm/Cargo.toml | 2 +- dex/price-discovery/Cargo.toml | 6 +++--- dex/price-discovery/meta/Cargo.toml | 2 +- dex/price-discovery/src/redeem_token.rs | 2 +- dex/price-discovery/wasm/Cargo.toml | 2 +- dex/proxy-deployer/Cargo.toml | 4 ++-- dex/proxy-deployer/meta/Cargo.toml | 2 +- dex/proxy-deployer/wasm/Cargo.toml | 2 +- dex/router/Cargo.toml | 4 ++-- dex/router/meta/Cargo.toml | 2 +- dex/router/src/contract.rs | 2 +- dex/router/wasm/Cargo.toml | 2 +- .../common-modules/energy-query/Cargo.toml | 2 +- .../week-timekeeping/Cargo.toml | 2 +- .../weekly-rewards-splitting/Cargo.toml | 2 +- energy-integration/common-types/Cargo.toml | 2 +- .../energy-factory-mock/Cargo.toml | 4 ++-- .../energy-factory-mock/meta/Cargo.toml | 2 +- .../energy-factory-mock/wasm/Cargo.toml | 2 +- energy-integration/energy-update/Cargo.toml | 6 +++--- .../energy-update/meta/Cargo.toml | 2 +- .../energy-update/wasm/Cargo.toml | 2 +- .../farm-boosted-yields/Cargo.toml | 2 +- energy-integration/fees-collector/Cargo.toml | 6 +++--- .../fees-collector/meta/Cargo.toml | 2 +- .../fees-collector/wasm/Cargo.toml | 2 +- energy-integration/governance-v2/Cargo.toml | 20 +++++++++---------- .../governance-v2/meta/Cargo.toml | 2 +- .../governance-v2/wasm/Cargo.toml | 2 +- farm-staking/farm-staking-proxy/Cargo.toml | 6 +++--- .../farm-staking-proxy/meta/Cargo.toml | 2 +- .../src/dual_yield_token.rs | 2 +- .../src/proxy_actions/merge_pos.rs | 2 +- .../farm-staking-proxy/wasm/Cargo.toml | 2 +- farm-staking/farm-staking/Cargo.toml | 6 +++--- farm-staking/farm-staking/meta/Cargo.toml | 2 +- farm-staking/farm-staking/src/stake_farm.rs | 2 +- farm-staking/farm-staking/wasm/Cargo.toml | 2 +- farm-staking/metabonding-staking/Cargo.toml | 6 +++--- .../metabonding-staking/meta/Cargo.toml | 2 +- farm-staking/metabonding-staking/src/lib.rs | 2 +- .../metabonding-staking/wasm/Cargo.toml | 2 +- locked-asset/Cargo.toml | 6 +++--- locked-asset/distribution/Cargo.toml | 4 ++-- locked-asset/distribution/meta/Cargo.toml | 2 +- locked-asset/distribution/wasm/Cargo.toml | 2 +- locked-asset/energy-factory/Cargo.toml | 6 +++--- locked-asset/energy-factory/meta/Cargo.toml | 2 +- locked-asset/energy-factory/wasm/Cargo.toml | 2 +- locked-asset/factory/Cargo.toml | 6 +++--- locked-asset/factory/meta/Cargo.toml | 2 +- locked-asset/factory/src/lib.rs | 2 +- locked-asset/factory/wasm/Cargo.toml | 2 +- locked-asset/lkmex-transfer/Cargo.toml | 7 ++++--- locked-asset/lkmex-transfer/meta/Cargo.toml | 2 +- locked-asset/lkmex-transfer/src/lib.rs | 2 +- locked-asset/lkmex-transfer/wasm/Cargo.toml | 2 +- locked-asset/locked-token-wrapper/Cargo.toml | 6 +++--- .../locked-token-wrapper/meta/Cargo.toml | 2 +- .../locked-token-wrapper/src/wrapped_token.rs | 2 +- .../locked-token-wrapper/wasm/Cargo.toml | 2 +- locked-asset/proxy_dex/Cargo.toml | 6 +++--- locked-asset/proxy_dex/meta/Cargo.toml | 2 +- locked-asset/proxy_dex/src/lib.rs | 4 ++-- locked-asset/proxy_dex/wasm/Cargo.toml | 2 +- locked-asset/simple-lock-whitelist/Cargo.toml | 6 +++--- .../simple-lock-whitelist/meta/Cargo.toml | 2 +- .../simple-lock-whitelist/wasm/Cargo.toml | 2 +- locked-asset/simple-lock/Cargo.toml | 6 +++--- locked-asset/simple-lock/meta/Cargo.toml | 2 +- locked-asset/simple-lock/src/locked_token.rs | 2 +- locked-asset/simple-lock/src/proxy_farm.rs | 4 ++-- locked-asset/simple-lock/src/proxy_lp.rs | 2 +- locked-asset/simple-lock/wasm/Cargo.toml | 2 +- locked-asset/token-unstake/Cargo.toml | 6 +++--- locked-asset/token-unstake/meta/Cargo.toml | 2 +- locked-asset/token-unstake/wasm/Cargo.toml | 2 +- pause-all/Cargo.toml | 6 +++--- pause-all/meta/Cargo.toml | 2 +- pause-all/wasm/Cargo.toml | 2 +- 124 files changed, 191 insertions(+), 188 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 03bc3e07d..dbdd0d3ec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,4 +1,6 @@ [workspace] +resolver = "2" + members = [ "dex", "dex/farm", diff --git a/common/common_errors/Cargo.toml b/common/common_errors/Cargo.toml index c4d256a3c..bdc222367 100644 --- a/common/common_errors/Cargo.toml +++ b/common/common_errors/Cargo.toml @@ -7,5 +7,5 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/common_structs/Cargo.toml b/common/common_structs/Cargo.toml index 98b03285a..cff885fce 100644 --- a/common/common_structs/Cargo.toml +++ b/common/common_structs/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.mergeable] diff --git a/common/modules/farm/config/Cargo.toml b/common/modules/farm/config/Cargo.toml index 7380edcdc..91de3a378 100644 --- a/common/modules/farm/config/Cargo.toml +++ b/common/modules/farm/config/Cargo.toml @@ -22,5 +22,5 @@ path = "../../pausable" path = "../../permissions_module" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/farm/contexts/Cargo.toml b/common/modules/farm/contexts/Cargo.toml index 1fc3a93ed..49f186fba 100644 --- a/common/modules/farm/contexts/Cargo.toml +++ b/common/modules/farm/contexts/Cargo.toml @@ -34,8 +34,8 @@ path = "../../pausable" path = "../../permissions_module" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.39.4" +version = "=0.40.0" diff --git a/common/modules/farm/events/Cargo.toml b/common/modules/farm/events/Cargo.toml index 453278dd2..308590817 100644 --- a/common/modules/farm/events/Cargo.toml +++ b/common/modules/farm/events/Cargo.toml @@ -13,5 +13,5 @@ path = "../../../common_structs" path = "../contexts" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/farm/farm_base_impl/Cargo.toml b/common/modules/farm/farm_base_impl/Cargo.toml index db5644507..d06e9c14e 100644 --- a/common/modules/farm/farm_base_impl/Cargo.toml +++ b/common/modules/farm/farm_base_impl/Cargo.toml @@ -49,10 +49,10 @@ path = "../../../traits/mergeable" path = "../../../traits/fixed-supply-token" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.39.4" +version = "=0.40.0" [dev-dependencies.multiversx-sc-scenario] -version = "=0.39.4" +version = "=0.40.0" diff --git a/common/modules/farm/farm_token/Cargo.toml b/common/modules/farm/farm_token/Cargo.toml index 7fc2158cc..31babc159 100644 --- a/common/modules/farm/farm_token/Cargo.toml +++ b/common/modules/farm/farm_token/Cargo.toml @@ -25,8 +25,8 @@ path = "../../pausable" path = "../../permissions_module" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.39.4" +version = "=0.40.0" diff --git a/common/modules/farm/farm_token/src/farm_token.rs b/common/modules/farm/farm_token/src/farm_token.rs index 30843ef3d..de3f32d5d 100644 --- a/common/modules/farm/farm_token/src/farm_token.rs +++ b/common/modules/farm/farm_token/src/farm_token.rs @@ -20,7 +20,7 @@ pub trait FarmTokenModule: ) { self.require_caller_has_owner_or_admin_permissions(); - let payment_amount = self.call_value().egld_value(); + let payment_amount = self.call_value().egld_value().clone_value(); self.farm_token().issue_and_set_all_roles( EsdtTokenType::Meta, payment_amount, diff --git a/common/modules/farm/farm_token_merge/Cargo.toml b/common/modules/farm/farm_token_merge/Cargo.toml index e73555fd1..aa54886c4 100644 --- a/common/modules/farm/farm_token_merge/Cargo.toml +++ b/common/modules/farm/farm_token_merge/Cargo.toml @@ -22,8 +22,8 @@ path = "../../token_merge_helper" path = "../farm_token" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.39.4" +version = "=0.40.0" diff --git a/common/modules/farm/rewards/Cargo.toml b/common/modules/farm/rewards/Cargo.toml index 57a1fe8de..9f003a58d 100644 --- a/common/modules/farm/rewards/Cargo.toml +++ b/common/modules/farm/rewards/Cargo.toml @@ -28,8 +28,8 @@ path = "../../pausable" path = "../../permissions_module" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.39.4" +version = "=0.40.0" diff --git a/common/modules/legacy_token_decode_module/Cargo.toml b/common/modules/legacy_token_decode_module/Cargo.toml index 5f26f6f7b..83d0bf26d 100644 --- a/common/modules/legacy_token_decode_module/Cargo.toml +++ b/common/modules/legacy_token_decode_module/Cargo.toml @@ -7,7 +7,7 @@ edition = "2018" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.common_structs] diff --git a/common/modules/locking_module/Cargo.toml b/common/modules/locking_module/Cargo.toml index b6179493e..5be9a144e 100644 --- a/common/modules/locking_module/Cargo.toml +++ b/common/modules/locking_module/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.simple-lock] diff --git a/common/modules/math/Cargo.toml b/common/modules/math/Cargo.toml index 4b5883072..29abbd7cf 100644 --- a/common/modules/math/Cargo.toml +++ b/common/modules/math/Cargo.toml @@ -7,5 +7,5 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/pausable/Cargo.toml b/common/modules/pausable/Cargo.toml index 1f6aa17be..3f5c8259c 100644 --- a/common/modules/pausable/Cargo.toml +++ b/common/modules/pausable/Cargo.toml @@ -10,5 +10,5 @@ path = "src/pausable.rs" path = "../permissions_module" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/permissions_module/Cargo.toml b/common/modules/permissions_module/Cargo.toml index e899bb299..b46cf5c92 100644 --- a/common/modules/permissions_module/Cargo.toml +++ b/common/modules/permissions_module/Cargo.toml @@ -14,5 +14,5 @@ bitflags = "1.3.2" path = "../../common_errors" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/sc_whitelist_module/Cargo.toml b/common/modules/sc_whitelist_module/Cargo.toml index 0b3bc696d..037cc7746 100644 --- a/common/modules/sc_whitelist_module/Cargo.toml +++ b/common/modules/sc_whitelist_module/Cargo.toml @@ -10,5 +10,5 @@ path = "src/sc_whitelist_module.rs" path = "../../common_errors" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/token_merge_helper/Cargo.toml b/common/modules/token_merge_helper/Cargo.toml index 2bf0e30e9..37073efc3 100644 --- a/common/modules/token_merge_helper/Cargo.toml +++ b/common/modules/token_merge_helper/Cargo.toml @@ -10,5 +10,5 @@ path = "src/lib.rs" path = "../../common_errors" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/token_send/Cargo.toml b/common/modules/token_send/Cargo.toml index f2aeda9cc..0f81a2d46 100644 --- a/common/modules/token_send/Cargo.toml +++ b/common/modules/token_send/Cargo.toml @@ -13,5 +13,5 @@ path = "../../common_structs" path = "../../common_errors" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/utils/Cargo.toml b/common/modules/utils/Cargo.toml index 6b821e33e..c36f1bc82 100644 --- a/common/modules/utils/Cargo.toml +++ b/common/modules/utils/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.common_structs] diff --git a/common/modules/utils/src/lib.rs b/common/modules/utils/src/lib.rs index 333c3e509..31d384146 100644 --- a/common/modules/utils/src/lib.rs +++ b/common/modules/utils/src/lib.rs @@ -32,7 +32,7 @@ pub trait UtilsModule { let payments = self.call_value().all_esdt_transfers(); require!(!payments.is_empty(), ERR_EMPTY_PAYMENTS); - payments + payments.clone_value() } fn pop_first_payment( diff --git a/common/traits/fixed-supply-token/Cargo.toml b/common/traits/fixed-supply-token/Cargo.toml index 1fe4b6fbc..81ee73396 100644 --- a/common/traits/fixed-supply-token/Cargo.toml +++ b/common/traits/fixed-supply-token/Cargo.toml @@ -7,4 +7,4 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" diff --git a/common/traits/mergeable/Cargo.toml b/common/traits/mergeable/Cargo.toml index 526ec4e13..68a549515 100644 --- a/common/traits/mergeable/Cargo.toml +++ b/common/traits/mergeable/Cargo.toml @@ -7,5 +7,5 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/traits/unwrappable/Cargo.toml b/common/traits/unwrappable/Cargo.toml index 05a13e631..2d628ded7 100644 --- a/common/traits/unwrappable/Cargo.toml +++ b/common/traits/unwrappable/Cargo.toml @@ -7,5 +7,5 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/dex/Cargo.toml b/dex/Cargo.toml index 25e221076..b78488475 100644 --- a/dex/Cargo.toml +++ b/dex/Cargo.toml @@ -4,17 +4,17 @@ version = "0.0.0" edition = "2021" publish = false [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-modules] -version = "=0.39.4" +version = "=0.40.0" [dev-dependencies.multiversx-sc-scenario] -version = "=0.39.4" +version = "=0.40.0" [dev-dependencies.config] path = "../common/modules/farm/config" diff --git a/dex/farm-with-locked-rewards/Cargo.toml b/dex/farm-with-locked-rewards/Cargo.toml index 3052499d2..464b2fc85 100644 --- a/dex/farm-with-locked-rewards/Cargo.toml +++ b/dex/farm-with-locked-rewards/Cargo.toml @@ -74,17 +74,17 @@ path = "../../locked-asset/energy-factory" path = "../../energy-integration/common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.39.4" +version = "=0.40.0" [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.39.4" +version = "=0.40.0" [dev-dependencies.simple-lock] path = "../../locked-asset/simple-lock" diff --git a/dex/farm-with-locked-rewards/meta/Cargo.toml b/dex/farm-with-locked-rewards/meta/Cargo.toml index 5189d15c6..ec1511ff7 100644 --- a/dex/farm-with-locked-rewards/meta/Cargo.toml +++ b/dex/farm-with-locked-rewards/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.39.4" +version = "0.40.0" diff --git a/dex/farm-with-locked-rewards/src/lib.rs b/dex/farm-with-locked-rewards/src/lib.rs index 0bfbff59b..948ed0739 100644 --- a/dex/farm-with-locked-rewards/src/lib.rs +++ b/dex/farm-with-locked-rewards/src/lib.rs @@ -121,7 +121,7 @@ pub trait Farm: let caller = self.blockchain().get_caller(); let orig_caller = self.get_orig_caller_from_opt(&caller, opt_orig_caller); - let payments = self.call_value().all_esdt_transfers(); + let payments = self.call_value().all_esdt_transfers().clone_value(); let base_claim_rewards_result = self.claim_rewards_base::>(orig_caller.clone(), payments); let output_farm_token_payment = base_claim_rewards_result.new_farm_token.payment.clone(); diff --git a/dex/farm-with-locked-rewards/wasm/Cargo.toml b/dex/farm-with-locked-rewards/wasm/Cargo.toml index 2c92c6c62..917e6e03b 100644 --- a/dex/farm-with-locked-rewards/wasm/Cargo.toml +++ b/dex/farm-with-locked-rewards/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.39.4" +version = "=0.40.0" diff --git a/dex/farm/Cargo.toml b/dex/farm/Cargo.toml index f2cca8bf7..35906d5a9 100644 --- a/dex/farm/Cargo.toml +++ b/dex/farm/Cargo.toml @@ -68,11 +68,11 @@ path = "../../energy-integration/common-modules/weekly-rewards-splitting" path = "../../energy-integration/common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.39.4" +version = "=0.40.0" [dev-dependencies] num-bigint = "0.4.2" @@ -81,7 +81,7 @@ num-bigint = "0.4.2" path = "../../energy-integration/energy-update" [dev-dependencies.multiversx-sc-scenario] -version = "=0.39.4" +version = "=0.40.0" [dev-dependencies.energy-factory-mock] path = "../../energy-integration/energy-factory-mock" diff --git a/dex/farm/meta/Cargo.toml b/dex/farm/meta/Cargo.toml index 0829c6199..963df4cd2 100644 --- a/dex/farm/meta/Cargo.toml +++ b/dex/farm/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.39.4" +version = "0.40.0" diff --git a/dex/farm/src/base_functions.rs b/dex/farm/src/base_functions.rs index 317ae4c1c..719092fc5 100644 --- a/dex/farm/src/base_functions.rs +++ b/dex/farm/src/base_functions.rs @@ -73,7 +73,7 @@ pub trait BaseFunctionsModule: &self, caller: ManagedAddress, ) -> EsdtTokenPayment { - let payments = self.call_value().all_esdt_transfers(); + let payments = self.call_value().all_esdt_transfers().clone_value(); let base_enter_farm_result = self.enter_farm_base::(caller.clone(), payments); self.set_farm_supply_for_current_week( @@ -95,7 +95,7 @@ pub trait BaseFunctionsModule: &self, caller: ManagedAddress, ) -> ClaimRewardsResultWrapper { - let payments = self.call_value().all_esdt_transfers(); + let payments = self.call_value().all_esdt_transfers().clone_value(); let base_claim_rewards_result = self.claim_rewards_base::(caller.clone(), payments); let output_farm_token_payment = base_claim_rewards_result.new_farm_token.payment.clone(); @@ -124,7 +124,7 @@ pub trait BaseFunctionsModule: &self, caller: ManagedAddress, ) -> EsdtTokenPayment { - let payments = self.call_value().all_esdt_transfers(); + let payments = self.call_value().all_esdt_transfers().clone_value(); let base_compound_rewards_result = self.compound_rewards_base::(caller.clone(), payments); diff --git a/dex/farm/wasm/Cargo.toml b/dex/farm/wasm/Cargo.toml index 61e5f6174..c18417cc4 100644 --- a/dex/farm/wasm/Cargo.toml +++ b/dex/farm/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.39.4" +version = "=0.40.0" diff --git a/dex/fuzz/Cargo.toml b/dex/fuzz/Cargo.toml index ba40e32f0..501f7d799 100644 --- a/dex/fuzz/Cargo.toml +++ b/dex/fuzz/Cargo.toml @@ -12,11 +12,11 @@ num-bigint = "0.4.2" rand = "0.8.4" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-scenario] -version = "=0.39.4" +version = "=0.40.0" [dependencies.pausable] path = "../../common/modules/pausable" diff --git a/dex/governance/Cargo.toml b/dex/governance/Cargo.toml index 7aeb1b170..6a2e01153 100644 --- a/dex/governance/Cargo.toml +++ b/dex/governance/Cargo.toml @@ -8,14 +8,14 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.39.4" +version = "=0.40.0" [dev-dependencies.pair-mock] path = "../pair-mock" diff --git a/dex/governance/meta/Cargo.toml b/dex/governance/meta/Cargo.toml index 0714371a8..8ce801e04 100644 --- a/dex/governance/meta/Cargo.toml +++ b/dex/governance/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.39.4" +version = "0.40.0" diff --git a/dex/governance/wasm/Cargo.toml b/dex/governance/wasm/Cargo.toml index 8214f691a..c5841d766 100644 --- a/dex/governance/wasm/Cargo.toml +++ b/dex/governance/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.39.4" +version = "=0.40.0" diff --git a/dex/pair-mock/Cargo.toml b/dex/pair-mock/Cargo.toml index cda7012ec..c58e13485 100644 --- a/dex/pair-mock/Cargo.toml +++ b/dex/pair-mock/Cargo.toml @@ -11,11 +11,11 @@ path = "src/pair.rs" path = "../../common/common_errors" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.itertools] version = "0.10.1" default-features = false [dev-dependencies.multiversx-sc-scenario] -version = "=0.39.4" +version = "=0.40.0" diff --git a/dex/pair-mock/meta/Cargo.toml b/dex/pair-mock/meta/Cargo.toml index ffee1543e..623b11a01 100644 --- a/dex/pair-mock/meta/Cargo.toml +++ b/dex/pair-mock/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.39.4" +version = "0.40.0" diff --git a/dex/pair-mock/wasm/Cargo.toml b/dex/pair-mock/wasm/Cargo.toml index feebc28dc..fbee18359 100644 --- a/dex/pair-mock/wasm/Cargo.toml +++ b/dex/pair-mock/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.39.4" +version = "=0.40.0" diff --git a/dex/pair/Cargo.toml b/dex/pair/Cargo.toml index b4ae5976b..28bf69884 100644 --- a/dex/pair/Cargo.toml +++ b/dex/pair/Cargo.toml @@ -33,11 +33,11 @@ version = "0.10.1" default-features = false [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.39.4" +version = "=0.40.0" diff --git a/dex/pair/meta/Cargo.toml b/dex/pair/meta/Cargo.toml index 2c4f80564..9bf1f1f3a 100644 --- a/dex/pair/meta/Cargo.toml +++ b/dex/pair/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.39.4" +version = "0.40.0" diff --git a/dex/pair/wasm-pair-full/Cargo.toml b/dex/pair/wasm-pair-full/Cargo.toml index 83cc77a50..bdbaa2c0e 100644 --- a/dex/pair/wasm-pair-full/Cargo.toml +++ b/dex/pair/wasm-pair-full/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.39.4" +version = "=0.40.0" diff --git a/dex/pair/wasm-safe-price-view/Cargo.toml b/dex/pair/wasm-safe-price-view/Cargo.toml index 90323de22..7154becef 100644 --- a/dex/pair/wasm-safe-price-view/Cargo.toml +++ b/dex/pair/wasm-safe-price-view/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.39.4" +version = "=0.40.0" diff --git a/dex/pair/wasm/Cargo.toml b/dex/pair/wasm/Cargo.toml index 6ef96197e..7faee9288 100644 --- a/dex/pair/wasm/Cargo.toml +++ b/dex/pair/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.39.4" +version = "=0.40.0" diff --git a/dex/price-discovery/Cargo.toml b/dex/price-discovery/Cargo.toml index 7bf90df61..172709172 100644 --- a/dex/price-discovery/Cargo.toml +++ b/dex/price-discovery/Cargo.toml @@ -12,11 +12,11 @@ path = "src/lib.rs" hex-literal = "0.3.1" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.39.4" +version = "=0.40.0" [dependencies.locking_module] path = "../../common/modules/locking_module" @@ -30,4 +30,4 @@ hex = "0.4" path = "../../locked-asset/simple-lock" [dev-dependencies.multiversx-sc-scenario] -version = "=0.39.4" +version = "=0.40.0" diff --git a/dex/price-discovery/meta/Cargo.toml b/dex/price-discovery/meta/Cargo.toml index 7ffb188bc..f8ce3fdab 100644 --- a/dex/price-discovery/meta/Cargo.toml +++ b/dex/price-discovery/meta/Cargo.toml @@ -8,4 +8,4 @@ authors = ["Dorin Iancu "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.39.4" +version = "0.40.0" diff --git a/dex/price-discovery/src/redeem_token.rs b/dex/price-discovery/src/redeem_token.rs index 70de40567..e54b091d8 100644 --- a/dex/price-discovery/src/redeem_token.rs +++ b/dex/price-discovery/src/redeem_token.rs @@ -19,7 +19,7 @@ pub trait RedeemTokenModule: token_ticker: ManagedBuffer, nr_decimals: usize, ) { - let payment_amount = self.call_value().egld_value(); + let payment_amount = self.call_value().egld_value().clone_value(); self.redeem_token().issue_and_set_all_roles( EsdtTokenType::Meta, payment_amount, diff --git a/dex/price-discovery/wasm/Cargo.toml b/dex/price-discovery/wasm/Cargo.toml index b706e6a63..a771c6db6 100644 --- a/dex/price-discovery/wasm/Cargo.toml +++ b/dex/price-discovery/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.39.4" +version = "=0.40.0" diff --git a/dex/proxy-deployer/Cargo.toml b/dex/proxy-deployer/Cargo.toml index 60586f00a..b56e2830e 100644 --- a/dex/proxy-deployer/Cargo.toml +++ b/dex/proxy-deployer/Cargo.toml @@ -20,11 +20,11 @@ path = "../../common/modules/farm/config" path = "../../common/modules/farm/farm_token" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.39.4" +version = "=0.40.0" diff --git a/dex/proxy-deployer/meta/Cargo.toml b/dex/proxy-deployer/meta/Cargo.toml index 43004528f..3c1d9eb40 100644 --- a/dex/proxy-deployer/meta/Cargo.toml +++ b/dex/proxy-deployer/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.39.4" +version = "0.40.0" diff --git a/dex/proxy-deployer/wasm/Cargo.toml b/dex/proxy-deployer/wasm/Cargo.toml index 86fa07458..5c27f6b07 100644 --- a/dex/proxy-deployer/wasm/Cargo.toml +++ b/dex/proxy-deployer/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.39.4" +version = "=0.40.0" diff --git a/dex/router/Cargo.toml b/dex/router/Cargo.toml index 32e19083e..0c4bf33b0 100644 --- a/dex/router/Cargo.toml +++ b/dex/router/Cargo.toml @@ -14,7 +14,7 @@ path = "../../common/modules/token_send" path = "../../common/modules/pausable" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.pair] @@ -26,4 +26,4 @@ path = "../../common/modules/locking_module" [dependencies.simple-lock] path = "../../locked-asset/simple-lock" [dev-dependencies.multiversx-sc-scenario] -version = "=0.39.4" +version = "=0.40.0" diff --git a/dex/router/meta/Cargo.toml b/dex/router/meta/Cargo.toml index 4901db35c..02b87ec1e 100644 --- a/dex/router/meta/Cargo.toml +++ b/dex/router/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.39.4" +version = "0.40.0" diff --git a/dex/router/src/contract.rs b/dex/router/src/contract.rs index 693c7fe23..8e9f685e5 100644 --- a/dex/router/src/contract.rs +++ b/dex/router/src/contract.rs @@ -190,7 +190,7 @@ pub trait Router: lp_token_display_name: ManagedBuffer, lp_token_ticker: ManagedBuffer, ) { - let issue_cost = self.call_value().egld_value(); + let issue_cost = self.call_value().egld_value().clone_value(); require!(self.is_active(), "Not active"); let caller = self.blockchain().get_caller(); diff --git a/dex/router/wasm/Cargo.toml b/dex/router/wasm/Cargo.toml index 5e1dbd501..91396f80e 100644 --- a/dex/router/wasm/Cargo.toml +++ b/dex/router/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.39.4" +version = "=0.40.0" diff --git a/energy-integration/common-modules/energy-query/Cargo.toml b/energy-integration/common-modules/energy-query/Cargo.toml index 4538084dd..be4cd4ea9 100644 --- a/energy-integration/common-modules/energy-query/Cargo.toml +++ b/energy-integration/common-modules/energy-query/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.energy-factory] diff --git a/energy-integration/common-modules/week-timekeeping/Cargo.toml b/energy-integration/common-modules/week-timekeeping/Cargo.toml index 5572b47c6..590353094 100644 --- a/energy-integration/common-modules/week-timekeeping/Cargo.toml +++ b/energy-integration/common-modules/week-timekeeping/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.common-types] diff --git a/energy-integration/common-modules/weekly-rewards-splitting/Cargo.toml b/energy-integration/common-modules/weekly-rewards-splitting/Cargo.toml index 17f83c964..cd144a625 100644 --- a/energy-integration/common-modules/weekly-rewards-splitting/Cargo.toml +++ b/energy-integration/common-modules/weekly-rewards-splitting/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.energy-query] diff --git a/energy-integration/common-types/Cargo.toml b/energy-integration/common-types/Cargo.toml index 11a2466fa..0be3be9d7 100644 --- a/energy-integration/common-types/Cargo.toml +++ b/energy-integration/common-types/Cargo.toml @@ -7,5 +7,5 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/energy-integration/energy-factory-mock/Cargo.toml b/energy-integration/energy-factory-mock/Cargo.toml index 8af77face..10e878081 100644 --- a/energy-integration/energy-factory-mock/Cargo.toml +++ b/energy-integration/energy-factory-mock/Cargo.toml @@ -11,7 +11,7 @@ path = "src/lib.rs" path = "../common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies.multiversx-sc-scenario] -version = "=0.39.4" +version = "=0.40.0" diff --git a/energy-integration/energy-factory-mock/meta/Cargo.toml b/energy-integration/energy-factory-mock/meta/Cargo.toml index 194f75d4c..b56977a01 100644 --- a/energy-integration/energy-factory-mock/meta/Cargo.toml +++ b/energy-integration/energy-factory-mock/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.39.4" +version = "0.40.0" diff --git a/energy-integration/energy-factory-mock/wasm/Cargo.toml b/energy-integration/energy-factory-mock/wasm/Cargo.toml index 3c5feb01a..6bea8b4a1 100644 --- a/energy-integration/energy-factory-mock/wasm/Cargo.toml +++ b/energy-integration/energy-factory-mock/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.39.4" +version = "=0.40.0" diff --git a/energy-integration/energy-update/Cargo.toml b/energy-integration/energy-update/Cargo.toml index 2282d5687..fe655051c 100644 --- a/energy-integration/energy-update/Cargo.toml +++ b/energy-integration/energy-update/Cargo.toml @@ -8,11 +8,11 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.39.4" +version = "=0.40.0" [dependencies.farm] path = "../../dex/farm" @@ -24,4 +24,4 @@ path = "../common-modules/weekly-rewards-splitting" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.39.4" +version = "=0.40.0" diff --git a/energy-integration/energy-update/meta/Cargo.toml b/energy-integration/energy-update/meta/Cargo.toml index 0a84ae847..f095ce203 100644 --- a/energy-integration/energy-update/meta/Cargo.toml +++ b/energy-integration/energy-update/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.39.4" +version = "0.40.0" diff --git a/energy-integration/energy-update/wasm/Cargo.toml b/energy-integration/energy-update/wasm/Cargo.toml index 1186d489e..9634dd90e 100644 --- a/energy-integration/energy-update/wasm/Cargo.toml +++ b/energy-integration/energy-update/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.39.4" +version = "=0.40.0" diff --git a/energy-integration/farm-boosted-yields/Cargo.toml b/energy-integration/farm-boosted-yields/Cargo.toml index 19d33b080..a71ef8b6f 100644 --- a/energy-integration/farm-boosted-yields/Cargo.toml +++ b/energy-integration/farm-boosted-yields/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.config] diff --git a/energy-integration/fees-collector/Cargo.toml b/energy-integration/fees-collector/Cargo.toml index 1f260d8f6..43b0f7cba 100644 --- a/energy-integration/fees-collector/Cargo.toml +++ b/energy-integration/fees-collector/Cargo.toml @@ -8,11 +8,11 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.39.4" +version = "=0.40.0" [dependencies.energy-query] path = "../common-modules/energy-query" @@ -48,7 +48,7 @@ path = "../../common/common_errors" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.39.4" +version = "=0.40.0" [dev-dependencies.sc_whitelist_module] path = "../../common/modules/sc_whitelist_module" diff --git a/energy-integration/fees-collector/meta/Cargo.toml b/energy-integration/fees-collector/meta/Cargo.toml index 2896d634f..26c79443e 100644 --- a/energy-integration/fees-collector/meta/Cargo.toml +++ b/energy-integration/fees-collector/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.39.4" +version = "0.40.0" diff --git a/energy-integration/fees-collector/wasm/Cargo.toml b/energy-integration/fees-collector/wasm/Cargo.toml index 8ccf99214..232074e58 100644 --- a/energy-integration/fees-collector/wasm/Cargo.toml +++ b/energy-integration/fees-collector/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.39.4" +version = "=0.40.0" diff --git a/energy-integration/governance-v2/Cargo.toml b/energy-integration/governance-v2/Cargo.toml index e1993198d..e82f11542 100644 --- a/energy-integration/governance-v2/Cargo.toml +++ b/energy-integration/governance-v2/Cargo.toml @@ -11,18 +11,9 @@ path = "src/lib.rs" path = "../common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] -[dev-dependencies] -num-bigint = "0.4.2" - -[dev-dependencies.multiversx-sc-scenario] -version = "=0.39.4" - -[dev-dependencies.energy-factory-mock] -path = "../energy-factory-mock" - [dependencies.permissions_module] path = "../../common/modules/permissions_module" @@ -31,3 +22,12 @@ path = "../fees-collector" [dependencies.weekly-rewards-splitting] path = "../common-modules/weekly-rewards-splitting" + +[dev-dependencies] +num-bigint = "0.4.2" + +[dev-dependencies.multiversx-sc-scenario] +version = "=0.40.0" + +[dev-dependencies.energy-factory-mock] +path = "../energy-factory-mock" diff --git a/energy-integration/governance-v2/meta/Cargo.toml b/energy-integration/governance-v2/meta/Cargo.toml index 2d5c3e77d..8c50d731b 100644 --- a/energy-integration/governance-v2/meta/Cargo.toml +++ b/energy-integration/governance-v2/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.39.4" +version = "0.40.0" diff --git a/energy-integration/governance-v2/wasm/Cargo.toml b/energy-integration/governance-v2/wasm/Cargo.toml index 9150116ff..78fda0c4a 100644 --- a/energy-integration/governance-v2/wasm/Cargo.toml +++ b/energy-integration/governance-v2/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.39.4" +version = "=0.40.0" diff --git a/farm-staking/farm-staking-proxy/Cargo.toml b/farm-staking/farm-staking-proxy/Cargo.toml index 65b8c1d5f..3060277f7 100644 --- a/farm-staking/farm-staking-proxy/Cargo.toml +++ b/farm-staking/farm-staking-proxy/Cargo.toml @@ -12,11 +12,11 @@ path = "src/lib.rs" hex-literal = "0.3.1" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.39.4" +version = "=0.40.0" [dependencies.farm] path = "../../dex/farm" @@ -61,7 +61,7 @@ path = "../../common/modules/sc_whitelist_module" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.39.4" +version = "=0.40.0" [dev-dependencies.farm_token] path = "../../common/modules/farm/farm_token" diff --git a/farm-staking/farm-staking-proxy/meta/Cargo.toml b/farm-staking/farm-staking-proxy/meta/Cargo.toml index 093f5cefc..2f50a4dbb 100644 --- a/farm-staking/farm-staking-proxy/meta/Cargo.toml +++ b/farm-staking/farm-staking-proxy/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.39.4" +version = "0.40.0" diff --git a/farm-staking/farm-staking-proxy/src/dual_yield_token.rs b/farm-staking/farm-staking-proxy/src/dual_yield_token.rs index cb9b5fe73..f1e2eedd0 100644 --- a/farm-staking/farm-staking-proxy/src/dual_yield_token.rs +++ b/farm-staking/farm-staking-proxy/src/dual_yield_token.rs @@ -114,7 +114,7 @@ pub trait DualYieldTokenModule: token_ticker: ManagedBuffer, num_decimals: usize, ) { - let register_cost = self.call_value().egld_value(); + let register_cost = self.call_value().egld_value().clone_value(); self.dual_yield_token().issue_and_set_all_roles( EsdtTokenType::Meta, register_cost, diff --git a/farm-staking/farm-staking-proxy/src/proxy_actions/merge_pos.rs b/farm-staking/farm-staking-proxy/src/proxy_actions/merge_pos.rs index 4a0f89031..84be38ae0 100644 --- a/farm-staking/farm-staking-proxy/src/proxy_actions/merge_pos.rs +++ b/farm-staking/farm-staking-proxy/src/proxy_actions/merge_pos.rs @@ -22,7 +22,7 @@ pub trait ProxyMergePosModule: #[payable("*")] #[endpoint(mergeMetastakingWithStakingToken)] fn merge_metastaking_with_staking_token(&self) -> MergeResult { - let mut payments = self.call_value().all_esdt_transfers(); + let mut payments = self.call_value().all_esdt_transfers().clone_value(); require!( payments.len() >= 2, "Must send metastaking token and at least a staking token" diff --git a/farm-staking/farm-staking-proxy/wasm/Cargo.toml b/farm-staking/farm-staking-proxy/wasm/Cargo.toml index 199cb1c27..d9c188ee1 100644 --- a/farm-staking/farm-staking-proxy/wasm/Cargo.toml +++ b/farm-staking/farm-staking-proxy/wasm/Cargo.toml @@ -22,5 +22,5 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.39.4" +version = "=0.40.0" features = ["vm-validate-token-identifier"] diff --git a/farm-staking/farm-staking/Cargo.toml b/farm-staking/farm-staking/Cargo.toml index d4d155aee..aaac3b278 100644 --- a/farm-staking/farm-staking/Cargo.toml +++ b/farm-staking/farm-staking/Cargo.toml @@ -77,14 +77,14 @@ path = "../../common/common_structs" path = "../../common/common_errors" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.39.4" +version = "=0.40.0" [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.39.4" +version = "=0.40.0" diff --git a/farm-staking/farm-staking/meta/Cargo.toml b/farm-staking/farm-staking/meta/Cargo.toml index 5b9131e0c..835ca66ae 100644 --- a/farm-staking/farm-staking/meta/Cargo.toml +++ b/farm-staking/farm-staking/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.39.4" +version = "0.40.0" diff --git a/farm-staking/farm-staking/src/stake_farm.rs b/farm-staking/farm-staking/src/stake_farm.rs index a50dca4b8..8524a2b4f 100644 --- a/farm-staking/farm-staking/src/stake_farm.rs +++ b/farm-staking/farm-staking/src/stake_farm.rs @@ -46,7 +46,7 @@ pub trait StakeFarmModule: let staked_token_simulated_payment = EsdtTokenPayment::new(staked_token_id, 0, staked_token_amount); - let farm_tokens = self.call_value().all_esdt_transfers(); + let farm_tokens = self.call_value().all_esdt_transfers().clone_value(); let mut payments = ManagedVec::from_single_item(staked_token_simulated_payment); payments.append_vec(farm_tokens); diff --git a/farm-staking/farm-staking/wasm/Cargo.toml b/farm-staking/farm-staking/wasm/Cargo.toml index f8658d344..98e3de41c 100644 --- a/farm-staking/farm-staking/wasm/Cargo.toml +++ b/farm-staking/farm-staking/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.39.4" +version = "=0.40.0" diff --git a/farm-staking/metabonding-staking/Cargo.toml b/farm-staking/metabonding-staking/Cargo.toml index 8ad683d29..253fc8514 100644 --- a/farm-staking/metabonding-staking/Cargo.toml +++ b/farm-staking/metabonding-staking/Cargo.toml @@ -8,11 +8,11 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.39.4" +version = "=0.40.0" [dependencies.factory] path = "../../locked-asset/factory" @@ -21,7 +21,7 @@ path = "../../locked-asset/factory" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.39.4" +version = "=0.40.0" [dev-dependencies.common_structs] path = "../../common/common_structs" diff --git a/farm-staking/metabonding-staking/meta/Cargo.toml b/farm-staking/metabonding-staking/meta/Cargo.toml index 06c584a9d..a27642b9a 100644 --- a/farm-staking/metabonding-staking/meta/Cargo.toml +++ b/farm-staking/metabonding-staking/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.39.4" +version = "0.40.0" diff --git a/farm-staking/metabonding-staking/src/lib.rs b/farm-staking/metabonding-staking/src/lib.rs index 9b3387a78..416e8d409 100644 --- a/farm-staking/metabonding-staking/src/lib.rs +++ b/farm-staking/metabonding-staking/src/lib.rs @@ -29,7 +29,7 @@ pub trait MetabondingStaking: #[payable("*")] #[endpoint(stakeLockedAsset)] fn stake_locked_asset(&self) { - let payments = self.call_value().all_esdt_transfers(); + let payments = self.call_value().all_esdt_transfers().clone_value(); self.require_all_locked_asset_payments(&payments); let caller = self.blockchain().get_caller(); diff --git a/farm-staking/metabonding-staking/wasm/Cargo.toml b/farm-staking/metabonding-staking/wasm/Cargo.toml index b979245b8..906c0e566 100644 --- a/farm-staking/metabonding-staking/wasm/Cargo.toml +++ b/farm-staking/metabonding-staking/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.39.4" +version = "=0.40.0" diff --git a/locked-asset/Cargo.toml b/locked-asset/Cargo.toml index 4dd7afd2e..adca36943 100644 --- a/locked-asset/Cargo.toml +++ b/locked-asset/Cargo.toml @@ -4,7 +4,7 @@ version = "0.0.0" edition = "2021" publish = false [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.farm] @@ -49,7 +49,7 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-modules] -version = "=0.39.4" +version = "=0.40.0" [dev-dependencies.multiversx-sc-scenario] -version = "=0.39.4" +version = "=0.40.0" diff --git a/locked-asset/distribution/Cargo.toml b/locked-asset/distribution/Cargo.toml index 991eb324d..805000190 100644 --- a/locked-asset/distribution/Cargo.toml +++ b/locked-asset/distribution/Cargo.toml @@ -13,7 +13,7 @@ path = "../../common/common_structs" path = "../factory" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies.multiversx-sc-scenario] -version = "=0.39.4" +version = "=0.40.0" diff --git a/locked-asset/distribution/meta/Cargo.toml b/locked-asset/distribution/meta/Cargo.toml index e43a9e44c..7784251a5 100644 --- a/locked-asset/distribution/meta/Cargo.toml +++ b/locked-asset/distribution/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.39.4" +version = "0.40.0" diff --git a/locked-asset/distribution/wasm/Cargo.toml b/locked-asset/distribution/wasm/Cargo.toml index 616dccf1b..1aec0fabf 100644 --- a/locked-asset/distribution/wasm/Cargo.toml +++ b/locked-asset/distribution/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.39.4" +version = "=0.40.0" diff --git a/locked-asset/energy-factory/Cargo.toml b/locked-asset/energy-factory/Cargo.toml index cad9fd46f..15b13bf36 100644 --- a/locked-asset/energy-factory/Cargo.toml +++ b/locked-asset/energy-factory/Cargo.toml @@ -32,11 +32,11 @@ path = "../../common/traits/unwrappable" path = "../../common/modules/legacy_token_decode_module" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.39.4" +version = "=0.40.0" [dev-dependencies] num-bigint = "0.4.2" @@ -44,4 +44,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.39.4" +version = "=0.40.0" diff --git a/locked-asset/energy-factory/meta/Cargo.toml b/locked-asset/energy-factory/meta/Cargo.toml index 736f335ed..c12b5726a 100644 --- a/locked-asset/energy-factory/meta/Cargo.toml +++ b/locked-asset/energy-factory/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.39.4" +version = "0.40.0" diff --git a/locked-asset/energy-factory/wasm/Cargo.toml b/locked-asset/energy-factory/wasm/Cargo.toml index 9e5f2dbc6..e7b0082b5 100644 --- a/locked-asset/energy-factory/wasm/Cargo.toml +++ b/locked-asset/energy-factory/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.39.4" +version = "=0.40.0" diff --git a/locked-asset/factory/Cargo.toml b/locked-asset/factory/Cargo.toml index 80516a5b4..48100dda5 100644 --- a/locked-asset/factory/Cargo.toml +++ b/locked-asset/factory/Cargo.toml @@ -26,11 +26,11 @@ path = "../../common/modules/token_merge_helper" path = "../energy-factory" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.39.4" +version = "=0.40.0" [dependencies.arrayvec] version = "0.7.1" @@ -49,4 +49,4 @@ hex = "0.4" path = "../simple-lock" [dev-dependencies.multiversx-sc-scenario] -version = "=0.39.4" +version = "=0.40.0" diff --git a/locked-asset/factory/meta/Cargo.toml b/locked-asset/factory/meta/Cargo.toml index 56dcbd950..7483b7728 100644 --- a/locked-asset/factory/meta/Cargo.toml +++ b/locked-asset/factory/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.39.4" +version = "0.40.0" diff --git a/locked-asset/factory/src/lib.rs b/locked-asset/factory/src/lib.rs index 893f16624..d4e552905 100644 --- a/locked-asset/factory/src/lib.rs +++ b/locked-asset/factory/src/lib.rs @@ -334,7 +334,7 @@ pub trait LockedAssetFactory: token_ticker: ManagedBuffer, num_decimals: usize, ) { - let payment_amount = self.call_value().egld_value(); + let payment_amount = self.call_value().egld_value().clone_value(); self.locked_asset_token().issue_and_set_all_roles( EsdtTokenType::Meta, payment_amount, diff --git a/locked-asset/factory/wasm/Cargo.toml b/locked-asset/factory/wasm/Cargo.toml index e4b9b3780..b61583c71 100644 --- a/locked-asset/factory/wasm/Cargo.toml +++ b/locked-asset/factory/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.39.4" +version = "=0.40.0" diff --git a/locked-asset/lkmex-transfer/Cargo.toml b/locked-asset/lkmex-transfer/Cargo.toml index 8742e67e8..d39f7629e 100644 --- a/locked-asset/lkmex-transfer/Cargo.toml +++ b/locked-asset/lkmex-transfer/Cargo.toml @@ -15,6 +15,7 @@ path = "../../common/modules/utils" [dependencies.legacy_token_decode_module] path = "../../common/modules/legacy_token_decode_module" + [dependencies.permissions_module] path = "../../common/modules/permissions_module" @@ -28,14 +29,14 @@ path = "../energy-factory" path = "../../energy-integration/common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.39.4" +version = "=0.40.0" [dev-dependencies.multiversx-sc-modules] -version = "=0.39.4" +version = "=0.40.0" diff --git a/locked-asset/lkmex-transfer/meta/Cargo.toml b/locked-asset/lkmex-transfer/meta/Cargo.toml index 6572c05da..7198cfdfd 100644 --- a/locked-asset/lkmex-transfer/meta/Cargo.toml +++ b/locked-asset/lkmex-transfer/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.39.4" +version = "0.40.0" diff --git a/locked-asset/lkmex-transfer/src/lib.rs b/locked-asset/lkmex-transfer/src/lib.rs index 993eb4913..f716b55a3 100644 --- a/locked-asset/lkmex-transfer/src/lib.rs +++ b/locked-asset/lkmex-transfer/src/lib.rs @@ -122,7 +122,7 @@ pub trait LkmexTransfer: let sender_last_transfer_mapper = self.sender_last_transfer_epoch(&sender); self.check_address_on_cooldown(&sender_last_transfer_mapper); - let payments = self.call_value().all_esdt_transfers(); + let payments = self.call_value().all_esdt_transfers().clone_value(); let locked_token_id = self.locked_token_id().get(); for payment in payments.iter() { require!( diff --git a/locked-asset/lkmex-transfer/wasm/Cargo.toml b/locked-asset/lkmex-transfer/wasm/Cargo.toml index 7960ec1fc..ef033e2fb 100644 --- a/locked-asset/lkmex-transfer/wasm/Cargo.toml +++ b/locked-asset/lkmex-transfer/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.39.4" +version = "=0.40.0" diff --git a/locked-asset/locked-token-wrapper/Cargo.toml b/locked-asset/locked-token-wrapper/Cargo.toml index cf44d39d6..cbc3eebc2 100644 --- a/locked-asset/locked-token-wrapper/Cargo.toml +++ b/locked-asset/locked-token-wrapper/Cargo.toml @@ -8,10 +8,10 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" [dependencies.multiversx-sc-modules] -version = "=0.39.4" +version = "=0.40.0" [dependencies.utils] path = "../../common/modules/utils" @@ -43,4 +43,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.39.4" +version = "=0.40.0" diff --git a/locked-asset/locked-token-wrapper/meta/Cargo.toml b/locked-asset/locked-token-wrapper/meta/Cargo.toml index 669290a57..dfc90a35a 100644 --- a/locked-asset/locked-token-wrapper/meta/Cargo.toml +++ b/locked-asset/locked-token-wrapper/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.39.4" +version = "0.40.0" diff --git a/locked-asset/locked-token-wrapper/src/wrapped_token.rs b/locked-asset/locked-token-wrapper/src/wrapped_token.rs index d4ac823c8..ae3fce50a 100644 --- a/locked-asset/locked-token-wrapper/src/wrapped_token.rs +++ b/locked-asset/locked-token-wrapper/src/wrapped_token.rs @@ -24,7 +24,7 @@ pub trait WrappedTokenModule: token_ticker: ManagedBuffer, num_decimals: usize, ) { - let payment_amount = self.call_value().egld_value(); + let payment_amount = self.call_value().egld_value().clone_value(); self.wrapped_token().issue_and_set_all_roles( EsdtTokenType::Meta, diff --git a/locked-asset/locked-token-wrapper/wasm/Cargo.toml b/locked-asset/locked-token-wrapper/wasm/Cargo.toml index 5fb959317..3fb4e5b75 100644 --- a/locked-asset/locked-token-wrapper/wasm/Cargo.toml +++ b/locked-asset/locked-token-wrapper/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.39.4" +version = "=0.40.0" diff --git a/locked-asset/proxy_dex/Cargo.toml b/locked-asset/proxy_dex/Cargo.toml index 5d3be5054..18f8a3ed9 100644 --- a/locked-asset/proxy_dex/Cargo.toml +++ b/locked-asset/proxy_dex/Cargo.toml @@ -44,11 +44,11 @@ path = "../../common/traits/mergeable" path = "../../common/traits/fixed-supply-token" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.39.4" +version = "=0.40.0" [dependencies.energy-factory] path = "../energy-factory" @@ -65,7 +65,7 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.39.4" +version = "=0.40.0" [dev-dependencies.pausable] path = "../../common/modules/pausable" diff --git a/locked-asset/proxy_dex/meta/Cargo.toml b/locked-asset/proxy_dex/meta/Cargo.toml index bac44200f..90f1ff8e9 100644 --- a/locked-asset/proxy_dex/meta/Cargo.toml +++ b/locked-asset/proxy_dex/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.39.4" +version = "0.40.0" diff --git a/locked-asset/proxy_dex/src/lib.rs b/locked-asset/proxy_dex/src/lib.rs index 6dde5c483..e8ff52eec 100644 --- a/locked-asset/proxy_dex/src/lib.rs +++ b/locked-asset/proxy_dex/src/lib.rs @@ -66,7 +66,7 @@ pub trait ProxyDexImpl: token_ticker: ManagedBuffer, num_decimals: usize, ) { - let register_cost = self.call_value().egld_value(); + let register_cost = self.call_value().egld_value().clone_value(); self.wrapped_lp_token().issue_and_set_all_roles( EsdtTokenType::Meta, register_cost, @@ -101,7 +101,7 @@ pub trait ProxyDexImpl: token_ticker: ManagedBuffer, num_decimals: usize, ) { - let register_cost = self.call_value().egld_value(); + let register_cost = self.call_value().egld_value().clone_value(); self.wrapped_farm_token().issue_and_set_all_roles( EsdtTokenType::Meta, register_cost, diff --git a/locked-asset/proxy_dex/wasm/Cargo.toml b/locked-asset/proxy_dex/wasm/Cargo.toml index a2523c980..ba10a9e5d 100644 --- a/locked-asset/proxy_dex/wasm/Cargo.toml +++ b/locked-asset/proxy_dex/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.39.4" +version = "=0.40.0" diff --git a/locked-asset/simple-lock-whitelist/Cargo.toml b/locked-asset/simple-lock-whitelist/Cargo.toml index 75df4276f..f1ffbaac1 100644 --- a/locked-asset/simple-lock-whitelist/Cargo.toml +++ b/locked-asset/simple-lock-whitelist/Cargo.toml @@ -14,11 +14,11 @@ path = "../simple-lock" path = "../../common/modules/utils" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.39.4" +version = "=0.40.0" [dev-dependencies] num-bigint = "0.4.2" @@ -26,4 +26,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.39.4" +version = "=0.40.0" diff --git a/locked-asset/simple-lock-whitelist/meta/Cargo.toml b/locked-asset/simple-lock-whitelist/meta/Cargo.toml index a55865268..ed59d5578 100644 --- a/locked-asset/simple-lock-whitelist/meta/Cargo.toml +++ b/locked-asset/simple-lock-whitelist/meta/Cargo.toml @@ -8,4 +8,4 @@ authors = ["Dorin Iancu "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.39.4" +version = "0.40.0" diff --git a/locked-asset/simple-lock-whitelist/wasm/Cargo.toml b/locked-asset/simple-lock-whitelist/wasm/Cargo.toml index 97334c70b..76a333844 100644 --- a/locked-asset/simple-lock-whitelist/wasm/Cargo.toml +++ b/locked-asset/simple-lock-whitelist/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.39.4" +version = "=0.40.0" diff --git a/locked-asset/simple-lock/Cargo.toml b/locked-asset/simple-lock/Cargo.toml index 13a7614a3..b86d0091d 100644 --- a/locked-asset/simple-lock/Cargo.toml +++ b/locked-asset/simple-lock/Cargo.toml @@ -8,11 +8,11 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.39.4" +version = "=0.40.0" [dependencies.common_structs] path = "../../common/common_structs" @@ -23,4 +23,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.39.4" +version = "=0.40.0" diff --git a/locked-asset/simple-lock/meta/Cargo.toml b/locked-asset/simple-lock/meta/Cargo.toml index 72ac58b6f..2854c8196 100644 --- a/locked-asset/simple-lock/meta/Cargo.toml +++ b/locked-asset/simple-lock/meta/Cargo.toml @@ -8,4 +8,4 @@ authors = ["Dorin Iancu "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.39.4" +version = "0.40.0" diff --git a/locked-asset/simple-lock/src/locked_token.rs b/locked-asset/simple-lock/src/locked_token.rs index 700d81a25..dbb9c1a5d 100644 --- a/locked-asset/simple-lock/src/locked_token.rs +++ b/locked-asset/simple-lock/src/locked_token.rs @@ -62,7 +62,7 @@ pub trait LockedTokenModule: token_ticker: ManagedBuffer, num_decimals: usize, ) { - let payment_amount = self.call_value().egld_value(); + let payment_amount = self.call_value().egld_value().clone_value(); self.locked_token().issue_and_set_all_roles( EsdtTokenType::Meta, diff --git a/locked-asset/simple-lock/src/proxy_farm.rs b/locked-asset/simple-lock/src/proxy_farm.rs index 36692a51a..43ea8b6c8 100644 --- a/locked-asset/simple-lock/src/proxy_farm.rs +++ b/locked-asset/simple-lock/src/proxy_farm.rs @@ -44,7 +44,7 @@ pub trait ProxyFarmModule: token_ticker: ManagedBuffer, num_decimals: usize, ) { - let payment_amount = self.call_value().egld_value(); + let payment_amount = self.call_value().egld_value().clone_value(); self.farm_proxy_token().issue_and_set_all_roles( EsdtTokenType::Meta, @@ -117,7 +117,7 @@ pub trait ProxyFarmModule: farm_type: FarmType, ) -> EnterFarmThroughProxyResultType { let payments: ManagedVec> = - self.call_value().all_esdt_transfers(); + self.call_value().all_esdt_transfers().clone_value(); require!(!payments.is_empty(), NO_PAYMENT_ERR_MSG); let proxy_lp_payment: EsdtTokenPayment = payments.get(0); diff --git a/locked-asset/simple-lock/src/proxy_lp.rs b/locked-asset/simple-lock/src/proxy_lp.rs index ca7a36ba5..9d6e4e599 100644 --- a/locked-asset/simple-lock/src/proxy_lp.rs +++ b/locked-asset/simple-lock/src/proxy_lp.rs @@ -34,7 +34,7 @@ pub trait ProxyLpModule: token_ticker: ManagedBuffer, num_decimals: usize, ) { - let payment_amount = self.call_value().egld_value(); + let payment_amount = self.call_value().egld_value().clone_value(); self.lp_proxy_token().issue_and_set_all_roles( EsdtTokenType::Meta, diff --git a/locked-asset/simple-lock/wasm/Cargo.toml b/locked-asset/simple-lock/wasm/Cargo.toml index 7c877dafc..a3bbc9629 100644 --- a/locked-asset/simple-lock/wasm/Cargo.toml +++ b/locked-asset/simple-lock/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.39.4" +version = "=0.40.0" diff --git a/locked-asset/token-unstake/Cargo.toml b/locked-asset/token-unstake/Cargo.toml index 544b7221b..fbdfa52a3 100644 --- a/locked-asset/token-unstake/Cargo.toml +++ b/locked-asset/token-unstake/Cargo.toml @@ -8,7 +8,7 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.mergeable] @@ -38,7 +38,7 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.39.4" +version = "=0.40.0" [dev-dependencies.multiversx-sc-modules] -version = "=0.39.4" +version = "=0.40.0" diff --git a/locked-asset/token-unstake/meta/Cargo.toml b/locked-asset/token-unstake/meta/Cargo.toml index f82b14477..45ecf8834 100644 --- a/locked-asset/token-unstake/meta/Cargo.toml +++ b/locked-asset/token-unstake/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.39.4" +version = "0.40.0" diff --git a/locked-asset/token-unstake/wasm/Cargo.toml b/locked-asset/token-unstake/wasm/Cargo.toml index d27d882ac..661043d39 100644 --- a/locked-asset/token-unstake/wasm/Cargo.toml +++ b/locked-asset/token-unstake/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.39.4" +version = "=0.40.0" diff --git a/pause-all/Cargo.toml b/pause-all/Cargo.toml index 5165b7955..d6166ac49 100644 --- a/pause-all/Cargo.toml +++ b/pause-all/Cargo.toml @@ -11,13 +11,13 @@ path = "src/lib.rs" path = "../common/modules/pausable" [dependencies.multiversx-sc] -version = "=0.39.4" +version = "=0.40.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.39.4" +version = "=0.40.0" [dev-dependencies.multiversx-sc-scenario] -version = "=0.39.4" +version = "=0.40.0" [dev-dependencies.farm] path = "../dex/farm" diff --git a/pause-all/meta/Cargo.toml b/pause-all/meta/Cargo.toml index 0dafab7fb..4b3b35f59 100644 --- a/pause-all/meta/Cargo.toml +++ b/pause-all/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.39.4" +version = "0.40.0" diff --git a/pause-all/wasm/Cargo.toml b/pause-all/wasm/Cargo.toml index 4e14e45c4..05572907d 100644 --- a/pause-all/wasm/Cargo.toml +++ b/pause-all/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.39.4" +version = "=0.40.0" From 928b77374fc4b858a1b576c01447a5fb72048d05 Mon Sep 17 00:00:00 2001 From: Andrei Marinica Date: Fri, 25 Aug 2023 17:07:03 +0300 Subject: [PATCH 031/213] upgrade to framework version 0.41.0 --- common/common_errors/Cargo.toml | 2 +- common/common_structs/Cargo.toml | 2 +- common/modules/farm/config/Cargo.toml | 2 +- common/modules/farm/contexts/Cargo.toml | 4 ++-- common/modules/farm/events/Cargo.toml | 2 +- common/modules/farm/farm_base_impl/Cargo.toml | 6 +++--- common/modules/farm/farm_token/Cargo.toml | 4 ++-- common/modules/farm/farm_token_merge/Cargo.toml | 4 ++-- common/modules/farm/rewards/Cargo.toml | 4 ++-- common/modules/legacy_token_decode_module/Cargo.toml | 2 +- common/modules/locking_module/Cargo.toml | 2 +- common/modules/math/Cargo.toml | 2 +- common/modules/pausable/Cargo.toml | 2 +- common/modules/permissions_module/Cargo.toml | 2 +- common/modules/sc_whitelist_module/Cargo.toml | 2 +- common/modules/token_merge_helper/Cargo.toml | 2 +- common/modules/token_send/Cargo.toml | 2 +- common/modules/utils/Cargo.toml | 2 +- common/traits/fixed-supply-token/Cargo.toml | 2 +- common/traits/mergeable/Cargo.toml | 2 +- common/traits/unwrappable/Cargo.toml | 2 +- dex/Cargo.toml | 6 +++--- dex/farm-with-locked-rewards/Cargo.toml | 6 +++--- dex/farm-with-locked-rewards/meta/Cargo.toml | 2 +- dex/farm-with-locked-rewards/wasm/Cargo.toml | 2 +- dex/farm/Cargo.toml | 6 +++--- dex/farm/meta/Cargo.toml | 2 +- dex/farm/wasm/Cargo.toml | 2 +- dex/fuzz/Cargo.toml | 4 ++-- dex/governance/Cargo.toml | 4 ++-- dex/governance/meta/Cargo.toml | 2 +- dex/governance/wasm/Cargo.toml | 2 +- dex/pair-mock/Cargo.toml | 4 ++-- dex/pair-mock/meta/Cargo.toml | 2 +- dex/pair-mock/wasm/Cargo.toml | 2 +- dex/pair/Cargo.toml | 4 ++-- dex/pair/meta/Cargo.toml | 2 +- dex/pair/wasm-pair-full/Cargo.toml | 2 +- dex/pair/wasm-safe-price-view/Cargo.toml | 2 +- dex/pair/wasm/Cargo.toml | 2 +- dex/price-discovery/Cargo.toml | 6 +++--- dex/price-discovery/meta/Cargo.toml | 2 +- dex/price-discovery/wasm/Cargo.toml | 2 +- dex/proxy-deployer/Cargo.toml | 4 ++-- dex/proxy-deployer/meta/Cargo.toml | 2 +- dex/proxy-deployer/wasm/Cargo.toml | 2 +- dex/router/Cargo.toml | 4 ++-- dex/router/meta/Cargo.toml | 2 +- dex/router/wasm/Cargo.toml | 2 +- energy-integration/common-modules/energy-query/Cargo.toml | 2 +- .../common-modules/week-timekeeping/Cargo.toml | 2 +- .../common-modules/weekly-rewards-splitting/Cargo.toml | 2 +- energy-integration/common-types/Cargo.toml | 2 +- energy-integration/energy-factory-mock/Cargo.toml | 4 ++-- energy-integration/energy-factory-mock/meta/Cargo.toml | 2 +- energy-integration/energy-factory-mock/wasm/Cargo.toml | 2 +- energy-integration/energy-update/Cargo.toml | 6 +++--- energy-integration/energy-update/meta/Cargo.toml | 2 +- energy-integration/energy-update/wasm/Cargo.toml | 2 +- energy-integration/farm-boosted-yields/Cargo.toml | 2 +- energy-integration/fees-collector/Cargo.toml | 6 +++--- energy-integration/fees-collector/meta/Cargo.toml | 2 +- energy-integration/fees-collector/wasm/Cargo.toml | 2 +- energy-integration/governance-v2/Cargo.toml | 4 ++-- energy-integration/governance-v2/meta/Cargo.toml | 2 +- energy-integration/governance-v2/wasm/Cargo.toml | 2 +- farm-staking/farm-staking-proxy/Cargo.toml | 6 +++--- farm-staking/farm-staking-proxy/meta/Cargo.toml | 2 +- farm-staking/farm-staking-proxy/wasm/Cargo.toml | 2 +- farm-staking/farm-staking/Cargo.toml | 6 +++--- farm-staking/farm-staking/meta/Cargo.toml | 2 +- farm-staking/farm-staking/wasm/Cargo.toml | 2 +- farm-staking/metabonding-staking/Cargo.toml | 6 +++--- farm-staking/metabonding-staking/meta/Cargo.toml | 2 +- farm-staking/metabonding-staking/wasm/Cargo.toml | 2 +- locked-asset/Cargo.toml | 6 +++--- locked-asset/distribution/Cargo.toml | 4 ++-- locked-asset/distribution/meta/Cargo.toml | 2 +- locked-asset/distribution/wasm/Cargo.toml | 2 +- locked-asset/energy-factory/Cargo.toml | 6 +++--- locked-asset/energy-factory/meta/Cargo.toml | 2 +- locked-asset/energy-factory/wasm/Cargo.toml | 2 +- locked-asset/factory/Cargo.toml | 6 +++--- locked-asset/factory/meta/Cargo.toml | 2 +- locked-asset/factory/wasm/Cargo.toml | 2 +- locked-asset/lkmex-transfer/Cargo.toml | 6 +++--- locked-asset/lkmex-transfer/meta/Cargo.toml | 2 +- locked-asset/lkmex-transfer/wasm/Cargo.toml | 2 +- locked-asset/locked-token-wrapper/Cargo.toml | 6 +++--- locked-asset/locked-token-wrapper/meta/Cargo.toml | 2 +- locked-asset/locked-token-wrapper/wasm/Cargo.toml | 2 +- locked-asset/proxy_dex/Cargo.toml | 6 +++--- locked-asset/proxy_dex/meta/Cargo.toml | 2 +- locked-asset/proxy_dex/wasm/Cargo.toml | 2 +- locked-asset/simple-lock-whitelist/Cargo.toml | 6 +++--- locked-asset/simple-lock-whitelist/meta/Cargo.toml | 2 +- locked-asset/simple-lock-whitelist/wasm/Cargo.toml | 2 +- locked-asset/simple-lock/Cargo.toml | 6 +++--- locked-asset/simple-lock/meta/Cargo.toml | 2 +- locked-asset/simple-lock/wasm/Cargo.toml | 2 +- locked-asset/token-unstake/Cargo.toml | 6 +++--- locked-asset/token-unstake/meta/Cargo.toml | 2 +- locked-asset/token-unstake/wasm/Cargo.toml | 2 +- pause-all/Cargo.toml | 6 +++--- pause-all/meta/Cargo.toml | 2 +- pause-all/wasm/Cargo.toml | 2 +- 106 files changed, 159 insertions(+), 159 deletions(-) diff --git a/common/common_errors/Cargo.toml b/common/common_errors/Cargo.toml index bdc222367..11defd1d9 100644 --- a/common/common_errors/Cargo.toml +++ b/common/common_errors/Cargo.toml @@ -7,5 +7,5 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/common_structs/Cargo.toml b/common/common_structs/Cargo.toml index cff885fce..cccede402 100644 --- a/common/common_structs/Cargo.toml +++ b/common/common_structs/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.mergeable] diff --git a/common/modules/farm/config/Cargo.toml b/common/modules/farm/config/Cargo.toml index 91de3a378..0ef973338 100644 --- a/common/modules/farm/config/Cargo.toml +++ b/common/modules/farm/config/Cargo.toml @@ -22,5 +22,5 @@ path = "../../pausable" path = "../../permissions_module" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/farm/contexts/Cargo.toml b/common/modules/farm/contexts/Cargo.toml index 49f186fba..c8cb79f1b 100644 --- a/common/modules/farm/contexts/Cargo.toml +++ b/common/modules/farm/contexts/Cargo.toml @@ -34,8 +34,8 @@ path = "../../pausable" path = "../../permissions_module" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.40.0" +version = "=0.41.0" diff --git a/common/modules/farm/events/Cargo.toml b/common/modules/farm/events/Cargo.toml index 308590817..2fa7e3a84 100644 --- a/common/modules/farm/events/Cargo.toml +++ b/common/modules/farm/events/Cargo.toml @@ -13,5 +13,5 @@ path = "../../../common_structs" path = "../contexts" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/farm/farm_base_impl/Cargo.toml b/common/modules/farm/farm_base_impl/Cargo.toml index d06e9c14e..9c7f304d3 100644 --- a/common/modules/farm/farm_base_impl/Cargo.toml +++ b/common/modules/farm/farm_base_impl/Cargo.toml @@ -49,10 +49,10 @@ path = "../../../traits/mergeable" path = "../../../traits/fixed-supply-token" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.40.0" +version = "=0.41.0" [dev-dependencies.multiversx-sc-scenario] -version = "=0.40.0" +version = "=0.41.0" diff --git a/common/modules/farm/farm_token/Cargo.toml b/common/modules/farm/farm_token/Cargo.toml index 31babc159..c76da530c 100644 --- a/common/modules/farm/farm_token/Cargo.toml +++ b/common/modules/farm/farm_token/Cargo.toml @@ -25,8 +25,8 @@ path = "../../pausable" path = "../../permissions_module" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.40.0" +version = "=0.41.0" diff --git a/common/modules/farm/farm_token_merge/Cargo.toml b/common/modules/farm/farm_token_merge/Cargo.toml index aa54886c4..b791802db 100644 --- a/common/modules/farm/farm_token_merge/Cargo.toml +++ b/common/modules/farm/farm_token_merge/Cargo.toml @@ -22,8 +22,8 @@ path = "../../token_merge_helper" path = "../farm_token" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.40.0" +version = "=0.41.0" diff --git a/common/modules/farm/rewards/Cargo.toml b/common/modules/farm/rewards/Cargo.toml index 9f003a58d..47278eaaa 100644 --- a/common/modules/farm/rewards/Cargo.toml +++ b/common/modules/farm/rewards/Cargo.toml @@ -28,8 +28,8 @@ path = "../../pausable" path = "../../permissions_module" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.40.0" +version = "=0.41.0" diff --git a/common/modules/legacy_token_decode_module/Cargo.toml b/common/modules/legacy_token_decode_module/Cargo.toml index 83d0bf26d..d0a3c69f8 100644 --- a/common/modules/legacy_token_decode_module/Cargo.toml +++ b/common/modules/legacy_token_decode_module/Cargo.toml @@ -7,7 +7,7 @@ edition = "2018" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.common_structs] diff --git a/common/modules/locking_module/Cargo.toml b/common/modules/locking_module/Cargo.toml index 5be9a144e..5a0615f01 100644 --- a/common/modules/locking_module/Cargo.toml +++ b/common/modules/locking_module/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.simple-lock] diff --git a/common/modules/math/Cargo.toml b/common/modules/math/Cargo.toml index 29abbd7cf..656647975 100644 --- a/common/modules/math/Cargo.toml +++ b/common/modules/math/Cargo.toml @@ -7,5 +7,5 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/pausable/Cargo.toml b/common/modules/pausable/Cargo.toml index 3f5c8259c..4424c91d9 100644 --- a/common/modules/pausable/Cargo.toml +++ b/common/modules/pausable/Cargo.toml @@ -10,5 +10,5 @@ path = "src/pausable.rs" path = "../permissions_module" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/permissions_module/Cargo.toml b/common/modules/permissions_module/Cargo.toml index b46cf5c92..7d4b3d79b 100644 --- a/common/modules/permissions_module/Cargo.toml +++ b/common/modules/permissions_module/Cargo.toml @@ -14,5 +14,5 @@ bitflags = "1.3.2" path = "../../common_errors" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/sc_whitelist_module/Cargo.toml b/common/modules/sc_whitelist_module/Cargo.toml index 037cc7746..923e9bf7a 100644 --- a/common/modules/sc_whitelist_module/Cargo.toml +++ b/common/modules/sc_whitelist_module/Cargo.toml @@ -10,5 +10,5 @@ path = "src/sc_whitelist_module.rs" path = "../../common_errors" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/token_merge_helper/Cargo.toml b/common/modules/token_merge_helper/Cargo.toml index 37073efc3..85ef46b52 100644 --- a/common/modules/token_merge_helper/Cargo.toml +++ b/common/modules/token_merge_helper/Cargo.toml @@ -10,5 +10,5 @@ path = "src/lib.rs" path = "../../common_errors" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/token_send/Cargo.toml b/common/modules/token_send/Cargo.toml index 0f81a2d46..b765f1352 100644 --- a/common/modules/token_send/Cargo.toml +++ b/common/modules/token_send/Cargo.toml @@ -13,5 +13,5 @@ path = "../../common_structs" path = "../../common_errors" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/utils/Cargo.toml b/common/modules/utils/Cargo.toml index c36f1bc82..dadbeb561 100644 --- a/common/modules/utils/Cargo.toml +++ b/common/modules/utils/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.common_structs] diff --git a/common/traits/fixed-supply-token/Cargo.toml b/common/traits/fixed-supply-token/Cargo.toml index 81ee73396..1cdd1ce39 100644 --- a/common/traits/fixed-supply-token/Cargo.toml +++ b/common/traits/fixed-supply-token/Cargo.toml @@ -7,4 +7,4 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" diff --git a/common/traits/mergeable/Cargo.toml b/common/traits/mergeable/Cargo.toml index 68a549515..1c9430de7 100644 --- a/common/traits/mergeable/Cargo.toml +++ b/common/traits/mergeable/Cargo.toml @@ -7,5 +7,5 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/traits/unwrappable/Cargo.toml b/common/traits/unwrappable/Cargo.toml index 2d628ded7..b745d0e67 100644 --- a/common/traits/unwrappable/Cargo.toml +++ b/common/traits/unwrappable/Cargo.toml @@ -7,5 +7,5 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/dex/Cargo.toml b/dex/Cargo.toml index b78488475..e36131bd9 100644 --- a/dex/Cargo.toml +++ b/dex/Cargo.toml @@ -4,17 +4,17 @@ version = "0.0.0" edition = "2021" publish = false [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-modules] -version = "=0.40.0" +version = "=0.41.0" [dev-dependencies.multiversx-sc-scenario] -version = "=0.40.0" +version = "=0.41.0" [dev-dependencies.config] path = "../common/modules/farm/config" diff --git a/dex/farm-with-locked-rewards/Cargo.toml b/dex/farm-with-locked-rewards/Cargo.toml index 464b2fc85..71b2647b6 100644 --- a/dex/farm-with-locked-rewards/Cargo.toml +++ b/dex/farm-with-locked-rewards/Cargo.toml @@ -74,17 +74,17 @@ path = "../../locked-asset/energy-factory" path = "../../energy-integration/common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.40.0" +version = "=0.41.0" [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.40.0" +version = "=0.41.0" [dev-dependencies.simple-lock] path = "../../locked-asset/simple-lock" diff --git a/dex/farm-with-locked-rewards/meta/Cargo.toml b/dex/farm-with-locked-rewards/meta/Cargo.toml index ec1511ff7..46d2c3d3f 100644 --- a/dex/farm-with-locked-rewards/meta/Cargo.toml +++ b/dex/farm-with-locked-rewards/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.40.0" +version = "0.41.0" diff --git a/dex/farm-with-locked-rewards/wasm/Cargo.toml b/dex/farm-with-locked-rewards/wasm/Cargo.toml index 917e6e03b..ab0df013e 100644 --- a/dex/farm-with-locked-rewards/wasm/Cargo.toml +++ b/dex/farm-with-locked-rewards/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.40.0" +version = "=0.41.0" diff --git a/dex/farm/Cargo.toml b/dex/farm/Cargo.toml index 35906d5a9..5d119c8fe 100644 --- a/dex/farm/Cargo.toml +++ b/dex/farm/Cargo.toml @@ -68,11 +68,11 @@ path = "../../energy-integration/common-modules/weekly-rewards-splitting" path = "../../energy-integration/common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.40.0" +version = "=0.41.0" [dev-dependencies] num-bigint = "0.4.2" @@ -81,7 +81,7 @@ num-bigint = "0.4.2" path = "../../energy-integration/energy-update" [dev-dependencies.multiversx-sc-scenario] -version = "=0.40.0" +version = "=0.41.0" [dev-dependencies.energy-factory-mock] path = "../../energy-integration/energy-factory-mock" diff --git a/dex/farm/meta/Cargo.toml b/dex/farm/meta/Cargo.toml index 963df4cd2..1b158fa11 100644 --- a/dex/farm/meta/Cargo.toml +++ b/dex/farm/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.40.0" +version = "0.41.0" diff --git a/dex/farm/wasm/Cargo.toml b/dex/farm/wasm/Cargo.toml index c18417cc4..e043258ce 100644 --- a/dex/farm/wasm/Cargo.toml +++ b/dex/farm/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.40.0" +version = "=0.41.0" diff --git a/dex/fuzz/Cargo.toml b/dex/fuzz/Cargo.toml index 501f7d799..71278ce20 100644 --- a/dex/fuzz/Cargo.toml +++ b/dex/fuzz/Cargo.toml @@ -12,11 +12,11 @@ num-bigint = "0.4.2" rand = "0.8.4" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-scenario] -version = "=0.40.0" +version = "=0.41.0" [dependencies.pausable] path = "../../common/modules/pausable" diff --git a/dex/governance/Cargo.toml b/dex/governance/Cargo.toml index 6a2e01153..567d8b18e 100644 --- a/dex/governance/Cargo.toml +++ b/dex/governance/Cargo.toml @@ -8,14 +8,14 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.40.0" +version = "=0.41.0" [dev-dependencies.pair-mock] path = "../pair-mock" diff --git a/dex/governance/meta/Cargo.toml b/dex/governance/meta/Cargo.toml index 8ce801e04..280d962bb 100644 --- a/dex/governance/meta/Cargo.toml +++ b/dex/governance/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.40.0" +version = "0.41.0" diff --git a/dex/governance/wasm/Cargo.toml b/dex/governance/wasm/Cargo.toml index c5841d766..16090dbdc 100644 --- a/dex/governance/wasm/Cargo.toml +++ b/dex/governance/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.40.0" +version = "=0.41.0" diff --git a/dex/pair-mock/Cargo.toml b/dex/pair-mock/Cargo.toml index c58e13485..95229f91c 100644 --- a/dex/pair-mock/Cargo.toml +++ b/dex/pair-mock/Cargo.toml @@ -11,11 +11,11 @@ path = "src/pair.rs" path = "../../common/common_errors" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.itertools] version = "0.10.1" default-features = false [dev-dependencies.multiversx-sc-scenario] -version = "=0.40.0" +version = "=0.41.0" diff --git a/dex/pair-mock/meta/Cargo.toml b/dex/pair-mock/meta/Cargo.toml index 623b11a01..fcb82cfb9 100644 --- a/dex/pair-mock/meta/Cargo.toml +++ b/dex/pair-mock/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.40.0" +version = "0.41.0" diff --git a/dex/pair-mock/wasm/Cargo.toml b/dex/pair-mock/wasm/Cargo.toml index fbee18359..c0a0ee702 100644 --- a/dex/pair-mock/wasm/Cargo.toml +++ b/dex/pair-mock/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.40.0" +version = "=0.41.0" diff --git a/dex/pair/Cargo.toml b/dex/pair/Cargo.toml index 28bf69884..e8e5721aa 100644 --- a/dex/pair/Cargo.toml +++ b/dex/pair/Cargo.toml @@ -33,11 +33,11 @@ version = "0.10.1" default-features = false [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.40.0" +version = "=0.41.0" diff --git a/dex/pair/meta/Cargo.toml b/dex/pair/meta/Cargo.toml index 9bf1f1f3a..5c7086200 100644 --- a/dex/pair/meta/Cargo.toml +++ b/dex/pair/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.40.0" +version = "0.41.0" diff --git a/dex/pair/wasm-pair-full/Cargo.toml b/dex/pair/wasm-pair-full/Cargo.toml index bdbaa2c0e..078063580 100644 --- a/dex/pair/wasm-pair-full/Cargo.toml +++ b/dex/pair/wasm-pair-full/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.40.0" +version = "=0.41.0" diff --git a/dex/pair/wasm-safe-price-view/Cargo.toml b/dex/pair/wasm-safe-price-view/Cargo.toml index 7154becef..6f945e5ad 100644 --- a/dex/pair/wasm-safe-price-view/Cargo.toml +++ b/dex/pair/wasm-safe-price-view/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.40.0" +version = "=0.41.0" diff --git a/dex/pair/wasm/Cargo.toml b/dex/pair/wasm/Cargo.toml index 7faee9288..3752c727c 100644 --- a/dex/pair/wasm/Cargo.toml +++ b/dex/pair/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.40.0" +version = "=0.41.0" diff --git a/dex/price-discovery/Cargo.toml b/dex/price-discovery/Cargo.toml index 172709172..fa03a7b15 100644 --- a/dex/price-discovery/Cargo.toml +++ b/dex/price-discovery/Cargo.toml @@ -12,11 +12,11 @@ path = "src/lib.rs" hex-literal = "0.3.1" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.40.0" +version = "=0.41.0" [dependencies.locking_module] path = "../../common/modules/locking_module" @@ -30,4 +30,4 @@ hex = "0.4" path = "../../locked-asset/simple-lock" [dev-dependencies.multiversx-sc-scenario] -version = "=0.40.0" +version = "=0.41.0" diff --git a/dex/price-discovery/meta/Cargo.toml b/dex/price-discovery/meta/Cargo.toml index f8ce3fdab..c9abf0455 100644 --- a/dex/price-discovery/meta/Cargo.toml +++ b/dex/price-discovery/meta/Cargo.toml @@ -8,4 +8,4 @@ authors = ["Dorin Iancu "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.40.0" +version = "0.41.0" diff --git a/dex/price-discovery/wasm/Cargo.toml b/dex/price-discovery/wasm/Cargo.toml index a771c6db6..b9febeed9 100644 --- a/dex/price-discovery/wasm/Cargo.toml +++ b/dex/price-discovery/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.40.0" +version = "=0.41.0" diff --git a/dex/proxy-deployer/Cargo.toml b/dex/proxy-deployer/Cargo.toml index b56e2830e..2074d9bdd 100644 --- a/dex/proxy-deployer/Cargo.toml +++ b/dex/proxy-deployer/Cargo.toml @@ -20,11 +20,11 @@ path = "../../common/modules/farm/config" path = "../../common/modules/farm/farm_token" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.40.0" +version = "=0.41.0" diff --git a/dex/proxy-deployer/meta/Cargo.toml b/dex/proxy-deployer/meta/Cargo.toml index 3c1d9eb40..3ee1590b9 100644 --- a/dex/proxy-deployer/meta/Cargo.toml +++ b/dex/proxy-deployer/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.40.0" +version = "0.41.0" diff --git a/dex/proxy-deployer/wasm/Cargo.toml b/dex/proxy-deployer/wasm/Cargo.toml index 5c27f6b07..4f61b8c73 100644 --- a/dex/proxy-deployer/wasm/Cargo.toml +++ b/dex/proxy-deployer/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.40.0" +version = "=0.41.0" diff --git a/dex/router/Cargo.toml b/dex/router/Cargo.toml index 0c4bf33b0..b23370a09 100644 --- a/dex/router/Cargo.toml +++ b/dex/router/Cargo.toml @@ -14,7 +14,7 @@ path = "../../common/modules/token_send" path = "../../common/modules/pausable" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.pair] @@ -26,4 +26,4 @@ path = "../../common/modules/locking_module" [dependencies.simple-lock] path = "../../locked-asset/simple-lock" [dev-dependencies.multiversx-sc-scenario] -version = "=0.40.0" +version = "=0.41.0" diff --git a/dex/router/meta/Cargo.toml b/dex/router/meta/Cargo.toml index 02b87ec1e..2df7a1a67 100644 --- a/dex/router/meta/Cargo.toml +++ b/dex/router/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.40.0" +version = "0.41.0" diff --git a/dex/router/wasm/Cargo.toml b/dex/router/wasm/Cargo.toml index 91396f80e..5f4c95d70 100644 --- a/dex/router/wasm/Cargo.toml +++ b/dex/router/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.40.0" +version = "=0.41.0" diff --git a/energy-integration/common-modules/energy-query/Cargo.toml b/energy-integration/common-modules/energy-query/Cargo.toml index be4cd4ea9..f82a69e26 100644 --- a/energy-integration/common-modules/energy-query/Cargo.toml +++ b/energy-integration/common-modules/energy-query/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.energy-factory] diff --git a/energy-integration/common-modules/week-timekeeping/Cargo.toml b/energy-integration/common-modules/week-timekeeping/Cargo.toml index 590353094..c40233221 100644 --- a/energy-integration/common-modules/week-timekeeping/Cargo.toml +++ b/energy-integration/common-modules/week-timekeeping/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.common-types] diff --git a/energy-integration/common-modules/weekly-rewards-splitting/Cargo.toml b/energy-integration/common-modules/weekly-rewards-splitting/Cargo.toml index cd144a625..8969827f5 100644 --- a/energy-integration/common-modules/weekly-rewards-splitting/Cargo.toml +++ b/energy-integration/common-modules/weekly-rewards-splitting/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.energy-query] diff --git a/energy-integration/common-types/Cargo.toml b/energy-integration/common-types/Cargo.toml index 0be3be9d7..9f3258892 100644 --- a/energy-integration/common-types/Cargo.toml +++ b/energy-integration/common-types/Cargo.toml @@ -7,5 +7,5 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/energy-integration/energy-factory-mock/Cargo.toml b/energy-integration/energy-factory-mock/Cargo.toml index 10e878081..7a3f7728f 100644 --- a/energy-integration/energy-factory-mock/Cargo.toml +++ b/energy-integration/energy-factory-mock/Cargo.toml @@ -11,7 +11,7 @@ path = "src/lib.rs" path = "../common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies.multiversx-sc-scenario] -version = "=0.40.0" +version = "=0.41.0" diff --git a/energy-integration/energy-factory-mock/meta/Cargo.toml b/energy-integration/energy-factory-mock/meta/Cargo.toml index b56977a01..74848b0df 100644 --- a/energy-integration/energy-factory-mock/meta/Cargo.toml +++ b/energy-integration/energy-factory-mock/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.40.0" +version = "0.41.0" diff --git a/energy-integration/energy-factory-mock/wasm/Cargo.toml b/energy-integration/energy-factory-mock/wasm/Cargo.toml index 6bea8b4a1..99c907c59 100644 --- a/energy-integration/energy-factory-mock/wasm/Cargo.toml +++ b/energy-integration/energy-factory-mock/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.40.0" +version = "=0.41.0" diff --git a/energy-integration/energy-update/Cargo.toml b/energy-integration/energy-update/Cargo.toml index fe655051c..53af90b10 100644 --- a/energy-integration/energy-update/Cargo.toml +++ b/energy-integration/energy-update/Cargo.toml @@ -8,11 +8,11 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.40.0" +version = "=0.41.0" [dependencies.farm] path = "../../dex/farm" @@ -24,4 +24,4 @@ path = "../common-modules/weekly-rewards-splitting" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.40.0" +version = "=0.41.0" diff --git a/energy-integration/energy-update/meta/Cargo.toml b/energy-integration/energy-update/meta/Cargo.toml index f095ce203..4b238d65d 100644 --- a/energy-integration/energy-update/meta/Cargo.toml +++ b/energy-integration/energy-update/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.40.0" +version = "0.41.0" diff --git a/energy-integration/energy-update/wasm/Cargo.toml b/energy-integration/energy-update/wasm/Cargo.toml index 9634dd90e..df1055bb7 100644 --- a/energy-integration/energy-update/wasm/Cargo.toml +++ b/energy-integration/energy-update/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.40.0" +version = "=0.41.0" diff --git a/energy-integration/farm-boosted-yields/Cargo.toml b/energy-integration/farm-boosted-yields/Cargo.toml index a71ef8b6f..a093421b9 100644 --- a/energy-integration/farm-boosted-yields/Cargo.toml +++ b/energy-integration/farm-boosted-yields/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.config] diff --git a/energy-integration/fees-collector/Cargo.toml b/energy-integration/fees-collector/Cargo.toml index 43b0f7cba..4252cad97 100644 --- a/energy-integration/fees-collector/Cargo.toml +++ b/energy-integration/fees-collector/Cargo.toml @@ -8,11 +8,11 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.40.0" +version = "=0.41.0" [dependencies.energy-query] path = "../common-modules/energy-query" @@ -48,7 +48,7 @@ path = "../../common/common_errors" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.40.0" +version = "=0.41.0" [dev-dependencies.sc_whitelist_module] path = "../../common/modules/sc_whitelist_module" diff --git a/energy-integration/fees-collector/meta/Cargo.toml b/energy-integration/fees-collector/meta/Cargo.toml index 26c79443e..0f44601f2 100644 --- a/energy-integration/fees-collector/meta/Cargo.toml +++ b/energy-integration/fees-collector/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.40.0" +version = "0.41.0" diff --git a/energy-integration/fees-collector/wasm/Cargo.toml b/energy-integration/fees-collector/wasm/Cargo.toml index 232074e58..7382de0f1 100644 --- a/energy-integration/fees-collector/wasm/Cargo.toml +++ b/energy-integration/fees-collector/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.40.0" +version = "=0.41.0" diff --git a/energy-integration/governance-v2/Cargo.toml b/energy-integration/governance-v2/Cargo.toml index e82f11542..23a054917 100644 --- a/energy-integration/governance-v2/Cargo.toml +++ b/energy-integration/governance-v2/Cargo.toml @@ -11,7 +11,7 @@ path = "src/lib.rs" path = "../common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.permissions_module] @@ -27,7 +27,7 @@ path = "../common-modules/weekly-rewards-splitting" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.40.0" +version = "=0.41.0" [dev-dependencies.energy-factory-mock] path = "../energy-factory-mock" diff --git a/energy-integration/governance-v2/meta/Cargo.toml b/energy-integration/governance-v2/meta/Cargo.toml index 8c50d731b..1b3a3d68b 100644 --- a/energy-integration/governance-v2/meta/Cargo.toml +++ b/energy-integration/governance-v2/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.40.0" +version = "0.41.0" diff --git a/energy-integration/governance-v2/wasm/Cargo.toml b/energy-integration/governance-v2/wasm/Cargo.toml index 78fda0c4a..34f7bde21 100644 --- a/energy-integration/governance-v2/wasm/Cargo.toml +++ b/energy-integration/governance-v2/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.40.0" +version = "=0.41.0" diff --git a/farm-staking/farm-staking-proxy/Cargo.toml b/farm-staking/farm-staking-proxy/Cargo.toml index 3060277f7..d2596d68e 100644 --- a/farm-staking/farm-staking-proxy/Cargo.toml +++ b/farm-staking/farm-staking-proxy/Cargo.toml @@ -12,11 +12,11 @@ path = "src/lib.rs" hex-literal = "0.3.1" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.40.0" +version = "=0.41.0" [dependencies.farm] path = "../../dex/farm" @@ -61,7 +61,7 @@ path = "../../common/modules/sc_whitelist_module" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.40.0" +version = "=0.41.0" [dev-dependencies.farm_token] path = "../../common/modules/farm/farm_token" diff --git a/farm-staking/farm-staking-proxy/meta/Cargo.toml b/farm-staking/farm-staking-proxy/meta/Cargo.toml index 2f50a4dbb..ae7ccede3 100644 --- a/farm-staking/farm-staking-proxy/meta/Cargo.toml +++ b/farm-staking/farm-staking-proxy/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.40.0" +version = "0.41.0" diff --git a/farm-staking/farm-staking-proxy/wasm/Cargo.toml b/farm-staking/farm-staking-proxy/wasm/Cargo.toml index d9c188ee1..72cad6257 100644 --- a/farm-staking/farm-staking-proxy/wasm/Cargo.toml +++ b/farm-staking/farm-staking-proxy/wasm/Cargo.toml @@ -22,5 +22,5 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.40.0" +version = "=0.41.0" features = ["vm-validate-token-identifier"] diff --git a/farm-staking/farm-staking/Cargo.toml b/farm-staking/farm-staking/Cargo.toml index aaac3b278..8755cfddd 100644 --- a/farm-staking/farm-staking/Cargo.toml +++ b/farm-staking/farm-staking/Cargo.toml @@ -77,14 +77,14 @@ path = "../../common/common_structs" path = "../../common/common_errors" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.40.0" +version = "=0.41.0" [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.40.0" +version = "=0.41.0" diff --git a/farm-staking/farm-staking/meta/Cargo.toml b/farm-staking/farm-staking/meta/Cargo.toml index 835ca66ae..9a9bb3c61 100644 --- a/farm-staking/farm-staking/meta/Cargo.toml +++ b/farm-staking/farm-staking/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.40.0" +version = "0.41.0" diff --git a/farm-staking/farm-staking/wasm/Cargo.toml b/farm-staking/farm-staking/wasm/Cargo.toml index 98e3de41c..43aa71f48 100644 --- a/farm-staking/farm-staking/wasm/Cargo.toml +++ b/farm-staking/farm-staking/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.40.0" +version = "=0.41.0" diff --git a/farm-staking/metabonding-staking/Cargo.toml b/farm-staking/metabonding-staking/Cargo.toml index 253fc8514..b7bb52cee 100644 --- a/farm-staking/metabonding-staking/Cargo.toml +++ b/farm-staking/metabonding-staking/Cargo.toml @@ -8,11 +8,11 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.40.0" +version = "=0.41.0" [dependencies.factory] path = "../../locked-asset/factory" @@ -21,7 +21,7 @@ path = "../../locked-asset/factory" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.40.0" +version = "=0.41.0" [dev-dependencies.common_structs] path = "../../common/common_structs" diff --git a/farm-staking/metabonding-staking/meta/Cargo.toml b/farm-staking/metabonding-staking/meta/Cargo.toml index a27642b9a..9848cd72d 100644 --- a/farm-staking/metabonding-staking/meta/Cargo.toml +++ b/farm-staking/metabonding-staking/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.40.0" +version = "0.41.0" diff --git a/farm-staking/metabonding-staking/wasm/Cargo.toml b/farm-staking/metabonding-staking/wasm/Cargo.toml index 906c0e566..1fae8b4c0 100644 --- a/farm-staking/metabonding-staking/wasm/Cargo.toml +++ b/farm-staking/metabonding-staking/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.40.0" +version = "=0.41.0" diff --git a/locked-asset/Cargo.toml b/locked-asset/Cargo.toml index adca36943..a11a0fa62 100644 --- a/locked-asset/Cargo.toml +++ b/locked-asset/Cargo.toml @@ -4,7 +4,7 @@ version = "0.0.0" edition = "2021" publish = false [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.farm] @@ -49,7 +49,7 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-modules] -version = "=0.40.0" +version = "=0.41.0" [dev-dependencies.multiversx-sc-scenario] -version = "=0.40.0" +version = "=0.41.0" diff --git a/locked-asset/distribution/Cargo.toml b/locked-asset/distribution/Cargo.toml index 805000190..1f202ec0e 100644 --- a/locked-asset/distribution/Cargo.toml +++ b/locked-asset/distribution/Cargo.toml @@ -13,7 +13,7 @@ path = "../../common/common_structs" path = "../factory" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies.multiversx-sc-scenario] -version = "=0.40.0" +version = "=0.41.0" diff --git a/locked-asset/distribution/meta/Cargo.toml b/locked-asset/distribution/meta/Cargo.toml index 7784251a5..a072c5736 100644 --- a/locked-asset/distribution/meta/Cargo.toml +++ b/locked-asset/distribution/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.40.0" +version = "0.41.0" diff --git a/locked-asset/distribution/wasm/Cargo.toml b/locked-asset/distribution/wasm/Cargo.toml index 1aec0fabf..6acbac2c9 100644 --- a/locked-asset/distribution/wasm/Cargo.toml +++ b/locked-asset/distribution/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.40.0" +version = "=0.41.0" diff --git a/locked-asset/energy-factory/Cargo.toml b/locked-asset/energy-factory/Cargo.toml index 15b13bf36..46de9581c 100644 --- a/locked-asset/energy-factory/Cargo.toml +++ b/locked-asset/energy-factory/Cargo.toml @@ -32,11 +32,11 @@ path = "../../common/traits/unwrappable" path = "../../common/modules/legacy_token_decode_module" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.40.0" +version = "=0.41.0" [dev-dependencies] num-bigint = "0.4.2" @@ -44,4 +44,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.40.0" +version = "=0.41.0" diff --git a/locked-asset/energy-factory/meta/Cargo.toml b/locked-asset/energy-factory/meta/Cargo.toml index c12b5726a..50c0431a1 100644 --- a/locked-asset/energy-factory/meta/Cargo.toml +++ b/locked-asset/energy-factory/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.40.0" +version = "0.41.0" diff --git a/locked-asset/energy-factory/wasm/Cargo.toml b/locked-asset/energy-factory/wasm/Cargo.toml index e7b0082b5..a35ae1bac 100644 --- a/locked-asset/energy-factory/wasm/Cargo.toml +++ b/locked-asset/energy-factory/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.40.0" +version = "=0.41.0" diff --git a/locked-asset/factory/Cargo.toml b/locked-asset/factory/Cargo.toml index 48100dda5..764235d05 100644 --- a/locked-asset/factory/Cargo.toml +++ b/locked-asset/factory/Cargo.toml @@ -26,11 +26,11 @@ path = "../../common/modules/token_merge_helper" path = "../energy-factory" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.40.0" +version = "=0.41.0" [dependencies.arrayvec] version = "0.7.1" @@ -49,4 +49,4 @@ hex = "0.4" path = "../simple-lock" [dev-dependencies.multiversx-sc-scenario] -version = "=0.40.0" +version = "=0.41.0" diff --git a/locked-asset/factory/meta/Cargo.toml b/locked-asset/factory/meta/Cargo.toml index 7483b7728..008ea69d4 100644 --- a/locked-asset/factory/meta/Cargo.toml +++ b/locked-asset/factory/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.40.0" +version = "0.41.0" diff --git a/locked-asset/factory/wasm/Cargo.toml b/locked-asset/factory/wasm/Cargo.toml index b61583c71..2fe668562 100644 --- a/locked-asset/factory/wasm/Cargo.toml +++ b/locked-asset/factory/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.40.0" +version = "=0.41.0" diff --git a/locked-asset/lkmex-transfer/Cargo.toml b/locked-asset/lkmex-transfer/Cargo.toml index d39f7629e..e16312493 100644 --- a/locked-asset/lkmex-transfer/Cargo.toml +++ b/locked-asset/lkmex-transfer/Cargo.toml @@ -29,14 +29,14 @@ path = "../energy-factory" path = "../../energy-integration/common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.40.0" +version = "=0.41.0" [dev-dependencies.multiversx-sc-modules] -version = "=0.40.0" +version = "=0.41.0" diff --git a/locked-asset/lkmex-transfer/meta/Cargo.toml b/locked-asset/lkmex-transfer/meta/Cargo.toml index 7198cfdfd..72173b3a0 100644 --- a/locked-asset/lkmex-transfer/meta/Cargo.toml +++ b/locked-asset/lkmex-transfer/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.40.0" +version = "0.41.0" diff --git a/locked-asset/lkmex-transfer/wasm/Cargo.toml b/locked-asset/lkmex-transfer/wasm/Cargo.toml index ef033e2fb..716705c35 100644 --- a/locked-asset/lkmex-transfer/wasm/Cargo.toml +++ b/locked-asset/lkmex-transfer/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.40.0" +version = "=0.41.0" diff --git a/locked-asset/locked-token-wrapper/Cargo.toml b/locked-asset/locked-token-wrapper/Cargo.toml index cbc3eebc2..b1e7a4a15 100644 --- a/locked-asset/locked-token-wrapper/Cargo.toml +++ b/locked-asset/locked-token-wrapper/Cargo.toml @@ -8,10 +8,10 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" [dependencies.multiversx-sc-modules] -version = "=0.40.0" +version = "=0.41.0" [dependencies.utils] path = "../../common/modules/utils" @@ -43,4 +43,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.40.0" +version = "=0.41.0" diff --git a/locked-asset/locked-token-wrapper/meta/Cargo.toml b/locked-asset/locked-token-wrapper/meta/Cargo.toml index dfc90a35a..39e80ce0f 100644 --- a/locked-asset/locked-token-wrapper/meta/Cargo.toml +++ b/locked-asset/locked-token-wrapper/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.40.0" +version = "0.41.0" diff --git a/locked-asset/locked-token-wrapper/wasm/Cargo.toml b/locked-asset/locked-token-wrapper/wasm/Cargo.toml index 3fb4e5b75..6dd616302 100644 --- a/locked-asset/locked-token-wrapper/wasm/Cargo.toml +++ b/locked-asset/locked-token-wrapper/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.40.0" +version = "=0.41.0" diff --git a/locked-asset/proxy_dex/Cargo.toml b/locked-asset/proxy_dex/Cargo.toml index 18f8a3ed9..14361f041 100644 --- a/locked-asset/proxy_dex/Cargo.toml +++ b/locked-asset/proxy_dex/Cargo.toml @@ -44,11 +44,11 @@ path = "../../common/traits/mergeable" path = "../../common/traits/fixed-supply-token" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.40.0" +version = "=0.41.0" [dependencies.energy-factory] path = "../energy-factory" @@ -65,7 +65,7 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.40.0" +version = "=0.41.0" [dev-dependencies.pausable] path = "../../common/modules/pausable" diff --git a/locked-asset/proxy_dex/meta/Cargo.toml b/locked-asset/proxy_dex/meta/Cargo.toml index 90f1ff8e9..6b835d751 100644 --- a/locked-asset/proxy_dex/meta/Cargo.toml +++ b/locked-asset/proxy_dex/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.40.0" +version = "0.41.0" diff --git a/locked-asset/proxy_dex/wasm/Cargo.toml b/locked-asset/proxy_dex/wasm/Cargo.toml index ba10a9e5d..a36693d1b 100644 --- a/locked-asset/proxy_dex/wasm/Cargo.toml +++ b/locked-asset/proxy_dex/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.40.0" +version = "=0.41.0" diff --git a/locked-asset/simple-lock-whitelist/Cargo.toml b/locked-asset/simple-lock-whitelist/Cargo.toml index f1ffbaac1..5e32fc766 100644 --- a/locked-asset/simple-lock-whitelist/Cargo.toml +++ b/locked-asset/simple-lock-whitelist/Cargo.toml @@ -14,11 +14,11 @@ path = "../simple-lock" path = "../../common/modules/utils" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.40.0" +version = "=0.41.0" [dev-dependencies] num-bigint = "0.4.2" @@ -26,4 +26,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.40.0" +version = "=0.41.0" diff --git a/locked-asset/simple-lock-whitelist/meta/Cargo.toml b/locked-asset/simple-lock-whitelist/meta/Cargo.toml index ed59d5578..8313a3a25 100644 --- a/locked-asset/simple-lock-whitelist/meta/Cargo.toml +++ b/locked-asset/simple-lock-whitelist/meta/Cargo.toml @@ -8,4 +8,4 @@ authors = ["Dorin Iancu "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.40.0" +version = "0.41.0" diff --git a/locked-asset/simple-lock-whitelist/wasm/Cargo.toml b/locked-asset/simple-lock-whitelist/wasm/Cargo.toml index 76a333844..c40b42eea 100644 --- a/locked-asset/simple-lock-whitelist/wasm/Cargo.toml +++ b/locked-asset/simple-lock-whitelist/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.40.0" +version = "=0.41.0" diff --git a/locked-asset/simple-lock/Cargo.toml b/locked-asset/simple-lock/Cargo.toml index b86d0091d..e001ab642 100644 --- a/locked-asset/simple-lock/Cargo.toml +++ b/locked-asset/simple-lock/Cargo.toml @@ -8,11 +8,11 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.40.0" +version = "=0.41.0" [dependencies.common_structs] path = "../../common/common_structs" @@ -23,4 +23,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.40.0" +version = "=0.41.0" diff --git a/locked-asset/simple-lock/meta/Cargo.toml b/locked-asset/simple-lock/meta/Cargo.toml index 2854c8196..567b68d62 100644 --- a/locked-asset/simple-lock/meta/Cargo.toml +++ b/locked-asset/simple-lock/meta/Cargo.toml @@ -8,4 +8,4 @@ authors = ["Dorin Iancu "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.40.0" +version = "0.41.0" diff --git a/locked-asset/simple-lock/wasm/Cargo.toml b/locked-asset/simple-lock/wasm/Cargo.toml index a3bbc9629..cc638384f 100644 --- a/locked-asset/simple-lock/wasm/Cargo.toml +++ b/locked-asset/simple-lock/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.40.0" +version = "=0.41.0" diff --git a/locked-asset/token-unstake/Cargo.toml b/locked-asset/token-unstake/Cargo.toml index fbdfa52a3..a81cdc500 100644 --- a/locked-asset/token-unstake/Cargo.toml +++ b/locked-asset/token-unstake/Cargo.toml @@ -8,7 +8,7 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.mergeable] @@ -38,7 +38,7 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.40.0" +version = "=0.41.0" [dev-dependencies.multiversx-sc-modules] -version = "=0.40.0" +version = "=0.41.0" diff --git a/locked-asset/token-unstake/meta/Cargo.toml b/locked-asset/token-unstake/meta/Cargo.toml index 45ecf8834..81b241482 100644 --- a/locked-asset/token-unstake/meta/Cargo.toml +++ b/locked-asset/token-unstake/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.40.0" +version = "0.41.0" diff --git a/locked-asset/token-unstake/wasm/Cargo.toml b/locked-asset/token-unstake/wasm/Cargo.toml index 661043d39..2991c44a3 100644 --- a/locked-asset/token-unstake/wasm/Cargo.toml +++ b/locked-asset/token-unstake/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.40.0" +version = "=0.41.0" diff --git a/pause-all/Cargo.toml b/pause-all/Cargo.toml index d6166ac49..c99ec1a7f 100644 --- a/pause-all/Cargo.toml +++ b/pause-all/Cargo.toml @@ -11,13 +11,13 @@ path = "src/lib.rs" path = "../common/modules/pausable" [dependencies.multiversx-sc] -version = "=0.40.0" +version = "=0.41.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.40.0" +version = "=0.41.0" [dev-dependencies.multiversx-sc-scenario] -version = "=0.40.0" +version = "=0.41.0" [dev-dependencies.farm] path = "../dex/farm" diff --git a/pause-all/meta/Cargo.toml b/pause-all/meta/Cargo.toml index 4b3b35f59..9a477b7b0 100644 --- a/pause-all/meta/Cargo.toml +++ b/pause-all/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.40.0" +version = "0.41.0" diff --git a/pause-all/wasm/Cargo.toml b/pause-all/wasm/Cargo.toml index 05572907d..09882a081 100644 --- a/pause-all/wasm/Cargo.toml +++ b/pause-all/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.40.0" +version = "=0.41.0" From d123b6bdcce1dddbd452635d955552564879f855 Mon Sep 17 00:00:00 2001 From: Andrei Marinica Date: Fri, 25 Aug 2023 17:52:20 +0300 Subject: [PATCH 032/213] github actions update --- .github/workflows/actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index edce63ab7..3404f739e 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -20,7 +20,7 @@ permissions: jobs: contracts: name: Contracts - uses: multiversx/mx-sc-actions/.github/workflows/contracts.yml@v2 + uses: multiversx/mx-sc-actions/.github/workflows/contracts.yml@v2.3.0 with: rust-toolchain: nightly-2023-04-23 vmtools-version: v1.4.60 From 34e264f641fc5d9ac3b62fd8ca68135e934415bd Mon Sep 17 00:00:00 2001 From: ovidiuolteanu Date: Fri, 25 Aug 2023 18:18:55 +0300 Subject: [PATCH 033/213] rustc compatibility fixes --- .github/workflows/actions.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index edce63ab7..c5fdba201 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -20,9 +20,9 @@ permissions: jobs: contracts: name: Contracts - uses: multiversx/mx-sc-actions/.github/workflows/contracts.yml@v2 + uses: multiversx/mx-sc-actions/.github/workflows/contracts.yml@v2.3.1 with: - rust-toolchain: nightly-2023-04-23 + rust-toolchain: nightly-2023-05-26 vmtools-version: v1.4.60 secrets: token: ${{ secrets.GITHUB_TOKEN }} From a41d0fa52fa7de4481e01a209015917edff9fd26 Mon Sep 17 00:00:00 2001 From: Andrei Marinica Date: Fri, 25 Aug 2023 20:03:44 +0300 Subject: [PATCH 034/213] upgrade to framework version 0.42.0 --- common/common_errors/Cargo.toml | 2 +- common/common_structs/Cargo.toml | 2 +- common/modules/farm/config/Cargo.toml | 2 +- common/modules/farm/contexts/Cargo.toml | 4 +- .../contexts/src/claim_rewards_context.rs | 1 + .../farm/contexts/src/exit_farm_context.rs | 1 + common/modules/farm/events/Cargo.toml | 2 +- common/modules/farm/farm_base_impl/Cargo.toml | 6 +- common/modules/farm/farm_token/Cargo.toml | 4 +- .../modules/farm/farm_token_merge/Cargo.toml | 4 +- common/modules/farm/rewards/Cargo.toml | 4 +- .../legacy_token_decode_module/Cargo.toml | 2 +- common/modules/locking_module/Cargo.toml | 2 +- common/modules/math/Cargo.toml | 2 +- common/modules/pausable/Cargo.toml | 2 +- common/modules/permissions_module/Cargo.toml | 2 +- common/modules/sc_whitelist_module/Cargo.toml | 2 +- common/modules/token_merge_helper/Cargo.toml | 2 +- common/modules/token_send/Cargo.toml | 2 +- common/modules/utils/Cargo.toml | 2 +- common/traits/fixed-supply-token/Cargo.toml | 2 +- common/traits/mergeable/Cargo.toml | 2 +- common/traits/unwrappable/Cargo.toml | 2 +- dex/Cargo.toml | 6 +- dex/farm-with-locked-rewards/Cargo.toml | 6 +- dex/farm-with-locked-rewards/meta/Cargo.toml | 2 +- .../farm_with_locked_rewards_setup/mod.rs | 4 +- .../tests/farm_with_locked_rewards_test.rs | 2 + dex/farm-with-locked-rewards/wasm/Cargo.toml | 2 +- dex/farm/Cargo.toml | 6 +- dex/farm/meta/Cargo.toml | 2 +- dex/farm/tests/energy_update_test.rs | 2 + dex/farm/tests/farm_multi_user_test.rs | 2 + .../farm_setup/farm_rewards_distr_setup.rs | 5 +- .../tests/farm_setup/multi_user_farm_setup.rs | 5 +- .../farm_setup/single_user_farm_setup.rs | 5 +- dex/farm/tests/farm_single_user_test.rs | 6 +- dex/farm/wasm/Cargo.toml | 2 +- dex/fuzz/Cargo.toml | 4 +- dex/fuzz/src/fuzz_data.rs | 4 +- dex/fuzz/src/fuzz_factory.rs | 3 +- dex/fuzz/src/fuzz_farm.rs | 3 +- dex/fuzz/src/fuzz_pair.rs | 3 +- dex/fuzz/src/fuzz_price_discovery.rs | 1 + dex/fuzz/src/fuzz_start.rs | 1 + dex/governance/Cargo.toml | 4 +- dex/governance/meta/Cargo.toml | 2 +- dex/governance/src/proposal.rs | 20 +- dex/governance/src/weight.rs | 4 +- dex/governance/tests/gov_tests.rs | 6 +- dex/governance/wasm/Cargo.toml | 2 +- dex/pair-mock/Cargo.toml | 4 +- dex/pair-mock/meta/Cargo.toml | 2 +- dex/pair-mock/wasm/Cargo.toml | 2 +- dex/pair/Cargo.toml | 4 +- dex/pair/meta/Cargo.toml | 2 +- dex/pair/tests/pair_rs_test.rs | 4 +- dex/pair/tests/pair_setup/mod.rs | 4 +- dex/pair/wasm-pair-full/Cargo.toml | 2 +- dex/pair/wasm-safe-price-view/Cargo.toml | 2 +- dex/pair/wasm/Cargo.toml | 2 +- dex/price-discovery/Cargo.toml | 6 +- dex/price-discovery/meta/Cargo.toml | 2 +- dex/price-discovery/tests/price_disc_tests.rs | 2 + dex/price-discovery/tests/tests_common.rs | 6 +- dex/price-discovery/wasm/Cargo.toml | 2 +- dex/proxy-deployer/Cargo.toml | 4 +- dex/proxy-deployer/meta/Cargo.toml | 2 +- dex/proxy-deployer/wasm/Cargo.toml | 2 +- dex/router/Cargo.toml | 4 +- dex/router/meta/Cargo.toml | 2 +- dex/router/tests/router_setup/mod.rs | 6 +- dex/router/tests/router_test.rs | 4 +- dex/router/wasm/Cargo.toml | 2 +- dex/tests/dex_scenario_go_test.rs | 90 ++--- dex/tests/dex_scenario_rs_test.rs | 92 +++-- .../common-modules/energy-query/Cargo.toml | 2 +- .../week-timekeeping/Cargo.toml | 2 +- .../weekly-rewards-splitting/Cargo.toml | 2 +- energy-integration/common-types/Cargo.toml | 2 +- .../energy-factory-mock/Cargo.toml | 4 +- .../energy-factory-mock/meta/Cargo.toml | 2 +- .../energy-factory-mock/wasm/Cargo.toml | 2 +- energy-integration/energy-update/Cargo.toml | 6 +- .../energy-update/meta/Cargo.toml | 2 +- .../energy-update/wasm/Cargo.toml | 2 +- .../farm-boosted-yields/Cargo.toml | 2 +- .../farm-boosted-yields/src/lib.rs | 1 + energy-integration/fees-collector/Cargo.toml | 6 +- .../fees-collector/meta/Cargo.toml | 2 +- .../tests/fees_collector_rust_test.rs | 2 + .../tests/fees_collector_test_setup/mod.rs | 4 +- .../fees-collector/wasm/Cargo.toml | 2 +- energy-integration/governance-v2/Cargo.toml | 4 +- .../governance-v2/meta/Cargo.toml | 2 +- energy-integration/governance-v2/src/lib.rs | 2 +- .../governance-v2/tests/gov_rust_test.rs | 2 + .../governance-v2/tests/gov_test_setup/mod.rs | 6 +- .../governance-v2/wasm/Cargo.toml | 2 +- farm-staking/farm-staking-proxy/Cargo.toml | 6 +- .../farm-staking-proxy/meta/Cargo.toml | 2 +- .../tests/composed_pos_test.rs | 2 + .../tests/staking_farm_with_lp.rs | 2 + .../mod.rs | 6 +- .../mod.rs | 6 +- .../mod.rs | 4 +- .../farm-staking-proxy/wasm/Cargo.toml | 2 +- farm-staking/farm-staking/Cargo.toml | 6 +- farm-staking/farm-staking/meta/Cargo.toml | 2 +- .../tests/farm_staking_energy_test.rs | 2 + .../tests/farm_staking_setup/mod.rs | 6 +- .../farm-staking/tests/farm_staking_test.rs | 4 +- farm-staking/farm-staking/wasm/Cargo.toml | 2 +- farm-staking/metabonding-staking/Cargo.toml | 6 +- .../metabonding-staking/meta/Cargo.toml | 2 +- .../tests/metabonding_staking_setup/mod.rs | 6 +- .../tests/metabonding_staking_test.rs | 4 +- .../metabonding-staking/wasm/Cargo.toml | 2 +- locked-asset/Cargo.toml | 6 +- locked-asset/distribution/Cargo.toml | 4 +- locked-asset/distribution/meta/Cargo.toml | 2 +- locked-asset/distribution/wasm/Cargo.toml | 2 +- locked-asset/energy-factory/Cargo.toml | 6 +- locked-asset/energy-factory/meta/Cargo.toml | 2 +- .../energy-factory/src/token_merging.rs | 2 + .../tests/energy_factory_setup/mod.rs | 5 +- .../energy-factory/tests/old_tokens_test.rs | 2 + .../tests/simple_lock_energy_test.rs | 2 + .../tests/token_merging_test.rs | 5 +- .../energy-factory/tests/virtual_lock_test.rs | 2 + locked-asset/energy-factory/wasm/Cargo.toml | 2 +- locked-asset/factory/Cargo.toml | 6 +- locked-asset/factory/meta/Cargo.toml | 2 +- .../factory/tests/factory_setup/mod.rs | 3 +- locked-asset/factory/tests/lock_test.rs | 4 +- locked-asset/factory/tests/unlock_test.rs | 4 +- locked-asset/factory/wasm/Cargo.toml | 2 +- locked-asset/lkmex-transfer/Cargo.toml | 6 +- locked-asset/lkmex-transfer/meta/Cargo.toml | 2 +- .../tests/lkmex_transfer_tests.rs | 4 +- locked-asset/lkmex-transfer/wasm/Cargo.toml | 2 +- locked-asset/locked-token-wrapper/Cargo.toml | 6 +- .../locked-token-wrapper/meta/Cargo.toml | 2 +- .../tests/locked_token_wrapping_test.rs | 4 +- .../locked-token-wrapper/wasm/Cargo.toml | 2 +- locked-asset/proxy_dex/Cargo.toml | 6 +- locked-asset/proxy_dex/meta/Cargo.toml | 2 +- .../tests/proxy_dex_test_setup/mod.rs | 4 +- .../proxy_dex/tests/proxy_farm_test.rs | 4 +- locked-asset/proxy_dex/tests/proxy_lp_test.rs | 4 +- locked-asset/proxy_dex/wasm/Cargo.toml | 2 +- locked-asset/simple-lock-whitelist/Cargo.toml | 6 +- .../simple-lock-whitelist/meta/Cargo.toml | 2 +- .../tests/whitelist_test.rs | 4 +- .../simple-lock-whitelist/wasm/Cargo.toml | 2 +- locked-asset/simple-lock/Cargo.toml | 6 +- locked-asset/simple-lock/meta/Cargo.toml | 2 +- locked-asset/simple-lock/tests/rust_test.rs | 4 +- locked-asset/simple-lock/wasm/Cargo.toml | 2 +- .../tests/distribution_scenario_go_test.rs | 317 ++++++++++-------- locked-asset/token-unstake/Cargo.toml | 6 +- locked-asset/token-unstake/meta/Cargo.toml | 2 +- .../tests/token_unstake_setup/mod.rs | 5 +- .../token-unstake/tests/token_unstake_test.rs | 2 + .../token-unstake/tests/unlock_early_test.rs | 2 + locked-asset/token-unstake/wasm/Cargo.toml | 2 +- pause-all/Cargo.toml | 6 +- pause-all/meta/Cargo.toml | 2 +- pause-all/tests/pause_all_test.rs | 4 +- pause-all/wasm/Cargo.toml | 2 +- 170 files changed, 592 insertions(+), 458 deletions(-) diff --git a/common/common_errors/Cargo.toml b/common/common_errors/Cargo.toml index 11defd1d9..2ac587ef5 100644 --- a/common/common_errors/Cargo.toml +++ b/common/common_errors/Cargo.toml @@ -7,5 +7,5 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/common_structs/Cargo.toml b/common/common_structs/Cargo.toml index cccede402..b74834ee6 100644 --- a/common/common_structs/Cargo.toml +++ b/common/common_structs/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.mergeable] diff --git a/common/modules/farm/config/Cargo.toml b/common/modules/farm/config/Cargo.toml index 0ef973338..e8a8d417a 100644 --- a/common/modules/farm/config/Cargo.toml +++ b/common/modules/farm/config/Cargo.toml @@ -22,5 +22,5 @@ path = "../../pausable" path = "../../permissions_module" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/farm/contexts/Cargo.toml b/common/modules/farm/contexts/Cargo.toml index c8cb79f1b..bcc6faea2 100644 --- a/common/modules/farm/contexts/Cargo.toml +++ b/common/modules/farm/contexts/Cargo.toml @@ -34,8 +34,8 @@ path = "../../pausable" path = "../../permissions_module" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.41.0" +version = "=0.42.0" diff --git a/common/modules/farm/contexts/src/claim_rewards_context.rs b/common/modules/farm/contexts/src/claim_rewards_context.rs index d327156b5..653c6b2e6 100644 --- a/common/modules/farm/contexts/src/claim_rewards_context.rs +++ b/common/modules/farm/contexts/src/claim_rewards_context.rs @@ -3,6 +3,7 @@ multiversx_sc::derive_imports!(); use common_errors::{ERROR_BAD_PAYMENTS, ERROR_EMPTY_PAYMENTS}; use common_structs::PaymentAttributesPair; +use multiversx_sc::api::BlockchainApi; use multiversx_sc::contract_base::BlockchainWrapper; pub struct ClaimRewardsContext diff --git a/common/modules/farm/contexts/src/exit_farm_context.rs b/common/modules/farm/contexts/src/exit_farm_context.rs index b56d88498..98aea1adb 100644 --- a/common/modules/farm/contexts/src/exit_farm_context.rs +++ b/common/modules/farm/contexts/src/exit_farm_context.rs @@ -3,6 +3,7 @@ multiversx_sc::derive_imports!(); use common_errors::ERROR_BAD_PAYMENTS; use common_structs::PaymentAttributesPair; +use multiversx_sc::api::BlockchainApi; use multiversx_sc::contract_base::BlockchainWrapper; pub struct ExitFarmContext diff --git a/common/modules/farm/events/Cargo.toml b/common/modules/farm/events/Cargo.toml index 2fa7e3a84..f6e7008be 100644 --- a/common/modules/farm/events/Cargo.toml +++ b/common/modules/farm/events/Cargo.toml @@ -13,5 +13,5 @@ path = "../../../common_structs" path = "../contexts" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/farm/farm_base_impl/Cargo.toml b/common/modules/farm/farm_base_impl/Cargo.toml index 9c7f304d3..eab9a3ae1 100644 --- a/common/modules/farm/farm_base_impl/Cargo.toml +++ b/common/modules/farm/farm_base_impl/Cargo.toml @@ -49,10 +49,10 @@ path = "../../../traits/mergeable" path = "../../../traits/fixed-supply-token" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.41.0" +version = "=0.42.0" [dev-dependencies.multiversx-sc-scenario] -version = "=0.41.0" +version = "=0.42.0" diff --git a/common/modules/farm/farm_token/Cargo.toml b/common/modules/farm/farm_token/Cargo.toml index c76da530c..eca09fbb1 100644 --- a/common/modules/farm/farm_token/Cargo.toml +++ b/common/modules/farm/farm_token/Cargo.toml @@ -25,8 +25,8 @@ path = "../../pausable" path = "../../permissions_module" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.41.0" +version = "=0.42.0" diff --git a/common/modules/farm/farm_token_merge/Cargo.toml b/common/modules/farm/farm_token_merge/Cargo.toml index b791802db..20289e13d 100644 --- a/common/modules/farm/farm_token_merge/Cargo.toml +++ b/common/modules/farm/farm_token_merge/Cargo.toml @@ -22,8 +22,8 @@ path = "../../token_merge_helper" path = "../farm_token" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.41.0" +version = "=0.42.0" diff --git a/common/modules/farm/rewards/Cargo.toml b/common/modules/farm/rewards/Cargo.toml index 47278eaaa..e3cbe0419 100644 --- a/common/modules/farm/rewards/Cargo.toml +++ b/common/modules/farm/rewards/Cargo.toml @@ -28,8 +28,8 @@ path = "../../pausable" path = "../../permissions_module" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.41.0" +version = "=0.42.0" diff --git a/common/modules/legacy_token_decode_module/Cargo.toml b/common/modules/legacy_token_decode_module/Cargo.toml index d0a3c69f8..a0817d114 100644 --- a/common/modules/legacy_token_decode_module/Cargo.toml +++ b/common/modules/legacy_token_decode_module/Cargo.toml @@ -7,7 +7,7 @@ edition = "2018" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.common_structs] diff --git a/common/modules/locking_module/Cargo.toml b/common/modules/locking_module/Cargo.toml index 5a0615f01..c55b00d69 100644 --- a/common/modules/locking_module/Cargo.toml +++ b/common/modules/locking_module/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.simple-lock] diff --git a/common/modules/math/Cargo.toml b/common/modules/math/Cargo.toml index 656647975..f0594e357 100644 --- a/common/modules/math/Cargo.toml +++ b/common/modules/math/Cargo.toml @@ -7,5 +7,5 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/pausable/Cargo.toml b/common/modules/pausable/Cargo.toml index 4424c91d9..0b4300147 100644 --- a/common/modules/pausable/Cargo.toml +++ b/common/modules/pausable/Cargo.toml @@ -10,5 +10,5 @@ path = "src/pausable.rs" path = "../permissions_module" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/permissions_module/Cargo.toml b/common/modules/permissions_module/Cargo.toml index 7d4b3d79b..aa19a0098 100644 --- a/common/modules/permissions_module/Cargo.toml +++ b/common/modules/permissions_module/Cargo.toml @@ -14,5 +14,5 @@ bitflags = "1.3.2" path = "../../common_errors" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/sc_whitelist_module/Cargo.toml b/common/modules/sc_whitelist_module/Cargo.toml index 923e9bf7a..f5469987f 100644 --- a/common/modules/sc_whitelist_module/Cargo.toml +++ b/common/modules/sc_whitelist_module/Cargo.toml @@ -10,5 +10,5 @@ path = "src/sc_whitelist_module.rs" path = "../../common_errors" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/token_merge_helper/Cargo.toml b/common/modules/token_merge_helper/Cargo.toml index 85ef46b52..35ba6122f 100644 --- a/common/modules/token_merge_helper/Cargo.toml +++ b/common/modules/token_merge_helper/Cargo.toml @@ -10,5 +10,5 @@ path = "src/lib.rs" path = "../../common_errors" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/token_send/Cargo.toml b/common/modules/token_send/Cargo.toml index b765f1352..f895e3524 100644 --- a/common/modules/token_send/Cargo.toml +++ b/common/modules/token_send/Cargo.toml @@ -13,5 +13,5 @@ path = "../../common_structs" path = "../../common_errors" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/utils/Cargo.toml b/common/modules/utils/Cargo.toml index dadbeb561..66296dddc 100644 --- a/common/modules/utils/Cargo.toml +++ b/common/modules/utils/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.common_structs] diff --git a/common/traits/fixed-supply-token/Cargo.toml b/common/traits/fixed-supply-token/Cargo.toml index 1cdd1ce39..f81b16f66 100644 --- a/common/traits/fixed-supply-token/Cargo.toml +++ b/common/traits/fixed-supply-token/Cargo.toml @@ -7,4 +7,4 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" diff --git a/common/traits/mergeable/Cargo.toml b/common/traits/mergeable/Cargo.toml index 1c9430de7..c2629c71c 100644 --- a/common/traits/mergeable/Cargo.toml +++ b/common/traits/mergeable/Cargo.toml @@ -7,5 +7,5 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/traits/unwrappable/Cargo.toml b/common/traits/unwrappable/Cargo.toml index b745d0e67..6aff2032c 100644 --- a/common/traits/unwrappable/Cargo.toml +++ b/common/traits/unwrappable/Cargo.toml @@ -7,5 +7,5 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/dex/Cargo.toml b/dex/Cargo.toml index e36131bd9..21226dbaf 100644 --- a/dex/Cargo.toml +++ b/dex/Cargo.toml @@ -4,17 +4,17 @@ version = "0.0.0" edition = "2021" publish = false [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-modules] -version = "=0.41.0" +version = "=0.42.0" [dev-dependencies.multiversx-sc-scenario] -version = "=0.41.0" +version = "=0.42.0" [dev-dependencies.config] path = "../common/modules/farm/config" diff --git a/dex/farm-with-locked-rewards/Cargo.toml b/dex/farm-with-locked-rewards/Cargo.toml index 71b2647b6..bdbe34677 100644 --- a/dex/farm-with-locked-rewards/Cargo.toml +++ b/dex/farm-with-locked-rewards/Cargo.toml @@ -74,17 +74,17 @@ path = "../../locked-asset/energy-factory" path = "../../energy-integration/common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.41.0" +version = "=0.42.0" [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.41.0" +version = "=0.42.0" [dev-dependencies.simple-lock] path = "../../locked-asset/simple-lock" diff --git a/dex/farm-with-locked-rewards/meta/Cargo.toml b/dex/farm-with-locked-rewards/meta/Cargo.toml index 46d2c3d3f..ff1dc11ca 100644 --- a/dex/farm-with-locked-rewards/meta/Cargo.toml +++ b/dex/farm-with-locked-rewards/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.41.0" +version = "0.42.0" diff --git a/dex/farm-with-locked-rewards/tests/farm_with_locked_rewards_setup/mod.rs b/dex/farm-with-locked-rewards/tests/farm_with_locked_rewards_setup/mod.rs index dfccee8b9..b51328190 100644 --- a/dex/farm-with-locked-rewards/tests/farm_with_locked_rewards_setup/mod.rs +++ b/dex/farm-with-locked-rewards/tests/farm_with_locked_rewards_setup/mod.rs @@ -1,3 +1,5 @@ +#![allow(deprecated)] + use common_structs::FarmTokenAttributes; use config::ConfigModule; use multiversx_sc::{ @@ -7,7 +9,7 @@ use multiversx_sc::{ }; use multiversx_sc_scenario::{ managed_address, managed_biguint, managed_token_id, rust_biguint, - whitebox::{BlockchainStateWrapper, ContractObjWrapper}, + whitebox_legacy::{BlockchainStateWrapper, ContractObjWrapper}, DebugApi, }; diff --git a/dex/farm-with-locked-rewards/tests/farm_with_locked_rewards_test.rs b/dex/farm-with-locked-rewards/tests/farm_with_locked_rewards_test.rs index f88ed6774..941c08f8e 100644 --- a/dex/farm-with-locked-rewards/tests/farm_with_locked_rewards_test.rs +++ b/dex/farm-with-locked-rewards/tests/farm_with_locked_rewards_test.rs @@ -1,3 +1,5 @@ +#![allow(deprecated)] + use common_structs::FarmTokenAttributes; use multiversx_sc_scenario::{managed_address, managed_biguint, rust_biguint, DebugApi}; use simple_lock::locked_token::LockedTokenAttributes; diff --git a/dex/farm-with-locked-rewards/wasm/Cargo.toml b/dex/farm-with-locked-rewards/wasm/Cargo.toml index ab0df013e..56abe71c5 100644 --- a/dex/farm-with-locked-rewards/wasm/Cargo.toml +++ b/dex/farm-with-locked-rewards/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.41.0" +version = "=0.42.0" diff --git a/dex/farm/Cargo.toml b/dex/farm/Cargo.toml index 5d119c8fe..c98bc2e9b 100644 --- a/dex/farm/Cargo.toml +++ b/dex/farm/Cargo.toml @@ -68,11 +68,11 @@ path = "../../energy-integration/common-modules/weekly-rewards-splitting" path = "../../energy-integration/common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.41.0" +version = "=0.42.0" [dev-dependencies] num-bigint = "0.4.2" @@ -81,7 +81,7 @@ num-bigint = "0.4.2" path = "../../energy-integration/energy-update" [dev-dependencies.multiversx-sc-scenario] -version = "=0.41.0" +version = "=0.42.0" [dev-dependencies.energy-factory-mock] path = "../../energy-integration/energy-factory-mock" diff --git a/dex/farm/meta/Cargo.toml b/dex/farm/meta/Cargo.toml index 1b158fa11..d546f9321 100644 --- a/dex/farm/meta/Cargo.toml +++ b/dex/farm/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.41.0" +version = "0.42.0" diff --git a/dex/farm/tests/energy_update_test.rs b/dex/farm/tests/energy_update_test.rs index d8dd4e639..1d8f78a98 100644 --- a/dex/farm/tests/energy_update_test.rs +++ b/dex/farm/tests/energy_update_test.rs @@ -1,3 +1,5 @@ +#![allow(deprecated)] + mod farm_setup; use farm_setup::multi_user_farm_setup::*; diff --git a/dex/farm/tests/farm_multi_user_test.rs b/dex/farm/tests/farm_multi_user_test.rs index 45b388ba0..dcb1dba22 100644 --- a/dex/farm/tests/farm_multi_user_test.rs +++ b/dex/farm/tests/farm_multi_user_test.rs @@ -1,3 +1,5 @@ +#![allow(deprecated)] + use common_structs::FarmTokenAttributes; use multiversx_sc_scenario::{managed_address, managed_biguint, rust_biguint, DebugApi}; diff --git a/dex/farm/tests/farm_setup/farm_rewards_distr_setup.rs b/dex/farm/tests/farm_setup/farm_rewards_distr_setup.rs index 7b9672d4f..7c610556c 100644 --- a/dex/farm/tests/farm_setup/farm_rewards_distr_setup.rs +++ b/dex/farm/tests/farm_setup/farm_rewards_distr_setup.rs @@ -1,11 +1,12 @@ #![allow(dead_code)] +#![allow(deprecated)] use multiversx_sc::codec::multi_types::OptionalValue; use multiversx_sc::storage::mappers::StorageTokenWrapper; use multiversx_sc::types::{Address, BigUint, EsdtLocalRole, ManagedAddress, MultiValueEncoded}; use multiversx_sc_scenario::{ - managed_address, managed_biguint, managed_token_id, rust_biguint, whitebox::TxTokenTransfer, - whitebox::*, DebugApi, + managed_address, managed_biguint, managed_token_id, rust_biguint, + whitebox_legacy::TxTokenTransfer, whitebox_legacy::*, DebugApi, }; pub type RustBigUint = num_bigint::BigUint; diff --git a/dex/farm/tests/farm_setup/multi_user_farm_setup.rs b/dex/farm/tests/farm_setup/multi_user_farm_setup.rs index aa669401e..00995b692 100644 --- a/dex/farm/tests/farm_setup/multi_user_farm_setup.rs +++ b/dex/farm/tests/farm_setup/multi_user_farm_setup.rs @@ -1,4 +1,5 @@ #![allow(dead_code)] +#![allow(deprecated)] use common_structs::FarmTokenAttributes; use config::ConfigModule; @@ -7,10 +8,10 @@ use multiversx_sc::{ storage::mappers::StorageTokenWrapper, types::{Address, BigInt, EsdtLocalRole, MultiValueEncoded}, }; -use multiversx_sc_scenario::whitebox::TxTokenTransfer; +use multiversx_sc_scenario::whitebox_legacy::TxTokenTransfer; use multiversx_sc_scenario::{ managed_address, managed_biguint, managed_token_id, rust_biguint, - whitebox::{BlockchainStateWrapper, ContractObjWrapper}, + whitebox_legacy::{BlockchainStateWrapper, ContractObjWrapper}, DebugApi, }; diff --git a/dex/farm/tests/farm_setup/single_user_farm_setup.rs b/dex/farm/tests/farm_setup/single_user_farm_setup.rs index 6ec061758..6dd2620e7 100644 --- a/dex/farm/tests/farm_setup/single_user_farm_setup.rs +++ b/dex/farm/tests/farm_setup/single_user_farm_setup.rs @@ -1,12 +1,13 @@ #![allow(dead_code)] +#![allow(deprecated)] use common_structs::FarmTokenAttributes; use multiversx_sc::codec::multi_types::OptionalValue; use multiversx_sc::storage::mappers::StorageTokenWrapper; use multiversx_sc::types::{Address, EsdtLocalRole, ManagedAddress, MultiValueEncoded}; -use multiversx_sc_scenario::whitebox::{TxContextStack, TxTokenTransfer}; +use multiversx_sc_scenario::whitebox_legacy::{TxContextStack, TxTokenTransfer}; use multiversx_sc_scenario::{ - managed_address, managed_biguint, managed_token_id, rust_biguint, whitebox::*, DebugApi, + managed_address, managed_biguint, managed_token_id, rust_biguint, whitebox_legacy::*, DebugApi, }; type RustBigUint = num_bigint::BigUint; diff --git a/dex/farm/tests/farm_single_user_test.rs b/dex/farm/tests/farm_single_user_test.rs index a928eecb6..eb5c9f61c 100644 --- a/dex/farm/tests/farm_single_user_test.rs +++ b/dex/farm/tests/farm_single_user_test.rs @@ -1,11 +1,13 @@ +#![allow(deprecated)] + mod farm_setup; use config::ConfigModule; use farm_setup::single_user_farm_setup::*; use multiversx_sc::types::EsdtLocalRole; use multiversx_sc_scenario::{ - managed_address, managed_biguint, managed_token_id, rust_biguint, whitebox::TxTokenTransfer, - DebugApi, + managed_address, managed_biguint, managed_token_id, rust_biguint, + whitebox_legacy::TxTokenTransfer, DebugApi, }; use sc_whitelist_module::SCWhitelistModule; diff --git a/dex/farm/wasm/Cargo.toml b/dex/farm/wasm/Cargo.toml index e043258ce..6e6c4a5c2 100644 --- a/dex/farm/wasm/Cargo.toml +++ b/dex/farm/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.41.0" +version = "=0.42.0" diff --git a/dex/fuzz/Cargo.toml b/dex/fuzz/Cargo.toml index 71278ce20..0a3647b95 100644 --- a/dex/fuzz/Cargo.toml +++ b/dex/fuzz/Cargo.toml @@ -12,11 +12,11 @@ num-bigint = "0.4.2" rand = "0.8.4" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-scenario] -version = "=0.41.0" +version = "=0.42.0" [dependencies.pausable] path = "../../common/modules/pausable" diff --git a/dex/fuzz/src/fuzz_data.rs b/dex/fuzz/src/fuzz_data.rs index a9f19a346..14de4e7c3 100644 --- a/dex/fuzz/src/fuzz_data.rs +++ b/dex/fuzz/src/fuzz_data.rs @@ -1,5 +1,7 @@ #[cfg(test)] pub mod fuzz_data_tests { + #![allow(deprecated)] + multiversx_sc::imports!(); multiversx_sc::derive_imports!(); @@ -14,7 +16,7 @@ pub mod fuzz_data_tests { use multiversx_sc::types::{Address, BigUint, EsdtLocalRole}; use multiversx_sc_scenario::{ managed_address, managed_biguint, managed_token_id, managed_token_id_wrapped, rust_biguint, - whitebox::*, DebugApi, + whitebox_legacy::*, DebugApi, }; use pair::*; use pausable::{PausableModule, State}; diff --git a/dex/fuzz/src/fuzz_factory.rs b/dex/fuzz/src/fuzz_factory.rs index 1aaf848d2..4286c72c7 100644 --- a/dex/fuzz/src/fuzz_factory.rs +++ b/dex/fuzz/src/fuzz_factory.rs @@ -1,10 +1,11 @@ #[cfg(test)] pub mod fuzz_factory_test { + #![allow(deprecated)] multiversx_sc::imports!(); multiversx_sc::derive_imports!(); - use multiversx_sc_scenario::whitebox::TxTokenTransfer; + use multiversx_sc_scenario::whitebox_legacy::TxTokenTransfer; use multiversx_sc_scenario::{rust_biguint, DebugApi}; use crate::fuzz_data::fuzz_data_tests::*; diff --git a/dex/fuzz/src/fuzz_farm.rs b/dex/fuzz/src/fuzz_farm.rs index 6df66416c..1ef8e2463 100644 --- a/dex/fuzz/src/fuzz_farm.rs +++ b/dex/fuzz/src/fuzz_farm.rs @@ -1,12 +1,13 @@ #[cfg(test)] pub mod fuzz_farm_test { + #![allow(deprecated)] multiversx_sc::imports!(); multiversx_sc::derive_imports!(); use std::cmp::Ordering; - use multiversx_sc_scenario::whitebox::TxTokenTransfer; + use multiversx_sc_scenario::whitebox_legacy::TxTokenTransfer; use multiversx_sc_scenario::{managed_biguint, rust_biguint, DebugApi}; use crate::fuzz_data::fuzz_data_tests::*; diff --git a/dex/fuzz/src/fuzz_pair.rs b/dex/fuzz/src/fuzz_pair.rs index 74a326ea0..3ccc5031a 100644 --- a/dex/fuzz/src/fuzz_pair.rs +++ b/dex/fuzz/src/fuzz_pair.rs @@ -1,11 +1,12 @@ #[cfg(test)] pub mod fuzz_pair_test { + #![allow(deprecated)] multiversx_sc::imports!(); multiversx_sc::derive_imports!(); use multiversx_sc_scenario::{ - managed_biguint, managed_token_id, rust_biguint, whitebox::TxTokenTransfer, DebugApi, + managed_biguint, managed_token_id, rust_biguint, whitebox_legacy::TxTokenTransfer, DebugApi, }; use rand::prelude::*; diff --git a/dex/fuzz/src/fuzz_price_discovery.rs b/dex/fuzz/src/fuzz_price_discovery.rs index 45254341b..2b6cd9909 100644 --- a/dex/fuzz/src/fuzz_price_discovery.rs +++ b/dex/fuzz/src/fuzz_price_discovery.rs @@ -1,5 +1,6 @@ #[cfg(test)] pub mod fuzz_price_discovery_test { + #![allow(deprecated)] multiversx_sc::imports!(); multiversx_sc::derive_imports!(); diff --git a/dex/fuzz/src/fuzz_start.rs b/dex/fuzz/src/fuzz_start.rs index 2c673a261..4df24d71a 100644 --- a/dex/fuzz/src/fuzz_start.rs +++ b/dex/fuzz/src/fuzz_start.rs @@ -1,5 +1,6 @@ #[cfg(test)] mod test { + #![allow(deprecated)] multiversx_sc::imports!(); multiversx_sc::derive_imports!(); diff --git a/dex/governance/Cargo.toml b/dex/governance/Cargo.toml index 567d8b18e..3ebc9493d 100644 --- a/dex/governance/Cargo.toml +++ b/dex/governance/Cargo.toml @@ -8,14 +8,14 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.41.0" +version = "=0.42.0" [dev-dependencies.pair-mock] path = "../pair-mock" diff --git a/dex/governance/meta/Cargo.toml b/dex/governance/meta/Cargo.toml index 280d962bb..97ae17c5e 100644 --- a/dex/governance/meta/Cargo.toml +++ b/dex/governance/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.41.0" +version = "0.42.0" diff --git a/dex/governance/src/proposal.rs b/dex/governance/src/proposal.rs index 7f04c1f2f..3a80c60bd 100644 --- a/dex/governance/src/proposal.rs +++ b/dex/governance/src/proposal.rs @@ -103,12 +103,18 @@ pub trait ProposalHelper: config::Config { } fn execute_action(&self, action: &Action) -> Result<(), &'static [u8]> { - Self::Api::send_api_impl().transfer_value_execute( - &action.dest_address, - &BigUint::zero(), - action.gas_limit, - &action.endpoint_name, - &ManagedArgBuffer::from(action.arguments.clone()), - ) + self.send() + .contract_call::<()>(action.dest_address.clone(), action.endpoint_name.clone()) + .with_raw_arguments(ManagedArgBuffer::from(action.arguments.clone())) + .with_gas_limit(action.gas_limit) + .transfer_execute(); + Result::Ok(()) + // ContractCallNoPayment::new() + // self.send_raw().direct_egld( + // &BigUint::zero(), + // action.gas_limit, + // &action.endpoint_name, + // &ManagedArgBuffer::from(action.arguments.clone()), + // ) } } diff --git a/dex/governance/src/weight.rs b/dex/governance/src/weight.rs index 2eda127a1..07b075f95 100644 --- a/dex/governance/src/weight.rs +++ b/dex/governance/src/weight.rs @@ -27,9 +27,7 @@ pub trait Lib: config::Config { if let Some(provider) = self.price_providers().get(&payment.token_identifier) { let call_result: MultiValue2, EsdtTokenPayment> = self.price_provider_proxy(provider) - .get_tokens_for_given_position_with_safe_price( - payment.amount.clone(), - ) + .get_tokens_for_given_position_with_safe_price(payment.amount.clone()) .execute_on_dest_context(); let (token1, token2) = call_result.into_tuple(); diff --git a/dex/governance/tests/gov_tests.rs b/dex/governance/tests/gov_tests.rs index cbc708798..61dc9c985 100644 --- a/dex/governance/tests/gov_tests.rs +++ b/dex/governance/tests/gov_tests.rs @@ -1,9 +1,11 @@ +#![allow(deprecated)] + use multiversx_sc::codec::multi_types::{MultiValue2, OptionalValue}; use multiversx_sc::types::MultiValueEncoded; use multiversx_sc::types::{Address, EsdtLocalRole, EsdtTokenPayment, ManagedVec}; use multiversx_sc_scenario::{ - managed_address, managed_biguint, managed_buffer, managed_token_id, rust_biguint, whitebox::*, - DebugApi, + managed_address, managed_biguint, managed_buffer, managed_token_id, rust_biguint, + whitebox_legacy::*, DebugApi, }; use governance::config::*; diff --git a/dex/governance/wasm/Cargo.toml b/dex/governance/wasm/Cargo.toml index 16090dbdc..adb5831a7 100644 --- a/dex/governance/wasm/Cargo.toml +++ b/dex/governance/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.41.0" +version = "=0.42.0" diff --git a/dex/pair-mock/Cargo.toml b/dex/pair-mock/Cargo.toml index 95229f91c..921328f78 100644 --- a/dex/pair-mock/Cargo.toml +++ b/dex/pair-mock/Cargo.toml @@ -11,11 +11,11 @@ path = "src/pair.rs" path = "../../common/common_errors" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.itertools] version = "0.10.1" default-features = false [dev-dependencies.multiversx-sc-scenario] -version = "=0.41.0" +version = "=0.42.0" diff --git a/dex/pair-mock/meta/Cargo.toml b/dex/pair-mock/meta/Cargo.toml index fcb82cfb9..9e6ec9b08 100644 --- a/dex/pair-mock/meta/Cargo.toml +++ b/dex/pair-mock/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.41.0" +version = "0.42.0" diff --git a/dex/pair-mock/wasm/Cargo.toml b/dex/pair-mock/wasm/Cargo.toml index c0a0ee702..cf62f1077 100644 --- a/dex/pair-mock/wasm/Cargo.toml +++ b/dex/pair-mock/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.41.0" +version = "=0.42.0" diff --git a/dex/pair/Cargo.toml b/dex/pair/Cargo.toml index e8e5721aa..559184b9d 100644 --- a/dex/pair/Cargo.toml +++ b/dex/pair/Cargo.toml @@ -33,11 +33,11 @@ version = "0.10.1" default-features = false [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.41.0" +version = "=0.42.0" diff --git a/dex/pair/meta/Cargo.toml b/dex/pair/meta/Cargo.toml index 5c7086200..b9869414c 100644 --- a/dex/pair/meta/Cargo.toml +++ b/dex/pair/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.41.0" +version = "0.42.0" diff --git a/dex/pair/tests/pair_rs_test.rs b/dex/pair/tests/pair_rs_test.rs index 585093667..ea2a2cf52 100644 --- a/dex/pair/tests/pair_rs_test.rs +++ b/dex/pair/tests/pair_rs_test.rs @@ -1,3 +1,5 @@ +#![allow(deprecated)] + mod pair_setup; use fees_collector::{ config::ConfigModule, fees_accumulation::FeesAccumulationModule, FeesCollector, @@ -9,7 +11,7 @@ use multiversx_sc::{ }; use multiversx_sc_scenario::{ managed_address, managed_biguint, managed_token_id, managed_token_id_wrapped, rust_biguint, - whitebox::TxTokenTransfer, DebugApi, + whitebox_legacy::TxTokenTransfer, DebugApi, }; // use pair::safe_price::MAX_OBSERVATIONS; use pair::{config::MAX_PERCENTAGE, fee::FeeModule, locking_wrapper::LockingWrapperModule, Pair}; diff --git a/dex/pair/tests/pair_setup/mod.rs b/dex/pair/tests/pair_setup/mod.rs index 2032efe24..e7311eca5 100644 --- a/dex/pair/tests/pair_setup/mod.rs +++ b/dex/pair/tests/pair_setup/mod.rs @@ -2,9 +2,9 @@ use multiversx_sc::codec::multi_types::MultiValue3; use multiversx_sc::types::{ Address, EsdtLocalRole, EsdtTokenPayment, ManagedAddress, MultiValueEncoded, }; -use multiversx_sc_scenario::whitebox::TxTokenTransfer; +use multiversx_sc_scenario::whitebox_legacy::TxTokenTransfer; use multiversx_sc_scenario::{ - managed_address, managed_biguint, managed_token_id, rust_biguint, whitebox::*, DebugApi, + managed_address, managed_biguint, managed_token_id, rust_biguint, whitebox_legacy::*, DebugApi, }; pub const PAIR_WASM_PATH: &str = "pair/output/pair.wasm"; diff --git a/dex/pair/wasm-pair-full/Cargo.toml b/dex/pair/wasm-pair-full/Cargo.toml index 078063580..ca4c2c82c 100644 --- a/dex/pair/wasm-pair-full/Cargo.toml +++ b/dex/pair/wasm-pair-full/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.41.0" +version = "=0.42.0" diff --git a/dex/pair/wasm-safe-price-view/Cargo.toml b/dex/pair/wasm-safe-price-view/Cargo.toml index 6f945e5ad..9d2719a95 100644 --- a/dex/pair/wasm-safe-price-view/Cargo.toml +++ b/dex/pair/wasm-safe-price-view/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.41.0" +version = "=0.42.0" diff --git a/dex/pair/wasm/Cargo.toml b/dex/pair/wasm/Cargo.toml index 3752c727c..2b6c9c8f5 100644 --- a/dex/pair/wasm/Cargo.toml +++ b/dex/pair/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.41.0" +version = "=0.42.0" diff --git a/dex/price-discovery/Cargo.toml b/dex/price-discovery/Cargo.toml index fa03a7b15..64e827a60 100644 --- a/dex/price-discovery/Cargo.toml +++ b/dex/price-discovery/Cargo.toml @@ -12,11 +12,11 @@ path = "src/lib.rs" hex-literal = "0.3.1" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.41.0" +version = "=0.42.0" [dependencies.locking_module] path = "../../common/modules/locking_module" @@ -30,4 +30,4 @@ hex = "0.4" path = "../../locked-asset/simple-lock" [dev-dependencies.multiversx-sc-scenario] -version = "=0.41.0" +version = "=0.42.0" diff --git a/dex/price-discovery/meta/Cargo.toml b/dex/price-discovery/meta/Cargo.toml index c9abf0455..4897cfd92 100644 --- a/dex/price-discovery/meta/Cargo.toml +++ b/dex/price-discovery/meta/Cargo.toml @@ -8,4 +8,4 @@ authors = ["Dorin Iancu "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.41.0" +version = "0.42.0" diff --git a/dex/price-discovery/tests/price_disc_tests.rs b/dex/price-discovery/tests/price_disc_tests.rs index 5094c568b..db0905cf8 100644 --- a/dex/price-discovery/tests/price_disc_tests.rs +++ b/dex/price-discovery/tests/price_disc_tests.rs @@ -1,3 +1,5 @@ +#![allow(deprecated)] + use multiversx_sc::codec::Empty; use multiversx_sc_scenario::{managed_biguint, managed_token_id_wrapped}; use multiversx_sc_scenario::{rust_biguint, DebugApi}; diff --git a/dex/price-discovery/tests/tests_common.rs b/dex/price-discovery/tests/tests_common.rs index 788013975..984a7ec0c 100644 --- a/dex/price-discovery/tests/tests_common.rs +++ b/dex/price-discovery/tests/tests_common.rs @@ -1,8 +1,10 @@ +#![allow(deprecated)] + use multiversx_sc::codec::Empty; use multiversx_sc::types::{Address, EsdtLocalRole}; -use multiversx_sc_scenario::whitebox::TxResult; +use multiversx_sc_scenario::whitebox_legacy::TxResult; use multiversx_sc_scenario::{ - managed_address, managed_biguint, managed_token_id_wrapped, whitebox::*, + managed_address, managed_biguint, managed_token_id_wrapped, whitebox_legacy::*, }; use multiversx_sc_scenario::{managed_token_id, rust_biguint, DebugApi}; diff --git a/dex/price-discovery/wasm/Cargo.toml b/dex/price-discovery/wasm/Cargo.toml index b9febeed9..8fff57628 100644 --- a/dex/price-discovery/wasm/Cargo.toml +++ b/dex/price-discovery/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.41.0" +version = "=0.42.0" diff --git a/dex/proxy-deployer/Cargo.toml b/dex/proxy-deployer/Cargo.toml index 2074d9bdd..7b4123b5a 100644 --- a/dex/proxy-deployer/Cargo.toml +++ b/dex/proxy-deployer/Cargo.toml @@ -20,11 +20,11 @@ path = "../../common/modules/farm/config" path = "../../common/modules/farm/farm_token" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.41.0" +version = "=0.42.0" diff --git a/dex/proxy-deployer/meta/Cargo.toml b/dex/proxy-deployer/meta/Cargo.toml index 3ee1590b9..4ea12f805 100644 --- a/dex/proxy-deployer/meta/Cargo.toml +++ b/dex/proxy-deployer/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.41.0" +version = "0.42.0" diff --git a/dex/proxy-deployer/wasm/Cargo.toml b/dex/proxy-deployer/wasm/Cargo.toml index 4f61b8c73..c29ba0d40 100644 --- a/dex/proxy-deployer/wasm/Cargo.toml +++ b/dex/proxy-deployer/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.41.0" +version = "=0.42.0" diff --git a/dex/router/Cargo.toml b/dex/router/Cargo.toml index b23370a09..83dc3492a 100644 --- a/dex/router/Cargo.toml +++ b/dex/router/Cargo.toml @@ -14,7 +14,7 @@ path = "../../common/modules/token_send" path = "../../common/modules/pausable" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.pair] @@ -26,4 +26,4 @@ path = "../../common/modules/locking_module" [dependencies.simple-lock] path = "../../locked-asset/simple-lock" [dev-dependencies.multiversx-sc-scenario] -version = "=0.41.0" +version = "=0.42.0" diff --git a/dex/router/meta/Cargo.toml b/dex/router/meta/Cargo.toml index 2df7a1a67..9b71b6e99 100644 --- a/dex/router/meta/Cargo.toml +++ b/dex/router/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.41.0" +version = "0.42.0" diff --git a/dex/router/tests/router_setup/mod.rs b/dex/router/tests/router_setup/mod.rs index a7cd6c14c..98313d35a 100644 --- a/dex/router/tests/router_setup/mod.rs +++ b/dex/router/tests/router_setup/mod.rs @@ -1,9 +1,9 @@ use multiversx_sc::codec::multi_types::{MultiValue4, OptionalValue}; use multiversx_sc::types::{Address, EsdtLocalRole, ManagedAddress, MultiValueEncoded}; -use multiversx_sc_scenario::whitebox::TxTokenTransfer; +use multiversx_sc_scenario::whitebox_legacy::TxTokenTransfer; use multiversx_sc_scenario::{ - managed_address, managed_biguint, managed_buffer, managed_token_id, rust_biguint, whitebox::*, - DebugApi, + managed_address, managed_biguint, managed_buffer, managed_token_id, rust_biguint, + whitebox_legacy::*, DebugApi, }; pub const PAIR_WASM_PATH: &str = "pair/output/pair.wasm"; diff --git a/dex/router/tests/router_test.rs b/dex/router/tests/router_test.rs index 2c1803311..3d395316d 100644 --- a/dex/router/tests/router_test.rs +++ b/dex/router/tests/router_test.rs @@ -1,3 +1,5 @@ +#![allow(deprecated)] + mod router_setup; use multiversx_sc::{ codec::multi_types::OptionalValue, @@ -19,7 +21,7 @@ use router_setup::*; use multiversx_sc_scenario::{ managed_address, managed_biguint, managed_token_id, managed_token_id_wrapped, rust_biguint, - whitebox::BlockchainStateWrapper, whitebox::TxTokenTransfer, DebugApi, + whitebox_legacy::BlockchainStateWrapper, whitebox_legacy::TxTokenTransfer, DebugApi, }; use simple_lock::{ locked_token::{LockedTokenAttributes, LockedTokenModule}, diff --git a/dex/router/wasm/Cargo.toml b/dex/router/wasm/Cargo.toml index 5f4c95d70..0256a67b3 100644 --- a/dex/router/wasm/Cargo.toml +++ b/dex/router/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.41.0" +version = "=0.42.0" diff --git a/dex/tests/dex_scenario_go_test.rs b/dex/tests/dex_scenario_go_test.rs index 1bc63e0c1..5675b0a8d 100644 --- a/dex/tests/dex_scenario_go_test.rs +++ b/dex/tests/dex_scenario_go_test.rs @@ -1,203 +1,205 @@ +use multiversx_sc_scenario::*; + +fn world() -> ScenarioWorld { + ScenarioWorld::vm_go() +} + #[test] fn add_liquidity_go() { - multiversx_sc_scenario::run_go("scenarios/add_liquidity.scen.json"); + world().run("scenarios/add_liquidity.scen.json"); } #[test] fn calculate_rewards_for_given_position_go() { - multiversx_sc_scenario::run_go("scenarios/calculate_rewards_for_given_position.scen.json"); + world().run("scenarios/calculate_rewards_for_given_position.scen.json"); } #[test] fn calculate_rewards_for_given_position_after_compound_go() { - multiversx_sc_scenario::run_go( - "scenarios/calculate_rewards_for_given_position_after_compound.scen.json", - ); + world().run("scenarios/calculate_rewards_for_given_position_after_compound.scen.json"); } #[test] fn check_fee_disabled_after_swap_go() { - multiversx_sc_scenario::run_go("scenarios/check_fee_disabled_after_swap.scen.json"); + world().run("scenarios/check_fee_disabled_after_swap.scen.json"); } #[test] fn check_fee_enabled_after_swap_go() { - multiversx_sc_scenario::run_go("scenarios/check_fee_enabled_after_swap.scen.json"); + world().run("scenarios/check_fee_enabled_after_swap.scen.json"); } #[test] fn claim_rewards_go() { - multiversx_sc_scenario::run_go("scenarios/claim_rewards.scen.json"); + world().run("scenarios/claim_rewards.scen.json"); } #[test] fn complete_setup_go() { - multiversx_sc_scenario::run_go("scenarios/complete_setup.scen.json"); + world().run("scenarios/complete_setup.scen.json"); } #[test] fn compound_rewards_go() { - multiversx_sc_scenario::run_go("scenarios/compound_rewards.scen.json"); + world().run("scenarios/compound_rewards.scen.json"); } #[test] fn create_pair_twice_go() { - multiversx_sc_scenario::run_go("scenarios/create_pair_twice.scen.json"); + world().run("scenarios/create_pair_twice.scen.json"); } #[test] fn enter_farm_go() { - multiversx_sc_scenario::run_go("scenarios/enter_farm.scen.json"); + world().run("scenarios/enter_farm.scen.json"); } #[test] fn enter_farm_with_merge_tokens_go() { - multiversx_sc_scenario::run_go("scenarios/enter_farm_with_merge_tokens.scen.json"); + world().run("scenarios/enter_farm_with_merge_tokens.scen.json"); } #[test] fn enter_mex_farm_go() { - multiversx_sc_scenario::run_go("scenarios/enter_mex_farm.scen.json"); + world().run("scenarios/enter_mex_farm.scen.json"); } #[test] fn exit_farm_go() { - multiversx_sc_scenario::run_go("scenarios/exit_farm.scen.json"); + world().run("scenarios/exit_farm.scen.json"); } #[test] fn exit_farm_too_soon_go() { - multiversx_sc_scenario::run_go("scenarios/exit_farm_too_soon.scen.json"); + world().run("scenarios/exit_farm_too_soon.scen.json"); } #[test] fn exit_mex_farm_go() { - multiversx_sc_scenario::run_go("scenarios/exit_mex_farm.scen.json"); + world().run("scenarios/exit_mex_farm.scen.json"); } #[test] fn farm_reward_distr_scen_1_go() { - multiversx_sc_scenario::run_go("scenarios/farm_reward_distr_scen_1.scen.json"); + world().run("scenarios/farm_reward_distr_scen_1.scen.json"); } #[test] fn farm_reward_distr_scen_2_go() { - multiversx_sc_scenario::run_go("scenarios/farm_reward_distr_scen_2.scen.json"); + world().run("scenarios/farm_reward_distr_scen_2.scen.json"); } #[test] fn farm_reward_distr_scen_3_go() { - multiversx_sc_scenario::run_go("scenarios/farm_reward_distr_scen_3.scen.json"); + world().run("scenarios/farm_reward_distr_scen_3.scen.json"); } #[test] fn farm_reward_distr_scen_4_go() { - multiversx_sc_scenario::run_go("scenarios/farm_reward_distr_scen_4.scen.json"); + world().run("scenarios/farm_reward_distr_scen_4.scen.json"); } #[test] fn farm_with_egld_token_go() { - multiversx_sc_scenario::run_go("scenarios/farm_with_egld_token.scen.json"); + world().run("scenarios/farm_with_egld_token.scen.json"); } #[test] fn farm_wrong_lp_token_go() { - multiversx_sc_scenario::run_go("scenarios/farm_wrong_lp_token.scen.json"); + world().run("scenarios/farm_wrong_lp_token.scen.json"); } #[test] fn get_amounts_go() { - multiversx_sc_scenario::run_go("scenarios/get_amounts.scen.json"); + world().run("scenarios/get_amounts.scen.json"); } #[test] fn get_amounts_no_liquidity_go() { - multiversx_sc_scenario::run_go("scenarios/get_amounts_no_liquidity.scen.json"); + world().run("scenarios/get_amounts_no_liquidity.scen.json"); } #[test] fn get_pair_non_existent_go() { - multiversx_sc_scenario::run_go("scenarios/get_pair_non_existent.scen.json"); + world().run("scenarios/get_pair_non_existent.scen.json"); } #[test] fn get_pair_views_go() { - multiversx_sc_scenario::run_go("scenarios/get_pair_views.scen.json"); + world().run("scenarios/get_pair_views.scen.json"); } #[test] fn merge_tokens_go() { - multiversx_sc_scenario::run_go("scenarios/merge_tokens.scen.json"); + world().run("scenarios/merge_tokens.scen.json"); } #[test] fn owner_pause_farm_go() { - multiversx_sc_scenario::run_go("scenarios/owner_pause_farm.scen.json"); + world().run("scenarios/owner_pause_farm.scen.json"); } #[test] fn owner_resume_farm_go() { - multiversx_sc_scenario::run_go("scenarios/owner_resume_farm.scen.json"); + world().run("scenarios/owner_resume_farm.scen.json"); } #[test] fn remove_liquidity_go() { - multiversx_sc_scenario::run_go("scenarios/remove_liquidity.scen.json"); + world().run("scenarios/remove_liquidity.scen.json"); } #[test] fn remove_liquidity_and_buyback_and_burn_token_go() { - multiversx_sc_scenario::run_go( - "scenarios/remove_liquidity_and_buyback_and_burn_token.scen.json", - ); + world().run("scenarios/remove_liquidity_and_buyback_and_burn_token.scen.json"); } #[test] fn remove_liquidity_twice_go() { - multiversx_sc_scenario::run_go("scenarios/remove_liquidity_twice.scen.json"); + world().run("scenarios/remove_liquidity_twice.scen.json"); } #[test] fn remove_pair_go() { - multiversx_sc_scenario::run_go("scenarios/remove_pair.scen.json"); + world().run("scenarios/remove_pair.scen.json"); } #[test] fn router_pause_self_go() { - multiversx_sc_scenario::run_go("scenarios/router_pause_self.scen.json"); + world().run("scenarios/router_pause_self.scen.json"); } #[test] fn router_resume_self_go() { - multiversx_sc_scenario::run_go("scenarios/router_resume_self.scen.json"); + world().run("scenarios/router_resume_self.scen.json"); } #[test] fn swap_fixed_input_go() { - multiversx_sc_scenario::run_go("scenarios/swap_fixed_input.scen.json"); + world().run("scenarios/swap_fixed_input.scen.json"); } #[test] fn swap_fixed_input_after_removed_liquidity_go() { - multiversx_sc_scenario::run_go("scenarios/swap_fixed_input_after_removed_liquidity.scen.json"); + world().run("scenarios/swap_fixed_input_after_removed_liquidity.scen.json"); } #[test] fn swap_fixed_output_go() { - multiversx_sc_scenario::run_go("scenarios/swap_fixed_output.scen.json"); + world().run("scenarios/swap_fixed_output.scen.json"); } #[test] fn swap_same_token_go() { - multiversx_sc_scenario::run_go("scenarios/swap_same_token.scen.json"); + world().run("scenarios/swap_same_token.scen.json"); } #[test] fn swap_wrong_token_go() { - multiversx_sc_scenario::run_go("scenarios/swap_wrong_token.scen.json"); + world().run("scenarios/swap_wrong_token.scen.json"); } #[test] fn upgrade_contract_go() { - multiversx_sc_scenario::run_go("scenarios/upgrade_contract.scen.json"); + world().run("scenarios/upgrade_contract.scen.json"); } diff --git a/dex/tests/dex_scenario_rs_test.rs b/dex/tests/dex_scenario_rs_test.rs index b5124f1d0..623f63667 100644 --- a/dex/tests/dex_scenario_rs_test.rs +++ b/dex/tests/dex_scenario_rs_test.rs @@ -13,212 +13,200 @@ fn world() -> ScenarioWorld { #[test] fn add_liquidity_rs() { - multiversx_sc_scenario::run_rs("scenarios/add_liquidity.scen.json", world()); + world().run("scenarios/add_liquidity.scen.json"); } #[test] fn calculate_rewards_for_given_position_rs() { - multiversx_sc_scenario::run_rs( - "scenarios/calculate_rewards_for_given_position.scen.json", - world(), - ); + world().run("scenarios/calculate_rewards_for_given_position.scen.json"); } #[test] fn calculate_rewards_for_given_position_after_compound_rs() { - multiversx_sc_scenario::run_rs( - "scenarios/calculate_rewards_for_given_position_after_compound.scen.json", - world(), - ); + world().run("scenarios/calculate_rewards_for_given_position_after_compound.scen.json"); } #[test] fn check_fee_disabled_after_swap_rs() { - multiversx_sc_scenario::run_rs("scenarios/check_fee_disabled_after_swap.scen.json", world()); + world().run("scenarios/check_fee_disabled_after_swap.scen.json"); } #[test] fn check_fee_enabled_after_swap_rs() { - multiversx_sc_scenario::run_rs("scenarios/check_fee_enabled_after_swap.scen.json", world()); + world().run("scenarios/check_fee_enabled_after_swap.scen.json"); } #[test] fn claim_rewards_rs() { - multiversx_sc_scenario::run_rs("scenarios/claim_rewards.scen.json", world()); + world().run("scenarios/claim_rewards.scen.json"); } #[test] fn complete_setup_rs() { - multiversx_sc_scenario::run_rs("scenarios/complete_setup.scen.json", world()); + world().run("scenarios/complete_setup.scen.json"); } #[test] fn compound_rewards_rs() { - multiversx_sc_scenario::run_rs("scenarios/compound_rewards.scen.json", world()); + world().run("scenarios/compound_rewards.scen.json"); } #[test] fn create_pair_twice_rs() { - multiversx_sc_scenario::run_rs("scenarios/create_pair_twice.scen.json", world()); + world().run("scenarios/create_pair_twice.scen.json"); } #[test] fn enter_farm_rs() { - multiversx_sc_scenario::run_rs("scenarios/enter_farm.scen.json", world()); + world().run("scenarios/enter_farm.scen.json"); } #[test] fn enter_farm_with_merge_tokens_rs() { - multiversx_sc_scenario::run_rs("scenarios/enter_farm_with_merge_tokens.scen.json", world()); + world().run("scenarios/enter_farm_with_merge_tokens.scen.json"); } #[test] fn enter_mex_farm_rs() { - multiversx_sc_scenario::run_rs("scenarios/enter_mex_farm.scen.json", world()); + world().run("scenarios/enter_mex_farm.scen.json"); } #[test] fn exit_farm_rs() { - multiversx_sc_scenario::run_rs("scenarios/exit_farm.scen.json", world()); + world().run("scenarios/exit_farm.scen.json"); } #[test] fn exit_farm_too_soon_rs() { - multiversx_sc_scenario::run_rs("scenarios/exit_farm_too_soon.scen.json", world()); + world().run("scenarios/exit_farm_too_soon.scen.json"); } #[test] fn exit_mex_farm_rs() { - multiversx_sc_scenario::run_rs("scenarios/exit_mex_farm.scen.json", world()); + world().run("scenarios/exit_mex_farm.scen.json"); } #[test] fn farm_reward_distr_scen_1_rs() { - multiversx_sc_scenario::run_rs("scenarios/farm_reward_distr_scen_1.scen.json", world()); + world().run("scenarios/farm_reward_distr_scen_1.scen.json"); } #[test] fn farm_reward_distr_scen_2_rs() { - multiversx_sc_scenario::run_rs("scenarios/farm_reward_distr_scen_2.scen.json", world()); + world().run("scenarios/farm_reward_distr_scen_2.scen.json"); } #[test] fn farm_reward_distr_scen_3_rs() { - multiversx_sc_scenario::run_rs("scenarios/farm_reward_distr_scen_3.scen.json", world()); + world().run("scenarios/farm_reward_distr_scen_3.scen.json"); } #[test] fn farm_reward_distr_scen_4_rs() { - multiversx_sc_scenario::run_rs("scenarios/farm_reward_distr_scen_4.scen.json", world()); + world().run("scenarios/farm_reward_distr_scen_4.scen.json"); } #[test] fn farm_with_egld_token_rs() { - multiversx_sc_scenario::run_rs("scenarios/farm_with_egld_token.scen.json", world()); + world().run("scenarios/farm_with_egld_token.scen.json"); } #[test] fn farm_wrong_lp_token_rs() { - multiversx_sc_scenario::run_rs("scenarios/farm_wrong_lp_token.scen.json", world()); + world().run("scenarios/farm_wrong_lp_token.scen.json"); } #[test] fn get_amounts_rs() { - multiversx_sc_scenario::run_rs("scenarios/get_amounts.scen.json", world()); + world().run("scenarios/get_amounts.scen.json"); } #[test] fn get_amounts_no_liquidity_rs() { - multiversx_sc_scenario::run_rs("scenarios/get_amounts_no_liquidity.scen.json", world()); + world().run("scenarios/get_amounts_no_liquidity.scen.json"); } #[test] fn get_pair_non_existent_rs() { - multiversx_sc_scenario::run_rs("scenarios/get_pair_non_existent.scen.json", world()); + world().run("scenarios/get_pair_non_existent.scen.json"); } #[test] fn get_pair_views_rs() { - multiversx_sc_scenario::run_rs("scenarios/get_pair_views.scen.json", world()); + world().run("scenarios/get_pair_views.scen.json"); } #[test] fn merge_tokens_rs() { - multiversx_sc_scenario::run_rs("scenarios/merge_tokens.scen.json", world()); + world().run("scenarios/merge_tokens.scen.json"); } #[test] fn owner_pause_farm_rs() { - multiversx_sc_scenario::run_rs("scenarios/owner_pause_farm.scen.json", world()); + world().run("scenarios/owner_pause_farm.scen.json"); } #[test] fn owner_resume_farm_rs() { - multiversx_sc_scenario::run_rs("scenarios/owner_resume_farm.scen.json", world()); + world().run("scenarios/owner_resume_farm.scen.json"); } #[test] fn remove_liquidity_rs() { - multiversx_sc_scenario::run_rs("scenarios/remove_liquidity.scen.json", world()); + world().run("scenarios/remove_liquidity.scen.json"); } #[test] fn remove_liquidity_and_buyback_and_burn_token_rs() { - multiversx_sc_scenario::run_rs( - "scenarios/remove_liquidity_and_buyback_and_burn_token.scen.json", - world(), - ); + world().run("scenarios/remove_liquidity_and_buyback_and_burn_token.scen.json"); } #[test] fn remove_liquidity_twice_rs() { - multiversx_sc_scenario::run_rs("scenarios/remove_liquidity_twice.scen.json", world()); + world().run("scenarios/remove_liquidity_twice.scen.json"); } #[test] fn remove_pair_rs() { - multiversx_sc_scenario::run_rs("scenarios/remove_pair.scen.json", world()); + world().run("scenarios/remove_pair.scen.json"); } #[test] fn router_pause_self_rs() { - multiversx_sc_scenario::run_rs("scenarios/router_pause_self.scen.json", world()); + world().run("scenarios/router_pause_self.scen.json"); } #[test] fn router_resume_self_rs() { - multiversx_sc_scenario::run_rs("scenarios/router_resume_self.scen.json", world()); + world().run("scenarios/router_resume_self.scen.json"); } #[test] fn swap_fixed_input_rs() { - multiversx_sc_scenario::run_rs("scenarios/swap_fixed_input.scen.json", world()); + world().run("scenarios/swap_fixed_input.scen.json"); } #[test] fn swap_fixed_input_after_removed_liquidity_rs() { - multiversx_sc_scenario::run_rs( - "scenarios/swap_fixed_input_after_removed_liquidity.scen.json", - world(), - ); + world().run("scenarios/swap_fixed_input_after_removed_liquidity.scen.json"); } #[test] fn swap_fixed_output_rs() { - multiversx_sc_scenario::run_rs("scenarios/swap_fixed_output.scen.json", world()); + world().run("scenarios/swap_fixed_output.scen.json"); } #[test] fn swap_same_token_rs() { - multiversx_sc_scenario::run_rs("scenarios/swap_same_token.scen.json", world()); + world().run("scenarios/swap_same_token.scen.json"); } #[test] fn swap_wrong_token_rs() { - multiversx_sc_scenario::run_rs("scenarios/swap_wrong_token.scen.json", world()); + world().run("scenarios/swap_wrong_token.scen.json"); } #[test] fn upgrade_contract_rs() { - multiversx_sc_scenario::run_rs("scenarios/upgrade_contract.scen.json", world()); + world().run("scenarios/upgrade_contract.scen.json"); } diff --git a/energy-integration/common-modules/energy-query/Cargo.toml b/energy-integration/common-modules/energy-query/Cargo.toml index f82a69e26..fa86ab377 100644 --- a/energy-integration/common-modules/energy-query/Cargo.toml +++ b/energy-integration/common-modules/energy-query/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.energy-factory] diff --git a/energy-integration/common-modules/week-timekeeping/Cargo.toml b/energy-integration/common-modules/week-timekeeping/Cargo.toml index c40233221..08a32ef44 100644 --- a/energy-integration/common-modules/week-timekeeping/Cargo.toml +++ b/energy-integration/common-modules/week-timekeeping/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.common-types] diff --git a/energy-integration/common-modules/weekly-rewards-splitting/Cargo.toml b/energy-integration/common-modules/weekly-rewards-splitting/Cargo.toml index 8969827f5..fb0f0c2dc 100644 --- a/energy-integration/common-modules/weekly-rewards-splitting/Cargo.toml +++ b/energy-integration/common-modules/weekly-rewards-splitting/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.energy-query] diff --git a/energy-integration/common-types/Cargo.toml b/energy-integration/common-types/Cargo.toml index 9f3258892..ecb8bb89d 100644 --- a/energy-integration/common-types/Cargo.toml +++ b/energy-integration/common-types/Cargo.toml @@ -7,5 +7,5 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/energy-integration/energy-factory-mock/Cargo.toml b/energy-integration/energy-factory-mock/Cargo.toml index 7a3f7728f..95588ec75 100644 --- a/energy-integration/energy-factory-mock/Cargo.toml +++ b/energy-integration/energy-factory-mock/Cargo.toml @@ -11,7 +11,7 @@ path = "src/lib.rs" path = "../common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies.multiversx-sc-scenario] -version = "=0.41.0" +version = "=0.42.0" diff --git a/energy-integration/energy-factory-mock/meta/Cargo.toml b/energy-integration/energy-factory-mock/meta/Cargo.toml index 74848b0df..2875e2307 100644 --- a/energy-integration/energy-factory-mock/meta/Cargo.toml +++ b/energy-integration/energy-factory-mock/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.41.0" +version = "0.42.0" diff --git a/energy-integration/energy-factory-mock/wasm/Cargo.toml b/energy-integration/energy-factory-mock/wasm/Cargo.toml index 99c907c59..59674aaef 100644 --- a/energy-integration/energy-factory-mock/wasm/Cargo.toml +++ b/energy-integration/energy-factory-mock/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.41.0" +version = "=0.42.0" diff --git a/energy-integration/energy-update/Cargo.toml b/energy-integration/energy-update/Cargo.toml index 53af90b10..9855a3bd5 100644 --- a/energy-integration/energy-update/Cargo.toml +++ b/energy-integration/energy-update/Cargo.toml @@ -8,11 +8,11 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.41.0" +version = "=0.42.0" [dependencies.farm] path = "../../dex/farm" @@ -24,4 +24,4 @@ path = "../common-modules/weekly-rewards-splitting" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.41.0" +version = "=0.42.0" diff --git a/energy-integration/energy-update/meta/Cargo.toml b/energy-integration/energy-update/meta/Cargo.toml index 4b238d65d..6ba2d63b1 100644 --- a/energy-integration/energy-update/meta/Cargo.toml +++ b/energy-integration/energy-update/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.41.0" +version = "0.42.0" diff --git a/energy-integration/energy-update/wasm/Cargo.toml b/energy-integration/energy-update/wasm/Cargo.toml index df1055bb7..4bc2db79c 100644 --- a/energy-integration/energy-update/wasm/Cargo.toml +++ b/energy-integration/energy-update/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.41.0" +version = "=0.42.0" diff --git a/energy-integration/farm-boosted-yields/Cargo.toml b/energy-integration/farm-boosted-yields/Cargo.toml index a093421b9..51a690e35 100644 --- a/energy-integration/farm-boosted-yields/Cargo.toml +++ b/energy-integration/farm-boosted-yields/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.config] diff --git a/energy-integration/farm-boosted-yields/src/lib.rs b/energy-integration/farm-boosted-yields/src/lib.rs index e9b38e526..fc441b515 100644 --- a/energy-integration/farm-boosted-yields/src/lib.rs +++ b/energy-integration/farm-boosted-yields/src/lib.rs @@ -6,6 +6,7 @@ use core::cmp; use boosted_yields_factors::BoostedYieldsConfig; use common_types::PaymentsVec; +use multiversx_sc::api::ErrorApi; use week_timekeeping::Week; use weekly_rewards_splitting::{ base_impl::WeeklyRewardsSplittingTraitsModule, USER_MAX_CLAIM_WEEKS, diff --git a/energy-integration/fees-collector/Cargo.toml b/energy-integration/fees-collector/Cargo.toml index 4252cad97..c77e3e03b 100644 --- a/energy-integration/fees-collector/Cargo.toml +++ b/energy-integration/fees-collector/Cargo.toml @@ -8,11 +8,11 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.41.0" +version = "=0.42.0" [dependencies.energy-query] path = "../common-modules/energy-query" @@ -48,7 +48,7 @@ path = "../../common/common_errors" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.41.0" +version = "=0.42.0" [dev-dependencies.sc_whitelist_module] path = "../../common/modules/sc_whitelist_module" diff --git a/energy-integration/fees-collector/meta/Cargo.toml b/energy-integration/fees-collector/meta/Cargo.toml index 0f44601f2..c050057c7 100644 --- a/energy-integration/fees-collector/meta/Cargo.toml +++ b/energy-integration/fees-collector/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.41.0" +version = "0.42.0" diff --git a/energy-integration/fees-collector/tests/fees_collector_rust_test.rs b/energy-integration/fees-collector/tests/fees_collector_rust_test.rs index c840080e5..30a8d56b2 100644 --- a/energy-integration/fees-collector/tests/fees_collector_rust_test.rs +++ b/energy-integration/fees-collector/tests/fees_collector_rust_test.rs @@ -1,3 +1,5 @@ +#![allow(deprecated)] + mod fees_collector_test_setup; use energy_query::Energy; diff --git a/energy-integration/fees-collector/tests/fees_collector_test_setup/mod.rs b/energy-integration/fees-collector/tests/fees_collector_test_setup/mod.rs index e3524ce65..e5d5baaca 100644 --- a/energy-integration/fees-collector/tests/fees_collector_test_setup/mod.rs +++ b/energy-integration/fees-collector/tests/fees_collector_test_setup/mod.rs @@ -1,3 +1,5 @@ +#![allow(deprecated)] + use multiversx_sc::{ codec::multi_types::OptionalValue, storage::mappers::StorageTokenWrapper, @@ -5,7 +7,7 @@ use multiversx_sc::{ }; use multiversx_sc_scenario::{ managed_address, managed_biguint, managed_token_id, managed_token_id_wrapped, rust_biguint, - whitebox::TxResult, whitebox::*, DebugApi, + whitebox_legacy::TxResult, whitebox_legacy::*, DebugApi, }; use energy_factory::{energy::EnergyModule, SimpleLockEnergy}; diff --git a/energy-integration/fees-collector/wasm/Cargo.toml b/energy-integration/fees-collector/wasm/Cargo.toml index 7382de0f1..c394f7c6d 100644 --- a/energy-integration/fees-collector/wasm/Cargo.toml +++ b/energy-integration/fees-collector/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.41.0" +version = "=0.42.0" diff --git a/energy-integration/governance-v2/Cargo.toml b/energy-integration/governance-v2/Cargo.toml index 23a054917..4dc4d683f 100644 --- a/energy-integration/governance-v2/Cargo.toml +++ b/energy-integration/governance-v2/Cargo.toml @@ -11,7 +11,7 @@ path = "src/lib.rs" path = "../common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.permissions_module] @@ -27,7 +27,7 @@ path = "../common-modules/weekly-rewards-splitting" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.41.0" +version = "=0.42.0" [dev-dependencies.energy-factory-mock] path = "../energy-factory-mock" diff --git a/energy-integration/governance-v2/meta/Cargo.toml b/energy-integration/governance-v2/meta/Cargo.toml index 1b3a3d68b..1e2c7b5ac 100644 --- a/energy-integration/governance-v2/meta/Cargo.toml +++ b/energy-integration/governance-v2/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.41.0" +version = "0.42.0" diff --git a/energy-integration/governance-v2/src/lib.rs b/energy-integration/governance-v2/src/lib.rs index 584d43008..e2b27e5c6 100644 --- a/energy-integration/governance-v2/src/lib.rs +++ b/energy-integration/governance-v2/src/lib.rs @@ -37,7 +37,7 @@ pub trait GovernanceV2: /// - `quorum_percentage` - the minimum number of (`votes` minus `downvotes`) at the end of voting period /// - `votingDelayInBlocks` - Number of blocks to wait after a block is proposed before being able to vote/downvote that proposal /// - `votingPeriodInBlocks` - Number of blocks the voting period lasts (voting delay does not count towards this) - /// - `withdraw_percentage_defeated` - Percetange of the fee to be returned if proposal defetead + /// - `withdraw_percentage_defeated` - Percetange of the fee to be returned if proposal defetead /// - `energy_factory_address` /// - `fees_collector_address` /// - `fee_token` - The token used to pay the fee diff --git a/energy-integration/governance-v2/tests/gov_rust_test.rs b/energy-integration/governance-v2/tests/gov_rust_test.rs index 5c2329a3d..a9ec92558 100644 --- a/energy-integration/governance-v2/tests/gov_rust_test.rs +++ b/energy-integration/governance-v2/tests/gov_rust_test.rs @@ -1,3 +1,5 @@ +#![allow(deprecated)] + mod gov_test_setup; use gov_test_setup::*; diff --git a/energy-integration/governance-v2/tests/gov_test_setup/mod.rs b/energy-integration/governance-v2/tests/gov_test_setup/mod.rs index 3c02e7e09..8ea1ef5f0 100644 --- a/energy-integration/governance-v2/tests/gov_test_setup/mod.rs +++ b/energy-integration/governance-v2/tests/gov_test_setup/mod.rs @@ -1,3 +1,5 @@ +#![allow(deprecated)] + use energy_factory_mock::EnergyFactoryMock; use energy_query::Energy; use fees_collector::FeesCollector; @@ -12,8 +14,8 @@ use multiversx_sc::{ }; use multiversx_sc_scenario::{ managed_address, managed_biguint, managed_buffer, managed_token_id, rust_biguint, - whitebox::TxResult, - whitebox::{BlockchainStateWrapper, ContractObjWrapper}, + whitebox_legacy::TxResult, + whitebox_legacy::{BlockchainStateWrapper, ContractObjWrapper}, DebugApi, }; use num_bigint::BigUint; diff --git a/energy-integration/governance-v2/wasm/Cargo.toml b/energy-integration/governance-v2/wasm/Cargo.toml index 34f7bde21..bbae2b03e 100644 --- a/energy-integration/governance-v2/wasm/Cargo.toml +++ b/energy-integration/governance-v2/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.41.0" +version = "=0.42.0" diff --git a/farm-staking/farm-staking-proxy/Cargo.toml b/farm-staking/farm-staking-proxy/Cargo.toml index d2596d68e..a66a88277 100644 --- a/farm-staking/farm-staking-proxy/Cargo.toml +++ b/farm-staking/farm-staking-proxy/Cargo.toml @@ -12,11 +12,11 @@ path = "src/lib.rs" hex-literal = "0.3.1" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.41.0" +version = "=0.42.0" [dependencies.farm] path = "../../dex/farm" @@ -61,7 +61,7 @@ path = "../../common/modules/sc_whitelist_module" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.41.0" +version = "=0.42.0" [dev-dependencies.farm_token] path = "../../common/modules/farm/farm_token" diff --git a/farm-staking/farm-staking-proxy/meta/Cargo.toml b/farm-staking/farm-staking-proxy/meta/Cargo.toml index ae7ccede3..2647116b3 100644 --- a/farm-staking/farm-staking-proxy/meta/Cargo.toml +++ b/farm-staking/farm-staking-proxy/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.41.0" +version = "0.42.0" diff --git a/farm-staking/farm-staking-proxy/tests/composed_pos_test.rs b/farm-staking/farm-staking-proxy/tests/composed_pos_test.rs index 76b13a8f8..ee0f78cbc 100644 --- a/farm-staking/farm-staking-proxy/tests/composed_pos_test.rs +++ b/farm-staking/farm-staking-proxy/tests/composed_pos_test.rs @@ -1,3 +1,5 @@ +#![allow(deprecated)] + pub mod constants; pub mod staking_farm_with_lp_external_contracts; pub mod staking_farm_with_lp_staking_contract_interactions; diff --git a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp.rs b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp.rs index 6036f505e..e54f13dc6 100644 --- a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp.rs +++ b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp.rs @@ -1,3 +1,5 @@ +#![allow(deprecated)] + pub mod constants; pub mod staking_farm_with_lp_external_contracts; pub mod staking_farm_with_lp_staking_contract_interactions; diff --git a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_external_contracts/mod.rs b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_external_contracts/mod.rs index 02729ff2d..69891868d 100644 --- a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_external_contracts/mod.rs +++ b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_external_contracts/mod.rs @@ -1,9 +1,11 @@ +#![allow(deprecated)] + use multiversx_sc::codec::multi_types::{MultiValue3, OptionalValue}; use multiversx_sc::storage::mappers::StorageTokenWrapper; use multiversx_sc::types::{Address, EsdtLocalRole, ManagedAddress, MultiValueEncoded}; -use multiversx_sc_scenario::whitebox::TxTokenTransfer; +use multiversx_sc_scenario::whitebox_legacy::TxTokenTransfer; use multiversx_sc_scenario::{ - managed_address, managed_biguint, managed_token_id, rust_biguint, whitebox::*, DebugApi, + managed_address, managed_biguint, managed_token_id, rust_biguint, whitebox_legacy::*, DebugApi, }; use farm::exit_penalty::ExitPenaltyModule; diff --git a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_interactions/mod.rs b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_interactions/mod.rs index f9eb0b06e..8be6d9b13 100644 --- a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_interactions/mod.rs +++ b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_interactions/mod.rs @@ -1,8 +1,10 @@ +#![allow(deprecated)] + use multiversx_sc::{codec::multi_types::OptionalValue, types::Address}; use multiversx_sc_scenario::{ managed_address, managed_biguint, rust_biguint, - whitebox::TxTokenTransfer, - whitebox::{BlockchainStateWrapper, ContractObjWrapper}, + whitebox_legacy::TxTokenTransfer, + whitebox_legacy::{BlockchainStateWrapper, ContractObjWrapper}, DebugApi, }; diff --git a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_setup/mod.rs b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_setup/mod.rs index 1635f22e0..e5d848e5d 100644 --- a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_setup/mod.rs +++ b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_setup/mod.rs @@ -1,8 +1,10 @@ +#![allow(deprecated)] + use multiversx_sc::storage::mappers::StorageTokenWrapper; use multiversx_sc::types::{Address, EsdtLocalRole, ManagedAddress, MultiValueEncoded}; use multiversx_sc_scenario::{ managed_address, managed_biguint, managed_token_id, rust_biguint, - whitebox::{BlockchainStateWrapper, ContractObjWrapper}, + whitebox_legacy::{BlockchainStateWrapper, ContractObjWrapper}, DebugApi, }; diff --git a/farm-staking/farm-staking-proxy/wasm/Cargo.toml b/farm-staking/farm-staking-proxy/wasm/Cargo.toml index 72cad6257..912124ded 100644 --- a/farm-staking/farm-staking-proxy/wasm/Cargo.toml +++ b/farm-staking/farm-staking-proxy/wasm/Cargo.toml @@ -22,5 +22,5 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.41.0" +version = "=0.42.0" features = ["vm-validate-token-identifier"] diff --git a/farm-staking/farm-staking/Cargo.toml b/farm-staking/farm-staking/Cargo.toml index 8755cfddd..036fc5e1d 100644 --- a/farm-staking/farm-staking/Cargo.toml +++ b/farm-staking/farm-staking/Cargo.toml @@ -77,14 +77,14 @@ path = "../../common/common_structs" path = "../../common/common_errors" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.41.0" +version = "=0.42.0" [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.41.0" +version = "=0.42.0" diff --git a/farm-staking/farm-staking/meta/Cargo.toml b/farm-staking/farm-staking/meta/Cargo.toml index 9a9bb3c61..15e0d861c 100644 --- a/farm-staking/farm-staking/meta/Cargo.toml +++ b/farm-staking/farm-staking/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.41.0" +version = "0.42.0" diff --git a/farm-staking/farm-staking/tests/farm_staking_energy_test.rs b/farm-staking/farm-staking/tests/farm_staking_energy_test.rs index d7afaf744..bb95876b4 100644 --- a/farm-staking/farm-staking/tests/farm_staking_energy_test.rs +++ b/farm-staking/farm-staking/tests/farm_staking_energy_test.rs @@ -1,3 +1,5 @@ +#![allow(deprecated)] + pub mod farm_staking_setup; use farm_staking::{ claim_stake_farm_rewards::ClaimStakeFarmRewardsModule, stake_farm::StakeFarmModule, diff --git a/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs b/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs index 0ad97a738..e861eb64f 100644 --- a/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs +++ b/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs @@ -1,9 +1,11 @@ +#![allow(deprecated)] + use multiversx_sc::codec::multi_types::OptionalValue; use multiversx_sc::storage::mappers::StorageTokenWrapper; use multiversx_sc::types::{Address, BigInt, EsdtLocalRole, ManagedAddress, MultiValueEncoded}; -use multiversx_sc_scenario::whitebox::TxTokenTransfer; +use multiversx_sc_scenario::whitebox_legacy::TxTokenTransfer; use multiversx_sc_scenario::{ - managed_address, managed_biguint, managed_token_id, rust_biguint, whitebox::*, DebugApi, + managed_address, managed_biguint, managed_token_id, rust_biguint, whitebox_legacy::*, DebugApi, }; pub type RustBigUint = num_bigint::BigUint; diff --git a/farm-staking/farm-staking/tests/farm_staking_test.rs b/farm-staking/farm-staking/tests/farm_staking_test.rs index 6a8eba2ae..271efe5c2 100644 --- a/farm-staking/farm-staking/tests/farm_staking_test.rs +++ b/farm-staking/farm-staking/tests/farm_staking_test.rs @@ -1,4 +1,6 @@ -use multiversx_sc_scenario::{rust_biguint, whitebox::TxTokenTransfer, DebugApi}; +#![allow(deprecated)] + +use multiversx_sc_scenario::{rust_biguint, whitebox_legacy::TxTokenTransfer, DebugApi}; pub mod farm_staking_setup; use farm_staking::{ diff --git a/farm-staking/farm-staking/wasm/Cargo.toml b/farm-staking/farm-staking/wasm/Cargo.toml index 43aa71f48..13d4e5205 100644 --- a/farm-staking/farm-staking/wasm/Cargo.toml +++ b/farm-staking/farm-staking/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.41.0" +version = "=0.42.0" diff --git a/farm-staking/metabonding-staking/Cargo.toml b/farm-staking/metabonding-staking/Cargo.toml index b7bb52cee..d9c18ae26 100644 --- a/farm-staking/metabonding-staking/Cargo.toml +++ b/farm-staking/metabonding-staking/Cargo.toml @@ -8,11 +8,11 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.41.0" +version = "=0.42.0" [dependencies.factory] path = "../../locked-asset/factory" @@ -21,7 +21,7 @@ path = "../../locked-asset/factory" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.41.0" +version = "=0.42.0" [dev-dependencies.common_structs] path = "../../common/common_structs" diff --git a/farm-staking/metabonding-staking/meta/Cargo.toml b/farm-staking/metabonding-staking/meta/Cargo.toml index 9848cd72d..2e1acb451 100644 --- a/farm-staking/metabonding-staking/meta/Cargo.toml +++ b/farm-staking/metabonding-staking/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.41.0" +version = "0.42.0" diff --git a/farm-staking/metabonding-staking/tests/metabonding_staking_setup/mod.rs b/farm-staking/metabonding-staking/tests/metabonding_staking_setup/mod.rs index 6e7d01b4a..b32812145 100644 --- a/farm-staking/metabonding-staking/tests/metabonding_staking_setup/mod.rs +++ b/farm-staking/metabonding-staking/tests/metabonding_staking_setup/mod.rs @@ -1,3 +1,5 @@ +#![allow(deprecated)] + use common_structs::{ LockedAssetTokenAttributesEx, UnlockMilestone, UnlockMilestoneEx, UnlockScheduleEx, }; @@ -7,9 +9,9 @@ use metabonding_staking::MetabondingStaking; use multiversx_sc::storage::mappers::StorageTokenWrapper; use multiversx_sc::types::{Address, EsdtLocalRole, ManagedVec}; use multiversx_sc_modules::pause::PauseModule; -use multiversx_sc_scenario::whitebox::{TxResult, TxTokenTransfer}; +use multiversx_sc_scenario::whitebox_legacy::{TxResult, TxTokenTransfer}; use multiversx_sc_scenario::{ - managed_address, managed_biguint, managed_token_id, rust_biguint, whitebox::*, DebugApi, + managed_address, managed_biguint, managed_token_id, rust_biguint, whitebox_legacy::*, DebugApi, }; pub const METABONDING_STAKING_WASM_PATH: &str = "1.wasm"; diff --git a/farm-staking/metabonding-staking/tests/metabonding_staking_test.rs b/farm-staking/metabonding-staking/tests/metabonding_staking_test.rs index cc084e495..c83be6726 100644 --- a/farm-staking/metabonding-staking/tests/metabonding_staking_test.rs +++ b/farm-staking/metabonding-staking/tests/metabonding_staking_test.rs @@ -1,3 +1,5 @@ +#![allow(deprecated)] + pub mod metabonding_staking_setup; use metabonding_staking::{ locked_asset_token::{LockedAssetTokenModule, UserEntry}, @@ -5,7 +7,7 @@ use metabonding_staking::{ }; use metabonding_staking_setup::*; use multiversx_sc_scenario::{ - managed_address, managed_biguint, rust_biguint, whitebox::TxTokenTransfer, + managed_address, managed_biguint, rust_biguint, whitebox_legacy::TxTokenTransfer, }; #[test] diff --git a/farm-staking/metabonding-staking/wasm/Cargo.toml b/farm-staking/metabonding-staking/wasm/Cargo.toml index 1fae8b4c0..76a1fde72 100644 --- a/farm-staking/metabonding-staking/wasm/Cargo.toml +++ b/farm-staking/metabonding-staking/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.41.0" +version = "=0.42.0" diff --git a/locked-asset/Cargo.toml b/locked-asset/Cargo.toml index a11a0fa62..72e7f786e 100644 --- a/locked-asset/Cargo.toml +++ b/locked-asset/Cargo.toml @@ -4,7 +4,7 @@ version = "0.0.0" edition = "2021" publish = false [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.farm] @@ -49,7 +49,7 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-modules] -version = "=0.41.0" +version = "=0.42.0" [dev-dependencies.multiversx-sc-scenario] -version = "=0.41.0" +version = "=0.42.0" diff --git a/locked-asset/distribution/Cargo.toml b/locked-asset/distribution/Cargo.toml index 1f202ec0e..05da3b270 100644 --- a/locked-asset/distribution/Cargo.toml +++ b/locked-asset/distribution/Cargo.toml @@ -13,7 +13,7 @@ path = "../../common/common_structs" path = "../factory" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies.multiversx-sc-scenario] -version = "=0.41.0" +version = "=0.42.0" diff --git a/locked-asset/distribution/meta/Cargo.toml b/locked-asset/distribution/meta/Cargo.toml index a072c5736..599c2a126 100644 --- a/locked-asset/distribution/meta/Cargo.toml +++ b/locked-asset/distribution/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.41.0" +version = "0.42.0" diff --git a/locked-asset/distribution/wasm/Cargo.toml b/locked-asset/distribution/wasm/Cargo.toml index 6acbac2c9..eb70848ae 100644 --- a/locked-asset/distribution/wasm/Cargo.toml +++ b/locked-asset/distribution/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.41.0" +version = "=0.42.0" diff --git a/locked-asset/energy-factory/Cargo.toml b/locked-asset/energy-factory/Cargo.toml index 46de9581c..f164c78cb 100644 --- a/locked-asset/energy-factory/Cargo.toml +++ b/locked-asset/energy-factory/Cargo.toml @@ -32,11 +32,11 @@ path = "../../common/traits/unwrappable" path = "../../common/modules/legacy_token_decode_module" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.41.0" +version = "=0.42.0" [dev-dependencies] num-bigint = "0.4.2" @@ -44,4 +44,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.41.0" +version = "=0.42.0" diff --git a/locked-asset/energy-factory/meta/Cargo.toml b/locked-asset/energy-factory/meta/Cargo.toml index 50c0431a1..db4b5f52d 100644 --- a/locked-asset/energy-factory/meta/Cargo.toml +++ b/locked-asset/energy-factory/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.41.0" +version = "0.42.0" diff --git a/locked-asset/energy-factory/src/token_merging.rs b/locked-asset/energy-factory/src/token_merging.rs index e6b683206..36470c70d 100644 --- a/locked-asset/energy-factory/src/token_merging.rs +++ b/locked-asset/energy-factory/src/token_merging.rs @@ -1,6 +1,8 @@ multiversx_sc::imports!(); multiversx_sc::derive_imports!(); +use multiversx_sc::api::BlockchainApi; + use common_structs::PaymentsVec; use math::weighted_average_round_up; use mergeable::Mergeable; diff --git a/locked-asset/energy-factory/tests/energy_factory_setup/mod.rs b/locked-asset/energy-factory/tests/energy_factory_setup/mod.rs index e44ac9fc5..f6693c2fe 100644 --- a/locked-asset/energy-factory/tests/energy_factory_setup/mod.rs +++ b/locked-asset/energy-factory/tests/energy_factory_setup/mod.rs @@ -1,4 +1,5 @@ #![allow(dead_code)] +#![allow(deprecated)] pub mod unbond_sc_mock; @@ -14,8 +15,8 @@ use multiversx_sc::{ use multiversx_sc_modules::pause::PauseModule; use multiversx_sc_scenario::{ managed_address, managed_biguint, managed_token_id, rust_biguint, - whitebox::TxResult, - whitebox::{BlockchainStateWrapper, ContractObjWrapper}, + whitebox_legacy::TxResult, + whitebox_legacy::{BlockchainStateWrapper, ContractObjWrapper}, DebugApi, }; use simple_lock::locked_token::LockedTokenModule; diff --git a/locked-asset/energy-factory/tests/old_tokens_test.rs b/locked-asset/energy-factory/tests/old_tokens_test.rs index ba8be3d6a..6f39214ff 100644 --- a/locked-asset/energy-factory/tests/old_tokens_test.rs +++ b/locked-asset/energy-factory/tests/old_tokens_test.rs @@ -1,3 +1,5 @@ +#![allow(deprecated)] + mod energy_factory_setup; use common_structs::{ diff --git a/locked-asset/energy-factory/tests/simple_lock_energy_test.rs b/locked-asset/energy-factory/tests/simple_lock_energy_test.rs index 21d4f2d29..409ee1c1a 100644 --- a/locked-asset/energy-factory/tests/simple_lock_energy_test.rs +++ b/locked-asset/energy-factory/tests/simple_lock_energy_test.rs @@ -1,3 +1,5 @@ +#![allow(deprecated)] + mod energy_factory_setup; use energy_factory::energy::EnergyModule; diff --git a/locked-asset/energy-factory/tests/token_merging_test.rs b/locked-asset/energy-factory/tests/token_merging_test.rs index fd81bb2d7..00b4ede93 100644 --- a/locked-asset/energy-factory/tests/token_merging_test.rs +++ b/locked-asset/energy-factory/tests/token_merging_test.rs @@ -1,3 +1,5 @@ +#![allow(deprecated)] + mod energy_factory_setup; use energy_factory::{ @@ -17,7 +19,8 @@ use multiversx_sc::{ }; use multiversx_sc_modules::pause::PauseModule; use multiversx_sc_scenario::{ - managed_address, managed_token_id, whitebox::BlockchainStateWrapper, whitebox::TxTokenTransfer, + managed_address, managed_token_id, whitebox_legacy::BlockchainStateWrapper, + whitebox_legacy::TxTokenTransfer, }; use simple_lock::{ basic_lock_unlock::BasicLockUnlock, diff --git a/locked-asset/energy-factory/tests/virtual_lock_test.rs b/locked-asset/energy-factory/tests/virtual_lock_test.rs index 1d13e1eb9..250abff1f 100644 --- a/locked-asset/energy-factory/tests/virtual_lock_test.rs +++ b/locked-asset/energy-factory/tests/virtual_lock_test.rs @@ -1,3 +1,5 @@ +#![allow(deprecated)] + mod energy_factory_setup; use energy_factory::virtual_lock::VirtualLockModule; diff --git a/locked-asset/energy-factory/wasm/Cargo.toml b/locked-asset/energy-factory/wasm/Cargo.toml index a35ae1bac..ba6f427b8 100644 --- a/locked-asset/energy-factory/wasm/Cargo.toml +++ b/locked-asset/energy-factory/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.41.0" +version = "=0.42.0" diff --git a/locked-asset/factory/Cargo.toml b/locked-asset/factory/Cargo.toml index 764235d05..e2a659fc1 100644 --- a/locked-asset/factory/Cargo.toml +++ b/locked-asset/factory/Cargo.toml @@ -26,11 +26,11 @@ path = "../../common/modules/token_merge_helper" path = "../energy-factory" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.41.0" +version = "=0.42.0" [dependencies.arrayvec] version = "0.7.1" @@ -49,4 +49,4 @@ hex = "0.4" path = "../simple-lock" [dev-dependencies.multiversx-sc-scenario] -version = "=0.41.0" +version = "=0.42.0" diff --git a/locked-asset/factory/meta/Cargo.toml b/locked-asset/factory/meta/Cargo.toml index 008ea69d4..7312ff4fa 100644 --- a/locked-asset/factory/meta/Cargo.toml +++ b/locked-asset/factory/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.41.0" +version = "0.42.0" diff --git a/locked-asset/factory/tests/factory_setup/mod.rs b/locked-asset/factory/tests/factory_setup/mod.rs index 148ce0e13..9fec3157d 100644 --- a/locked-asset/factory/tests/factory_setup/mod.rs +++ b/locked-asset/factory/tests/factory_setup/mod.rs @@ -1,4 +1,5 @@ #![allow(dead_code)] +#![allow(deprecated)] use common_structs::UnlockMilestone; use energy_factory::SimpleLockEnergy; @@ -11,7 +12,7 @@ use multiversx_sc::{ }; use multiversx_sc_scenario::{ managed_address, managed_token_id, rust_biguint, - whitebox::{BlockchainStateWrapper, ContractObjWrapper}, + whitebox_legacy::{BlockchainStateWrapper, ContractObjWrapper}, DebugApi, }; use simple_lock::locked_token::LockedTokenModule; diff --git a/locked-asset/factory/tests/lock_test.rs b/locked-asset/factory/tests/lock_test.rs index bd097933c..556642eef 100644 --- a/locked-asset/factory/tests/lock_test.rs +++ b/locked-asset/factory/tests/lock_test.rs @@ -1,3 +1,5 @@ +#![allow(deprecated)] + use common_structs::{ LockedAssetTokenAttributesEx, UnlockMilestone, UnlockMilestoneEx, UnlockScheduleEx, }; @@ -6,7 +8,7 @@ use multiversx_sc::{ types::{EsdtLocalRole, ManagedVec, MultiValueEncoded}, }; use multiversx_sc_scenario::{ - managed_biguint, managed_token_id, rust_biguint, whitebox::*, DebugApi, + managed_biguint, managed_token_id, rust_biguint, whitebox_legacy::*, DebugApi, }; const SC_WASM_PATH: &str = "output/factory.wasm"; diff --git a/locked-asset/factory/tests/unlock_test.rs b/locked-asset/factory/tests/unlock_test.rs index bfc8403de..333d97b50 100644 --- a/locked-asset/factory/tests/unlock_test.rs +++ b/locked-asset/factory/tests/unlock_test.rs @@ -1,8 +1,10 @@ +#![allow(deprecated)] + use common_structs::{LockedAssetTokenAttributesEx, UnlockMilestoneEx, UnlockScheduleEx}; use multiversx_sc::types::{BigInt, MultiValueEncoded}; use multiversx_sc::types::{EsdtTokenPayment, ManagedVec, TokenIdentifier}; use multiversx_sc_scenario::{ - managed_address, managed_biguint, rust_biguint, whitebox::*, DebugApi, + managed_address, managed_biguint, rust_biguint, whitebox_legacy::*, DebugApi, }; const SC_WASM_PATH: &str = "output/factory.wasm"; diff --git a/locked-asset/factory/wasm/Cargo.toml b/locked-asset/factory/wasm/Cargo.toml index 2fe668562..22220e5d5 100644 --- a/locked-asset/factory/wasm/Cargo.toml +++ b/locked-asset/factory/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.41.0" +version = "=0.42.0" diff --git a/locked-asset/lkmex-transfer/Cargo.toml b/locked-asset/lkmex-transfer/Cargo.toml index e16312493..a6d2e4b9a 100644 --- a/locked-asset/lkmex-transfer/Cargo.toml +++ b/locked-asset/lkmex-transfer/Cargo.toml @@ -29,14 +29,14 @@ path = "../energy-factory" path = "../../energy-integration/common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.41.0" +version = "=0.42.0" [dev-dependencies.multiversx-sc-modules] -version = "=0.41.0" +version = "=0.42.0" diff --git a/locked-asset/lkmex-transfer/meta/Cargo.toml b/locked-asset/lkmex-transfer/meta/Cargo.toml index 72173b3a0..76410a6b4 100644 --- a/locked-asset/lkmex-transfer/meta/Cargo.toml +++ b/locked-asset/lkmex-transfer/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.41.0" +version = "0.42.0" diff --git a/locked-asset/lkmex-transfer/tests/lkmex_transfer_tests.rs b/locked-asset/lkmex-transfer/tests/lkmex_transfer_tests.rs index 2f265d1a1..9ec46ebc2 100644 --- a/locked-asset/lkmex-transfer/tests/lkmex_transfer_tests.rs +++ b/locked-asset/lkmex-transfer/tests/lkmex_transfer_tests.rs @@ -1,7 +1,9 @@ +#![allow(deprecated)] + use multiversx_sc::codec::multi_types::OptionalValue; use multiversx_sc::storage::mappers::StorageTokenWrapper; use multiversx_sc::types::{BigInt, EsdtLocalRole, MultiValueEncoded}; -use multiversx_sc_scenario::{managed_address, managed_biguint, whitebox::*}; +use multiversx_sc_scenario::{managed_address, managed_biguint, whitebox_legacy::*}; use multiversx_sc_scenario::{managed_token_id, rust_biguint}; use energy_factory::energy::EnergyModule; diff --git a/locked-asset/lkmex-transfer/wasm/Cargo.toml b/locked-asset/lkmex-transfer/wasm/Cargo.toml index 716705c35..366cc607b 100644 --- a/locked-asset/lkmex-transfer/wasm/Cargo.toml +++ b/locked-asset/lkmex-transfer/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.41.0" +version = "=0.42.0" diff --git a/locked-asset/locked-token-wrapper/Cargo.toml b/locked-asset/locked-token-wrapper/Cargo.toml index b1e7a4a15..105e22340 100644 --- a/locked-asset/locked-token-wrapper/Cargo.toml +++ b/locked-asset/locked-token-wrapper/Cargo.toml @@ -8,10 +8,10 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" [dependencies.multiversx-sc-modules] -version = "=0.41.0" +version = "=0.42.0" [dependencies.utils] path = "../../common/modules/utils" @@ -43,4 +43,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.41.0" +version = "=0.42.0" diff --git a/locked-asset/locked-token-wrapper/meta/Cargo.toml b/locked-asset/locked-token-wrapper/meta/Cargo.toml index 39e80ce0f..5c0709dc7 100644 --- a/locked-asset/locked-token-wrapper/meta/Cargo.toml +++ b/locked-asset/locked-token-wrapper/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.41.0" +version = "0.42.0" diff --git a/locked-asset/locked-token-wrapper/tests/locked_token_wrapping_test.rs b/locked-asset/locked-token-wrapper/tests/locked_token_wrapping_test.rs index d4c5d22c8..13edf221e 100644 --- a/locked-asset/locked-token-wrapper/tests/locked_token_wrapping_test.rs +++ b/locked-asset/locked-token-wrapper/tests/locked_token_wrapping_test.rs @@ -1,3 +1,5 @@ +#![allow(deprecated)] + use energy_factory_mock::EnergyFactoryMock; use energy_query::Energy; use locked_token_wrapper::{ @@ -7,7 +9,7 @@ use locked_token_wrapper::{ use multiversx_sc::{storage::mappers::StorageTokenWrapper, types::EsdtLocalRole}; use multiversx_sc_scenario::{ managed_address, managed_biguint, managed_token_id, managed_token_id_wrapped, rust_biguint, - whitebox::BlockchainStateWrapper, DebugApi, + whitebox_legacy::BlockchainStateWrapper, DebugApi, }; use simple_lock::locked_token::LockedTokenAttributes; diff --git a/locked-asset/locked-token-wrapper/wasm/Cargo.toml b/locked-asset/locked-token-wrapper/wasm/Cargo.toml index 6dd616302..7d3bf7341 100644 --- a/locked-asset/locked-token-wrapper/wasm/Cargo.toml +++ b/locked-asset/locked-token-wrapper/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.41.0" +version = "=0.42.0" diff --git a/locked-asset/proxy_dex/Cargo.toml b/locked-asset/proxy_dex/Cargo.toml index 14361f041..e4d6cb257 100644 --- a/locked-asset/proxy_dex/Cargo.toml +++ b/locked-asset/proxy_dex/Cargo.toml @@ -44,11 +44,11 @@ path = "../../common/traits/mergeable" path = "../../common/traits/fixed-supply-token" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.41.0" +version = "=0.42.0" [dependencies.energy-factory] path = "../energy-factory" @@ -65,7 +65,7 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.41.0" +version = "=0.42.0" [dev-dependencies.pausable] path = "../../common/modules/pausable" diff --git a/locked-asset/proxy_dex/meta/Cargo.toml b/locked-asset/proxy_dex/meta/Cargo.toml index 6b835d751..55c609a02 100644 --- a/locked-asset/proxy_dex/meta/Cargo.toml +++ b/locked-asset/proxy_dex/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.41.0" +version = "0.42.0" diff --git a/locked-asset/proxy_dex/tests/proxy_dex_test_setup/mod.rs b/locked-asset/proxy_dex/tests/proxy_dex_test_setup/mod.rs index 1fdff8d2b..413ddb980 100644 --- a/locked-asset/proxy_dex/tests/proxy_dex_test_setup/mod.rs +++ b/locked-asset/proxy_dex/tests/proxy_dex_test_setup/mod.rs @@ -1,3 +1,5 @@ +#![allow(deprecated)] + use config::ConfigModule; use energy_factory::{locked_token_transfer::LockedTokenTransferModule, SimpleLockEnergy}; use energy_query::EnergyQueryModule; @@ -14,7 +16,7 @@ use multiversx_sc::{ use multiversx_sc_modules::pause::PauseModule; use multiversx_sc_scenario::{ managed_address, managed_biguint, managed_token_id, managed_token_id_wrapped, rust_biguint, - whitebox::{BlockchainStateWrapper, ContractObjWrapper}, + whitebox_legacy::{BlockchainStateWrapper, ContractObjWrapper}, DebugApi, }; use pair::{config::ConfigModule as OtherConfigModule, Pair}; diff --git a/locked-asset/proxy_dex/tests/proxy_farm_test.rs b/locked-asset/proxy_dex/tests/proxy_farm_test.rs index f363483e9..bfa289fde 100644 --- a/locked-asset/proxy_dex/tests/proxy_farm_test.rs +++ b/locked-asset/proxy_dex/tests/proxy_farm_test.rs @@ -1,3 +1,5 @@ +#![allow(deprecated)] + mod proxy_dex_test_setup; use common_structs::FarmTokenAttributes; @@ -11,7 +13,7 @@ use multiversx_sc::{ }; use multiversx_sc_scenario::{ managed_address, managed_biguint, managed_token_id, managed_token_id_wrapped, rust_biguint, - whitebox::TxTokenTransfer, DebugApi, + whitebox_legacy::TxTokenTransfer, DebugApi, }; use num_traits::ToPrimitive; use proxy_dex::{ diff --git a/locked-asset/proxy_dex/tests/proxy_lp_test.rs b/locked-asset/proxy_dex/tests/proxy_lp_test.rs index c96323a50..1f025ca67 100644 --- a/locked-asset/proxy_dex/tests/proxy_lp_test.rs +++ b/locked-asset/proxy_dex/tests/proxy_lp_test.rs @@ -1,3 +1,5 @@ +#![allow(deprecated)] + mod proxy_dex_test_setup; use energy_factory::{energy::EnergyModule, SimpleLockEnergy}; @@ -8,7 +10,7 @@ use multiversx_sc::{ }; use multiversx_sc_scenario::{ managed_address, managed_biguint, managed_token_id, managed_token_id_wrapped, rust_biguint, - whitebox::TxTokenTransfer, DebugApi, + whitebox_legacy::TxTokenTransfer, DebugApi, }; use num_traits::ToPrimitive; use proxy_dex::{ diff --git a/locked-asset/proxy_dex/wasm/Cargo.toml b/locked-asset/proxy_dex/wasm/Cargo.toml index a36693d1b..3070db804 100644 --- a/locked-asset/proxy_dex/wasm/Cargo.toml +++ b/locked-asset/proxy_dex/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.41.0" +version = "=0.42.0" diff --git a/locked-asset/simple-lock-whitelist/Cargo.toml b/locked-asset/simple-lock-whitelist/Cargo.toml index 5e32fc766..39882c1bd 100644 --- a/locked-asset/simple-lock-whitelist/Cargo.toml +++ b/locked-asset/simple-lock-whitelist/Cargo.toml @@ -14,11 +14,11 @@ path = "../simple-lock" path = "../../common/modules/utils" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.41.0" +version = "=0.42.0" [dev-dependencies] num-bigint = "0.4.2" @@ -26,4 +26,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.41.0" +version = "=0.42.0" diff --git a/locked-asset/simple-lock-whitelist/meta/Cargo.toml b/locked-asset/simple-lock-whitelist/meta/Cargo.toml index 8313a3a25..b146358f9 100644 --- a/locked-asset/simple-lock-whitelist/meta/Cargo.toml +++ b/locked-asset/simple-lock-whitelist/meta/Cargo.toml @@ -8,4 +8,4 @@ authors = ["Dorin Iancu "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.41.0" +version = "0.42.0" diff --git a/locked-asset/simple-lock-whitelist/tests/whitelist_test.rs b/locked-asset/simple-lock-whitelist/tests/whitelist_test.rs index 8e3cff4d3..d2f335ec1 100644 --- a/locked-asset/simple-lock-whitelist/tests/whitelist_test.rs +++ b/locked-asset/simple-lock-whitelist/tests/whitelist_test.rs @@ -1,7 +1,9 @@ +#![allow(deprecated)] + use multiversx_sc::codec::multi_types::OptionalValue; use multiversx_sc::types::{EsdtLocalRole, MultiValueEncoded}; use multiversx_sc_scenario::{managed_token_id, rust_biguint, DebugApi}; -use multiversx_sc_scenario::{managed_token_id_wrapped, whitebox::*}; +use multiversx_sc_scenario::{managed_token_id_wrapped, whitebox_legacy::*}; use multiversx_sc::storage::mappers::StorageTokenWrapper; use simple_lock::locked_token::*; diff --git a/locked-asset/simple-lock-whitelist/wasm/Cargo.toml b/locked-asset/simple-lock-whitelist/wasm/Cargo.toml index c40b42eea..aeef25cc8 100644 --- a/locked-asset/simple-lock-whitelist/wasm/Cargo.toml +++ b/locked-asset/simple-lock-whitelist/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.41.0" +version = "=0.42.0" diff --git a/locked-asset/simple-lock/Cargo.toml b/locked-asset/simple-lock/Cargo.toml index e001ab642..7251cb4d2 100644 --- a/locked-asset/simple-lock/Cargo.toml +++ b/locked-asset/simple-lock/Cargo.toml @@ -8,11 +8,11 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.41.0" +version = "=0.42.0" [dependencies.common_structs] path = "../../common/common_structs" @@ -23,4 +23,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.41.0" +version = "=0.42.0" diff --git a/locked-asset/simple-lock/meta/Cargo.toml b/locked-asset/simple-lock/meta/Cargo.toml index 567b68d62..578259c66 100644 --- a/locked-asset/simple-lock/meta/Cargo.toml +++ b/locked-asset/simple-lock/meta/Cargo.toml @@ -8,4 +8,4 @@ authors = ["Dorin Iancu "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.41.0" +version = "0.42.0" diff --git a/locked-asset/simple-lock/tests/rust_test.rs b/locked-asset/simple-lock/tests/rust_test.rs index 8b879b610..8b760049a 100644 --- a/locked-asset/simple-lock/tests/rust_test.rs +++ b/locked-asset/simple-lock/tests/rust_test.rs @@ -1,6 +1,8 @@ +#![allow(deprecated)] + use multiversx_sc::codec::multi_types::OptionalValue; use multiversx_sc::types::EsdtLocalRole; -use multiversx_sc_scenario::{managed_biguint, managed_token_id_wrapped, whitebox::*}; +use multiversx_sc_scenario::{managed_biguint, managed_token_id_wrapped, whitebox_legacy::*}; use multiversx_sc_scenario::{managed_token_id, rust_biguint, DebugApi}; use multiversx_sc::storage::mappers::StorageTokenWrapper; diff --git a/locked-asset/simple-lock/wasm/Cargo.toml b/locked-asset/simple-lock/wasm/Cargo.toml index cc638384f..6c63e40f1 100644 --- a/locked-asset/simple-lock/wasm/Cargo.toml +++ b/locked-asset/simple-lock/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.41.0" +version = "=0.42.0" diff --git a/locked-asset/tests/distribution_scenario_go_test.rs b/locked-asset/tests/distribution_scenario_go_test.rs index 637f0521b..b887a0d42 100644 --- a/locked-asset/tests/distribution_scenario_go_test.rs +++ b/locked-asset/tests/distribution_scenario_go_test.rs @@ -1,138 +1,179 @@ -// #[test] -// fn add_liquidity_proxy_go() { -// multiversx_sc_scenario::run_go("scenarios/add_liquidity_proxy.scen.json"); -// } - -// #[test] -// fn claim_locked_assets_basic_go() { -// multiversx_sc_scenario::run_go("scenarios/claim_locked_assets_basic.scen.json"); -// } - -// #[test] -// fn claim_mex_rewards_proxy_after_mint_rewards_go() { -// multiversx_sc_scenario::run_go("scenarios/claim_mex_rewards_proxy_after_mint_rewards.scen.json"); -// } - -// #[test] -// fn claim_only_last_four_go() { -// multiversx_sc_scenario::run_go("scenarios/claim_only_last_four.scen.json"); -// } - -// #[test] -// fn claim_rewards_proxy_go() { -// multiversx_sc_scenario::run_go("scenarios/claim_rewards_proxy.scen.json"); -// } - -// /* -// #[test] -// fn claim_rewards_proxy_after_mint_rewards_go() { -// multiversx_sc_scenario::run_go("scenarios/claim_rewards_proxy_after_mint_rewards.scen.json"); -// } -// */ -// #[test] -// fn clear_unclaimable_assets_go() { -// multiversx_sc_scenario::run_go("scenarios/clear_unclaimable_assets.scen.json"); -// } - -// #[test] -// fn compound_mex_rewards_proxy_after_mint_rewards_go() { -// multiversx_sc_scenario::run_go("scenarios/compound_mex_rewards_proxy_after_mint_rewards.scen.json"); -// } - -// #[test] -// fn enter_farm_proxy_go() { -// multiversx_sc_scenario::run_go("scenarios/enter_farm_proxy.scen.json"); -// } - -// #[test] -// fn enter_mex_farm_proxy_go() { -// multiversx_sc_scenario::run_go("scenarios/enter_mex_farm_proxy.scen.json"); -// } - -// #[test] -// fn exit_farm_proxy_go() { -// multiversx_sc_scenario::run_go("scenarios/exit_farm_proxy.scen.json"); -// } - -// #[test] -// fn exit_mex_farm_proxy_after_compound_rewards_and_epoch_increase_go() { -// multiversx_sc_scenario::run_go( -// "scenarios/exit_mex_farm_proxy_after_compound_rewards_and_epoch_increase.scen.json", -// ); -// } - -// #[test] -// fn exit_mex_farm_proxy_after_compound_rewards_go() { -// multiversx_sc_scenario::run_go("scenarios/exit_mex_farm_proxy_after_compound_rewards.scen.json"); -// } - -// /* -// #[test] -// fn exit_farm_proxy_after_mint_rewards_go() { -// multiversx_sc_scenario::run_go("scenarios/exit_farm_proxy_after_mint_rewards.scen.json"); -// } -// */ -// #[test] -// fn exit_mex_farm_proxy_after_mint_rewards_go() { -// multiversx_sc_scenario::run_go("scenarios/exit_mex_farm_proxy_after_mint_rewards.scen.json"); -// } - -// #[test] -// fn merge_locked_mex_tokens_go() { -// multiversx_sc_scenario::run_go("scenarios/merge_locked_mex_tokens.scen.json"); -// } - -// #[test] -// fn multiple_claim_assets_go() { -// multiversx_sc_scenario::run_go("scenarios/multiple_claim_assets.scen.json"); -// } - -// #[test] -// fn remove_liquidity_proxy_go() { -// multiversx_sc_scenario::run_go("scenarios/remove_liquidity_proxy.scen.json"); -// } - -// #[test] -// fn remove_liquidity_proxy_after_swap_mex_go() { -// multiversx_sc_scenario::run_go("scenarios/remove_liquidity_proxy_after_swap_mex.scen.json"); -// } - -// #[test] -// fn remove_liquidity_proxy_after_swap_wegld_go() { -// multiversx_sc_scenario::run_go("scenarios/remove_liquidity_proxy_after_swap_wegld.scen.json"); -// } - -// #[test] -// fn set_user_distribution_go() { -// multiversx_sc_scenario::run_go("scenarios/set_user_distribution.scen.json"); -// } - -// #[test] -// fn set_user_distribution_above_cap_go() { -// multiversx_sc_scenario::run_go("scenarios/set_user_distribution_above_cap.scen.json"); -// } - -// #[test] -// fn set_user_distribution_duplicate_go() { -// multiversx_sc_scenario::run_go("scenarios/set_user_distribution_duplicate.scen.json"); -// } - -// #[test] -// fn set_user_distribution_with_unlock_go() { -// multiversx_sc_scenario::run_go("scenarios/set_user_distribution_with_unlock.scen.json"); -// } - -// #[test] -// fn undo_last_community_distribution_go() { -// multiversx_sc_scenario::run_go("scenarios/undo_last_community_distribution.scen.json"); -// } - -// #[test] -// fn undo_user_distribution_between_epochs_go() { -// multiversx_sc_scenario::run_go("scenarios/undo_user_distribution_between_epochs.scen.json"); -// } - -// #[test] -// fn unlock_assets_basic_go() { -// multiversx_sc_scenario::run_go("scenarios/unlock_assets_basic.scen.json"); -// } +use multiversx_sc_scenario::*; + +fn world() -> ScenarioWorld { + ScenarioWorld::vm_go() +} + +#[test] +#[ignore] +fn add_liquidity_proxy_go() { + world().run("scenarios/add_liquidity_proxy.scen.json"); +} + +#[test] +#[ignore] +fn add_liquidity_with_merge_tokens_go() { + world().run("scenarios/add_liquidity_with_merge_tokens.scen.json"); +} + +#[test] +#[ignore] +fn claim_locked_assets_basic_go() { + world().run("scenarios/claim_locked_assets_basic.scen.json"); +} + +#[test] +#[ignore] +fn claim_mex_rewards_proxy_after_mint_rewards_go() { + world().run("scenarios/claim_mex_rewards_proxy_after_mint_rewards.scen.json"); +} + +#[test] +#[ignore] +fn claim_only_last_four_go() { + world().run("scenarios/claim_only_last_four.scen.json"); +} + +#[test] +#[ignore] +fn claim_rewards_proxy_go() { + world().run("scenarios/claim_rewards_proxy.scen.json"); +} + +#[test] +#[ignore] +fn clear_unclaimable_assets_go() { + world().run("scenarios/clear_unclaimable_assets.scen.json"); +} + +#[test] +#[ignore] +fn compound_mex_rewards_proxy_after_mint_rewards_go() { + world().run("scenarios/compound_mex_rewards_proxy_after_mint_rewards.scen.json"); +} + +#[test] +#[ignore] +fn enter_farm_proxy_go() { + world().run("scenarios/enter_farm_proxy.scen.json"); +} + +#[test] +#[ignore] +fn enter_farm_proxy_with_merge_tokens_go() { + world().run("scenarios/enter_farm_proxy_with_merge_tokens.scen.json"); +} + +#[test] +#[ignore] +fn enter_mex_farm_proxy_go() { + world().run("scenarios/enter_mex_farm_proxy.scen.json"); +} + +#[test] +#[ignore] +fn exit_farm_proxy_go() { + world().run("scenarios/exit_farm_proxy.scen.json"); +} + +#[test] +#[ignore] +fn exit_mex_farm_proxy_after_compound_rewards_go() { + world().run("scenarios/exit_mex_farm_proxy_after_compound_rewards.scen.json"); +} + +#[test] +#[ignore] +fn exit_mex_farm_proxy_after_compound_rewards_and_epoch_increase_go() { + world().run("scenarios/exit_mex_farm_proxy_after_compound_rewards_and_epoch_increase.scen.json"); +} + +#[test] +#[ignore] +fn exit_mex_farm_proxy_after_mint_rewards_go() { + world().run("scenarios/exit_mex_farm_proxy_after_mint_rewards.scen.json"); +} + +#[test] +#[ignore] +fn merge_locked_mex_tokens_go() { + world().run("scenarios/merge_locked_mex_tokens.scen.json"); +} + +#[test] +#[ignore] +fn merge_wrapped_farm_tokens_go() { + world().run("scenarios/merge_wrapped_farm_tokens.scen.json"); +} + +#[test] +#[ignore] +fn merge_wrapped_lp_tokens_go() { + world().run("scenarios/merge_wrapped_lp_tokens.scen.json"); +} + +#[test] +#[ignore] +fn multiple_claim_assets_go() { + world().run("scenarios/multiple_claim_assets.scen.json"); +} + +#[test] +#[ignore] +fn remove_liquidity_proxy_go() { + world().run("scenarios/remove_liquidity_proxy.scen.json"); +} + +#[test] +#[ignore] +fn remove_liquidity_proxy_after_swap_mex_go() { + world().run("scenarios/remove_liquidity_proxy_after_swap_mex.scen.json"); +} + +#[test] +#[ignore] +fn remove_liquidity_proxy_after_swap_wegld_go() { + world().run("scenarios/remove_liquidity_proxy_after_swap_wegld.scen.json"); +} + +#[test] +#[ignore] +fn set_user_distribution_go() { + world().run("scenarios/set_user_distribution.scen.json"); +} + +#[test] +#[ignore] +fn set_user_distribution_above_cap_go() { + world().run("scenarios/set_user_distribution_above_cap.scen.json"); +} + +#[test] +#[ignore] +fn set_user_distribution_duplicate_go() { + world().run("scenarios/set_user_distribution_duplicate.scen.json"); +} + +#[test] +#[ignore] +fn set_user_distribution_with_unlock_go() { + world().run("scenarios/set_user_distribution_with_unlock.scen.json"); +} + +#[test] +#[ignore] +fn undo_last_community_distribution_go() { + world().run("scenarios/undo_last_community_distribution.scen.json"); +} + +#[test] +#[ignore] +fn undo_user_distribution_between_epochs_go() { + world().run("scenarios/undo_user_distribution_between_epochs.scen.json"); +} + +#[test] +#[ignore] +fn unlock_assets_basic_go() { + world().run("scenarios/unlock_assets_basic.scen.json"); +} diff --git a/locked-asset/token-unstake/Cargo.toml b/locked-asset/token-unstake/Cargo.toml index a81cdc500..a11a4a670 100644 --- a/locked-asset/token-unstake/Cargo.toml +++ b/locked-asset/token-unstake/Cargo.toml @@ -8,7 +8,7 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.mergeable] @@ -38,7 +38,7 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.41.0" +version = "=0.42.0" [dev-dependencies.multiversx-sc-modules] -version = "=0.41.0" +version = "=0.42.0" diff --git a/locked-asset/token-unstake/meta/Cargo.toml b/locked-asset/token-unstake/meta/Cargo.toml index 81b241482..47fedd0b8 100644 --- a/locked-asset/token-unstake/meta/Cargo.toml +++ b/locked-asset/token-unstake/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.41.0" +version = "0.42.0" diff --git a/locked-asset/token-unstake/tests/token_unstake_setup/mod.rs b/locked-asset/token-unstake/tests/token_unstake_setup/mod.rs index f74fbb844..5191fe7b8 100644 --- a/locked-asset/token-unstake/tests/token_unstake_setup/mod.rs +++ b/locked-asset/token-unstake/tests/token_unstake_setup/mod.rs @@ -1,4 +1,5 @@ #![allow(dead_code)] +#![allow(deprecated)] pub mod fees_collector_mock; @@ -15,8 +16,8 @@ use multiversx_sc::{ use multiversx_sc_modules::pause::PauseModule; use multiversx_sc_scenario::{ managed_address, managed_biguint, managed_token_id, rust_biguint, - whitebox::TxResult, - whitebox::{BlockchainStateWrapper, ContractObjWrapper}, + whitebox_legacy::TxResult, + whitebox_legacy::{BlockchainStateWrapper, ContractObjWrapper}, DebugApi, }; use simple_lock::locked_token::LockedTokenModule; diff --git a/locked-asset/token-unstake/tests/token_unstake_test.rs b/locked-asset/token-unstake/tests/token_unstake_test.rs index 21596d411..e247a4a0d 100644 --- a/locked-asset/token-unstake/tests/token_unstake_test.rs +++ b/locked-asset/token-unstake/tests/token_unstake_test.rs @@ -1,3 +1,5 @@ +#![allow(deprecated)] + mod token_unstake_setup; use multiversx_sc::types::{EsdtTokenPayment, ManagedVec}; diff --git a/locked-asset/token-unstake/tests/unlock_early_test.rs b/locked-asset/token-unstake/tests/unlock_early_test.rs index bbe17cf2c..5da1c4021 100644 --- a/locked-asset/token-unstake/tests/unlock_early_test.rs +++ b/locked-asset/token-unstake/tests/unlock_early_test.rs @@ -1,3 +1,5 @@ +#![allow(deprecated)] + mod token_unstake_setup; use energy_factory::energy::EnergyModule; diff --git a/locked-asset/token-unstake/wasm/Cargo.toml b/locked-asset/token-unstake/wasm/Cargo.toml index 2991c44a3..d4e44421c 100644 --- a/locked-asset/token-unstake/wasm/Cargo.toml +++ b/locked-asset/token-unstake/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.41.0" +version = "=0.42.0" diff --git a/pause-all/Cargo.toml b/pause-all/Cargo.toml index c99ec1a7f..49ee9d910 100644 --- a/pause-all/Cargo.toml +++ b/pause-all/Cargo.toml @@ -11,13 +11,13 @@ path = "src/lib.rs" path = "../common/modules/pausable" [dependencies.multiversx-sc] -version = "=0.41.0" +version = "=0.42.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.41.0" +version = "=0.42.0" [dev-dependencies.multiversx-sc-scenario] -version = "=0.41.0" +version = "=0.42.0" [dev-dependencies.farm] path = "../dex/farm" diff --git a/pause-all/meta/Cargo.toml b/pause-all/meta/Cargo.toml index 9a477b7b0..bcfe951d6 100644 --- a/pause-all/meta/Cargo.toml +++ b/pause-all/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.41.0" +version = "0.42.0" diff --git a/pause-all/tests/pause_all_test.rs b/pause-all/tests/pause_all_test.rs index 6a46cbbbf..37cc38e70 100644 --- a/pause-all/tests/pause_all_test.rs +++ b/pause-all/tests/pause_all_test.rs @@ -1,7 +1,9 @@ +#![allow(deprecated)] + use farm::Farm; use multiversx_sc::types::{Address, ManagedAddress, MultiValueEncoded, OperationCompletionStatus}; use multiversx_sc_scenario::{ - managed_address, managed_biguint, managed_token_id, rust_biguint, whitebox::*, DebugApi, + managed_address, managed_biguint, managed_token_id, rust_biguint, whitebox_legacy::*, DebugApi, }; use pair::Pair; use pausable::{PausableModule, State}; diff --git a/pause-all/wasm/Cargo.toml b/pause-all/wasm/Cargo.toml index 09882a081..958a4a7e6 100644 --- a/pause-all/wasm/Cargo.toml +++ b/pause-all/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.41.0" +version = "=0.42.0" From 225b32cb30c17c6753fa168104b1826cfd102f67 Mon Sep 17 00:00:00 2001 From: ovidiuolteanu Date: Mon, 28 Aug 2023 09:34:29 +0300 Subject: [PATCH 035/213] reproducible build update for compatibility --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f4d16ca6d..6c10eb4fe 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,5 +11,5 @@ jobs: build: uses: multiversx/mx-sc-actions/.github/workflows/reproducible-build.yml@v2.3.1 with: - image_tag: v5.1.0 + image_tag: v5.2.0 attach_to_existing_release: true From 76578b45bc94400cf14070a0d020d291d1befe79 Mon Sep 17 00:00:00 2001 From: ovidiuolteanu Date: Mon, 28 Aug 2023 16:44:50 +0300 Subject: [PATCH 036/213] purge for the unspoken --- README.md | 10 +++++----- dex/farm-with-locked-rewards/README.md | 2 +- dex/farm/README.md | 2 +- dex/pair/README.md | 4 ++-- dex/router/README.md | 2 +- locked-asset/distribution/README.md | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index e5376eaa0..615a1e32e 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# Maiar Exchange Smart Contracts +# xExchange Smart Contracts -This repository contains the principal Smart Contract components of Maiar Exchange. +This repository contains the principal Smart Contract components of xExchange. This document is a brief description of the Smart Contracts. It covers the basic workflows that a user may do in order to succesfully interact with each contract. For those interested about more in-depth technical details, each contract will have its separate README in its own root directory. -- [Maiar Exchange Smart Contracts](#maiar-exchange-smart-contracts) +- [xExchange Smart Contracts](#xexchange-smart-contracts) - [DEX Contracts](#dex-contracts) - [Pair Contract](#pair-contract) - [Router Contract](#router-contract) @@ -20,13 +20,13 @@ This document is a brief description of the Smart Contracts. It covers the basic - [DEX Proxy Contract](#dex-proxy-contract) - [Locked MEX Factory Contract](#locked-mex-factory-contract) -Other Smart Contracts that are part of Maiar exchange, but are not part of this repository: +Other Smart Contracts that are part of xExchange, but are not part of this repository: - [Egld wrapping](https://github.com/multiversx/mx-sdk-rs/tree/master/contracts/core/wegld-swap) used for swapping EGLD to an ESDT and reversed with an exchange rate of 1:1. ## DEX Contracts -Core SCs of Maiar Exchange. They usually handle a few tokens and are used as primitives by the other contracts as they are built on top of them. +Core SCs of xExchange. They usually handle a few tokens and are used as primitives by the other contracts as they are built on top of them. ### Pair Contract diff --git a/dex/farm-with-locked-rewards/README.md b/dex/farm-with-locked-rewards/README.md index ba1d7b443..fd70b0aa2 100644 --- a/dex/farm-with-locked-rewards/README.md +++ b/dex/farm-with-locked-rewards/README.md @@ -2,7 +2,7 @@ ## Abstract -Liquidity providers of Maiar Exchange are incentivized with locked rewards in exchange for them locking their tokens in Farm contracts. +Liquidity providers of xExchange are incentivized with locked rewards in exchange for them locking their tokens in Farm contracts. ## Introduction diff --git a/dex/farm/README.md b/dex/farm/README.md index 7a202719a..fcc860299 100644 --- a/dex/farm/README.md +++ b/dex/farm/README.md @@ -2,7 +2,7 @@ ## Abstract -Liquidity providers of Maiar Exchange are incentivized with MEX rewards in exchange for them locking their LP tokens in Farm contracts. +Liquidity providers of xExchange are incentivized with MEX rewards in exchange for them locking their LP tokens in Farm contracts. ## Introduction diff --git a/dex/pair/README.md b/dex/pair/README.md index 076cffdf6..00e1ce939 100644 --- a/dex/pair/README.md +++ b/dex/pair/README.md @@ -33,7 +33,7 @@ The init function is called when deploying/upgrading a smart contract. It receiv - __router_address__ - The address of the router smart contract. In most cases it is the caller address. The router address, together with the router owner address act as managers. They have the rights to upgrade and modify the contract's settings until a multisign dApp implementation will be ready and in place. - __router_owner_address__ - __total_fee_percent__ - Each time a swap is made, a fee is charged. The total percent is configurable by this parameter, but is usually 300, representing a percentage of 0.3, base points being 1_000. -- __special_fee_percent__ - The total fee is handled in two different manners. By default, the fee is reinvested into the pool, thus increasing the amount of tokens of liquidity providers. Part of the total fee is handled differently. More specific, a value of 50, representing a percentage of 0.05 of each swap is used to buyback and burn MEX tokens. The special fee can also be split in many equal parts and can be configured to be sent to other addresses also. The convention is that, if a configured special fee destination address is zero, then the tokens should be burned (the way it is configured in Maiar Exchange as well). +- __special_fee_percent__ - The total fee is handled in two different manners. By default, the fee is reinvested into the pool, thus increasing the amount of tokens of liquidity providers. Part of the total fee is handled differently. More specific, a value of 50, representing a percentage of 0.05 of each swap is used to buyback and burn MEX tokens. The special fee can also be split in many equal parts and can be configured to be sent to other addresses also. The convention is that, if a configured special fee destination address is zero, then the tokens should be burned (the way it is configured in xExchange as well). - __initial_liquidity_adder__ - An optional argument that is usually a Price Discovery smart contract. Used to decrease changes and impact of Pump & Dump at new listings. ### addLiquidity @@ -139,7 +139,7 @@ Considering __f__ being the percent of total fee, the formula including fees is rI * rO = (rI + (1 - f) * aI) * (rO - aO) ``` -Let's presume that __aO__ will be calculated only by taking into account ```(1 - f) * aI```. In Maiar Exchange's current configuration, that would be 0.97% of the input. +Let's presume that __aO__ will be calculated only by taking into account ```(1 - f) * aI```. In xExchange's current configuration, that would be 0.97% of the input. The remaining fee, which is ```f * aI``` would be split afterwards into regular fee - reinvested in the pool and special fee - used for buyback and burn mex. For more in depth dive into how the special fee is handled, see ```send_fee``` private function. diff --git a/dex/router/README.md b/dex/router/README.md index 442511018..dd753c883 100644 --- a/dex/router/README.md +++ b/dex/router/README.md @@ -16,7 +16,7 @@ This contract allows: - Keeping track -of Pair smart contracts deployed as part of Maiar Exchange. +of Pair smart contracts deployed as part of xExchange. ## Endpoints diff --git a/locked-asset/distribution/README.md b/locked-asset/distribution/README.md index 2831173de..50b64039e 100644 --- a/locked-asset/distribution/README.md +++ b/locked-asset/distribution/README.md @@ -9,7 +9,7 @@ The Distribution contract can be deployed using `erdpy` and using the interactio The init parameters are: -- __asset_token_id__. The TokenId of the asset that a locked asset represents. In case of Maiar Exchange it will be MEX. +- __asset_token_id__. The TokenId of the asset that a locked asset represents. In case of xExchange it will be MEX. - __locked_asset_factory_address__. ManagedAddress of the locked asset factory which is used to request creation of Locked MEX tokens. From a2e3f9bf07ce2d74d89b42ddc56b3228138d3975 Mon Sep 17 00:00:00 2001 From: ovidiuolteanu Date: Mon, 28 Aug 2023 16:59:34 +0300 Subject: [PATCH 037/213] switched references to mxpy --- dex/pair/README.md | 4 ++-- dex/router/README.md | 4 ++-- locked-asset/distribution/README.md | 2 +- locked-asset/proxy_dex/README.md | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dex/pair/README.md b/dex/pair/README.md index 00e1ce939..5fefeb960 100644 --- a/dex/pair/README.md +++ b/dex/pair/README.md @@ -208,11 +208,11 @@ There are four test suites around this contract: ## Interaction -The interaction scripts are located in the _dex/interaction_ directory. The scripts are written in python and erdpy is required in order to be used. Interaction scripts are scripts that ease the interaction with the deployed contract by wrapping erdpy sdk functionality in bash scripts. Make sure to update the PEM path and the PROXY and CHAINID values in order to correctly use the scripts. +The interaction scripts are located in the _dex/interaction_ directory. The scripts are written in python and mxpy is required in order to be used. Interaction scripts are scripts that ease the interaction with the deployed contract by wrapping mxpy sdk functionality in bash scripts. Make sure to update the PEM path and the PROXY and CHAINID values in order to correctly use the scripts. ## Deployment -The deployment of this contract is done by the Router smart contract but it can be done also in a standalone manner using the erdpy interaction scripts for deploy/upgrade. +The deployment of this contract is done by the Router smart contract but it can be done also in a standalone manner using the mxpy interaction scripts for deploy/upgrade. # Safe Price V2 diff --git a/dex/router/README.md b/dex/router/README.md index dd753c883..45585f54b 100644 --- a/dex/router/README.md +++ b/dex/router/README.md @@ -95,8 +95,8 @@ There are four test suites around this contract: ## Interaction -The interaction scripts are located in the _dex/interaction_ directory. They are written in python and erdpy is required in order to be used. Interaction scripts are scripts that ease the interaction with the deployed contract by wrapping erdpy sdk functionality in bash scripts. Make sure to update the PEM path and the PROXY and CHAINID values in order to correctly use them. +The interaction scripts are located in the _dex/interaction_ directory. They are written in python and mxpy is required in order to be used. Interaction scripts are scripts that ease the interaction with the deployed contract by wrapping mxpy sdk functionality in bash scripts. Make sure to update the PEM path and the PROXY and CHAINID values in order to correctly use them. ## Deployment -The deployment of this contract is done using erdpy, interaction scripts, or any other tool, in a standalone manner or by previously deploying the template pair smart contract. +The deployment of this contract is done using mxpy, interaction scripts, or any other tool, in a standalone manner or by previously deploying the template pair smart contract. diff --git a/locked-asset/distribution/README.md b/locked-asset/distribution/README.md index 50b64039e..3dee590d8 100644 --- a/locked-asset/distribution/README.md +++ b/locked-asset/distribution/README.md @@ -5,7 +5,7 @@ The bigger picture about what a Distribution Contract can do can be found in the ## Deployment -The Distribution contract can be deployed using `erdpy` and using the interaction snippets. +The Distribution contract can be deployed using `mxpy` and using the interaction snippets. The init parameters are: diff --git a/locked-asset/proxy_dex/README.md b/locked-asset/proxy_dex/README.md index c0d37d945..24b995891 100644 --- a/locked-asset/proxy_dex/README.md +++ b/locked-asset/proxy_dex/README.md @@ -2,7 +2,7 @@ ## Abstract -Locked MEX tokens can be used as MEX token in Maiar Exchange, with the help of this proxy contract. +Locked MEX tokens can be used as MEX token in xExchange, with the help of this proxy contract. ## Introduction From 6580dbad0b327b2c90c04035dd448aa07bc5fc06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Tue, 29 Aug 2023 10:00:02 +0300 Subject: [PATCH 038/213] farm/farm-staking: Update energy after claim --- dex/farm/src/lib.rs | 10 ++++++++-- .../farm-staking/src/claim_stake_farm_rewards.rs | 4 +++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/dex/farm/src/lib.rs b/dex/farm/src/lib.rs index 34975a2a5..cf53e0b68 100644 --- a/dex/farm/src/lib.rs +++ b/dex/farm/src/lib.rs @@ -118,10 +118,13 @@ pub trait Farm: let caller = self.blockchain().get_caller(); let orig_caller = self.get_orig_caller_from_opt(&caller, opt_orig_caller); - let claim_rewards_result = self.claim_rewards::>(orig_caller); + let claim_rewards_result = self.claim_rewards::>(orig_caller.clone()); + self.send_payment_non_zero(&caller, &claim_rewards_result.new_farm_token); self.send_payment_non_zero(&caller, &claim_rewards_result.rewards); + self.update_energy_and_progress(&orig_caller); + claim_rewards_result.into() } @@ -134,9 +137,12 @@ pub trait Farm: let caller = self.blockchain().get_caller(); let orig_caller = self.get_orig_caller_from_opt(&caller, opt_orig_caller); - let output_farm_token_payment = self.compound_rewards::>(orig_caller); + let output_farm_token_payment = self.compound_rewards::>(orig_caller.clone()); + self.send_payment_non_zero(&caller, &output_farm_token_payment); + self.update_energy_and_progress(&orig_caller); + output_farm_token_payment } diff --git a/farm-staking/farm-staking/src/claim_stake_farm_rewards.rs b/farm-staking/farm-staking/src/claim_stake_farm_rewards.rs index f8bef0283..bea77d267 100644 --- a/farm-staking/farm-staking/src/claim_stake_farm_rewards.rs +++ b/farm-staking/farm-staking/src/claim_stake_farm_rewards.rs @@ -63,7 +63,7 @@ pub trait ClaimStakeFarmRewardsModule: let payment = self.call_value().single_esdt(); let mut claim_result = self .claim_rewards_base_no_farm_token_mint::>( - original_caller, + original_caller.clone(), ManagedVec::from_single_item(payment), ); @@ -78,6 +78,8 @@ pub trait ClaimStakeFarmRewardsModule: self.set_farm_supply_for_current_week(&claim_result.storage_cache.farm_token_supply); } + self.update_energy_and_progress(&original_caller); + let new_farm_token_nonce = self.send().esdt_nft_create_compact( &virtual_farm_token.payment.token_identifier, &virtual_farm_token.payment.amount, From 5d7a8489f3f7dfe8b5093f7899203615e29a1f2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Tue, 29 Aug 2023 12:33:55 +0300 Subject: [PATCH 039/213] fees-collector: Fixes after review --- energy-integration/fees-collector/src/config.rs | 8 ++++++++ energy-integration/fees-collector/src/lib.rs | 17 +++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/energy-integration/fees-collector/src/config.rs b/energy-integration/fees-collector/src/config.rs index 9a369df9a..64c61c239 100644 --- a/energy-integration/fees-collector/src/config.rs +++ b/energy-integration/fees-collector/src/config.rs @@ -78,4 +78,12 @@ pub trait ConfigModule { #[storage_mapper("allTokens")] fn all_tokens(&self) -> SingleValueMapper>; + + #[view(getAllowExternalClaimRewards)] + #[storage_mapper("allowExternalClaimRewards")] + fn allow_external_claim_rewards( + &self, + user: &ManagedAddress, + ) -> SingleValueMapper; + } diff --git a/energy-integration/fees-collector/src/lib.rs b/energy-integration/fees-collector/src/lib.rs index da7698e88..79c29a233 100644 --- a/energy-integration/fees-collector/src/lib.rs +++ b/energy-integration/fees-collector/src/lib.rs @@ -53,8 +53,17 @@ pub trait FeesCollector: self.accumulate_additional_locked_tokens(); - let caller = self.blockchain().get_caller(); - let original_caller = self.get_orig_caller_from_opt(&caller, opt_original_caller); + let original_caller = match opt_original_caller { + OptionalValue::Some(user) => { + require!( + self.allow_external_claim_rewards(&user).get(), + "Cannot claim rewards for this address" + ); + user + } + OptionalValue::None => self.blockchain().get_caller(), + }; + let wrapper = FeesCollectorWrapper::new(); let mut rewards = self.claim_multi(&wrapper, &original_caller); @@ -79,14 +88,14 @@ pub trait FeesCollector: } if !rewards.is_empty() { - self.send().direct_multi(&caller, &rewards); + self.send().direct_multi(&original_caller, &rewards); } if total_locked_token_rewards_amount > 0 { let locked_rewards = self.lock_virtual( self.get_base_token_id(), total_locked_token_rewards_amount, - caller, + original_caller.clone(), original_caller, ); From b445da153dff385be1318e609407a40773f45a76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Tue, 29 Aug 2023 12:34:13 +0300 Subject: [PATCH 040/213] Clippy fixes and compiling dependencies --- energy-integration/fees-collector/wasm/src/lib.rs | 5 +++-- farm-staking/metabonding-staking/src/lib.rs | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/energy-integration/fees-collector/wasm/src/lib.rs b/energy-integration/fees-collector/wasm/src/lib.rs index 74fbfdf40..141b80dc6 100644 --- a/energy-integration/fees-collector/wasm/src/lib.rs +++ b/energy-integration/fees-collector/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 35 +// Endpoints: 36 // Async Callback (empty): 1 -// Total number of exported functions: 37 +// Total number of exported functions: 38 #![no_std] #![feature(alloc_error_handler, lang_items)] @@ -26,6 +26,7 @@ multiversx_sc_wasm_adapter::endpoints! { getLockedTokenId getAllTokens getAllKnownContracts + getAllowExternalClaimRewards getLastActiveWeekForUser getUserEnergyForWeek getLastGlobalUpdateWeek diff --git a/farm-staking/metabonding-staking/src/lib.rs b/farm-staking/metabonding-staking/src/lib.rs index 9b3387a78..ebd1967e5 100644 --- a/farm-staking/metabonding-staking/src/lib.rs +++ b/farm-staking/metabonding-staking/src/lib.rs @@ -74,7 +74,7 @@ pub trait MetabondingStaking: require!(!entry_mapper.is_empty(), "Must stake first"); let mut user_entry: UserEntry = entry_mapper.get(); - let unstake_amount = user_entry.unstake_amount.clone(); + let unstake_amount = user_entry.unstake_amount; require!(unstake_amount > 0, "Must unstake first"); let current_epoch = self.blockchain().get_block_epoch(); From e46c4d2790a7580364e03c85e717acfd5b9f1a2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Tue, 29 Aug 2023 12:38:34 +0300 Subject: [PATCH 041/213] Update common/modules/farm/farm_base_impl/src/base_traits_impl.rs Co-authored-by: dorin-iancu <72252689+dorin-iancu@users.noreply.github.com> --- common/modules/farm/farm_base_impl/src/base_traits_impl.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/modules/farm/farm_base_impl/src/base_traits_impl.rs b/common/modules/farm/farm_base_impl/src/base_traits_impl.rs index 7839efbbf..5ac1c4369 100644 --- a/common/modules/farm/farm_base_impl/src/base_traits_impl.rs +++ b/common/modules/farm/farm_base_impl/src/base_traits_impl.rs @@ -216,7 +216,7 @@ pub trait FarmContract { Self::increase_user_farm_position(sc, user, &farm_position_increase); } } - +#[inline] fn increase_user_farm_position( sc: &Self::FarmSc, user: &ManagedAddress<::Api>, From df198583c2789a532690d963d515c5212c6f3da8 Mon Sep 17 00:00:00 2001 From: "dorin.iancu" Date: Tue, 29 Aug 2023 13:04:42 +0300 Subject: [PATCH 042/213] upgrade 0.43.2 --- common/common_errors/Cargo.toml | 2 +- common/common_structs/Cargo.toml | 2 +- common/modules/farm/config/Cargo.toml | 2 +- common/modules/farm/contexts/Cargo.toml | 4 ++-- common/modules/farm/events/Cargo.toml | 2 +- common/modules/farm/farm_base_impl/Cargo.toml | 6 +++--- common/modules/farm/farm_base_impl/src/base_farm_init.rs | 6 +----- common/modules/farm/farm_token/Cargo.toml | 4 ++-- common/modules/farm/farm_token_merge/Cargo.toml | 4 ++-- common/modules/farm/rewards/Cargo.toml | 4 ++-- common/modules/legacy_token_decode_module/Cargo.toml | 2 +- common/modules/locking_module/Cargo.toml | 2 +- common/modules/math/Cargo.toml | 2 +- common/modules/pausable/Cargo.toml | 2 +- common/modules/permissions_module/Cargo.toml | 2 +- common/modules/sc_whitelist_module/Cargo.toml | 2 +- common/modules/token_merge_helper/Cargo.toml | 2 +- common/modules/token_send/Cargo.toml | 2 +- common/modules/utils/Cargo.toml | 2 +- common/traits/fixed-supply-token/Cargo.toml | 2 +- common/traits/mergeable/Cargo.toml | 2 +- common/traits/unwrappable/Cargo.toml | 2 +- dex/Cargo.toml | 6 +++--- dex/farm-with-locked-rewards/Cargo.toml | 6 +++--- dex/farm-with-locked-rewards/meta/Cargo.toml | 2 +- dex/farm-with-locked-rewards/wasm/Cargo.toml | 2 +- dex/farm/Cargo.toml | 6 +++--- dex/farm/meta/Cargo.toml | 2 +- dex/farm/wasm/Cargo.toml | 2 +- dex/fuzz/Cargo.toml | 4 ++-- dex/governance/Cargo.toml | 4 ++-- dex/governance/meta/Cargo.toml | 2 +- dex/governance/wasm/Cargo.toml | 2 +- dex/pair-mock/Cargo.toml | 4 ++-- dex/pair-mock/meta/Cargo.toml | 2 +- dex/pair-mock/wasm/Cargo.toml | 2 +- dex/pair/Cargo.toml | 4 ++-- dex/pair/meta/Cargo.toml | 2 +- dex/pair/wasm-pair-full/Cargo.toml | 2 +- dex/pair/wasm-safe-price-view/Cargo.toml | 2 +- dex/pair/wasm/Cargo.toml | 2 +- dex/price-discovery/Cargo.toml | 6 +++--- dex/price-discovery/meta/Cargo.toml | 2 +- dex/price-discovery/wasm/Cargo.toml | 2 +- dex/proxy-deployer/Cargo.toml | 4 ++-- dex/proxy-deployer/meta/Cargo.toml | 2 +- dex/proxy-deployer/wasm/Cargo.toml | 2 +- dex/router/Cargo.toml | 4 ++-- dex/router/meta/Cargo.toml | 2 +- dex/router/wasm/Cargo.toml | 2 +- energy-integration/common-modules/energy-query/Cargo.toml | 2 +- .../common-modules/week-timekeeping/Cargo.toml | 2 +- .../common-modules/weekly-rewards-splitting/Cargo.toml | 2 +- energy-integration/common-types/Cargo.toml | 2 +- energy-integration/energy-factory-mock/Cargo.toml | 4 ++-- energy-integration/energy-factory-mock/meta/Cargo.toml | 2 +- energy-integration/energy-factory-mock/wasm/Cargo.toml | 2 +- energy-integration/energy-update/Cargo.toml | 6 +++--- energy-integration/energy-update/meta/Cargo.toml | 2 +- energy-integration/energy-update/wasm/Cargo.toml | 2 +- energy-integration/farm-boosted-yields/Cargo.toml | 2 +- energy-integration/fees-collector/Cargo.toml | 6 +++--- energy-integration/fees-collector/meta/Cargo.toml | 2 +- energy-integration/fees-collector/wasm/Cargo.toml | 2 +- energy-integration/governance-v2/Cargo.toml | 4 ++-- energy-integration/governance-v2/meta/Cargo.toml | 2 +- energy-integration/governance-v2/wasm/Cargo.toml | 2 +- farm-staking/farm-staking-proxy/Cargo.toml | 6 +++--- farm-staking/farm-staking-proxy/meta/Cargo.toml | 2 +- farm-staking/farm-staking-proxy/wasm/Cargo.toml | 2 +- farm-staking/farm-staking/Cargo.toml | 6 +++--- farm-staking/farm-staking/meta/Cargo.toml | 2 +- farm-staking/farm-staking/wasm/Cargo.toml | 2 +- farm-staking/metabonding-staking/Cargo.toml | 6 +++--- farm-staking/metabonding-staking/meta/Cargo.toml | 2 +- farm-staking/metabonding-staking/wasm/Cargo.toml | 2 +- locked-asset/Cargo.toml | 6 +++--- locked-asset/distribution/Cargo.toml | 4 ++-- locked-asset/distribution/meta/Cargo.toml | 2 +- locked-asset/distribution/wasm/Cargo.toml | 2 +- locked-asset/energy-factory/Cargo.toml | 6 +++--- locked-asset/energy-factory/meta/Cargo.toml | 2 +- locked-asset/energy-factory/wasm/Cargo.toml | 2 +- locked-asset/factory/Cargo.toml | 6 +++--- locked-asset/factory/meta/Cargo.toml | 2 +- locked-asset/factory/wasm/Cargo.toml | 2 +- locked-asset/lkmex-transfer/Cargo.toml | 6 +++--- locked-asset/lkmex-transfer/meta/Cargo.toml | 2 +- locked-asset/lkmex-transfer/wasm/Cargo.toml | 2 +- locked-asset/locked-token-wrapper/Cargo.toml | 6 +++--- locked-asset/locked-token-wrapper/meta/Cargo.toml | 2 +- locked-asset/locked-token-wrapper/wasm/Cargo.toml | 2 +- locked-asset/proxy_dex/Cargo.toml | 6 +++--- locked-asset/proxy_dex/meta/Cargo.toml | 2 +- locked-asset/proxy_dex/wasm/Cargo.toml | 2 +- locked-asset/simple-lock-whitelist/Cargo.toml | 6 +++--- locked-asset/simple-lock-whitelist/meta/Cargo.toml | 2 +- locked-asset/simple-lock-whitelist/wasm/Cargo.toml | 2 +- locked-asset/simple-lock/Cargo.toml | 6 +++--- locked-asset/simple-lock/meta/Cargo.toml | 2 +- locked-asset/simple-lock/wasm/Cargo.toml | 2 +- locked-asset/token-unstake/Cargo.toml | 6 +++--- locked-asset/token-unstake/meta/Cargo.toml | 2 +- locked-asset/token-unstake/wasm/Cargo.toml | 2 +- pause-all/Cargo.toml | 6 +++--- pause-all/meta/Cargo.toml | 2 +- pause-all/wasm/Cargo.toml | 2 +- 107 files changed, 160 insertions(+), 164 deletions(-) diff --git a/common/common_errors/Cargo.toml b/common/common_errors/Cargo.toml index 2ac587ef5..499450be3 100644 --- a/common/common_errors/Cargo.toml +++ b/common/common_errors/Cargo.toml @@ -7,5 +7,5 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/common_structs/Cargo.toml b/common/common_structs/Cargo.toml index b74834ee6..f1ab9094c 100644 --- a/common/common_structs/Cargo.toml +++ b/common/common_structs/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.mergeable] diff --git a/common/modules/farm/config/Cargo.toml b/common/modules/farm/config/Cargo.toml index e8a8d417a..2bf5d119e 100644 --- a/common/modules/farm/config/Cargo.toml +++ b/common/modules/farm/config/Cargo.toml @@ -22,5 +22,5 @@ path = "../../pausable" path = "../../permissions_module" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/farm/contexts/Cargo.toml b/common/modules/farm/contexts/Cargo.toml index bcc6faea2..8ab7c0cd5 100644 --- a/common/modules/farm/contexts/Cargo.toml +++ b/common/modules/farm/contexts/Cargo.toml @@ -34,8 +34,8 @@ path = "../../pausable" path = "../../permissions_module" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.42.0" +version = "=0.43.2" diff --git a/common/modules/farm/events/Cargo.toml b/common/modules/farm/events/Cargo.toml index f6e7008be..b19892e0b 100644 --- a/common/modules/farm/events/Cargo.toml +++ b/common/modules/farm/events/Cargo.toml @@ -13,5 +13,5 @@ path = "../../../common_structs" path = "../contexts" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/farm/farm_base_impl/Cargo.toml b/common/modules/farm/farm_base_impl/Cargo.toml index eab9a3ae1..e38957230 100644 --- a/common/modules/farm/farm_base_impl/Cargo.toml +++ b/common/modules/farm/farm_base_impl/Cargo.toml @@ -49,10 +49,10 @@ path = "../../../traits/mergeable" path = "../../../traits/fixed-supply-token" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.42.0" +version = "=0.43.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.42.0" +version = "=0.43.2" diff --git a/common/modules/farm/farm_base_impl/src/base_farm_init.rs b/common/modules/farm/farm_base_impl/src/base_farm_init.rs index dcba4b6c4..700057a3e 100644 --- a/common/modules/farm/farm_base_impl/src/base_farm_init.rs +++ b/common/modules/farm/farm_base_impl/src/base_farm_init.rs @@ -1,6 +1,6 @@ multiversx_sc::imports!(); -use common_errors::{ERROR_NOT_AN_ESDT, ERROR_SAME_TOKEN_IDS, ERROR_ZERO_AMOUNT}; +use common_errors::{ERROR_NOT_AN_ESDT, ERROR_ZERO_AMOUNT}; use pausable::State; use permissions_module::Permissions; @@ -30,10 +30,6 @@ pub trait BaseFarmInitModule: ); require!(division_safety_constant != 0u64, ERROR_ZERO_AMOUNT); - let farm_token = self.farm_token().get_token_id(); - require!(reward_token_id != farm_token, ERROR_SAME_TOKEN_IDS); - require!(farming_token_id != farm_token, ERROR_SAME_TOKEN_IDS); - self.state().set(State::Inactive); self.division_safety_constant() .set_if_empty(&division_safety_constant); diff --git a/common/modules/farm/farm_token/Cargo.toml b/common/modules/farm/farm_token/Cargo.toml index eca09fbb1..27579b189 100644 --- a/common/modules/farm/farm_token/Cargo.toml +++ b/common/modules/farm/farm_token/Cargo.toml @@ -25,8 +25,8 @@ path = "../../pausable" path = "../../permissions_module" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.42.0" +version = "=0.43.2" diff --git a/common/modules/farm/farm_token_merge/Cargo.toml b/common/modules/farm/farm_token_merge/Cargo.toml index 20289e13d..3458a9daa 100644 --- a/common/modules/farm/farm_token_merge/Cargo.toml +++ b/common/modules/farm/farm_token_merge/Cargo.toml @@ -22,8 +22,8 @@ path = "../../token_merge_helper" path = "../farm_token" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.42.0" +version = "=0.43.2" diff --git a/common/modules/farm/rewards/Cargo.toml b/common/modules/farm/rewards/Cargo.toml index e3cbe0419..954b95342 100644 --- a/common/modules/farm/rewards/Cargo.toml +++ b/common/modules/farm/rewards/Cargo.toml @@ -28,8 +28,8 @@ path = "../../pausable" path = "../../permissions_module" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.42.0" +version = "=0.43.2" diff --git a/common/modules/legacy_token_decode_module/Cargo.toml b/common/modules/legacy_token_decode_module/Cargo.toml index a0817d114..50d697c77 100644 --- a/common/modules/legacy_token_decode_module/Cargo.toml +++ b/common/modules/legacy_token_decode_module/Cargo.toml @@ -7,7 +7,7 @@ edition = "2018" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.common_structs] diff --git a/common/modules/locking_module/Cargo.toml b/common/modules/locking_module/Cargo.toml index c55b00d69..6dbd6e89c 100644 --- a/common/modules/locking_module/Cargo.toml +++ b/common/modules/locking_module/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.simple-lock] diff --git a/common/modules/math/Cargo.toml b/common/modules/math/Cargo.toml index f0594e357..d591a6aa5 100644 --- a/common/modules/math/Cargo.toml +++ b/common/modules/math/Cargo.toml @@ -7,5 +7,5 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/pausable/Cargo.toml b/common/modules/pausable/Cargo.toml index 0b4300147..c332aed4c 100644 --- a/common/modules/pausable/Cargo.toml +++ b/common/modules/pausable/Cargo.toml @@ -10,5 +10,5 @@ path = "src/pausable.rs" path = "../permissions_module" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/permissions_module/Cargo.toml b/common/modules/permissions_module/Cargo.toml index aa19a0098..ce9642965 100644 --- a/common/modules/permissions_module/Cargo.toml +++ b/common/modules/permissions_module/Cargo.toml @@ -14,5 +14,5 @@ bitflags = "1.3.2" path = "../../common_errors" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/sc_whitelist_module/Cargo.toml b/common/modules/sc_whitelist_module/Cargo.toml index f5469987f..711661188 100644 --- a/common/modules/sc_whitelist_module/Cargo.toml +++ b/common/modules/sc_whitelist_module/Cargo.toml @@ -10,5 +10,5 @@ path = "src/sc_whitelist_module.rs" path = "../../common_errors" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/token_merge_helper/Cargo.toml b/common/modules/token_merge_helper/Cargo.toml index 35ba6122f..56585e019 100644 --- a/common/modules/token_merge_helper/Cargo.toml +++ b/common/modules/token_merge_helper/Cargo.toml @@ -10,5 +10,5 @@ path = "src/lib.rs" path = "../../common_errors" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/token_send/Cargo.toml b/common/modules/token_send/Cargo.toml index f895e3524..bff76dcd0 100644 --- a/common/modules/token_send/Cargo.toml +++ b/common/modules/token_send/Cargo.toml @@ -13,5 +13,5 @@ path = "../../common_structs" path = "../../common_errors" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/utils/Cargo.toml b/common/modules/utils/Cargo.toml index 66296dddc..0b229c058 100644 --- a/common/modules/utils/Cargo.toml +++ b/common/modules/utils/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.common_structs] diff --git a/common/traits/fixed-supply-token/Cargo.toml b/common/traits/fixed-supply-token/Cargo.toml index f81b16f66..c8a2679f9 100644 --- a/common/traits/fixed-supply-token/Cargo.toml +++ b/common/traits/fixed-supply-token/Cargo.toml @@ -7,4 +7,4 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" diff --git a/common/traits/mergeable/Cargo.toml b/common/traits/mergeable/Cargo.toml index c2629c71c..fce702ff2 100644 --- a/common/traits/mergeable/Cargo.toml +++ b/common/traits/mergeable/Cargo.toml @@ -7,5 +7,5 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/traits/unwrappable/Cargo.toml b/common/traits/unwrappable/Cargo.toml index 6aff2032c..5ea86b7fb 100644 --- a/common/traits/unwrappable/Cargo.toml +++ b/common/traits/unwrappable/Cargo.toml @@ -7,5 +7,5 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] diff --git a/dex/Cargo.toml b/dex/Cargo.toml index 21226dbaf..7bf3dc375 100644 --- a/dex/Cargo.toml +++ b/dex/Cargo.toml @@ -4,17 +4,17 @@ version = "0.0.0" edition = "2021" publish = false [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-modules] -version = "=0.42.0" +version = "=0.43.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.42.0" +version = "=0.43.2" [dev-dependencies.config] path = "../common/modules/farm/config" diff --git a/dex/farm-with-locked-rewards/Cargo.toml b/dex/farm-with-locked-rewards/Cargo.toml index bdbe34677..e111ba646 100644 --- a/dex/farm-with-locked-rewards/Cargo.toml +++ b/dex/farm-with-locked-rewards/Cargo.toml @@ -74,17 +74,17 @@ path = "../../locked-asset/energy-factory" path = "../../energy-integration/common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.42.0" +version = "=0.43.2" [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.42.0" +version = "=0.43.2" [dev-dependencies.simple-lock] path = "../../locked-asset/simple-lock" diff --git a/dex/farm-with-locked-rewards/meta/Cargo.toml b/dex/farm-with-locked-rewards/meta/Cargo.toml index ff1dc11ca..4db13ec1d 100644 --- a/dex/farm-with-locked-rewards/meta/Cargo.toml +++ b/dex/farm-with-locked-rewards/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.42.0" +version = "0.43.2" diff --git a/dex/farm-with-locked-rewards/wasm/Cargo.toml b/dex/farm-with-locked-rewards/wasm/Cargo.toml index 56abe71c5..7a33ece2d 100644 --- a/dex/farm-with-locked-rewards/wasm/Cargo.toml +++ b/dex/farm-with-locked-rewards/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.42.0" +version = "=0.43.2" diff --git a/dex/farm/Cargo.toml b/dex/farm/Cargo.toml index c98bc2e9b..c75ce1fcb 100644 --- a/dex/farm/Cargo.toml +++ b/dex/farm/Cargo.toml @@ -68,11 +68,11 @@ path = "../../energy-integration/common-modules/weekly-rewards-splitting" path = "../../energy-integration/common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.42.0" +version = "=0.43.2" [dev-dependencies] num-bigint = "0.4.2" @@ -81,7 +81,7 @@ num-bigint = "0.4.2" path = "../../energy-integration/energy-update" [dev-dependencies.multiversx-sc-scenario] -version = "=0.42.0" +version = "=0.43.2" [dev-dependencies.energy-factory-mock] path = "../../energy-integration/energy-factory-mock" diff --git a/dex/farm/meta/Cargo.toml b/dex/farm/meta/Cargo.toml index d546f9321..777764d67 100644 --- a/dex/farm/meta/Cargo.toml +++ b/dex/farm/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.42.0" +version = "0.43.2" diff --git a/dex/farm/wasm/Cargo.toml b/dex/farm/wasm/Cargo.toml index 6e6c4a5c2..c43c76ab2 100644 --- a/dex/farm/wasm/Cargo.toml +++ b/dex/farm/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.42.0" +version = "=0.43.2" diff --git a/dex/fuzz/Cargo.toml b/dex/fuzz/Cargo.toml index 0a3647b95..bd8bc2d8e 100644 --- a/dex/fuzz/Cargo.toml +++ b/dex/fuzz/Cargo.toml @@ -12,11 +12,11 @@ num-bigint = "0.4.2" rand = "0.8.4" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-scenario] -version = "=0.42.0" +version = "=0.43.2" [dependencies.pausable] path = "../../common/modules/pausable" diff --git a/dex/governance/Cargo.toml b/dex/governance/Cargo.toml index 3ebc9493d..5ceb95c9d 100644 --- a/dex/governance/Cargo.toml +++ b/dex/governance/Cargo.toml @@ -8,14 +8,14 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.42.0" +version = "=0.43.2" [dev-dependencies.pair-mock] path = "../pair-mock" diff --git a/dex/governance/meta/Cargo.toml b/dex/governance/meta/Cargo.toml index 97ae17c5e..0a183b8d9 100644 --- a/dex/governance/meta/Cargo.toml +++ b/dex/governance/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.42.0" +version = "0.43.2" diff --git a/dex/governance/wasm/Cargo.toml b/dex/governance/wasm/Cargo.toml index adb5831a7..964b6bf7c 100644 --- a/dex/governance/wasm/Cargo.toml +++ b/dex/governance/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.42.0" +version = "=0.43.2" diff --git a/dex/pair-mock/Cargo.toml b/dex/pair-mock/Cargo.toml index 921328f78..a335ee5da 100644 --- a/dex/pair-mock/Cargo.toml +++ b/dex/pair-mock/Cargo.toml @@ -11,11 +11,11 @@ path = "src/pair.rs" path = "../../common/common_errors" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.itertools] version = "0.10.1" default-features = false [dev-dependencies.multiversx-sc-scenario] -version = "=0.42.0" +version = "=0.43.2" diff --git a/dex/pair-mock/meta/Cargo.toml b/dex/pair-mock/meta/Cargo.toml index 9e6ec9b08..f6dc3932d 100644 --- a/dex/pair-mock/meta/Cargo.toml +++ b/dex/pair-mock/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.42.0" +version = "0.43.2" diff --git a/dex/pair-mock/wasm/Cargo.toml b/dex/pair-mock/wasm/Cargo.toml index cf62f1077..0e43165cd 100644 --- a/dex/pair-mock/wasm/Cargo.toml +++ b/dex/pair-mock/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.42.0" +version = "=0.43.2" diff --git a/dex/pair/Cargo.toml b/dex/pair/Cargo.toml index 559184b9d..32c1fae21 100644 --- a/dex/pair/Cargo.toml +++ b/dex/pair/Cargo.toml @@ -33,11 +33,11 @@ version = "0.10.1" default-features = false [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.42.0" +version = "=0.43.2" diff --git a/dex/pair/meta/Cargo.toml b/dex/pair/meta/Cargo.toml index b9869414c..26d231c9f 100644 --- a/dex/pair/meta/Cargo.toml +++ b/dex/pair/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.42.0" +version = "0.43.2" diff --git a/dex/pair/wasm-pair-full/Cargo.toml b/dex/pair/wasm-pair-full/Cargo.toml index ca4c2c82c..b9e1841c2 100644 --- a/dex/pair/wasm-pair-full/Cargo.toml +++ b/dex/pair/wasm-pair-full/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.42.0" +version = "=0.43.2" diff --git a/dex/pair/wasm-safe-price-view/Cargo.toml b/dex/pair/wasm-safe-price-view/Cargo.toml index 9d2719a95..be0fd8731 100644 --- a/dex/pair/wasm-safe-price-view/Cargo.toml +++ b/dex/pair/wasm-safe-price-view/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.42.0" +version = "=0.43.2" diff --git a/dex/pair/wasm/Cargo.toml b/dex/pair/wasm/Cargo.toml index 2b6c9c8f5..02438d6bc 100644 --- a/dex/pair/wasm/Cargo.toml +++ b/dex/pair/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.42.0" +version = "=0.43.2" diff --git a/dex/price-discovery/Cargo.toml b/dex/price-discovery/Cargo.toml index 64e827a60..d62a52636 100644 --- a/dex/price-discovery/Cargo.toml +++ b/dex/price-discovery/Cargo.toml @@ -12,11 +12,11 @@ path = "src/lib.rs" hex-literal = "0.3.1" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.42.0" +version = "=0.43.2" [dependencies.locking_module] path = "../../common/modules/locking_module" @@ -30,4 +30,4 @@ hex = "0.4" path = "../../locked-asset/simple-lock" [dev-dependencies.multiversx-sc-scenario] -version = "=0.42.0" +version = "=0.43.2" diff --git a/dex/price-discovery/meta/Cargo.toml b/dex/price-discovery/meta/Cargo.toml index 4897cfd92..e611b98a7 100644 --- a/dex/price-discovery/meta/Cargo.toml +++ b/dex/price-discovery/meta/Cargo.toml @@ -8,4 +8,4 @@ authors = ["Dorin Iancu "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.42.0" +version = "0.43.2" diff --git a/dex/price-discovery/wasm/Cargo.toml b/dex/price-discovery/wasm/Cargo.toml index 8fff57628..721537a54 100644 --- a/dex/price-discovery/wasm/Cargo.toml +++ b/dex/price-discovery/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.42.0" +version = "=0.43.2" diff --git a/dex/proxy-deployer/Cargo.toml b/dex/proxy-deployer/Cargo.toml index 7b4123b5a..85f723f1e 100644 --- a/dex/proxy-deployer/Cargo.toml +++ b/dex/proxy-deployer/Cargo.toml @@ -20,11 +20,11 @@ path = "../../common/modules/farm/config" path = "../../common/modules/farm/farm_token" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.42.0" +version = "=0.43.2" diff --git a/dex/proxy-deployer/meta/Cargo.toml b/dex/proxy-deployer/meta/Cargo.toml index 4ea12f805..728822284 100644 --- a/dex/proxy-deployer/meta/Cargo.toml +++ b/dex/proxy-deployer/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.42.0" +version = "0.43.2" diff --git a/dex/proxy-deployer/wasm/Cargo.toml b/dex/proxy-deployer/wasm/Cargo.toml index c29ba0d40..4cf22608e 100644 --- a/dex/proxy-deployer/wasm/Cargo.toml +++ b/dex/proxy-deployer/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.42.0" +version = "=0.43.2" diff --git a/dex/router/Cargo.toml b/dex/router/Cargo.toml index 83dc3492a..401e90b89 100644 --- a/dex/router/Cargo.toml +++ b/dex/router/Cargo.toml @@ -14,7 +14,7 @@ path = "../../common/modules/token_send" path = "../../common/modules/pausable" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.pair] @@ -26,4 +26,4 @@ path = "../../common/modules/locking_module" [dependencies.simple-lock] path = "../../locked-asset/simple-lock" [dev-dependencies.multiversx-sc-scenario] -version = "=0.42.0" +version = "=0.43.2" diff --git a/dex/router/meta/Cargo.toml b/dex/router/meta/Cargo.toml index 9b71b6e99..1952e09af 100644 --- a/dex/router/meta/Cargo.toml +++ b/dex/router/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.42.0" +version = "0.43.2" diff --git a/dex/router/wasm/Cargo.toml b/dex/router/wasm/Cargo.toml index 0256a67b3..f2a456292 100644 --- a/dex/router/wasm/Cargo.toml +++ b/dex/router/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.42.0" +version = "=0.43.2" diff --git a/energy-integration/common-modules/energy-query/Cargo.toml b/energy-integration/common-modules/energy-query/Cargo.toml index fa86ab377..e4a52097c 100644 --- a/energy-integration/common-modules/energy-query/Cargo.toml +++ b/energy-integration/common-modules/energy-query/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.energy-factory] diff --git a/energy-integration/common-modules/week-timekeeping/Cargo.toml b/energy-integration/common-modules/week-timekeeping/Cargo.toml index 08a32ef44..805abb126 100644 --- a/energy-integration/common-modules/week-timekeeping/Cargo.toml +++ b/energy-integration/common-modules/week-timekeeping/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.common-types] diff --git a/energy-integration/common-modules/weekly-rewards-splitting/Cargo.toml b/energy-integration/common-modules/weekly-rewards-splitting/Cargo.toml index fb0f0c2dc..4cc3bb2c3 100644 --- a/energy-integration/common-modules/weekly-rewards-splitting/Cargo.toml +++ b/energy-integration/common-modules/weekly-rewards-splitting/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.energy-query] diff --git a/energy-integration/common-types/Cargo.toml b/energy-integration/common-types/Cargo.toml index ecb8bb89d..43fdc4687 100644 --- a/energy-integration/common-types/Cargo.toml +++ b/energy-integration/common-types/Cargo.toml @@ -7,5 +7,5 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] diff --git a/energy-integration/energy-factory-mock/Cargo.toml b/energy-integration/energy-factory-mock/Cargo.toml index 95588ec75..2268f1472 100644 --- a/energy-integration/energy-factory-mock/Cargo.toml +++ b/energy-integration/energy-factory-mock/Cargo.toml @@ -11,7 +11,7 @@ path = "src/lib.rs" path = "../common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies.multiversx-sc-scenario] -version = "=0.42.0" +version = "=0.43.2" diff --git a/energy-integration/energy-factory-mock/meta/Cargo.toml b/energy-integration/energy-factory-mock/meta/Cargo.toml index 2875e2307..0a0449eda 100644 --- a/energy-integration/energy-factory-mock/meta/Cargo.toml +++ b/energy-integration/energy-factory-mock/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.42.0" +version = "0.43.2" diff --git a/energy-integration/energy-factory-mock/wasm/Cargo.toml b/energy-integration/energy-factory-mock/wasm/Cargo.toml index 59674aaef..ec16f4fae 100644 --- a/energy-integration/energy-factory-mock/wasm/Cargo.toml +++ b/energy-integration/energy-factory-mock/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.42.0" +version = "=0.43.2" diff --git a/energy-integration/energy-update/Cargo.toml b/energy-integration/energy-update/Cargo.toml index 9855a3bd5..09d479864 100644 --- a/energy-integration/energy-update/Cargo.toml +++ b/energy-integration/energy-update/Cargo.toml @@ -8,11 +8,11 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.42.0" +version = "=0.43.2" [dependencies.farm] path = "../../dex/farm" @@ -24,4 +24,4 @@ path = "../common-modules/weekly-rewards-splitting" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.42.0" +version = "=0.43.2" diff --git a/energy-integration/energy-update/meta/Cargo.toml b/energy-integration/energy-update/meta/Cargo.toml index 6ba2d63b1..9b28309d9 100644 --- a/energy-integration/energy-update/meta/Cargo.toml +++ b/energy-integration/energy-update/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.42.0" +version = "0.43.2" diff --git a/energy-integration/energy-update/wasm/Cargo.toml b/energy-integration/energy-update/wasm/Cargo.toml index 4bc2db79c..5ccada06e 100644 --- a/energy-integration/energy-update/wasm/Cargo.toml +++ b/energy-integration/energy-update/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.42.0" +version = "=0.43.2" diff --git a/energy-integration/farm-boosted-yields/Cargo.toml b/energy-integration/farm-boosted-yields/Cargo.toml index 51a690e35..443883813 100644 --- a/energy-integration/farm-boosted-yields/Cargo.toml +++ b/energy-integration/farm-boosted-yields/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.config] diff --git a/energy-integration/fees-collector/Cargo.toml b/energy-integration/fees-collector/Cargo.toml index c77e3e03b..1c01cc70f 100644 --- a/energy-integration/fees-collector/Cargo.toml +++ b/energy-integration/fees-collector/Cargo.toml @@ -8,11 +8,11 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.42.0" +version = "=0.43.2" [dependencies.energy-query] path = "../common-modules/energy-query" @@ -48,7 +48,7 @@ path = "../../common/common_errors" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.42.0" +version = "=0.43.2" [dev-dependencies.sc_whitelist_module] path = "../../common/modules/sc_whitelist_module" diff --git a/energy-integration/fees-collector/meta/Cargo.toml b/energy-integration/fees-collector/meta/Cargo.toml index c050057c7..64c545255 100644 --- a/energy-integration/fees-collector/meta/Cargo.toml +++ b/energy-integration/fees-collector/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.42.0" +version = "0.43.2" diff --git a/energy-integration/fees-collector/wasm/Cargo.toml b/energy-integration/fees-collector/wasm/Cargo.toml index c394f7c6d..4c46ff2ee 100644 --- a/energy-integration/fees-collector/wasm/Cargo.toml +++ b/energy-integration/fees-collector/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.42.0" +version = "=0.43.2" diff --git a/energy-integration/governance-v2/Cargo.toml b/energy-integration/governance-v2/Cargo.toml index 4dc4d683f..ab9768c6b 100644 --- a/energy-integration/governance-v2/Cargo.toml +++ b/energy-integration/governance-v2/Cargo.toml @@ -11,7 +11,7 @@ path = "src/lib.rs" path = "../common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.permissions_module] @@ -27,7 +27,7 @@ path = "../common-modules/weekly-rewards-splitting" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.42.0" +version = "=0.43.2" [dev-dependencies.energy-factory-mock] path = "../energy-factory-mock" diff --git a/energy-integration/governance-v2/meta/Cargo.toml b/energy-integration/governance-v2/meta/Cargo.toml index 1e2c7b5ac..f79ca0ab9 100644 --- a/energy-integration/governance-v2/meta/Cargo.toml +++ b/energy-integration/governance-v2/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.42.0" +version = "0.43.2" diff --git a/energy-integration/governance-v2/wasm/Cargo.toml b/energy-integration/governance-v2/wasm/Cargo.toml index bbae2b03e..767e42380 100644 --- a/energy-integration/governance-v2/wasm/Cargo.toml +++ b/energy-integration/governance-v2/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.42.0" +version = "=0.43.2" diff --git a/farm-staking/farm-staking-proxy/Cargo.toml b/farm-staking/farm-staking-proxy/Cargo.toml index a66a88277..a9fba8db2 100644 --- a/farm-staking/farm-staking-proxy/Cargo.toml +++ b/farm-staking/farm-staking-proxy/Cargo.toml @@ -12,11 +12,11 @@ path = "src/lib.rs" hex-literal = "0.3.1" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.42.0" +version = "=0.43.2" [dependencies.farm] path = "../../dex/farm" @@ -61,7 +61,7 @@ path = "../../common/modules/sc_whitelist_module" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.42.0" +version = "=0.43.2" [dev-dependencies.farm_token] path = "../../common/modules/farm/farm_token" diff --git a/farm-staking/farm-staking-proxy/meta/Cargo.toml b/farm-staking/farm-staking-proxy/meta/Cargo.toml index 2647116b3..7461b0f5b 100644 --- a/farm-staking/farm-staking-proxy/meta/Cargo.toml +++ b/farm-staking/farm-staking-proxy/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.42.0" +version = "0.43.2" diff --git a/farm-staking/farm-staking-proxy/wasm/Cargo.toml b/farm-staking/farm-staking-proxy/wasm/Cargo.toml index 912124ded..fc415475e 100644 --- a/farm-staking/farm-staking-proxy/wasm/Cargo.toml +++ b/farm-staking/farm-staking-proxy/wasm/Cargo.toml @@ -22,5 +22,5 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.42.0" +version = "=0.43.2" features = ["vm-validate-token-identifier"] diff --git a/farm-staking/farm-staking/Cargo.toml b/farm-staking/farm-staking/Cargo.toml index 036fc5e1d..48523fc76 100644 --- a/farm-staking/farm-staking/Cargo.toml +++ b/farm-staking/farm-staking/Cargo.toml @@ -77,14 +77,14 @@ path = "../../common/common_structs" path = "../../common/common_errors" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.42.0" +version = "=0.43.2" [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.42.0" +version = "=0.43.2" diff --git a/farm-staking/farm-staking/meta/Cargo.toml b/farm-staking/farm-staking/meta/Cargo.toml index 15e0d861c..0f03d3b72 100644 --- a/farm-staking/farm-staking/meta/Cargo.toml +++ b/farm-staking/farm-staking/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.42.0" +version = "0.43.2" diff --git a/farm-staking/farm-staking/wasm/Cargo.toml b/farm-staking/farm-staking/wasm/Cargo.toml index 13d4e5205..8a48c1058 100644 --- a/farm-staking/farm-staking/wasm/Cargo.toml +++ b/farm-staking/farm-staking/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.42.0" +version = "=0.43.2" diff --git a/farm-staking/metabonding-staking/Cargo.toml b/farm-staking/metabonding-staking/Cargo.toml index d9c18ae26..d618306bf 100644 --- a/farm-staking/metabonding-staking/Cargo.toml +++ b/farm-staking/metabonding-staking/Cargo.toml @@ -8,11 +8,11 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.42.0" +version = "=0.43.2" [dependencies.factory] path = "../../locked-asset/factory" @@ -21,7 +21,7 @@ path = "../../locked-asset/factory" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.42.0" +version = "=0.43.2" [dev-dependencies.common_structs] path = "../../common/common_structs" diff --git a/farm-staking/metabonding-staking/meta/Cargo.toml b/farm-staking/metabonding-staking/meta/Cargo.toml index 2e1acb451..f944c4fce 100644 --- a/farm-staking/metabonding-staking/meta/Cargo.toml +++ b/farm-staking/metabonding-staking/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.42.0" +version = "0.43.2" diff --git a/farm-staking/metabonding-staking/wasm/Cargo.toml b/farm-staking/metabonding-staking/wasm/Cargo.toml index 76a1fde72..f4fab82b3 100644 --- a/farm-staking/metabonding-staking/wasm/Cargo.toml +++ b/farm-staking/metabonding-staking/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.42.0" +version = "=0.43.2" diff --git a/locked-asset/Cargo.toml b/locked-asset/Cargo.toml index 72e7f786e..8c27ab608 100644 --- a/locked-asset/Cargo.toml +++ b/locked-asset/Cargo.toml @@ -4,7 +4,7 @@ version = "0.0.0" edition = "2021" publish = false [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.farm] @@ -49,7 +49,7 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-modules] -version = "=0.42.0" +version = "=0.43.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.42.0" +version = "=0.43.2" diff --git a/locked-asset/distribution/Cargo.toml b/locked-asset/distribution/Cargo.toml index 05da3b270..f40090c14 100644 --- a/locked-asset/distribution/Cargo.toml +++ b/locked-asset/distribution/Cargo.toml @@ -13,7 +13,7 @@ path = "../../common/common_structs" path = "../factory" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies.multiversx-sc-scenario] -version = "=0.42.0" +version = "=0.43.2" diff --git a/locked-asset/distribution/meta/Cargo.toml b/locked-asset/distribution/meta/Cargo.toml index 599c2a126..eef847e32 100644 --- a/locked-asset/distribution/meta/Cargo.toml +++ b/locked-asset/distribution/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.42.0" +version = "0.43.2" diff --git a/locked-asset/distribution/wasm/Cargo.toml b/locked-asset/distribution/wasm/Cargo.toml index eb70848ae..bb3466e11 100644 --- a/locked-asset/distribution/wasm/Cargo.toml +++ b/locked-asset/distribution/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.42.0" +version = "=0.43.2" diff --git a/locked-asset/energy-factory/Cargo.toml b/locked-asset/energy-factory/Cargo.toml index f164c78cb..a6aa2276f 100644 --- a/locked-asset/energy-factory/Cargo.toml +++ b/locked-asset/energy-factory/Cargo.toml @@ -32,11 +32,11 @@ path = "../../common/traits/unwrappable" path = "../../common/modules/legacy_token_decode_module" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.42.0" +version = "=0.43.2" [dev-dependencies] num-bigint = "0.4.2" @@ -44,4 +44,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.42.0" +version = "=0.43.2" diff --git a/locked-asset/energy-factory/meta/Cargo.toml b/locked-asset/energy-factory/meta/Cargo.toml index db4b5f52d..0bab3bc4d 100644 --- a/locked-asset/energy-factory/meta/Cargo.toml +++ b/locked-asset/energy-factory/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.42.0" +version = "0.43.2" diff --git a/locked-asset/energy-factory/wasm/Cargo.toml b/locked-asset/energy-factory/wasm/Cargo.toml index ba6f427b8..64c23e954 100644 --- a/locked-asset/energy-factory/wasm/Cargo.toml +++ b/locked-asset/energy-factory/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.42.0" +version = "=0.43.2" diff --git a/locked-asset/factory/Cargo.toml b/locked-asset/factory/Cargo.toml index e2a659fc1..c353b9c9d 100644 --- a/locked-asset/factory/Cargo.toml +++ b/locked-asset/factory/Cargo.toml @@ -26,11 +26,11 @@ path = "../../common/modules/token_merge_helper" path = "../energy-factory" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.42.0" +version = "=0.43.2" [dependencies.arrayvec] version = "0.7.1" @@ -49,4 +49,4 @@ hex = "0.4" path = "../simple-lock" [dev-dependencies.multiversx-sc-scenario] -version = "=0.42.0" +version = "=0.43.2" diff --git a/locked-asset/factory/meta/Cargo.toml b/locked-asset/factory/meta/Cargo.toml index 7312ff4fa..4dac5cc03 100644 --- a/locked-asset/factory/meta/Cargo.toml +++ b/locked-asset/factory/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.42.0" +version = "0.43.2" diff --git a/locked-asset/factory/wasm/Cargo.toml b/locked-asset/factory/wasm/Cargo.toml index 22220e5d5..2d8adf3c9 100644 --- a/locked-asset/factory/wasm/Cargo.toml +++ b/locked-asset/factory/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.42.0" +version = "=0.43.2" diff --git a/locked-asset/lkmex-transfer/Cargo.toml b/locked-asset/lkmex-transfer/Cargo.toml index a6d2e4b9a..05f05ce18 100644 --- a/locked-asset/lkmex-transfer/Cargo.toml +++ b/locked-asset/lkmex-transfer/Cargo.toml @@ -29,14 +29,14 @@ path = "../energy-factory" path = "../../energy-integration/common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.42.0" +version = "=0.43.2" [dev-dependencies.multiversx-sc-modules] -version = "=0.42.0" +version = "=0.43.2" diff --git a/locked-asset/lkmex-transfer/meta/Cargo.toml b/locked-asset/lkmex-transfer/meta/Cargo.toml index 76410a6b4..08a7e03f5 100644 --- a/locked-asset/lkmex-transfer/meta/Cargo.toml +++ b/locked-asset/lkmex-transfer/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.42.0" +version = "0.43.2" diff --git a/locked-asset/lkmex-transfer/wasm/Cargo.toml b/locked-asset/lkmex-transfer/wasm/Cargo.toml index 366cc607b..7555038a6 100644 --- a/locked-asset/lkmex-transfer/wasm/Cargo.toml +++ b/locked-asset/lkmex-transfer/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.42.0" +version = "=0.43.2" diff --git a/locked-asset/locked-token-wrapper/Cargo.toml b/locked-asset/locked-token-wrapper/Cargo.toml index 105e22340..63c4884e1 100644 --- a/locked-asset/locked-token-wrapper/Cargo.toml +++ b/locked-asset/locked-token-wrapper/Cargo.toml @@ -8,10 +8,10 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" [dependencies.multiversx-sc-modules] -version = "=0.42.0" +version = "=0.43.2" [dependencies.utils] path = "../../common/modules/utils" @@ -43,4 +43,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.42.0" +version = "=0.43.2" diff --git a/locked-asset/locked-token-wrapper/meta/Cargo.toml b/locked-asset/locked-token-wrapper/meta/Cargo.toml index 5c0709dc7..1b5daca09 100644 --- a/locked-asset/locked-token-wrapper/meta/Cargo.toml +++ b/locked-asset/locked-token-wrapper/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.42.0" +version = "0.43.2" diff --git a/locked-asset/locked-token-wrapper/wasm/Cargo.toml b/locked-asset/locked-token-wrapper/wasm/Cargo.toml index 7d3bf7341..198c12da9 100644 --- a/locked-asset/locked-token-wrapper/wasm/Cargo.toml +++ b/locked-asset/locked-token-wrapper/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.42.0" +version = "=0.43.2" diff --git a/locked-asset/proxy_dex/Cargo.toml b/locked-asset/proxy_dex/Cargo.toml index e4d6cb257..1038cdffa 100644 --- a/locked-asset/proxy_dex/Cargo.toml +++ b/locked-asset/proxy_dex/Cargo.toml @@ -44,11 +44,11 @@ path = "../../common/traits/mergeable" path = "../../common/traits/fixed-supply-token" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.42.0" +version = "=0.43.2" [dependencies.energy-factory] path = "../energy-factory" @@ -65,7 +65,7 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.42.0" +version = "=0.43.2" [dev-dependencies.pausable] path = "../../common/modules/pausable" diff --git a/locked-asset/proxy_dex/meta/Cargo.toml b/locked-asset/proxy_dex/meta/Cargo.toml index 55c609a02..062ab5aaf 100644 --- a/locked-asset/proxy_dex/meta/Cargo.toml +++ b/locked-asset/proxy_dex/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.42.0" +version = "0.43.2" diff --git a/locked-asset/proxy_dex/wasm/Cargo.toml b/locked-asset/proxy_dex/wasm/Cargo.toml index 3070db804..440f1a190 100644 --- a/locked-asset/proxy_dex/wasm/Cargo.toml +++ b/locked-asset/proxy_dex/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.42.0" +version = "=0.43.2" diff --git a/locked-asset/simple-lock-whitelist/Cargo.toml b/locked-asset/simple-lock-whitelist/Cargo.toml index 39882c1bd..e46c6f9d0 100644 --- a/locked-asset/simple-lock-whitelist/Cargo.toml +++ b/locked-asset/simple-lock-whitelist/Cargo.toml @@ -14,11 +14,11 @@ path = "../simple-lock" path = "../../common/modules/utils" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.42.0" +version = "=0.43.2" [dev-dependencies] num-bigint = "0.4.2" @@ -26,4 +26,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.42.0" +version = "=0.43.2" diff --git a/locked-asset/simple-lock-whitelist/meta/Cargo.toml b/locked-asset/simple-lock-whitelist/meta/Cargo.toml index b146358f9..9707df924 100644 --- a/locked-asset/simple-lock-whitelist/meta/Cargo.toml +++ b/locked-asset/simple-lock-whitelist/meta/Cargo.toml @@ -8,4 +8,4 @@ authors = ["Dorin Iancu "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.42.0" +version = "0.43.2" diff --git a/locked-asset/simple-lock-whitelist/wasm/Cargo.toml b/locked-asset/simple-lock-whitelist/wasm/Cargo.toml index aeef25cc8..638f49b8c 100644 --- a/locked-asset/simple-lock-whitelist/wasm/Cargo.toml +++ b/locked-asset/simple-lock-whitelist/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.42.0" +version = "=0.43.2" diff --git a/locked-asset/simple-lock/Cargo.toml b/locked-asset/simple-lock/Cargo.toml index 7251cb4d2..ca79b9b58 100644 --- a/locked-asset/simple-lock/Cargo.toml +++ b/locked-asset/simple-lock/Cargo.toml @@ -8,11 +8,11 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.42.0" +version = "=0.43.2" [dependencies.common_structs] path = "../../common/common_structs" @@ -23,4 +23,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.42.0" +version = "=0.43.2" diff --git a/locked-asset/simple-lock/meta/Cargo.toml b/locked-asset/simple-lock/meta/Cargo.toml index 578259c66..b51468b2b 100644 --- a/locked-asset/simple-lock/meta/Cargo.toml +++ b/locked-asset/simple-lock/meta/Cargo.toml @@ -8,4 +8,4 @@ authors = ["Dorin Iancu "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.42.0" +version = "0.43.2" diff --git a/locked-asset/simple-lock/wasm/Cargo.toml b/locked-asset/simple-lock/wasm/Cargo.toml index 6c63e40f1..952e46e5d 100644 --- a/locked-asset/simple-lock/wasm/Cargo.toml +++ b/locked-asset/simple-lock/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.42.0" +version = "=0.43.2" diff --git a/locked-asset/token-unstake/Cargo.toml b/locked-asset/token-unstake/Cargo.toml index a11a4a670..303074c0d 100644 --- a/locked-asset/token-unstake/Cargo.toml +++ b/locked-asset/token-unstake/Cargo.toml @@ -8,7 +8,7 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.mergeable] @@ -38,7 +38,7 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.42.0" +version = "=0.43.2" [dev-dependencies.multiversx-sc-modules] -version = "=0.42.0" +version = "=0.43.2" diff --git a/locked-asset/token-unstake/meta/Cargo.toml b/locked-asset/token-unstake/meta/Cargo.toml index 47fedd0b8..be6b1b488 100644 --- a/locked-asset/token-unstake/meta/Cargo.toml +++ b/locked-asset/token-unstake/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.42.0" +version = "0.43.2" diff --git a/locked-asset/token-unstake/wasm/Cargo.toml b/locked-asset/token-unstake/wasm/Cargo.toml index d4e44421c..1c9a3a43d 100644 --- a/locked-asset/token-unstake/wasm/Cargo.toml +++ b/locked-asset/token-unstake/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.42.0" +version = "=0.43.2" diff --git a/pause-all/Cargo.toml b/pause-all/Cargo.toml index 49ee9d910..182a8459d 100644 --- a/pause-all/Cargo.toml +++ b/pause-all/Cargo.toml @@ -11,13 +11,13 @@ path = "src/lib.rs" path = "../common/modules/pausable" [dependencies.multiversx-sc] -version = "=0.42.0" +version = "=0.43.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.42.0" +version = "=0.43.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.42.0" +version = "=0.43.2" [dev-dependencies.farm] path = "../dex/farm" diff --git a/pause-all/meta/Cargo.toml b/pause-all/meta/Cargo.toml index bcfe951d6..a9e79beef 100644 --- a/pause-all/meta/Cargo.toml +++ b/pause-all/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.42.0" +version = "0.43.2" diff --git a/pause-all/wasm/Cargo.toml b/pause-all/wasm/Cargo.toml index 958a4a7e6..5bf81326a 100644 --- a/pause-all/wasm/Cargo.toml +++ b/pause-all/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.42.0" +version = "=0.43.2" From c625a1bbd4a3c6679e97ce230c7602220a39336f Mon Sep 17 00:00:00 2001 From: "dorin.iancu" Date: Tue, 29 Aug 2023 14:03:51 +0300 Subject: [PATCH 043/213] fix test --- .../farm_with_locked_rewards_setup/mod.rs | 49 ++++++++++++++++++- .../tests/farm_setup/multi_user_farm_setup.rs | 49 ++++++++++++++++++- .../energy-factory/tests/old_tokens_test.rs | 24 ++++++--- .../tests/simple_lock_energy_test.rs | 10 +++- locked-asset/factory/src/lib.rs | 5 +- locked-asset/factory/tests/unlock_test.rs | 15 ++++-- 6 files changed, 131 insertions(+), 21 deletions(-) diff --git a/dex/farm-with-locked-rewards/tests/farm_with_locked_rewards_setup/mod.rs b/dex/farm-with-locked-rewards/tests/farm_with_locked_rewards_setup/mod.rs index b51328190..f795108e6 100644 --- a/dex/farm-with-locked-rewards/tests/farm_with_locked_rewards_setup/mod.rs +++ b/dex/farm-with-locked-rewards/tests/farm_with_locked_rewards_setup/mod.rs @@ -27,6 +27,7 @@ use multiversx_sc_modules::pause::PauseModule; use pausable::{PausableModule, State}; use sc_whitelist_module::SCWhitelistModule; use simple_lock::locked_token::LockedTokenModule; +use week_timekeeping::Epoch; pub static REWARD_TOKEN_ID: &[u8] = b"MEX-123456"; pub static LOCKED_REWARD_TOKEN_ID: &[u8] = b"LOCKED-123456"; @@ -48,6 +49,14 @@ pub const EPOCHS_IN_YEAR: u64 = 360; pub static LOCK_OPTIONS: &[u64] = &[EPOCHS_IN_YEAR, 2 * EPOCHS_IN_YEAR, 4 * EPOCHS_IN_YEAR]; pub static PENALTY_PERCENTAGES: &[u64] = &[4_000, 6_000, 8_000]; +pub struct RawFarmTokenAttributes { + pub reward_per_share_bytes: Vec, + pub entering_epoch: Epoch, + pub compounded_reward_bytes: Vec, + pub current_farm_amount_bytes: Vec, + pub original_owner_bytes: [u8; 32], +} + pub struct FarmSetup where FarmObjBuilder: 'static + Copy + Fn() -> farm_with_locked_rewards::ContractObj, @@ -302,12 +311,50 @@ where attributes: FarmTokenAttributes, ) -> u64 { let mut result = 0; + + let raw_attributes = RawFarmTokenAttributes { + reward_per_share_bytes: attributes + .reward_per_share + .to_bytes_be() + .as_slice() + .to_vec(), + entering_epoch: attributes.entering_epoch, + compounded_reward_bytes: attributes + .compounded_reward + .to_bytes_be() + .as_slice() + .to_vec(), + current_farm_amount_bytes: attributes + .current_farm_amount + .to_bytes_be() + .as_slice() + .to_vec(), + original_owner_bytes: attributes.original_owner.to_byte_array(), + }; + self.b_mock .execute_query(&self.farm_wrapper, |sc| { + let attributes_managed = FarmTokenAttributes { + reward_per_share: multiversx_sc::types::BigUint::::from_bytes_be( + &raw_attributes.reward_per_share_bytes, + ), + entering_epoch: raw_attributes.entering_epoch, + compounded_reward: multiversx_sc::types::BigUint::::from_bytes_be( + &raw_attributes.compounded_reward_bytes, + ), + current_farm_amount: multiversx_sc::types::BigUint::::from_bytes_be( + &raw_attributes.current_farm_amount_bytes, + ), + original_owner: + multiversx_sc::types::ManagedAddress::::new_from_bytes( + &raw_attributes.original_owner_bytes, + ), + }; + let result_managed = sc.calculate_rewards_for_given_position( managed_address!(user), managed_biguint!(farm_token_amount), - attributes, + attributes_managed, ); result = result_managed.to_u64().unwrap(); }) diff --git a/dex/farm/tests/farm_setup/multi_user_farm_setup.rs b/dex/farm/tests/farm_setup/multi_user_farm_setup.rs index 00995b692..2536c837f 100644 --- a/dex/farm/tests/farm_setup/multi_user_farm_setup.rs +++ b/dex/farm/tests/farm_setup/multi_user_farm_setup.rs @@ -24,6 +24,7 @@ use farm_boosted_yields::FarmBoostedYieldsModule; use farm_token::FarmTokenModule; use pausable::{PausableModule, State}; use sc_whitelist_module::SCWhitelistModule; +use week_timekeeping::Epoch; use weekly_rewards_splitting::update_claim_progress_energy::UpdateClaimProgressEnergyModule; pub static REWARD_TOKEN_ID: &[u8] = b"REW-123456"; @@ -39,6 +40,14 @@ pub const USER_REWARDS_FARM_CONST: u64 = 2; pub const MIN_ENERGY_AMOUNT_FOR_BOOSTED_YIELDS: u64 = 1; pub const MIN_FARM_AMOUNT_FOR_BOOSTED_YIELDS: u64 = 1; +pub struct RawFarmTokenAttributes { + pub reward_per_share_bytes: Vec, + pub entering_epoch: Epoch, + pub compounded_reward_bytes: Vec, + pub current_farm_amount_bytes: Vec, + pub original_owner_bytes: [u8; 32], +} + pub struct MultiUserFarmSetup where FarmObjBuilder: 'static + Copy + Fn() -> farm::ContractObj, @@ -347,12 +356,50 @@ where attributes: FarmTokenAttributes, ) -> u64 { let mut result = 0; + + let raw_attributes = RawFarmTokenAttributes { + reward_per_share_bytes: attributes + .reward_per_share + .to_bytes_be() + .as_slice() + .to_vec(), + entering_epoch: attributes.entering_epoch, + compounded_reward_bytes: attributes + .compounded_reward + .to_bytes_be() + .as_slice() + .to_vec(), + current_farm_amount_bytes: attributes + .current_farm_amount + .to_bytes_be() + .as_slice() + .to_vec(), + original_owner_bytes: attributes.original_owner.to_byte_array(), + }; + self.b_mock .execute_query(&self.farm_wrapper, |sc| { + let attributes_managed = FarmTokenAttributes { + reward_per_share: multiversx_sc::types::BigUint::::from_bytes_be( + &raw_attributes.reward_per_share_bytes, + ), + entering_epoch: raw_attributes.entering_epoch, + compounded_reward: multiversx_sc::types::BigUint::::from_bytes_be( + &raw_attributes.compounded_reward_bytes, + ), + current_farm_amount: multiversx_sc::types::BigUint::::from_bytes_be( + &raw_attributes.current_farm_amount_bytes, + ), + original_owner: + multiversx_sc::types::ManagedAddress::::new_from_bytes( + &raw_attributes.original_owner_bytes, + ), + }; + let result_managed = sc.calculate_rewards_for_given_position( managed_address!(user), managed_biguint!(farm_token_amount), - attributes, + attributes_managed, ); result = result_managed.to_u64().unwrap(); }) diff --git a/locked-asset/energy-factory/tests/old_tokens_test.rs b/locked-asset/energy-factory/tests/old_tokens_test.rs index 6f39214ff..2e45d0d83 100644 --- a/locked-asset/energy-factory/tests/old_tokens_test.rs +++ b/locked-asset/energy-factory/tests/old_tokens_test.rs @@ -60,6 +60,8 @@ fn extend_lock_period_old_token_test() { managed_biguint!(60_000) * USER_BALANCE * (second_unlock_epoch - current_epoch) / 100_000u32; + let user_energy_amount_vec = user_energy_amount.to_bytes_be().as_slice().to_vec(); + setup .b_mock .execute_tx(&setup.owner, &setup.sc_wrapper, &rust_zero, |sc| { @@ -68,14 +70,14 @@ fn extend_lock_period_old_token_test() { let user_energy = ( managed_address!(&first_user), managed_biguint!(USER_BALANCE), - BigInt::from(user_energy_amount.clone()), + BigInt::from_signed_bytes_be(&user_energy_amount_vec), ) .into(); users_energy.push(user_energy); sc.set_energy_for_old_tokens(users_energy); let expected_energy = Energy::new( - BigInt::from(user_energy_amount.clone()), + BigInt::from_signed_bytes_be(&user_energy_amount_vec), 1, managed_biguint!(USER_BALANCE), ); @@ -177,6 +179,8 @@ fn min_period_migrated_token_test() { managed_biguint!(60_000) * USER_BALANCE * (second_unlock_epoch - current_epoch) / 100_000u32; + let user_energy_amount_vec = user_energy_amount.to_bytes_be().as_slice().to_vec(); + setup .b_mock .execute_tx(&setup.owner, &setup.sc_wrapper, &rust_zero, |sc| { @@ -185,14 +189,14 @@ fn min_period_migrated_token_test() { let user_energy = ( managed_address!(&first_user), managed_biguint!(USER_BALANCE), - BigInt::from(user_energy_amount.clone()), + BigInt::from_signed_bytes_be(&user_energy_amount_vec), ) .into(); users_energy.push(user_energy); sc.set_energy_for_old_tokens(users_energy); let expected_energy = Energy::new( - BigInt::from(user_energy_amount.clone()), + BigInt::from_signed_bytes_be(&user_energy_amount_vec), 1, managed_biguint!(USER_BALANCE), ); @@ -285,6 +289,8 @@ fn min_period_migrated_token_test2() { managed_biguint!(60_000) * USER_BALANCE * (second_unlock_epoch - current_epoch) / 100_000u32; + let user_energy_amount_vec = user_energy_amount.to_bytes_be().as_slice().to_vec(); + setup .b_mock .execute_tx(&setup.owner, &setup.sc_wrapper, &rust_zero, |sc| { @@ -294,14 +300,14 @@ fn min_period_migrated_token_test2() { let user_energy = ( managed_address!(&first_user), managed_biguint!(USER_BALANCE), - BigInt::from(user_energy_amount.clone()), + BigInt::from_signed_bytes_be(&user_energy_amount_vec), ) .into(); users_energy.push(user_energy); sc.set_energy_for_old_tokens(users_energy); let expected_energy = Energy::new( - BigInt::from(user_energy_amount.clone()), + BigInt::from_signed_bytes_be(&user_energy_amount_vec), 1441, managed_biguint!(USER_BALANCE), ); @@ -403,6 +409,8 @@ fn check_initial_old_unlock_schedule_decode_test() { managed_biguint!(60_000) * USER_BALANCE * (second_unlock_epoch - current_epoch) / 100_000u32; + let user_energy_amount_vec = user_energy_amount.to_bytes_be().as_slice().to_vec(); + setup .b_mock .execute_tx(&setup.owner, &setup.sc_wrapper, &rust_zero, |sc| { @@ -411,14 +419,14 @@ fn check_initial_old_unlock_schedule_decode_test() { let user_energy = ( managed_address!(&first_user), managed_biguint!(USER_BALANCE), - BigInt::from(user_energy_amount.clone()), + BigInt::from_signed_bytes_be(&user_energy_amount_vec), ) .into(); users_energy.push(user_energy); sc.set_energy_for_old_tokens(users_energy); let expected_energy = Energy::new( - BigInt::from(user_energy_amount.clone()), + BigInt::from_signed_bytes_be(&user_energy_amount_vec), 1, managed_biguint!(USER_BALANCE), ); diff --git a/locked-asset/energy-factory/tests/simple_lock_energy_test.rs b/locked-asset/energy-factory/tests/simple_lock_energy_test.rs index 409ee1c1a..823a8eb56 100644 --- a/locked-asset/energy-factory/tests/simple_lock_energy_test.rs +++ b/locked-asset/energy-factory/tests/simple_lock_energy_test.rs @@ -4,6 +4,7 @@ mod energy_factory_setup; use energy_factory::energy::EnergyModule; use energy_factory_setup::*; +use multiversx_sc::types::BigUint; use simple_lock::locked_token::LockedTokenAttributes; use multiversx_sc_scenario::{ @@ -444,14 +445,19 @@ fn energy_deplete_test() { assert_eq!(actual_energy, expected_energy); current_epoch = 10; - let expected_energy = managed_biguint!(LOCK_OPTIONS[0] - current_epoch) * half_balance; + let expected_energy: BigUint = + managed_biguint!(LOCK_OPTIONS[0] - current_epoch) * half_balance; + let expected_energy_vec = expected_energy.to_bytes_be().as_slice().to_vec(); setup .b_mock .execute_query(&setup.sc_wrapper, |sc| { let mut energy = sc.user_energy(&managed_address!(&first_user)).get(); energy.deplete(current_epoch); - assert_eq!(energy.get_energy_amount(), expected_energy); + assert_eq!( + energy.get_energy_amount(), + BigUint::from_bytes_be(&expected_energy_vec) + ); }) .assert_ok(); } diff --git a/locked-asset/factory/src/lib.rs b/locked-asset/factory/src/lib.rs index d4e552905..21084b2f1 100644 --- a/locked-asset/factory/src/lib.rs +++ b/locked-asset/factory/src/lib.rs @@ -43,10 +43,7 @@ pub trait LockedAssetFactory: asset_token_id.is_valid_esdt_identifier(), "Asset token ID is not a valid esdt identifier" ); - require!( - asset_token_id != self.locked_asset_token().get_token_id(), - "Asset token ID cannot be the same as Locked asset token ID" - ); + let unlock_milestones = default_unlock_period.to_vec(); self.validate_unlock_milestones(&unlock_milestones); diff --git a/locked-asset/factory/tests/unlock_test.rs b/locked-asset/factory/tests/unlock_test.rs index 333d97b50..b1e26d7d7 100644 --- a/locked-asset/factory/tests/unlock_test.rs +++ b/locked-asset/factory/tests/unlock_test.rs @@ -817,7 +817,7 @@ fn update_energy_after_old_token_unlock_test() { &old_token_attributes, ); - let mut user_energy_amount = managed_biguint!(0); + let mut user_energy_amount: multiversx_sc::types::BigUint = managed_biguint!(0); user_energy_amount += managed_biguint!(20_000) * USER_BALANCE * (first_unlock_epoch - current_epoch) / 100_000u32; user_energy_amount += @@ -828,6 +828,8 @@ fn update_energy_after_old_token_unlock_test() { user_energy_amount += managed_biguint!(40_000) * USER_BALANCE * (forth_unlock_epoch - current_epoch) / 100_000u32; + let expected_energy_vec = user_energy_amount.to_bytes_be().as_slice().to_vec(); + setup .b_mock .execute_tx( @@ -841,14 +843,14 @@ fn update_energy_after_old_token_unlock_test() { let user_energy = ( managed_address!(&first_user), managed_biguint!(USER_BALANCE), - BigInt::from(user_energy_amount.clone()), + BigInt::from_signed_bytes_be(&expected_energy_vec), ) .into(); users_energy.push(user_energy); sc.set_energy_for_old_tokens(users_energy); let expected_energy = Energy::new( - BigInt::from(user_energy_amount.clone()), + BigInt::from_signed_bytes_be(&expected_energy_vec), 1441, managed_biguint!(USER_BALANCE), ); @@ -911,7 +913,8 @@ fn update_energy_after_old_token_unlock_test() { Some(&new_locked_token_attributes), ); - let mut final_user_energy_amount = managed_biguint!(0u64); + let mut final_user_energy_amount: multiversx_sc::types::BigUint = + managed_biguint!(0u64); final_user_energy_amount += managed_biguint!(33_333) * remaining_locked_token_balace * (third_unlock_epoch - current_epoch) @@ -921,11 +924,13 @@ fn update_energy_after_old_token_unlock_test() { * (forth_unlock_epoch - current_epoch) / 100_000u32; // 66_666 + 1 leftover + let final_amount_vec = final_user_energy_amount.to_bytes_be().as_slice().to_vec(); + setup .b_mock .execute_query(&setup.energy_factory_wrapper, |sc| { let expected_energy = Energy::new( - BigInt::from(final_user_energy_amount.clone()), + BigInt::from_signed_bytes_be(&final_amount_vec), current_epoch, managed_biguint!(remaining_locked_token_balace), ); From 49fe9a345c464b362337f5795ae95d658a48b7bf Mon Sep 17 00:00:00 2001 From: ovidiuolteanu Date: Tue, 29 Aug 2023 15:13:20 +0300 Subject: [PATCH 044/213] actions update --- .github/workflows/actions.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 3404f739e..c5fdba201 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -20,9 +20,9 @@ permissions: jobs: contracts: name: Contracts - uses: multiversx/mx-sc-actions/.github/workflows/contracts.yml@v2.3.0 + uses: multiversx/mx-sc-actions/.github/workflows/contracts.yml@v2.3.1 with: - rust-toolchain: nightly-2023-04-23 + rust-toolchain: nightly-2023-05-26 vmtools-version: v1.4.60 secrets: token: ${{ secrets.GITHUB_TOKEN }} From ea612c1081ba831b757c505c8aa861fdcee0da20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Tue, 29 Aug 2023 16:58:30 +0300 Subject: [PATCH 045/213] Fixes after review --- common/modules/farm/config/src/config.rs | 43 ++++++++++++++++--- .../farm_base_impl/src/base_traits_impl.rs | 20 ++++++--- .../farm/farm_base_impl/src/enter_farm.rs | 9 +++- dex/farm-with-locked-rewards/wasm/src/lib.rs | 5 +-- dex/farm/src/base_functions.rs | 11 ++--- dex/farm/src/claim_boost_only.rs | 15 +++---- dex/farm/wasm/src/lib.rs | 5 +-- dex/governance/src/weight.rs | 4 +- .../fees-collector/src/config.rs | 6 +-- energy-integration/fees-collector/src/lib.rs | 1 - energy-integration/governance-v2/src/lib.rs | 2 +- .../farm-staking/src/base_impl_wrapper.rs | 33 +++++++------- .../src/claim_only_boosted_staking_rewards.rs | 16 +++---- farm-staking/farm-staking/wasm/src/lib.rs | 5 +-- 14 files changed, 99 insertions(+), 76 deletions(-) diff --git a/common/modules/farm/config/src/config.rs b/common/modules/farm/config/src/config.rs index bd80456ff..909a5cfbb 100644 --- a/common/modules/farm/config/src/config.rs +++ b/common/modules/farm/config/src/config.rs @@ -8,6 +8,22 @@ use pausable::State; pub const DEFAULT_NFT_DEPOSIT_MAX_LEN: usize = 10; +#[derive( + ManagedVecItem, + TopEncode, + TopDecode, + NestedEncode, + NestedDecode, + TypeAbi, + Clone, + PartialEq, + Debug, +)] +pub struct UserTotalFarmPositionStruct { + pub total_farm_position: BigUint, + pub allow_external_claim_boosted_rewards: bool, +} + #[multiversx_sc::module] pub trait ConfigModule: pausable::PausableModule + permissions_module::PermissionsModule { #[inline] @@ -16,6 +32,24 @@ pub trait ConfigModule: pausable::PausableModule + permissions_module::Permissio state == State::Active } + fn get_user_total_farm_position(&self, user: &ManagedAddress) -> BigUint { + self.user_total_farm_position(user) + .set_if_empty(UserTotalFarmPositionStruct { + total_farm_position: BigUint::zero(), + allow_external_claim_boosted_rewards: false, + }); + + self.user_total_farm_position(user) + .get() + .total_farm_position + } + + fn get_allow_external_claim_boosted_rewards(&self, user: &ManagedAddress) -> bool { + self.user_total_farm_position(user) + .get() + .allow_external_claim_boosted_rewards + } + #[view(getFarmingTokenId)] #[storage_mapper("farming_token_id")] fn farming_token_id(&self) -> SingleValueMapper; @@ -41,13 +75,8 @@ pub trait ConfigModule: pausable::PausableModule + permissions_module::Permissio #[view(getUserTotalFarmPosition)] #[storage_mapper("userTotalFarmPosition")] - fn user_total_farm_position(&self, user: &ManagedAddress) -> SingleValueMapper; - - #[view(getAllowExternalClaimBoostedRewards)] - #[storage_mapper("allowExternalClaimBoostedRewards")] - fn allow_external_claim_boosted_rewards( + fn user_total_farm_position( &self, user: &ManagedAddress, - ) -> SingleValueMapper; - + ) -> SingleValueMapper>; } diff --git a/common/modules/farm/farm_base_impl/src/base_traits_impl.rs b/common/modules/farm/farm_base_impl/src/base_traits_impl.rs index 5ac1c4369..63f5957b0 100644 --- a/common/modules/farm/farm_base_impl/src/base_traits_impl.rs +++ b/common/modules/farm/farm_base_impl/src/base_traits_impl.rs @@ -210,20 +210,23 @@ pub trait FarmContract { } } - if sc.user_total_farm_position(user).get() == 0 { + let user_total_farm_position = sc.get_user_total_farm_position(user); + if user_total_farm_position == BigUint::zero() { Self::increase_user_farm_position(sc, user, &total_farm_position); } else if farm_position_increase > 0 { Self::increase_user_farm_position(sc, user, &farm_position_increase); } } -#[inline] + #[inline] fn increase_user_farm_position( sc: &Self::FarmSc, user: &ManagedAddress<::Api>, new_farm_position_amount: &BigUint<::Api>, ) { sc.user_total_farm_position(user) - .update(|user_farm_position| *user_farm_position += new_farm_position_amount); + .update(|user_farm_position_struct| { + user_farm_position_struct.total_farm_position += new_farm_position_amount + }); } fn decrease_user_farm_position( @@ -235,12 +238,15 @@ pub trait FarmContract { farm_token_mapper.get_token_attributes(farm_position.token_nonce); sc.user_total_farm_position(&token_attributes.original_owner) - .update(|user_farm_position| { - if *user_farm_position > farm_position.amount { - *user_farm_position -= &farm_position.amount; + .update(|user_farm_position_struct| { + let mut user_total_farm_position = + user_farm_position_struct.total_farm_position.clone(); + if user_total_farm_position > farm_position.amount { + user_total_farm_position -= &farm_position.amount; } else { - *user_farm_position = BigUint::zero(); + user_total_farm_position = BigUint::zero(); } + user_farm_position_struct.total_farm_position = user_total_farm_position; }); } } diff --git a/common/modules/farm/farm_base_impl/src/enter_farm.rs b/common/modules/farm/farm_base_impl/src/enter_farm.rs index e7628cf76..02e20d42a 100644 --- a/common/modules/farm/farm_base_impl/src/enter_farm.rs +++ b/common/modules/farm/farm_base_impl/src/enter_farm.rs @@ -45,11 +45,16 @@ pub trait BaseEnterFarmModule: ); // The order is important - first check and update, then increase position - FC::check_and_update_user_farm_position(self, + FC::check_and_update_user_farm_position( + self, &caller, &enter_farm_context.additional_farm_tokens, ); - FC::increase_user_farm_position(self, &caller, &enter_farm_context.farming_token_payment.amount); + FC::increase_user_farm_position( + self, + &caller, + &enter_farm_context.farming_token_payment.amount, + ); FC::generate_aggregated_rewards(self, &mut storage_cache); diff --git a/dex/farm-with-locked-rewards/wasm/src/lib.rs b/dex/farm-with-locked-rewards/wasm/src/lib.rs index 48baeb9fc..a124d3269 100644 --- a/dex/farm-with-locked-rewards/wasm/src/lib.rs +++ b/dex/farm-with-locked-rewards/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 65 +// Endpoints: 64 // Async Callback: 1 -// Total number of exported functions: 67 +// Total number of exported functions: 66 #![no_std] #![feature(alloc_error_handler, lang_items)] @@ -34,7 +34,6 @@ multiversx_sc_wasm_adapter::endpoints! { getLastRewardBlockNonce getDivisionSafetyConstant getUserTotalFarmPosition - getAllowExternalClaimBoostedRewards setLockingScAddress setLockEpochs getLockingScAddress diff --git a/dex/farm/src/base_functions.rs b/dex/farm/src/base_functions.rs index a243bac15..fad4e0908 100644 --- a/dex/farm/src/base_functions.rs +++ b/dex/farm/src/base_functions.rs @@ -13,7 +13,6 @@ use contexts::storage_cache::StorageCache; use farm_base_impl::base_traits_impl::{DefaultFarmWrapper, FarmContract}; use fixed_supply_token::FixedSupplyToken; - use crate::exit_penalty; pub type DoubleMultiPayment = MultiValue2, EsdtTokenPayment>; @@ -241,16 +240,18 @@ where caller: &ManagedAddress<<::FarmSc as ContractBase>::Api>, token_attributes: &::AttributesType, ) -> BigUint<<::FarmSc as ContractBase>::Api> { - if &token_attributes.original_owner != caller { + let original_owner = &token_attributes.original_owner; + + if original_owner != caller { sc.update_energy_and_progress(caller); } - let user_total_farm_position_mapper = sc.user_total_farm_position(caller); - if user_total_farm_position_mapper.is_empty() { + let user_total_farm_position = sc.get_user_total_farm_position(original_owner); + if user_total_farm_position == BigUint::zero() { return BigUint::zero(); } - sc.claim_boosted_yields_rewards(caller, user_total_farm_position_mapper.get()) + sc.claim_boosted_yields_rewards(caller, user_total_farm_position) } } diff --git a/dex/farm/src/claim_boost_only.rs b/dex/farm/src/claim_boost_only.rs index 15fe9cb5a..9159337d9 100644 --- a/dex/farm/src/claim_boost_only.rs +++ b/dex/farm/src/claim_boost_only.rs @@ -1,7 +1,5 @@ multiversx_sc::imports!(); - - use crate::base_functions::Wrapper; #[multiversx_sc::module] @@ -37,12 +35,12 @@ pub trait ClaimBoostOnlyModule: #[endpoint(claimBoostedRewards)] fn claim_boosted_rewards( &self, - opt_user: OptionalValue + opt_user: OptionalValue, ) -> EsdtTokenPayment { let user = match opt_user { OptionalValue::Some(user) => { require!( - self.allow_external_claim_boosted_rewards(&user).get(), + self.get_allow_external_claim_boosted_rewards(&user), "Cannot claim rewards for this address" ); user @@ -51,14 +49,13 @@ pub trait ClaimBoostOnlyModule: }; let reward_token_id = self.reward_token_id().get(); - - let user_total_farm_position_mapper = self.user_total_farm_position(&user); - if user_total_farm_position_mapper.is_empty() { + + let user_total_farm_position = self.get_user_total_farm_position(&user); + if user_total_farm_position == BigUint::zero() { return EsdtTokenPayment::new(reward_token_id, 0, BigUint::zero()); } - let reward = - self.claim_boosted_yields_rewards(&user, user_total_farm_position_mapper.get()); + let reward = self.claim_boosted_yields_rewards(&user, user_total_farm_position); if reward > 0 { self.reward_reserve().update(|reserve| *reserve -= &reward); } diff --git a/dex/farm/wasm/src/lib.rs b/dex/farm/wasm/src/lib.rs index dbb8e6d3d..4f3c13441 100644 --- a/dex/farm/wasm/src/lib.rs +++ b/dex/farm/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 62 +// Endpoints: 61 // Async Callback: 1 -// Total number of exported functions: 64 +// Total number of exported functions: 63 #![no_std] #![feature(alloc_error_handler, lang_items)] @@ -35,7 +35,6 @@ multiversx_sc_wasm_adapter::endpoints! { getLastRewardBlockNonce getDivisionSafetyConstant getUserTotalFarmPosition - getAllowExternalClaimBoostedRewards registerFarmToken getFarmTokenId getFarmTokenSupply diff --git a/dex/governance/src/weight.rs b/dex/governance/src/weight.rs index 2eda127a1..07b075f95 100644 --- a/dex/governance/src/weight.rs +++ b/dex/governance/src/weight.rs @@ -27,9 +27,7 @@ pub trait Lib: config::Config { if let Some(provider) = self.price_providers().get(&payment.token_identifier) { let call_result: MultiValue2, EsdtTokenPayment> = self.price_provider_proxy(provider) - .get_tokens_for_given_position_with_safe_price( - payment.amount.clone(), - ) + .get_tokens_for_given_position_with_safe_price(payment.amount.clone()) .execute_on_dest_context(); let (token1, token2) = call_result.into_tuple(); diff --git a/energy-integration/fees-collector/src/config.rs b/energy-integration/fees-collector/src/config.rs index 64c61c239..1e1a850a0 100644 --- a/energy-integration/fees-collector/src/config.rs +++ b/energy-integration/fees-collector/src/config.rs @@ -81,9 +81,5 @@ pub trait ConfigModule { #[view(getAllowExternalClaimRewards)] #[storage_mapper("allowExternalClaimRewards")] - fn allow_external_claim_rewards( - &self, - user: &ManagedAddress, - ) -> SingleValueMapper; - + fn allow_external_claim_rewards(&self, user: &ManagedAddress) -> SingleValueMapper; } diff --git a/energy-integration/fees-collector/src/lib.rs b/energy-integration/fees-collector/src/lib.rs index 79c29a233..f2aef7a34 100644 --- a/energy-integration/fees-collector/src/lib.rs +++ b/energy-integration/fees-collector/src/lib.rs @@ -64,7 +64,6 @@ pub trait FeesCollector: OptionalValue::None => self.blockchain().get_caller(), }; - let wrapper = FeesCollectorWrapper::new(); let mut rewards = self.claim_multi(&wrapper, &original_caller); if rewards.is_empty() { diff --git a/energy-integration/governance-v2/src/lib.rs b/energy-integration/governance-v2/src/lib.rs index 584d43008..e2b27e5c6 100644 --- a/energy-integration/governance-v2/src/lib.rs +++ b/energy-integration/governance-v2/src/lib.rs @@ -37,7 +37,7 @@ pub trait GovernanceV2: /// - `quorum_percentage` - the minimum number of (`votes` minus `downvotes`) at the end of voting period /// - `votingDelayInBlocks` - Number of blocks to wait after a block is proposed before being able to vote/downvote that proposal /// - `votingPeriodInBlocks` - Number of blocks the voting period lasts (voting delay does not count towards this) - /// - `withdraw_percentage_defeated` - Percetange of the fee to be returned if proposal defetead + /// - `withdraw_percentage_defeated` - Percetange of the fee to be returned if proposal defetead /// - `energy_factory_address` /// - `fees_collector_address` /// - `fee_token` - The token used to pay the fee diff --git a/farm-staking/farm-staking/src/base_impl_wrapper.rs b/farm-staking/farm-staking/src/base_impl_wrapper.rs index 25b41733d..51575b19a 100644 --- a/farm-staking/farm-staking/src/base_impl_wrapper.rs +++ b/farm-staking/farm-staking/src/base_impl_wrapper.rs @@ -52,12 +52,12 @@ where if &token_attributes.original_owner != caller { sc.update_energy_and_progress(caller); } - let user_total_farm_position_mapper = sc.user_total_farm_position(caller); - if user_total_farm_position_mapper.is_empty() { + let user_total_farm_position = sc.get_user_total_farm_position(caller); + if user_total_farm_position == BigUint::zero() { return BigUint::zero(); } - sc.claim_boosted_yields_rewards(caller, user_total_farm_position_mapper.get()) + sc.claim_boosted_yields_rewards(caller, user_total_farm_position) } } @@ -136,11 +136,7 @@ where ) -> BigUint<::Api> { let base_farm_reward = Self::calculate_base_farm_rewards(farm_token_amount, token_attributes, storage_cache); - let boosted_yield_rewards = Self::calculate_boosted_rewards( - sc, - caller, - token_attributes, - ); + let boosted_yield_rewards = Self::calculate_boosted_rewards(sc, caller, token_attributes); base_farm_reward + boosted_yield_rewards } @@ -190,7 +186,6 @@ where } } - fn check_and_update_user_farm_position( sc: &Self::FarmSc, user: &ManagedAddress<::Api>, @@ -211,8 +206,8 @@ where farm_position_increase += &farm_position.amount; } } - - if sc.user_total_farm_position(user).get() == 0 { + let user_total_farm_position = sc.get_user_total_farm_position(user); + if user_total_farm_position == BigUint::zero() { Self::increase_user_farm_position(sc, user, &total_farm_position); } else if farm_position_increase > 0 { Self::increase_user_farm_position(sc, user, &farm_position_increase); @@ -225,7 +220,9 @@ where new_farm_position_amount: &BigUint<::Api>, ) { sc.user_total_farm_position(user) - .update(|user_farm_position| *user_farm_position += new_farm_position_amount); + .update(|user_farm_position_struct| { + user_farm_position_struct.total_farm_position += new_farm_position_amount + }); } fn decrease_user_farm_position( @@ -237,13 +234,15 @@ where farm_token_mapper.get_token_attributes(farm_position.token_nonce); sc.user_total_farm_position(&token_attributes.original_owner) - .update(|user_farm_position| { - if *user_farm_position > farm_position.amount { - *user_farm_position -= &farm_position.amount; + .update(|user_farm_position_struct| { + let mut user_total_farm_position = + user_farm_position_struct.total_farm_position.clone(); + if user_total_farm_position > farm_position.amount { + user_total_farm_position -= &farm_position.amount; } else { - *user_farm_position = BigUint::zero(); + user_total_farm_position = BigUint::zero(); } + user_farm_position_struct.total_farm_position = user_total_farm_position; }); } - } diff --git a/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs b/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs index f69569933..a9b7605ee 100644 --- a/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs +++ b/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs @@ -30,7 +30,7 @@ pub trait ClaimOnlyBoostedStakingRewardsModule: let user = match opt_user { OptionalValue::Some(user) => { require!( - self.allow_external_claim_boosted_rewards(&user).get(), + self.get_allow_external_claim_boosted_rewards(&user), "Cannot claim rewards for this address" ); user @@ -39,13 +39,12 @@ pub trait ClaimOnlyBoostedStakingRewardsModule: }; let reward_token_id = self.reward_token_id().get(); - let user_total_farm_position_mapper = self.user_total_farm_position(&user); - if user_total_farm_position_mapper.is_empty() { + let user_total_farm_position = self.get_user_total_farm_position(&user); + if user_total_farm_position == BigUint::zero() { return EsdtTokenPayment::new(reward_token_id, 0, BigUint::zero()); } - let reward = - self.claim_boosted_yields_rewards(&user, user_total_farm_position_mapper.get()); + let reward = self.claim_boosted_yields_rewards(&user, user_total_farm_position); if reward > 0 { self.reward_reserve().update(|reserve| *reserve -= &reward); } @@ -69,11 +68,8 @@ pub trait ClaimOnlyBoostedStakingRewardsModule: let token_attributes = self.get_attributes_as_part_of_fixed_supply(payment, &farm_token_mapper); - let reward = FarmStakingWrapper::::calculate_boosted_rewards( - self, - caller, - &token_attributes, - ); + let reward = + FarmStakingWrapper::::calculate_boosted_rewards(self, caller, &token_attributes); if reward > 0 { self.reward_reserve().update(|reserve| *reserve -= &reward); } diff --git a/farm-staking/farm-staking/wasm/src/lib.rs b/farm-staking/farm-staking/wasm/src/lib.rs index f054fa567..d3322ea4e 100644 --- a/farm-staking/farm-staking/wasm/src/lib.rs +++ b/farm-staking/farm-staking/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 67 +// Endpoints: 66 // Async Callback: 1 -// Total number of exported functions: 69 +// Total number of exported functions: 68 #![no_std] #![feature(alloc_error_handler, lang_items)] @@ -38,7 +38,6 @@ multiversx_sc_wasm_adapter::endpoints! { getLastRewardBlockNonce getDivisionSafetyConstant getUserTotalFarmPosition - getAllowExternalClaimBoostedRewards registerFarmToken getFarmTokenId getFarmTokenSupply From 9293cd43ec09b2721dc44ea0a6adb1858cfe88f8 Mon Sep 17 00:00:00 2001 From: "dorin.iancu" Date: Wed, 30 Aug 2023 09:44:25 +0300 Subject: [PATCH 046/213] fix imports --- .../common-modules/weekly-rewards-splitting/src/base_impl.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/energy-integration/common-modules/weekly-rewards-splitting/src/base_impl.rs b/energy-integration/common-modules/weekly-rewards-splitting/src/base_impl.rs index e249aa9ba..c8579672d 100644 --- a/energy-integration/common-modules/weekly-rewards-splitting/src/base_impl.rs +++ b/energy-integration/common-modules/weekly-rewards-splitting/src/base_impl.rs @@ -1,6 +1,5 @@ multiversx_sc::imports!(); -use crate::update_claim_progress_energy::UpdateClaimProgressEnergyModule; use common_types::PaymentsVec; use week_timekeeping::Week; @@ -12,7 +11,8 @@ pub trait AllBaseWeeklyRewardsSplittingImplTraits = + week_timekeeping::WeekTimekeepingModule + crate::global_info::WeeklyRewardsGlobalInfo + crate::locked_token_buckets::WeeklyRewardsLockedTokenBucketsModule - + events::WeeklyRewardsSplittingEventsModule; + + events::WeeklyRewardsSplittingEventsModule + + crate::update_claim_progress_energy::UpdateClaimProgressEnergyModule; pub trait WeeklyRewardsSplittingTraitsModule { type WeeklyRewardsSplittingMod: AllBaseWeeklyRewardsSplittingImplTraits; From 9bdf09c241fc1757b02c80d1ed1a941665a96e9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Wed, 30 Aug 2023 17:26:45 +0300 Subject: [PATCH 047/213] Fixes after review --- common/modules/farm/config/src/config.rs | 15 +++++---------- .../farm/farm_base_impl/src/base_traits_impl.rs | 4 ++-- dex/farm/src/base_functions.rs | 4 +++- dex/farm/src/claim_boost_only.rs | 16 +++++++--------- .../farm-staking/src/base_impl_wrapper.rs | 7 ++++--- .../src/claim_only_boosted_staking_rewards.rs | 15 +++++++-------- 6 files changed, 28 insertions(+), 33 deletions(-) diff --git a/common/modules/farm/config/src/config.rs b/common/modules/farm/config/src/config.rs index 909a5cfbb..c7768500f 100644 --- a/common/modules/farm/config/src/config.rs +++ b/common/modules/farm/config/src/config.rs @@ -32,22 +32,17 @@ pub trait ConfigModule: pausable::PausableModule + permissions_module::Permissio state == State::Active } - fn get_user_total_farm_position(&self, user: &ManagedAddress) -> BigUint { + fn get_user_total_farm_position_struct( + &self, + user: &ManagedAddress, + ) -> UserTotalFarmPositionStruct { self.user_total_farm_position(user) .set_if_empty(UserTotalFarmPositionStruct { total_farm_position: BigUint::zero(), allow_external_claim_boosted_rewards: false, }); - self.user_total_farm_position(user) - .get() - .total_farm_position - } - - fn get_allow_external_claim_boosted_rewards(&self, user: &ManagedAddress) -> bool { - self.user_total_farm_position(user) - .get() - .allow_external_claim_boosted_rewards + self.user_total_farm_position(user).get() } #[view(getFarmingTokenId)] diff --git a/common/modules/farm/farm_base_impl/src/base_traits_impl.rs b/common/modules/farm/farm_base_impl/src/base_traits_impl.rs index 63f5957b0..81aa35955 100644 --- a/common/modules/farm/farm_base_impl/src/base_traits_impl.rs +++ b/common/modules/farm/farm_base_impl/src/base_traits_impl.rs @@ -210,8 +210,8 @@ pub trait FarmContract { } } - let user_total_farm_position = sc.get_user_total_farm_position(user); - if user_total_farm_position == BigUint::zero() { + let user_total_farm_position_struct = sc.get_user_total_farm_position_struct(user); + if user_total_farm_position_struct.total_farm_position == BigUint::zero() { Self::increase_user_farm_position(sc, user, &total_farm_position); } else if farm_position_increase > 0 { Self::increase_user_farm_position(sc, user, &farm_position_increase); diff --git a/dex/farm/src/base_functions.rs b/dex/farm/src/base_functions.rs index fad4e0908..15c6f8d3b 100644 --- a/dex/farm/src/base_functions.rs +++ b/dex/farm/src/base_functions.rs @@ -246,7 +246,9 @@ where sc.update_energy_and_progress(caller); } - let user_total_farm_position = sc.get_user_total_farm_position(original_owner); + let user_total_farm_position_struct = + sc.get_user_total_farm_position_struct(original_owner); + let user_total_farm_position = user_total_farm_position_struct.total_farm_position; if user_total_farm_position == BigUint::zero() { return BigUint::zero(); } diff --git a/dex/farm/src/claim_boost_only.rs b/dex/farm/src/claim_boost_only.rs index 9159337d9..1851bfd0c 100644 --- a/dex/farm/src/claim_boost_only.rs +++ b/dex/farm/src/claim_boost_only.rs @@ -38,19 +38,17 @@ pub trait ClaimBoostOnlyModule: opt_user: OptionalValue, ) -> EsdtTokenPayment { let user = match opt_user { - OptionalValue::Some(user) => { - require!( - self.get_allow_external_claim_boosted_rewards(&user), - "Cannot claim rewards for this address" - ); - user - } + OptionalValue::Some(user) => user, OptionalValue::None => self.blockchain().get_caller(), }; + let user_total_farm_position_struct = self.get_user_total_farm_position_struct(&user); + require!( + user_total_farm_position_struct.allow_external_claim_boosted_rewards, + "Cannot claim rewards for this address" + ); let reward_token_id = self.reward_token_id().get(); - - let user_total_farm_position = self.get_user_total_farm_position(&user); + let user_total_farm_position = user_total_farm_position_struct.total_farm_position; if user_total_farm_position == BigUint::zero() { return EsdtTokenPayment::new(reward_token_id, 0, BigUint::zero()); } diff --git a/farm-staking/farm-staking/src/base_impl_wrapper.rs b/farm-staking/farm-staking/src/base_impl_wrapper.rs index 51575b19a..abe646541 100644 --- a/farm-staking/farm-staking/src/base_impl_wrapper.rs +++ b/farm-staking/farm-staking/src/base_impl_wrapper.rs @@ -52,7 +52,8 @@ where if &token_attributes.original_owner != caller { sc.update_energy_and_progress(caller); } - let user_total_farm_position = sc.get_user_total_farm_position(caller); + let user_total_farm_position_struct = sc.get_user_total_farm_position_struct(caller); + let user_total_farm_position = user_total_farm_position_struct.total_farm_position; if user_total_farm_position == BigUint::zero() { return BigUint::zero(); } @@ -206,8 +207,8 @@ where farm_position_increase += &farm_position.amount; } } - let user_total_farm_position = sc.get_user_total_farm_position(user); - if user_total_farm_position == BigUint::zero() { + let user_total_farm_position_struct = sc.get_user_total_farm_position_struct(user); + if user_total_farm_position_struct.total_farm_position == BigUint::zero() { Self::increase_user_farm_position(sc, user, &total_farm_position); } else if farm_position_increase > 0 { Self::increase_user_farm_position(sc, user, &farm_position_increase); diff --git a/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs b/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs index a9b7605ee..9b91f526b 100644 --- a/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs +++ b/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs @@ -28,18 +28,17 @@ pub trait ClaimOnlyBoostedStakingRewardsModule: #[endpoint(claimBoostedRewards)] fn claim_boosted_rewards(&self, opt_user: OptionalValue) -> EsdtTokenPayment { let user = match opt_user { - OptionalValue::Some(user) => { - require!( - self.get_allow_external_claim_boosted_rewards(&user), - "Cannot claim rewards for this address" - ); - user - } + OptionalValue::Some(user) => user, OptionalValue::None => self.blockchain().get_caller(), }; + let user_total_farm_position_struct = self.get_user_total_farm_position_struct(&user); + require!( + user_total_farm_position_struct.allow_external_claim_boosted_rewards, + "Cannot claim rewards for this address" + ); let reward_token_id = self.reward_token_id().get(); - let user_total_farm_position = self.get_user_total_farm_position(&user); + let user_total_farm_position = user_total_farm_position_struct.total_farm_position; if user_total_farm_position == BigUint::zero() { return EsdtTokenPayment::new(reward_token_id, 0, BigUint::zero()); } From 07f41a3af8b6935de7ad6ace340acace06b03d08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Thu, 31 Aug 2023 09:33:59 +0300 Subject: [PATCH 048/213] Fix minor issue --- dex/farm/src/claim_boost_only.rs | 13 ++++++++----- .../src/claim_only_boosted_staking_rewards.rs | 14 ++++++++------ 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/dex/farm/src/claim_boost_only.rs b/dex/farm/src/claim_boost_only.rs index 1851bfd0c..c917983a0 100644 --- a/dex/farm/src/claim_boost_only.rs +++ b/dex/farm/src/claim_boost_only.rs @@ -37,15 +37,18 @@ pub trait ClaimBoostOnlyModule: &self, opt_user: OptionalValue, ) -> EsdtTokenPayment { + let caller = self.blockchain().get_caller(); let user = match opt_user { OptionalValue::Some(user) => user, - OptionalValue::None => self.blockchain().get_caller(), + OptionalValue::None => caller.clone(), }; let user_total_farm_position_struct = self.get_user_total_farm_position_struct(&user); - require!( - user_total_farm_position_struct.allow_external_claim_boosted_rewards, - "Cannot claim rewards for this address" - ); + if user != caller { + require!( + user_total_farm_position_struct.allow_external_claim_boosted_rewards, + "Cannot claim rewards for this address" + ); + } let reward_token_id = self.reward_token_id().get(); let user_total_farm_position = user_total_farm_position_struct.total_farm_position; diff --git a/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs b/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs index 9b91f526b..ce3c5ef2f 100644 --- a/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs +++ b/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs @@ -27,16 +27,18 @@ pub trait ClaimOnlyBoostedStakingRewardsModule: #[payable("*")] #[endpoint(claimBoostedRewards)] fn claim_boosted_rewards(&self, opt_user: OptionalValue) -> EsdtTokenPayment { + let caller = self.blockchain().get_caller(); let user = match opt_user { OptionalValue::Some(user) => user, - OptionalValue::None => self.blockchain().get_caller(), + OptionalValue::None => caller.clone(), }; let user_total_farm_position_struct = self.get_user_total_farm_position_struct(&user); - require!( - user_total_farm_position_struct.allow_external_claim_boosted_rewards, - "Cannot claim rewards for this address" - ); - + if user != caller { + require!( + user_total_farm_position_struct.allow_external_claim_boosted_rewards, + "Cannot claim rewards for this address" + ); + } let reward_token_id = self.reward_token_id().get(); let user_total_farm_position = user_total_farm_position_struct.total_farm_position; if user_total_farm_position == BigUint::zero() { From 14baa0a42064756a750e3ddad049bc2c4052811f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Thu, 31 Aug 2023 09:34:09 +0300 Subject: [PATCH 049/213] fees-collector:Add test for "claim for other user" --- .../tests/fees_collector_rust_test.rs | 132 ++++++++++++++++++ .../tests/fees_collector_test_setup/mod.rs | 14 ++ 2 files changed, 146 insertions(+) diff --git a/energy-integration/fees-collector/tests/fees_collector_rust_test.rs b/energy-integration/fees-collector/tests/fees_collector_rust_test.rs index c840080e5..db4c3aace 100644 --- a/energy-integration/fees-collector/tests/fees_collector_rust_test.rs +++ b/energy-integration/fees-collector/tests/fees_collector_rust_test.rs @@ -463,6 +463,138 @@ fn claim_second_week_test() { ); } +#[test] +fn claim_for_other_user_test() { + let rust_zero = rust_biguint!(0); + let mut fc_setup = + FeesCollectorSetup::new(fees_collector::contract_obj, energy_factory::contract_obj); + + let first_user = fc_setup.b_mock.create_user_account(&rust_zero); + let second_user = fc_setup.b_mock.create_user_account(&rust_zero); + + fc_setup.set_energy(&first_user, 500, 1_000); + fc_setup.set_energy(&second_user, 500, 9_000); + + fc_setup.deposit(FIRST_TOKEN_ID, USER_BALANCE).assert_ok(); + fc_setup + .deposit(SECOND_TOKEN_ID, USER_BALANCE / 2) + .assert_ok(); + + // user claim first week - user only get registered for week 2, without receiving rewards + fc_setup.claim(&first_user).assert_ok(); + fc_setup.claim(&second_user).assert_ok(); + + // advance week + fc_setup.advance_week(); + + // increase first user's energy + fc_setup.set_energy(&first_user, 1000, 2_000); + + // claim week 2 - receives rewards accumulated in week 1, and gets new energy saved + fc_setup + .claim_for_user(&first_user, &second_user) + .assert_user_error("Cannot claim rewards for this address"); + + fc_setup.allow_external_claim_rewards(&first_user).assert_ok(); + // claim week 2 - receives rewards accumulated in week 1, and gets new energy saved + + fc_setup + .claim_for_user(&first_user, &second_user) + .assert_ok(); + + fc_setup + .b_mock + .execute_query(&fc_setup.fc_wrapper, |sc| { + let mut expected_total_rewards = ManagedVec::new(); + expected_total_rewards.push(EsdtTokenPayment::new( + managed_token_id!(FIRST_TOKEN_ID), + 0, + managed_biguint!(USER_BALANCE), + )); + expected_total_rewards.push(EsdtTokenPayment::new( + managed_token_id!(SECOND_TOKEN_ID), + 0, + managed_biguint!(USER_BALANCE / 2), + )); + assert_eq!(expected_total_rewards, sc.total_rewards_for_week(1).get()); + }) + .assert_ok(); + + let first_user_expected_first_token_amt = rust_biguint!(USER_BALANCE) * 1_000u32 / 10_000u32; + let first_user_expected_second_token_amt = + rust_biguint!(USER_BALANCE / 2) * 1_000u32 / 10_000u32; + + fc_setup.b_mock.check_esdt_balance( + &first_user, + FIRST_TOKEN_ID, + &first_user_expected_first_token_amt, + ); + fc_setup.b_mock.check_esdt_balance( + &first_user, + SECOND_TOKEN_ID, + &first_user_expected_second_token_amt, + ); + + let current_epoch = fc_setup.current_epoch; + fc_setup + .b_mock + .execute_query(&fc_setup.fc_wrapper, |sc| { + // fees were cleared and accumulated in the total_rewards mapper + assert_eq!( + sc.accumulated_fees(1, &managed_token_id!(FIRST_TOKEN_ID)) + .get(), + managed_biguint!(0) + ); + assert_eq!( + sc.accumulated_fees(1, &managed_token_id!(SECOND_TOKEN_ID)) + .get(), + managed_biguint!(0) + ); + + let mut expected_total_rewards = ManagedVec::new(); + expected_total_rewards.push(EsdtTokenPayment::new( + managed_token_id!(FIRST_TOKEN_ID), + 0, + managed_biguint!(USER_BALANCE), + )); + expected_total_rewards.push(EsdtTokenPayment::new( + managed_token_id!(SECOND_TOKEN_ID), + 0, + managed_biguint!(USER_BALANCE / 2), + )); + assert_eq!(sc.total_rewards_for_week(1).get(), expected_total_rewards); + + // first user's new energy is added to week 2 + let first_user_energy = Energy::new( + BigInt::from(managed_biguint!(2_000)), + current_epoch, + managed_biguint!(1_000), + ); + + // 10_000 total prev week + // first user's tokens get removed, as they expired + // so we only decrease by second user's 500 tokens worth of energy + // + // - 7 * 500 global decrease (-3_500) + // - 1_000 (first user's surplus energy) + // + 2_000 (first user's new energy) + // = 7_500 + assert_eq!(sc.total_energy_for_week(2).get(), 7_500); + assert_eq!(sc.total_locked_tokens_for_week(2).get(), 1_500); + assert_eq!(sc.last_global_update_week().get(), 2); + + assert_eq!( + sc.current_claim_progress(&managed_address!(&first_user)) + .get(), + ClaimProgress { + energy: first_user_energy, + week: 2 + } + ); + }) + .assert_ok(); +} + #[test] fn claim_inactive_week_test() { let rust_zero = rust_biguint!(0); diff --git a/energy-integration/fees-collector/tests/fees_collector_test_setup/mod.rs b/energy-integration/fees-collector/tests/fees_collector_test_setup/mod.rs index e3524ce65..399fc574e 100644 --- a/energy-integration/fees-collector/tests/fees_collector_test_setup/mod.rs +++ b/energy-integration/fees-collector/tests/fees_collector_test_setup/mod.rs @@ -227,6 +227,20 @@ where }) } + pub fn claim_for_user(&mut self, owner: &Address, broker: &Address) -> TxResult { + self.b_mock + .execute_tx(broker, &self.fc_wrapper, &rust_biguint!(0), |sc| { + let _ = sc.claim_rewards(OptionalValue::Some(managed_address!(owner))); + }) + } + + pub fn allow_external_claim_rewards(&mut self, user: &Address) -> TxResult { + self.b_mock + .execute_tx(user, &self.fc_wrapper, &rust_biguint!(0), |sc| { + let _ = sc.allow_external_claim_rewards(&managed_address!(user)).set(true); + }) + } + pub fn set_energy(&mut self, user: &Address, total_locked_tokens: u64, energy_amount: u64) { let current_epoch = self.current_epoch; self.b_mock From 63de49e99efbe6fe4aa2726320709f257c755a4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Thu, 31 Aug 2023 13:23:14 +0300 Subject: [PATCH 050/213] Clippy fixes --- dex/farm/src/claim_boost_only.rs | 1 + .../farm-staking/src/claim_only_boosted_staking_rewards.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/dex/farm/src/claim_boost_only.rs b/dex/farm/src/claim_boost_only.rs index c917983a0..55d7504ba 100644 --- a/dex/farm/src/claim_boost_only.rs +++ b/dex/farm/src/claim_boost_only.rs @@ -40,6 +40,7 @@ pub trait ClaimBoostOnlyModule: let caller = self.blockchain().get_caller(); let user = match opt_user { OptionalValue::Some(user) => user, + #[allow(clippy::redundant_clone)] OptionalValue::None => caller.clone(), }; let user_total_farm_position_struct = self.get_user_total_farm_position_struct(&user); diff --git a/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs b/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs index ce3c5ef2f..f34fefb94 100644 --- a/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs +++ b/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs @@ -30,6 +30,7 @@ pub trait ClaimOnlyBoostedStakingRewardsModule: let caller = self.blockchain().get_caller(); let user = match opt_user { OptionalValue::Some(user) => user, + #[allow(clippy::redundant_clone)] OptionalValue::None => caller.clone(), }; let user_total_farm_position_struct = self.get_user_total_farm_position_struct(&user); From 0e7141ce91b53b79439b6422679b42371c936cc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Thu, 31 Aug 2023 13:23:59 +0300 Subject: [PATCH 051/213] farm: Add claim boosted for other user test --- dex/farm/tests/farm_multi_user_test.rs | 96 +++++++++++++++++++ .../tests/farm_setup/multi_user_farm_setup.rs | 34 +++++++ .../tests/fees_collector_rust_test.rs | 4 +- .../tests/fees_collector_test_setup/mod.rs | 4 +- 4 files changed, 136 insertions(+), 2 deletions(-) diff --git a/dex/farm/tests/farm_multi_user_test.rs b/dex/farm/tests/farm_multi_user_test.rs index 45b388ba0..8f9bfda0d 100644 --- a/dex/farm/tests/farm_multi_user_test.rs +++ b/dex/farm/tests/farm_multi_user_test.rs @@ -219,6 +219,102 @@ fn farm_with_boosted_yields_test() { ); } +#[test] +fn farm_claim_boosted_yields_for_other_user_test() { + let _ = DebugApi::dummy(); + let mut farm_setup = MultiUserFarmSetup::new( + farm::contract_obj, + energy_factory_mock::contract_obj, + energy_update::contract_obj, + ); + + farm_setup.set_boosted_yields_rewards_percentage(BOOSTED_YIELDS_PERCENTAGE); + farm_setup.set_boosted_yields_factors(); + farm_setup.b_mock.set_block_epoch(2); + + // first user enter farm + let first_farm_token_amount = 100_000_000; + let first_user = farm_setup.first_user.clone(); + let third_user = farm_setup.third_user.clone(); + + farm_setup.set_user_energy(&first_user, 1_000, 2, 1); + farm_setup.enter_farm(&first_user, first_farm_token_amount); + + // second user enter farm + let second_farm_token_amount = 50_000_000; + let second_user = farm_setup.second_user.clone(); + farm_setup.set_user_energy(&second_user, 4_000, 2, 1); + farm_setup.enter_farm(&second_user, second_farm_token_amount); + + // users claim rewards to get their energy registered + let _ = farm_setup.claim_rewards(&first_user, 1, first_farm_token_amount); + let _ = farm_setup.claim_rewards(&second_user, 2, second_farm_token_amount); + + // advance blocks - 10 blocks - 10 * 1_000 = 10_000 total rewards + // 7_500 base farm, 2_500 boosted yields + farm_setup.b_mock.set_block_nonce(10); + + // random tx on end of week 1, to cummulate rewards + farm_setup.b_mock.set_block_epoch(6); + farm_setup.set_user_energy(&first_user, 1_000, 6, 1); + farm_setup.set_user_energy(&second_user, 4_000, 6, 1); + farm_setup.set_user_energy(&third_user, 1, 6, 1); + farm_setup.enter_farm(&third_user, 1); + farm_setup.exit_farm(&third_user, 5, 1, 1); + + // advance 1 week + farm_setup.b_mock.set_block_epoch(10); + farm_setup.set_user_energy(&first_user, 1_000, 10, 1); + farm_setup.set_user_energy(&second_user, 4_000, 10, 1); + + // Second user claims for himself + let total_farm_tokens = first_farm_token_amount + second_farm_token_amount; + let second_base_farm_amt = second_farm_token_amount * 7_500 / total_farm_tokens; + let second_boosted_amt = 1533; // 4000 energy & 50_000_000 farm tokens + let second_total = second_base_farm_amt + second_boosted_amt; + + let second_receveived_reward_amt = + farm_setup.claim_rewards(&second_user, 4, second_farm_token_amount); + assert_eq!(second_receveived_reward_amt, second_total); + + farm_setup + .b_mock + .check_nft_balance::>( + &second_user, + FARM_TOKEN_ID, + 6, + &rust_biguint!(second_farm_token_amount), + None, + ); + + farm_setup.b_mock.check_esdt_balance( + &second_user, + REWARD_TOKEN_ID, + &rust_biguint!(second_receveived_reward_amt), + ); + + // Boosted yields rewards formula + // total_boosted_rewards * (energy_const * user_energy / total_energy + farm_const * user_farm / total_farm) / (energy_const + farm_const) + // (total_boosted_rewards * energy_const * user_energy / total_energy + total_boosted_rewards * farm_const * user_farm / total_farm) / (energy_const + farm_const) + // (2500 * 3 * 1_000 / 5_000 + 2500 * 2 * 100_000_000 / 150_000_000) / (3 + 2) + // (1500 + 3333) / (5) = 966 + let first_boosted_amt = 966; // 1000 energy & 100_000_000 farm tokens + + // Second user claim boosted rewards for first user + farm_setup.allow_external_claim_rewards(&first_user); + + let first_receveived_boosted_amt = + farm_setup.claim_boosted_rewards_for_user(&first_user, &second_user); + assert_eq!(first_receveived_boosted_amt, first_boosted_amt); + + // First user should receive the boosted rewards + farm_setup.b_mock.check_esdt_balance( + &first_user, + REWARD_TOKEN_ID, + &rust_biguint!(first_receveived_boosted_amt), + ); +} + #[test] fn farm_change_boosted_yields_factors_test() { let _ = DebugApi::dummy(); diff --git a/dex/farm/tests/farm_setup/multi_user_farm_setup.rs b/dex/farm/tests/farm_setup/multi_user_farm_setup.rs index aa669401e..83e300386 100644 --- a/dex/farm/tests/farm_setup/multi_user_farm_setup.rs +++ b/dex/farm/tests/farm_setup/multi_user_farm_setup.rs @@ -2,6 +2,7 @@ use common_structs::FarmTokenAttributes; use config::ConfigModule; +use farm::claim_boost_only::ClaimBoostOnlyModule; use multiversx_sc::codec::multi_types::OptionalValue; use multiversx_sc::{ storage::mappers::StorageTokenWrapper, @@ -401,6 +402,27 @@ where result } + pub fn claim_boosted_rewards_for_user(&mut self, owner: &Address, broker: &Address) -> u64 { + self.last_farm_token_nonce += 1; + + let mut result = 0; + self.b_mock + .execute_tx(broker, &self.farm_wrapper, &rust_biguint!(0), |sc| { + let reward_payment = + sc.claim_boosted_rewards(OptionalValue::Some(managed_address!(owner))); + assert_eq!( + reward_payment.token_identifier, + managed_token_id!(REWARD_TOKEN_ID) + ); + assert_eq!(reward_payment.token_nonce, 0); + + result = reward_payment.amount.to_u64().unwrap(); + }) + .assert_ok(); + + result + } + pub fn claim_rewards_known_proxy( &mut self, user: &Address, @@ -493,6 +515,18 @@ where .assert_ok(); } + pub fn allow_external_claim_rewards(&mut self, user: &Address) { + self.b_mock + .execute_tx(user, &self.farm_wrapper, &rust_biguint!(0), |sc| { + let _ = sc.user_total_farm_position(&managed_address!(user)).update( + |user_total_farm_position_struct| { + user_total_farm_position_struct.allow_external_claim_boosted_rewards = true; + }, + ); + }) + .assert_ok(); + } + pub fn update_energy_for_user(&mut self) { let b_mock = &mut self.b_mock; let user_addr = &self.first_user; diff --git a/energy-integration/fees-collector/tests/fees_collector_rust_test.rs b/energy-integration/fees-collector/tests/fees_collector_rust_test.rs index db4c3aace..9ca1441ad 100644 --- a/energy-integration/fees-collector/tests/fees_collector_rust_test.rs +++ b/energy-integration/fees-collector/tests/fees_collector_rust_test.rs @@ -495,7 +495,9 @@ fn claim_for_other_user_test() { .claim_for_user(&first_user, &second_user) .assert_user_error("Cannot claim rewards for this address"); - fc_setup.allow_external_claim_rewards(&first_user).assert_ok(); + fc_setup + .allow_external_claim_rewards(&first_user) + .assert_ok(); // claim week 2 - receives rewards accumulated in week 1, and gets new energy saved fc_setup diff --git a/energy-integration/fees-collector/tests/fees_collector_test_setup/mod.rs b/energy-integration/fees-collector/tests/fees_collector_test_setup/mod.rs index 399fc574e..e1d6b37e5 100644 --- a/energy-integration/fees-collector/tests/fees_collector_test_setup/mod.rs +++ b/energy-integration/fees-collector/tests/fees_collector_test_setup/mod.rs @@ -237,7 +237,9 @@ where pub fn allow_external_claim_rewards(&mut self, user: &Address) -> TxResult { self.b_mock .execute_tx(user, &self.fc_wrapper, &rust_biguint!(0), |sc| { - let _ = sc.allow_external_claim_rewards(&managed_address!(user)).set(true); + let _ = sc + .allow_external_claim_rewards(&managed_address!(user)) + .set(true); }) } From f40d64ab22359dfc2ae5f14c3eb56d66765fa6e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Thu, 31 Aug 2023 13:24:16 +0300 Subject: [PATCH 052/213] farm-staking:Add test claim for other user --- .../tests/farm_staking_energy_test.rs | 95 +++++++++++++++++++ .../tests/farm_staking_setup/mod.rs | 44 +++++++++ 2 files changed, 139 insertions(+) diff --git a/farm-staking/farm-staking/tests/farm_staking_energy_test.rs b/farm-staking/farm-staking/tests/farm_staking_energy_test.rs index d7afaf744..551ae1e6b 100644 --- a/farm-staking/farm-staking/tests/farm_staking_energy_test.rs +++ b/farm-staking/farm-staking/tests/farm_staking_energy_test.rs @@ -148,3 +148,98 @@ fn farm_staking_boosted_rewards_with_energy_test() { ); fs_setup.check_farm_token_supply(farm_in_amount); } + +#[test] +fn farm_staking_claim_boosted_rewards_for_user_test() { + let _ = DebugApi::dummy(); + let mut fs_setup = + FarmStakingSetup::new(farm_staking::contract_obj, energy_factory::contract_obj); + + fs_setup.set_boosted_yields_factors(); + fs_setup.set_boosted_yields_rewards_percentage(BOOSTED_YIELDS_PERCENTAGE); + + fs_setup.set_user_energy(&fs_setup.user_address.clone(), 10_000, 0, 10); + + let farm_in_amount = 100_000_000; + fs_setup.stake_farm(farm_in_amount, &[], 1, 0, 0); + fs_setup.check_farm_token_supply(farm_in_amount); + + // claim to get energy registered + fs_setup + .b_mock + .execute_esdt_transfer( + &fs_setup.user_address, + &fs_setup.farm_wrapper, + FARM_TOKEN_ID, + 1, + &rust_biguint!(farm_in_amount), + |sc| { + let _ = sc.claim_rewards(OptionalValue::None); + }, + ) + .assert_ok(); + + fs_setup.set_block_nonce(10); + + // random user tx to collect rewards + let rand_user = fs_setup.b_mock.create_user_account(&rust_biguint!(0)); + fs_setup.b_mock.set_esdt_balance( + &rand_user, + FARMING_TOKEN_ID, + &rust_biguint!(USER_TOTAL_RIDE_TOKENS), + ); + + fs_setup.set_user_energy(&rand_user, 1, 5, 1); + fs_setup.set_block_epoch(5); + + fs_setup + .b_mock + .execute_esdt_transfer( + &rand_user, + &fs_setup.farm_wrapper, + FARMING_TOKEN_ID, + 0, + &rust_biguint!(10), + |sc| { + let _ = sc.stake_farm_endpoint(OptionalValue::None); + }, + ) + .assert_ok(); + + fs_setup + .b_mock + .execute_esdt_transfer( + &rand_user, + &fs_setup.farm_wrapper, + FARM_TOKEN_ID, + 3, + &rust_biguint!(10), + |sc| { + let _ = sc.unstake_farm(managed_biguint!(10), OptionalValue::None); + }, + ) + .assert_ok(); + + fs_setup.set_block_epoch(8); + + fs_setup.set_user_energy(&fs_setup.user_address.clone(), 10_000, 8, 10); + + // value taken from the "test_unstake_farm" test + // originally, it was 40, but since 25% of the rewards go to boosted yields + // rewards are now only 3/4 * 40 = 30 + // + // 10 reserved for boosted yields -> 30 + 10 + let expected_boosted_reward_token_out = 10; + let expected_farming_token_balance = + rust_biguint!(USER_TOTAL_RIDE_TOKENS - farm_in_amount + expected_boosted_reward_token_out); + + // Random_user claim boosted rewards for user + fs_setup.allow_external_claim_rewards(&fs_setup.user_address.clone()); + fs_setup.claim_boosted_rewards_for_user( + &fs_setup.user_address.clone(), + &rand_user, + expected_boosted_reward_token_out, + &expected_farming_token_balance, + ); + fs_setup.check_farm_token_supply(farm_in_amount); +} diff --git a/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs b/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs index 0ad97a738..d1128ea84 100644 --- a/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs +++ b/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs @@ -1,3 +1,4 @@ +use farm_staking::claim_only_boosted_staking_rewards::ClaimOnlyBoostedStakingRewardsModule; use multiversx_sc::codec::multi_types::OptionalValue; use multiversx_sc::storage::mappers::StorageTokenWrapper; use multiversx_sc::types::{Address, BigInt, EsdtLocalRole, ManagedAddress, MultiValueEncoded}; @@ -274,6 +275,37 @@ where ); } + pub fn claim_boosted_rewards_for_user( + &mut self, + owner: &Address, + broker: &Address, + expected_reward_token_out: u64, + expected_user_reward_token_balance: &RustBigUint, + ) { + self.b_mock + .execute_tx(&broker, &self.farm_wrapper, &rust_biguint!(0u64), |sc| { + let payment_result = + sc.claim_boosted_rewards(OptionalValue::Some(managed_address!(owner))); + + assert_eq!( + payment_result.token_identifier, + managed_token_id!(REWARD_TOKEN_ID) + ); + assert_eq!(payment_result.token_nonce, 0); + assert_eq!( + payment_result.amount, + managed_biguint!(expected_reward_token_out) + ); + }) + .assert_ok(); + + self.b_mock.check_esdt_balance( + &self.user_address, + REWARD_TOKEN_ID, + expected_user_reward_token_balance, + ); + } + #[allow(clippy::too_many_arguments)] pub fn unstake_farm( &mut self, @@ -383,6 +415,18 @@ where .assert_ok(); } + pub fn allow_external_claim_rewards(&mut self, user: &Address) { + self.b_mock + .execute_tx(user, &self.farm_wrapper, &rust_biguint!(0), |sc| { + let _ = sc.user_total_farm_position(&managed_address!(user)).update( + |user_total_farm_position_struct| { + user_total_farm_position_struct.allow_external_claim_boosted_rewards = true; + }, + ); + }) + .assert_ok(); + } + pub fn set_block_nonce(&mut self, block_nonce: u64) { self.b_mock.set_block_nonce(block_nonce); } From ff3f040840a54be146aae778b32e1232957c59e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Thu, 31 Aug 2023 13:32:27 +0300 Subject: [PATCH 053/213] Fixes after review --- farm-staking/farm-staking/src/base_impl_wrapper.rs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/farm-staking/farm-staking/src/base_impl_wrapper.rs b/farm-staking/farm-staking/src/base_impl_wrapper.rs index abe646541..adf6136a5 100644 --- a/farm-staking/farm-staking/src/base_impl_wrapper.rs +++ b/farm-staking/farm-staking/src/base_impl_wrapper.rs @@ -236,14 +236,7 @@ where sc.user_total_farm_position(&token_attributes.original_owner) .update(|user_farm_position_struct| { - let mut user_total_farm_position = - user_farm_position_struct.total_farm_position.clone(); - if user_total_farm_position > farm_position.amount { - user_total_farm_position -= &farm_position.amount; - } else { - user_total_farm_position = BigUint::zero(); - } - user_farm_position_struct.total_farm_position = user_total_farm_position; + user_farm_position_struct.total_farm_position -= farm_position.amount.clone() }); } } From f1496d5f8d53b88c6f41354f531a13149a66b70a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Thu, 31 Aug 2023 14:43:21 +0300 Subject: [PATCH 054/213] farm: compound_rewards_base bug fix Correctly update total farm position --- common/modules/farm/farm_base_impl/src/base_traits_impl.rs | 4 ++-- common/modules/farm/farm_base_impl/src/compound_rewards.rs | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/common/modules/farm/farm_base_impl/src/base_traits_impl.rs b/common/modules/farm/farm_base_impl/src/base_traits_impl.rs index 81aa35955..d3260a170 100644 --- a/common/modules/farm/farm_base_impl/src/base_traits_impl.rs +++ b/common/modules/farm/farm_base_impl/src/base_traits_impl.rs @@ -221,11 +221,11 @@ pub trait FarmContract { fn increase_user_farm_position( sc: &Self::FarmSc, user: &ManagedAddress<::Api>, - new_farm_position_amount: &BigUint<::Api>, + increase_farm_position_amount: &BigUint<::Api>, ) { sc.user_total_farm_position(user) .update(|user_farm_position_struct| { - user_farm_position_struct.total_farm_position += new_farm_position_amount + user_farm_position_struct.total_farm_position += increase_farm_position_amount }); } diff --git a/common/modules/farm/farm_base_impl/src/compound_rewards.rs b/common/modules/farm/farm_base_impl/src/compound_rewards.rs index 6a00848a4..74a5f74d6 100644 --- a/common/modules/farm/farm_base_impl/src/compound_rewards.rs +++ b/common/modules/farm/farm_base_impl/src/compound_rewards.rs @@ -52,7 +52,6 @@ pub trait BaseCompoundRewardsModule: ); FC::check_and_update_user_farm_position(self, &caller, &payments); - FC::generate_aggregated_rewards(self, &mut storage_cache); let farm_token_amount = &compound_rewards_context.first_farm_token.payment.amount; @@ -75,7 +74,7 @@ pub trait BaseCompoundRewardsModule: let farm_token_mapper = self.farm_token(); let base_attributes = FC::create_compound_rewards_initial_attributes( self, - caller, + caller.clone(), token_attributes, storage_cache.reward_per_share.clone(), &reward, @@ -86,6 +85,8 @@ pub trait BaseCompoundRewardsModule: &farm_token_mapper, ); + FC::increase_user_farm_position(self, &caller, &reward); + let first_farm_token = &compound_rewards_context.first_farm_token.payment; farm_token_mapper.nft_burn(first_farm_token.token_nonce, &first_farm_token.amount); self.send() From 98aa8365a6c29ff5ff7f80b54973270108ca7867 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Thu, 31 Aug 2023 14:53:09 +0300 Subject: [PATCH 055/213] Refactor clippy fix --- dex/farm/src/claim_boost_only.rs | 15 +++++++-------- .../src/claim_only_boosted_staking_rewards.rs | 14 +++++++------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/dex/farm/src/claim_boost_only.rs b/dex/farm/src/claim_boost_only.rs index 55d7504ba..82a2d4ffc 100644 --- a/dex/farm/src/claim_boost_only.rs +++ b/dex/farm/src/claim_boost_only.rs @@ -38,13 +38,12 @@ pub trait ClaimBoostOnlyModule: opt_user: OptionalValue, ) -> EsdtTokenPayment { let caller = self.blockchain().get_caller(); - let user = match opt_user { + let user = match &opt_user { OptionalValue::Some(user) => user, - #[allow(clippy::redundant_clone)] - OptionalValue::None => caller.clone(), + OptionalValue::None => &caller, }; - let user_total_farm_position_struct = self.get_user_total_farm_position_struct(&user); - if user != caller { + let user_total_farm_position_struct = self.get_user_total_farm_position_struct(user); + if user != &caller { require!( user_total_farm_position_struct.allow_external_claim_boosted_rewards, "Cannot claim rewards for this address" @@ -57,15 +56,15 @@ pub trait ClaimBoostOnlyModule: return EsdtTokenPayment::new(reward_token_id, 0, BigUint::zero()); } - let reward = self.claim_boosted_yields_rewards(&user, user_total_farm_position); + let reward = self.claim_boosted_yields_rewards(user, user_total_farm_position); if reward > 0 { self.reward_reserve().update(|reserve| *reserve -= &reward); } let boosted_rewards = EsdtTokenPayment::new(reward_token_id, 0, reward); - self.send_payment_non_zero(&user, &boosted_rewards); + self.send_payment_non_zero(user, &boosted_rewards); - self.update_energy_and_progress(&user); + self.update_energy_and_progress(user); boosted_rewards } diff --git a/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs b/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs index f34fefb94..03253057b 100644 --- a/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs +++ b/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs @@ -28,13 +28,13 @@ pub trait ClaimOnlyBoostedStakingRewardsModule: #[endpoint(claimBoostedRewards)] fn claim_boosted_rewards(&self, opt_user: OptionalValue) -> EsdtTokenPayment { let caller = self.blockchain().get_caller(); - let user = match opt_user { + let user = match &opt_user { OptionalValue::Some(user) => user, #[allow(clippy::redundant_clone)] - OptionalValue::None => caller.clone(), + OptionalValue::None => &caller, }; - let user_total_farm_position_struct = self.get_user_total_farm_position_struct(&user); - if user != caller { + let user_total_farm_position_struct = self.get_user_total_farm_position_struct(user); + if user != &caller { require!( user_total_farm_position_struct.allow_external_claim_boosted_rewards, "Cannot claim rewards for this address" @@ -46,15 +46,15 @@ pub trait ClaimOnlyBoostedStakingRewardsModule: return EsdtTokenPayment::new(reward_token_id, 0, BigUint::zero()); } - let reward = self.claim_boosted_yields_rewards(&user, user_total_farm_position); + let reward = self.claim_boosted_yields_rewards(user, user_total_farm_position); if reward > 0 { self.reward_reserve().update(|reserve| *reserve -= &reward); } let boosted_rewards = EsdtTokenPayment::new(reward_token_id, 0, reward); - self.send_payment_non_zero(&user, &boosted_rewards); + self.send_payment_non_zero(user, &boosted_rewards); - self.update_energy_and_progress(&user); + self.update_energy_and_progress(user); boosted_rewards } From f371569355d7ec77ab9a4d2934c57f756e0c7466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Thu, 31 Aug 2023 17:22:03 +0300 Subject: [PATCH 056/213] Clippy fix for test setup --- dex/farm/tests/farm_setup/multi_user_farm_setup.rs | 2 +- .../fees-collector/tests/fees_collector_test_setup/mod.rs | 3 +-- farm-staking/farm-staking/tests/farm_staking_setup/mod.rs | 4 ++-- .../tests/energy_factory_setup/unbond_sc_mock.rs | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/dex/farm/tests/farm_setup/multi_user_farm_setup.rs b/dex/farm/tests/farm_setup/multi_user_farm_setup.rs index 83e300386..c70d3a3ae 100644 --- a/dex/farm/tests/farm_setup/multi_user_farm_setup.rs +++ b/dex/farm/tests/farm_setup/multi_user_farm_setup.rs @@ -518,7 +518,7 @@ where pub fn allow_external_claim_rewards(&mut self, user: &Address) { self.b_mock .execute_tx(user, &self.farm_wrapper, &rust_biguint!(0), |sc| { - let _ = sc.user_total_farm_position(&managed_address!(user)).update( + sc.user_total_farm_position(&managed_address!(user)).update( |user_total_farm_position_struct| { user_total_farm_position_struct.allow_external_claim_boosted_rewards = true; }, diff --git a/energy-integration/fees-collector/tests/fees_collector_test_setup/mod.rs b/energy-integration/fees-collector/tests/fees_collector_test_setup/mod.rs index e1d6b37e5..1d6d73e5d 100644 --- a/energy-integration/fees-collector/tests/fees_collector_test_setup/mod.rs +++ b/energy-integration/fees-collector/tests/fees_collector_test_setup/mod.rs @@ -237,8 +237,7 @@ where pub fn allow_external_claim_rewards(&mut self, user: &Address) -> TxResult { self.b_mock .execute_tx(user, &self.fc_wrapper, &rust_biguint!(0), |sc| { - let _ = sc - .allow_external_claim_rewards(&managed_address!(user)) + sc.allow_external_claim_rewards(&managed_address!(user)) .set(true); }) } diff --git a/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs b/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs index d1128ea84..cbdb0ddd1 100644 --- a/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs +++ b/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs @@ -283,7 +283,7 @@ where expected_user_reward_token_balance: &RustBigUint, ) { self.b_mock - .execute_tx(&broker, &self.farm_wrapper, &rust_biguint!(0u64), |sc| { + .execute_tx(broker, &self.farm_wrapper, &rust_biguint!(0u64), |sc| { let payment_result = sc.claim_boosted_rewards(OptionalValue::Some(managed_address!(owner))); @@ -418,7 +418,7 @@ where pub fn allow_external_claim_rewards(&mut self, user: &Address) { self.b_mock .execute_tx(user, &self.farm_wrapper, &rust_biguint!(0), |sc| { - let _ = sc.user_total_farm_position(&managed_address!(user)).update( + sc.user_total_farm_position(&managed_address!(user)).update( |user_total_farm_position_struct| { user_total_farm_position_struct.allow_external_claim_boosted_rewards = true; }, diff --git a/locked-asset/energy-factory/tests/energy_factory_setup/unbond_sc_mock.rs b/locked-asset/energy-factory/tests/energy_factory_setup/unbond_sc_mock.rs index 1b472a676..c993b7e24 100644 --- a/locked-asset/energy-factory/tests/energy_factory_setup/unbond_sc_mock.rs +++ b/locked-asset/energy-factory/tests/energy_factory_setup/unbond_sc_mock.rs @@ -35,11 +35,11 @@ impl UnbondScMock { pub fn send_to_user(&self) { let [locked_tokens, unlocked_tokens] = self.call_value().multi_esdt(); - let locked_tokens_burn_amount = unlocked_tokens.amount.clone(); + let locked_tokens_burn_amount = &unlocked_tokens.amount; self.send().esdt_local_burn( &locked_tokens.token_identifier, locked_tokens.token_nonce, - &locked_tokens_burn_amount, + locked_tokens_burn_amount, ); let (dest_user, ()) = From c48b882db4e93198bb215da16ba5cc92b5b8b083 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrei=20B=C4=83ncioiu?= Date: Fri, 1 Sep 2023 11:10:47 +0300 Subject: [PATCH 057/213] Remove reference of older feature from Cargo.toml. --- farm-staking/farm-staking-proxy/wasm/Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/farm-staking/farm-staking-proxy/wasm/Cargo.toml b/farm-staking/farm-staking-proxy/wasm/Cargo.toml index fc415475e..5e6c97a92 100644 --- a/farm-staking/farm-staking-proxy/wasm/Cargo.toml +++ b/farm-staking/farm-staking-proxy/wasm/Cargo.toml @@ -23,4 +23,3 @@ path = ".." [dependencies.multiversx-sc-wasm-adapter] version = "=0.43.2" -features = ["vm-validate-token-identifier"] From 5b00a9c7f4b582572702513839ea6dc0cee0bf58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Mon, 4 Sep 2023 09:36:28 +0300 Subject: [PATCH 058/213] Give boosted energy even after unlock xMEX --- .../weekly-rewards-splitting/src/lib.rs | 28 +++----- .../tests/fees_collector_rust_test.rs | 65 ------------------- .../mod.rs | 2 +- 3 files changed, 11 insertions(+), 84 deletions(-) diff --git a/energy-integration/common-modules/weekly-rewards-splitting/src/lib.rs b/energy-integration/common-modules/weekly-rewards-splitting/src/lib.rs index 8120994a9..9268023bd 100644 --- a/energy-integration/common-modules/weekly-rewards-splitting/src/lib.rs +++ b/energy-integration/common-modules/weekly-rewards-splitting/src/lib.rs @@ -86,25 +86,17 @@ pub trait WeeklyRewardsSplittingModule: let mut all_rewards = ManagedVec::new(); - // for the case when a user locks, enters the weekly rewards, and then unlocks. - // Then, they wait for a long period, and start claiming, - // getting rewards they shouldn't have access to. - // In this case, they receive no rewards, and their progress is reset - if current_user_energy.get_energy_amount_raw() - >= calculated_energy_for_current_epoch.get_energy_amount_raw() - { - let total_weeks_to_claim = current_week - claim_progress.week; - if total_weeks_to_claim > USER_MAX_CLAIM_WEEKS { - let extra_weeks = total_weeks_to_claim - USER_MAX_CLAIM_WEEKS; - claim_progress.advance_multiple_weeks(extra_weeks); - } + let total_weeks_to_claim = current_week - claim_progress.week; + if total_weeks_to_claim > USER_MAX_CLAIM_WEEKS { + let extra_weeks = total_weeks_to_claim - USER_MAX_CLAIM_WEEKS; + claim_progress.advance_multiple_weeks(extra_weeks); + } - let weeks_to_claim = core::cmp::min(total_weeks_to_claim, USER_MAX_CLAIM_WEEKS); - for _ in 0..weeks_to_claim { - let rewards_for_week = self.claim_single(wrapper, &mut claim_progress); - if !rewards_for_week.is_empty() { - all_rewards.append_vec(rewards_for_week); - } + let weeks_to_claim = core::cmp::min(total_weeks_to_claim, USER_MAX_CLAIM_WEEKS); + for _ in 0..weeks_to_claim { + let rewards_for_week = self.claim_single(wrapper, &mut claim_progress); + if !rewards_for_week.is_empty() { + all_rewards.append_vec(rewards_for_week); } } diff --git a/energy-integration/fees-collector/tests/fees_collector_rust_test.rs b/energy-integration/fees-collector/tests/fees_collector_rust_test.rs index 9ca1441ad..2c22c309a 100644 --- a/energy-integration/fees-collector/tests/fees_collector_rust_test.rs +++ b/energy-integration/fees-collector/tests/fees_collector_rust_test.rs @@ -700,71 +700,6 @@ fn claim_inactive_week_test() { ); } -#[test] -fn try_claim_after_unlock() { - let rust_zero = rust_biguint!(0); - let mut fc_setup = - FeesCollectorSetup::new(fees_collector::contract_obj, energy_factory::contract_obj); - - let first_user = fc_setup.b_mock.create_user_account(&rust_zero); - let second_user = fc_setup.b_mock.create_user_account(&rust_zero); - - fc_setup.set_energy(&first_user, 50, 3_000); - fc_setup.set_energy(&second_user, 50, 9_000); - - fc_setup.deposit(FIRST_TOKEN_ID, USER_BALANCE).assert_ok(); - fc_setup - .deposit(SECOND_TOKEN_ID, USER_BALANCE / 2) - .assert_ok(); - - // user claim first week - users only get registered for week 2, without receiving rewards - fc_setup.claim(&first_user).assert_ok(); - fc_setup.claim(&second_user).assert_ok(); - - // advance week - fc_setup.advance_week(); - - // deposit rewards week 2 - fc_setup.deposit(FIRST_TOKEN_ID, USER_BALANCE).assert_ok(); - fc_setup - .deposit(SECOND_TOKEN_ID, USER_BALANCE / 2) - .assert_ok(); - - // decrease user energy - fc_setup.set_energy(&first_user, 50, 1_000); - - // only first user claims in second week - fc_setup.claim(&first_user).assert_ok(); - - // no rewards are received, as energy decreased from the calculated amount - fc_setup - .b_mock - .check_esdt_balance(&first_user, FIRST_TOKEN_ID, &rust_zero); - fc_setup - .b_mock - .check_esdt_balance(&first_user, SECOND_TOKEN_ID, &rust_zero); - - let current_epoch = fc_setup.current_epoch; - fc_setup - .b_mock - .execute_query(&fc_setup.fc_wrapper, |sc| { - let first_user_energy = Energy::new( - BigInt::from(managed_biguint!(1_000)), - current_epoch, - managed_biguint!(50), - ); - assert_eq!( - sc.current_claim_progress(&managed_address!(&first_user)) - .get(), - ClaimProgress { - energy: first_user_energy, - week: 2 - } - ); - }) - .assert_ok(); -} - #[test] fn locked_token_buckets_shifting_test() { let rust_zero = rust_biguint!(0); diff --git a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_external_contracts/mod.rs b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_external_contracts/mod.rs index 02729ff2d..3b18eed52 100644 --- a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_external_contracts/mod.rs +++ b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_external_contracts/mod.rs @@ -76,7 +76,7 @@ where &rust_biguint!(USER_TOTAL_RIDE_TOKENS), ); - let mut block_round = 1; + let mut block_round: u64 = 1; b_mock.set_block_round(block_round); b_mock.set_block_nonce(BLOCK_NONCE_FIRST_ADD_LIQ); From 453a28022c1e59c5e1ba887ba8e4b1e61f5efc25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Mon, 4 Sep 2023 16:04:25 +0300 Subject: [PATCH 059/213] Governance-v2: 2 fixes * Anyone can propose * Anyone can call withdraw after proposal was NoWithVetoed --- energy-integration/governance-v2/src/lib.rs | 3 --- energy-integration/governance-v2/tests/gov_rust_test.rs | 7 +------ 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/energy-integration/governance-v2/src/lib.rs b/energy-integration/governance-v2/src/lib.rs index 584d43008..9d8450017 100644 --- a/energy-integration/governance-v2/src/lib.rs +++ b/energy-integration/governance-v2/src/lib.rs @@ -71,7 +71,6 @@ pub trait GovernanceV2: /// The proposer's energy is NOT automatically used for voting. A separate vote is needed. /// /// Returns the ID of the newly created proposal. - #[only_owner] #[payable("*")] #[endpoint] fn propose( @@ -266,8 +265,6 @@ pub trait GovernanceV2: let refund_amount = refund_percentage * proposal.fee_payment.amount.clone() / FULL_PERCENTAGE; - require!(caller == proposal.proposer, ONLY_PROPOSER_WITHDRAW); - self.refund_proposal_fee(proposal_id, &refund_amount); let remaining_fee = proposal.fee_payment.amount - refund_amount; diff --git a/energy-integration/governance-v2/tests/gov_rust_test.rs b/energy-integration/governance-v2/tests/gov_rust_test.rs index 5c2329a3d..7fcbf61bd 100644 --- a/energy-integration/governance-v2/tests/gov_rust_test.rs +++ b/energy-integration/governance-v2/tests/gov_rust_test.rs @@ -503,14 +503,9 @@ fn gov_withdraw_no_with_veto_defeated_proposal_test() { }) .assert_ok(); - // Other user (not proposer) try to withdraw the fee -> Fail + // Other user (not proposer) withdraw the fee gov_setup .withdraw_after_defeated(&third_user_addr, proposal_id) - .assert_error(4, "Only original proposer may withdraw a pending proposal"); - - // Proposer withdraw - gov_setup - .withdraw_after_defeated(&first_user_addr, proposal_id) .assert_ok(); // Check proposer balance (fee) From 00dc45d05792db3ce6cdb22189f4b65c04bbfe38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Mon, 4 Sep 2023 17:04:56 +0300 Subject: [PATCH 060/213] Fixes after review --- common/modules/farm/farm_base_impl/src/base_traits_impl.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/common/modules/farm/farm_base_impl/src/base_traits_impl.rs b/common/modules/farm/farm_base_impl/src/base_traits_impl.rs index d3260a170..964c014fe 100644 --- a/common/modules/farm/farm_base_impl/src/base_traits_impl.rs +++ b/common/modules/farm/farm_base_impl/src/base_traits_impl.rs @@ -217,6 +217,7 @@ pub trait FarmContract { Self::increase_user_farm_position(sc, user, &farm_position_increase); } } + #[inline] fn increase_user_farm_position( sc: &Self::FarmSc, From 249c3eefa7d8ae8920d838c243036d2cf4cbe754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Thu, 7 Sep 2023 11:02:28 +0300 Subject: [PATCH 061/213] Fix clippy --- .../tests/farm_with_locked_rewards_test.rs | 4 +- dex/farm/tests/farm_multi_user_test.rs | 18 +-- .../farm_setup/single_user_farm_setup.rs | 4 +- dex/farm/tests/farm_single_user_test.rs | 2 +- dex/pair/tests/pair_rs_test.rs | 4 +- dex/price-discovery/tests/price_disc_tests.rs | 2 +- dex/router/tests/router_test.rs | 4 +- .../tests/fees_collector_test_setup/mod.rs | 2 +- .../src/proxy_actions/merge_pos.rs | 108 ++++++++++++++++++ .../tests/staking_farm_with_lp.rs | 2 +- .../tests/farm_staking_energy_test.rs | 6 +- .../farm-staking/tests/farm_staking_test.rs | 12 +- .../tests/metabonding_staking_setup/mod.rs | 2 +- .../tests/energy_factory_setup/mod.rs | 2 +- .../energy-factory/tests/old_tokens_test.rs | 8 +- .../tests/token_merging_test.rs | 10 +- .../factory/tests/factory_setup/mod.rs | 2 +- locked-asset/factory/tests/unlock_test.rs | 2 +- .../tests/locked_token_wrapping_test.rs | 4 +- .../tests/proxy_dex_test_setup/mod.rs | 2 +- .../tests/whitelist_test.rs | 2 +- locked-asset/simple-lock/tests/rust_test.rs | 2 +- .../tests/token_unstake_setup/mod.rs | 2 +- .../token-unstake/tests/unlock_early_test.rs | 2 +- 24 files changed, 158 insertions(+), 50 deletions(-) create mode 100644 farm-staking/farm-staking-proxy/src/proxy_actions/merge_pos.rs diff --git a/dex/farm-with-locked-rewards/tests/farm_with_locked_rewards_test.rs b/dex/farm-with-locked-rewards/tests/farm_with_locked_rewards_test.rs index 941c08f8e..db4f9e7bc 100644 --- a/dex/farm-with-locked-rewards/tests/farm_with_locked_rewards_test.rs +++ b/dex/farm-with-locked-rewards/tests/farm_with_locked_rewards_test.rs @@ -12,7 +12,7 @@ mod farm_with_locked_rewards_setup; #[test] fn farm_with_no_boost_no_proxy_test() { - let _ = DebugApi::dummy(); + DebugApi::dummy(); let mut farm_setup = FarmSetup::new( farm_with_locked_rewards::contract_obj, energy_factory::contract_obj, @@ -112,7 +112,7 @@ fn farm_with_no_boost_no_proxy_test() { #[test] fn farm_with_boosted_yields_no_proxy_test() { - let _ = DebugApi::dummy(); + DebugApi::dummy(); let mut farm_setup = FarmSetup::new( farm_with_locked_rewards::contract_obj, energy_factory::contract_obj, diff --git a/dex/farm/tests/farm_multi_user_test.rs b/dex/farm/tests/farm_multi_user_test.rs index 9135f8c24..182de5c8c 100644 --- a/dex/farm/tests/farm_multi_user_test.rs +++ b/dex/farm/tests/farm_multi_user_test.rs @@ -13,7 +13,7 @@ use weekly_rewards_splitting::global_info::WeeklyRewardsGlobalInfo; #[test] fn farm_with_no_boost_test() { - let _ = DebugApi::dummy(); + DebugApi::dummy(); let mut farm_setup = MultiUserFarmSetup::new( farm::contract_obj, energy_factory_mock::contract_obj, @@ -111,7 +111,7 @@ fn farm_with_no_boost_test() { #[test] fn farm_with_boosted_yields_test() { - let _ = DebugApi::dummy(); + DebugApi::dummy(); let mut farm_setup = MultiUserFarmSetup::new( farm::contract_obj, energy_factory_mock::contract_obj, @@ -223,7 +223,7 @@ fn farm_with_boosted_yields_test() { #[test] fn farm_claim_boosted_yields_for_other_user_test() { - let _ = DebugApi::dummy(); + DebugApi::dummy(); let mut farm_setup = MultiUserFarmSetup::new( farm::contract_obj, energy_factory_mock::contract_obj, @@ -319,7 +319,7 @@ fn farm_claim_boosted_yields_for_other_user_test() { #[test] fn farm_change_boosted_yields_factors_test() { - let _ = DebugApi::dummy(); + DebugApi::dummy(); let mut farm_setup = MultiUserFarmSetup::new( farm::contract_obj, energy_factory_mock::contract_obj, @@ -382,7 +382,7 @@ fn farm_change_boosted_yields_factors_test() { #[test] fn farm_boosted_yields_claim_with_different_user_pos_test() { - let _ = DebugApi::dummy(); + DebugApi::dummy(); let mut farm_setup = MultiUserFarmSetup::new( farm::contract_obj, energy_factory_mock::contract_obj, @@ -484,7 +484,7 @@ fn farm_boosted_yields_claim_with_different_user_pos_test() { #[test] fn farm_known_proxy_test() { - let _ = DebugApi::dummy(); + DebugApi::dummy(); let mut farm_setup = MultiUserFarmSetup::new( farm::contract_obj, energy_factory_mock::contract_obj, @@ -583,7 +583,7 @@ fn farm_known_proxy_test() { #[test] fn farm_multiple_claim_weeks_with_collect_undistributed_rewards_test() { - let _ = DebugApi::dummy(); + DebugApi::dummy(); let mut farm_setup = MultiUserFarmSetup::new( farm::contract_obj, energy_factory_mock::contract_obj, @@ -833,7 +833,7 @@ fn farm_multiple_claim_weeks_with_collect_undistributed_rewards_test() { #[test] fn farm_enter_with_multiple_farm_token() { - let _ = DebugApi::dummy(); + DebugApi::dummy(); let mut farm_setup = MultiUserFarmSetup::new( farm::contract_obj, energy_factory_mock::contract_obj, @@ -948,7 +948,7 @@ fn farm_enter_with_multiple_farm_token() { #[test] fn farm_claim_with_minimum_tokens() { - let _ = DebugApi::dummy(); + DebugApi::dummy(); let mut farm_setup = MultiUserFarmSetup::new( farm::contract_obj, energy_factory_mock::contract_obj, diff --git a/dex/farm/tests/farm_setup/single_user_farm_setup.rs b/dex/farm/tests/farm_setup/single_user_farm_setup.rs index 6dd2620e7..13644ee88 100644 --- a/dex/farm/tests/farm_setup/single_user_farm_setup.rs +++ b/dex/farm/tests/farm_setup/single_user_farm_setup.rs @@ -184,7 +184,7 @@ where }) .assert_ok(); - let _ = DebugApi::dummy(); + DebugApi::dummy(); let expected_attributes = FarmTokenAttributes:: { reward_per_share: managed_biguint!(expected_reward_per_share), @@ -300,7 +300,7 @@ where ) .assert_ok(); - let _ = DebugApi::dummy(); + DebugApi::dummy(); let expected_attributes = FarmTokenAttributes:: { reward_per_share: managed_biguint!(expected_reward_per_share), entering_epoch: 0, diff --git a/dex/farm/tests/farm_single_user_test.rs b/dex/farm/tests/farm_single_user_test.rs index eb5c9f61c..9adc893fa 100644 --- a/dex/farm/tests/farm_single_user_test.rs +++ b/dex/farm/tests/farm_single_user_test.rs @@ -209,7 +209,7 @@ fn test_farm_through_simple_lock() { const LOCKED_LP_TOKEN_ID: &[u8] = b"LKLP-123456"; const FARM_PROXY_TOKEN_ID: &[u8] = b"PROXY-123456"; - let _ = DebugApi::dummy(); + DebugApi::dummy(); let rust_zero = rust_biguint!(0); let mut farm_setup = SingleUserFarmSetup::new(farm::contract_obj); let b_mock = &mut farm_setup.blockchain_wrapper; diff --git a/dex/pair/tests/pair_rs_test.rs b/dex/pair/tests/pair_rs_test.rs index ea2a2cf52..eb90a88f6 100644 --- a/dex/pair/tests/pair_rs_test.rs +++ b/dex/pair/tests/pair_rs_test.rs @@ -956,7 +956,7 @@ fn test_locked_asset() { ) .assert_ok(); - let _ = DebugApi::dummy(); + DebugApi::dummy(); pair_setup.b_mock.check_nft_balance( &pair_setup.user_address, LOCKED_TOKEN_ID, @@ -1077,7 +1077,7 @@ fn add_liquidity_through_simple_lock_proxy() { ); pair_setup.b_mock.set_block_epoch(5); - let _ = DebugApi::dummy(); + DebugApi::dummy(); // lock some tokens first pair_setup diff --git a/dex/price-discovery/tests/price_disc_tests.rs b/dex/price-discovery/tests/price_disc_tests.rs index db0905cf8..a6cfbec43 100644 --- a/dex/price-discovery/tests/price_disc_tests.rs +++ b/dex/price-discovery/tests/price_disc_tests.rs @@ -367,7 +367,7 @@ fn redeem_ok() { ) .assert_ok(); - let _ = DebugApi::dummy(); + DebugApi::dummy(); let first_user_expected_launched_tokens_balance = rust_biguint!(5_000_000_000u64 * 600_000_000 / 1_100_000_000); pd_setup.blockchain_wrapper.check_nft_balance( diff --git a/dex/router/tests/router_test.rs b/dex/router/tests/router_test.rs index 17e74be21..b4b7ad010 100644 --- a/dex/router/tests/router_test.rs +++ b/dex/router/tests/router_test.rs @@ -347,7 +347,7 @@ fn user_enable_pair_swaps_through_router_test() { ) .assert_ok(); - let _ = DebugApi::dummy(); + DebugApi::dummy(); b_mock.check_nft_balance( &user, LOCKED_TOKEN_ID, @@ -518,7 +518,7 @@ fn user_enable_pair_swaps_fail_test() { .assert_ok(); let custom_locked_token = b"LTOK2-123456"; - let _ = DebugApi::dummy(); + DebugApi::dummy(); b_mock.set_nft_balance( &user, custom_locked_token, diff --git a/energy-integration/fees-collector/tests/fees_collector_test_setup/mod.rs b/energy-integration/fees-collector/tests/fees_collector_test_setup/mod.rs index 6b0fdb9e0..2809ac297 100644 --- a/energy-integration/fees-collector/tests/fees_collector_test_setup/mod.rs +++ b/energy-integration/fees-collector/tests/fees_collector_test_setup/mod.rs @@ -108,7 +108,7 @@ where &rust_biguint!(USER_BALANCE * 2), ); - let _ = DebugApi::dummy(); + DebugApi::dummy(); b_mock.set_nft_balance( &depositor_address, diff --git a/farm-staking/farm-staking-proxy/src/proxy_actions/merge_pos.rs b/farm-staking/farm-staking-proxy/src/proxy_actions/merge_pos.rs new file mode 100644 index 000000000..2a81f2cf4 --- /dev/null +++ b/farm-staking/farm-staking-proxy/src/proxy_actions/merge_pos.rs @@ -0,0 +1,108 @@ +farm-staking/farm-staking-proxy/tests/composed_pos_test.rsuse common_structs::PaymentsVec; + +use crate::{dual_yield_token::DualYieldTokenAttributes, result_types::MergeResult}; + +use mergeable::Mergeable; +use unwrappable::Unwrappable; + +multiversx_sc::imports!(); +multiversx_sc::derive_imports!(); + +#[multiversx_sc::module] +pub trait ProxyMergePosModule: + crate::dual_yield_token::DualYieldTokenModule + + crate::external_contracts_interactions::ExternalContractsInteractionsModule + + crate::lp_farm_token::LpFarmTokenModule + + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule + + utils::UtilsModule + + token_send::TokenSendModule + + sc_whitelist_module::SCWhitelistModule + + super::claim::ProxyClaimModule +{ + #[payable("*")] + #[endpoint(mergeMetastakingWithStakingToken)] + fn merge_metastaking_with_staking_token(&self) -> MergeResult { + let mut payments = self.call_value().all_esdt_transfers().clone_value(); + require!( + payments.len() >= 2, + "Must send metastaking token and at least a staking token" + ); + + let dual_yield_token = self.pop_first_payment(&mut payments); + let dual_yield_token_mapper = self.dual_yield_token(); + dual_yield_token_mapper.require_same_token(&dual_yield_token.token_identifier); + + let mut attributes: DualYieldTokenAttributes = self + .get_attributes_as_part_of_fixed_supply(&dual_yield_token, &dual_yield_token_mapper); + dual_yield_token_mapper.nft_burn(dual_yield_token.token_nonce, &dual_yield_token.amount); + + let caller = self.blockchain().get_caller(); + let staking_farm_rewards = self.claim_staking_rewards_before_merge(&caller, &payments); + + let staking_amount_before_merge = attributes.get_total_staking_token_amount(); + for farm_staking_token in &payments { + attributes.real_pos_token_amount += &farm_staking_token.amount; + } + + let mut dual_yield_claim_result = self.claim_dual_yield( + &caller, + OptionalValue::None, + staking_amount_before_merge, + attributes, + ); + dual_yield_claim_result + .staking_farm_rewards + .merge_with(staking_farm_rewards); + + let new_dual_yield_tokens = self.create_dual_yield_tokens( + &dual_yield_token_mapper, + &dual_yield_claim_result.new_dual_yield_attributes, + ); + let merge_result = MergeResult { + lp_farm_rewards: dual_yield_claim_result.lp_farm_rewards, + staking_farm_rewards: dual_yield_claim_result.staking_farm_rewards, + new_dual_yield_tokens, + }; + + merge_result.send_and_return(self, &caller) + } + + fn claim_staking_rewards_before_merge( + &self, + caller: &ManagedAddress, + farm_staking_tokens: &PaymentsVec, + ) -> EsdtTokenPayment { + let staking_farm_token_id = self.staking_farm_token_id().get(); + let mut opt_staking_farm_rewards = Option::::None; + for farm_staking_token in farm_staking_tokens { + require!( + farm_staking_token.token_identifier == staking_farm_token_id, + "Invalid staking farm token" + ); + + let staking_claim_result = self.staking_farm_claim_rewards( + caller.clone(), + farm_staking_token.token_identifier, + farm_staking_token.token_nonce, + farm_staking_token.amount.clone(), + farm_staking_token.amount, + ); + + match &mut opt_staking_farm_rewards { + Some(rew) => rew.merge_with(staking_claim_result.staking_farm_rewards), + None => { + opt_staking_farm_rewards = Some(staking_claim_result.staking_farm_rewards); + } + }; + + let new_staking_farm_tokens = staking_claim_result.new_staking_farm_tokens; + self.send().esdt_local_burn( + &new_staking_farm_tokens.token_identifier, + new_staking_farm_tokens.token_nonce, + &new_staking_farm_tokens.amount, + ); + } + + opt_staking_farm_rewards.unwrap_or_panic::() + } +} diff --git a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp.rs b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp.rs index e54f13dc6..b15c69cc0 100644 --- a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp.rs +++ b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp.rs @@ -207,7 +207,7 @@ fn unstake_through_proxy_after_claim() { #[test] fn unstake_partial_position_test() { - let _ = DebugApi::dummy(); + DebugApi::dummy(); let mut setup = FarmStakingSetup::new( pair::contract_obj, farm::contract_obj, diff --git a/farm-staking/farm-staking/tests/farm_staking_energy_test.rs b/farm-staking/farm-staking/tests/farm_staking_energy_test.rs index df50ae354..9ce3d963e 100644 --- a/farm-staking/farm-staking/tests/farm_staking_energy_test.rs +++ b/farm-staking/farm-staking/tests/farm_staking_energy_test.rs @@ -20,7 +20,7 @@ fn farm_staking_with_energy_setup_test() { #[test] fn farm_staking_boosted_rewards_no_energy_test() { - let _ = DebugApi::dummy(); + DebugApi::dummy(); let mut fs_setup = FarmStakingSetup::new(farm_staking::contract_obj, energy_factory::contract_obj); @@ -56,7 +56,7 @@ fn farm_staking_boosted_rewards_no_energy_test() { #[test] fn farm_staking_boosted_rewards_with_energy_test() { - let _ = DebugApi::dummy(); + DebugApi::dummy(); let mut fs_setup = FarmStakingSetup::new(farm_staking::contract_obj, energy_factory::contract_obj); @@ -153,7 +153,7 @@ fn farm_staking_boosted_rewards_with_energy_test() { #[test] fn farm_staking_claim_boosted_rewards_for_user_test() { - let _ = DebugApi::dummy(); + DebugApi::dummy(); let mut fs_setup = FarmStakingSetup::new(farm_staking::contract_obj, energy_factory::contract_obj); diff --git a/farm-staking/farm-staking/tests/farm_staking_test.rs b/farm-staking/farm-staking/tests/farm_staking_test.rs index 271efe5c2..ed0925510 100644 --- a/farm-staking/farm-staking/tests/farm_staking_test.rs +++ b/farm-staking/farm-staking/tests/farm_staking_test.rs @@ -16,7 +16,7 @@ fn test_farm_setup() { #[test] fn test_enter_farm() { - let _ = DebugApi::dummy(); + DebugApi::dummy(); let mut farm_setup = FarmStakingSetup::new(farm_staking::contract_obj, energy_factory::contract_obj); @@ -28,7 +28,7 @@ fn test_enter_farm() { #[test] fn test_unstake_farm() { - let _ = DebugApi::dummy(); + DebugApi::dummy(); let mut farm_setup = FarmStakingSetup::new(farm_staking::contract_obj, energy_factory::contract_obj); @@ -70,7 +70,7 @@ fn test_unstake_farm() { #[test] fn test_claim_rewards() { - let _ = DebugApi::dummy(); + DebugApi::dummy(); let mut farm_setup = FarmStakingSetup::new(farm_staking::contract_obj, energy_factory::contract_obj); @@ -147,13 +147,13 @@ where #[test] fn test_enter_farm_twice() { - let _ = DebugApi::dummy(); + DebugApi::dummy(); let _ = steps_enter_farm_twice(farm_staking::contract_obj, energy_factory::contract_obj); } #[test] fn test_exit_farm_after_enter_twice() { - let _ = DebugApi::dummy(); + DebugApi::dummy(); let mut farm_setup = steps_enter_farm_twice(farm_staking::contract_obj, energy_factory::contract_obj); let farm_in_amount = 100_000_000; @@ -183,7 +183,7 @@ fn test_exit_farm_after_enter_twice() { #[test] fn test_unbond() { - let _ = DebugApi::dummy(); + DebugApi::dummy(); let mut farm_setup = FarmStakingSetup::new(farm_staking::contract_obj, energy_factory::contract_obj); diff --git a/farm-staking/metabonding-staking/tests/metabonding_staking_setup/mod.rs b/farm-staking/metabonding-staking/tests/metabonding_staking_setup/mod.rs index b32812145..a4b8effeb 100644 --- a/farm-staking/metabonding-staking/tests/metabonding_staking_setup/mod.rs +++ b/farm-staking/metabonding-staking/tests/metabonding_staking_setup/mod.rs @@ -47,7 +47,7 @@ where mbs_builder: MetabondingStakingObjBuilder, laf_builder: LockedAssetFactoryObjBuilder, ) -> Self { - let _ = DebugApi::dummy(); + DebugApi::dummy(); let rust_zero = rust_biguint!(0u64); let mut b_mock = BlockchainStateWrapper::new(); diff --git a/locked-asset/energy-factory/tests/energy_factory_setup/mod.rs b/locked-asset/energy-factory/tests/energy_factory_setup/mod.rs index f6693c2fe..de10068c0 100644 --- a/locked-asset/energy-factory/tests/energy_factory_setup/mod.rs +++ b/locked-asset/energy-factory/tests/energy_factory_setup/mod.rs @@ -52,7 +52,7 @@ where ScBuilder: 'static + Copy + Fn() -> energy_factory::ContractObj, { pub fn new(sc_builder: ScBuilder) -> Self { - let _ = DebugApi::dummy(); + DebugApi::dummy(); let rust_zero = rust_biguint!(0u64); let mut b_mock = BlockchainStateWrapper::new(); let owner = b_mock.create_user_account(&rust_zero); diff --git a/locked-asset/energy-factory/tests/old_tokens_test.rs b/locked-asset/energy-factory/tests/old_tokens_test.rs index 2e45d0d83..d4bd57a3c 100644 --- a/locked-asset/energy-factory/tests/old_tokens_test.rs +++ b/locked-asset/energy-factory/tests/old_tokens_test.rs @@ -21,7 +21,7 @@ use multiversx_sc_scenario::{ #[test] fn extend_lock_period_old_token_test() { - let _ = DebugApi::dummy(); + DebugApi::dummy(); let rust_zero = rust_biguint!(0); let mut setup = SimpleLockEnergySetup::new(energy_factory::contract_obj); @@ -140,7 +140,7 @@ fn extend_lock_period_old_token_test() { #[test] fn min_period_migrated_token_test() { - let _ = DebugApi::dummy(); + DebugApi::dummy(); let rust_zero = rust_biguint!(0); let mut setup = SimpleLockEnergySetup::new(energy_factory::contract_obj); @@ -250,7 +250,7 @@ fn min_period_migrated_token_test() { #[test] fn min_period_migrated_token_test2() { - let _ = DebugApi::dummy(); + DebugApi::dummy(); let rust_zero = rust_biguint!(0); let mut setup = SimpleLockEnergySetup::new(energy_factory::contract_obj); @@ -370,7 +370,7 @@ fn min_period_migrated_token_test2() { #[test] fn check_initial_old_unlock_schedule_decode_test() { - let _ = DebugApi::dummy(); + DebugApi::dummy(); let rust_zero = rust_biguint!(0); let mut setup = SimpleLockEnergySetup::new(energy_factory::contract_obj); diff --git a/locked-asset/energy-factory/tests/token_merging_test.rs b/locked-asset/energy-factory/tests/token_merging_test.rs index 00b4ede93..b32445506 100644 --- a/locked-asset/energy-factory/tests/token_merging_test.rs +++ b/locked-asset/energy-factory/tests/token_merging_test.rs @@ -31,7 +31,7 @@ use multiversx_sc_scenario::{managed_token_id_wrapped, rust_biguint, DebugApi}; #[test] fn token_merging_test() { - let _ = DebugApi::dummy(); + DebugApi::dummy(); let mut setup = SimpleLockEnergySetup::new(energy_factory::contract_obj); let first_user = setup.first_user.clone(); @@ -101,7 +101,7 @@ fn token_merging_test() { #[test] fn token_merging_different_years_test() { - let _ = DebugApi::dummy(); + DebugApi::dummy(); let mut setup = SimpleLockEnergySetup::new(energy_factory::contract_obj); let first_user = setup.first_user.clone(); @@ -171,7 +171,7 @@ fn token_merging_different_years_test() { #[test] fn token_merging_different_years2_test() { - let _ = DebugApi::dummy(); + DebugApi::dummy(); let mut setup = SimpleLockEnergySetup::new(energy_factory::contract_obj); let first_user = setup.first_user.clone(); @@ -241,7 +241,7 @@ fn token_merging_different_years2_test() { #[test] fn test_specific_tokens_merge() { - let _ = DebugApi::dummy(); + DebugApi::dummy(); let rust_zero = rust_biguint!(0u64); let mut b_mock = BlockchainStateWrapper::new(); let owner = b_mock.create_user_account(&rust_zero); @@ -371,7 +371,7 @@ fn test_specific_tokens_merge() { #[test] fn merge_same_schedule_test() { - let _ = DebugApi::dummy(); + DebugApi::dummy(); let mut setup = SimpleLockEnergySetup::new(energy_factory::contract_obj); let user = setup.first_user.clone(); let unlock_epoch = to_start_of_month(LOCK_OPTIONS[0]); diff --git a/locked-asset/factory/tests/factory_setup/mod.rs b/locked-asset/factory/tests/factory_setup/mod.rs index 9fec3157d..633805223 100644 --- a/locked-asset/factory/tests/factory_setup/mod.rs +++ b/locked-asset/factory/tests/factory_setup/mod.rs @@ -50,7 +50,7 @@ where factory_builder: FactoryBuilder, energy_factory_builder: EnergyFactoryBuilder, ) -> Self { - let _ = DebugApi::dummy(); + DebugApi::dummy(); let rust_zero = rust_biguint!(0u64); let mut b_mock = BlockchainStateWrapper::new(); let owner = b_mock.create_user_account(&rust_zero); diff --git a/locked-asset/factory/tests/unlock_test.rs b/locked-asset/factory/tests/unlock_test.rs index b1e26d7d7..057cf409c 100644 --- a/locked-asset/factory/tests/unlock_test.rs +++ b/locked-asset/factory/tests/unlock_test.rs @@ -775,7 +775,7 @@ fn test_aggregated_unlock_schedule_with_1_offset() { #[test] fn update_energy_after_old_token_unlock_test() { - let _ = DebugApi::dummy(); + DebugApi::dummy(); let rust_zero = rust_biguint!(0); let mut setup = FactorySetup::new(factory::contract_obj, energy_factory::contract_obj); diff --git a/locked-asset/locked-token-wrapper/tests/locked_token_wrapping_test.rs b/locked-asset/locked-token-wrapper/tests/locked_token_wrapping_test.rs index 13edf221e..812b114e9 100644 --- a/locked-asset/locked-token-wrapper/tests/locked_token_wrapping_test.rs +++ b/locked-asset/locked-token-wrapper/tests/locked_token_wrapping_test.rs @@ -19,7 +19,7 @@ static WRAPPED_TOKEN_ID: &[u8] = b"WRAPPED-123456"; #[test] fn token_wrap_unwrap_test() { - let _ = DebugApi::dummy(); + DebugApi::dummy(); let rust_zero = rust_biguint!(0); let mut b_mock = BlockchainStateWrapper::new(); @@ -179,7 +179,7 @@ fn token_wrap_unwrap_test() { #[test] fn tokens_wrap_unwrap_test2() { - let _ = DebugApi::dummy(); + DebugApi::dummy(); let rust_zero = rust_biguint!(0); let mut b_mock = BlockchainStateWrapper::new(); diff --git a/locked-asset/proxy_dex/tests/proxy_dex_test_setup/mod.rs b/locked-asset/proxy_dex/tests/proxy_dex_test_setup/mod.rs index 413ddb980..c93cfc924 100644 --- a/locked-asset/proxy_dex/tests/proxy_dex_test_setup/mod.rs +++ b/locked-asset/proxy_dex/tests/proxy_dex_test_setup/mod.rs @@ -87,7 +87,7 @@ where farm_locked_builder: FarmLockedObjBuilder, simple_lock_builder: SimpleLockObjBuilder, ) -> Self { - let _ = DebugApi::dummy(); + DebugApi::dummy(); let rust_zero = rust_biguint!(0); let mut b_mock = BlockchainStateWrapper::new(); diff --git a/locked-asset/simple-lock-whitelist/tests/whitelist_test.rs b/locked-asset/simple-lock-whitelist/tests/whitelist_test.rs index d2f335ec1..54bb650a5 100644 --- a/locked-asset/simple-lock-whitelist/tests/whitelist_test.rs +++ b/locked-asset/simple-lock-whitelist/tests/whitelist_test.rs @@ -82,7 +82,7 @@ fn lock_whitelist_test() { ) .assert_ok(); - let _ = DebugApi::dummy(); + DebugApi::dummy(); b_mock.check_nft_balance( &user_addr, LOCKED_TOKEN_ID, diff --git a/locked-asset/simple-lock/tests/rust_test.rs b/locked-asset/simple-lock/tests/rust_test.rs index 8b760049a..7b3395672 100644 --- a/locked-asset/simple-lock/tests/rust_test.rs +++ b/locked-asset/simple-lock/tests/rust_test.rs @@ -66,7 +66,7 @@ fn lock_unlock_test() { .assert_ok(); // needed for the managed types in LockedTokenAttributes - let _ = DebugApi::dummy(); + DebugApi::dummy(); b_mock.check_nft_balance( &user_addr, LOCKED_TOKEN_ID, diff --git a/locked-asset/token-unstake/tests/token_unstake_setup/mod.rs b/locked-asset/token-unstake/tests/token_unstake_setup/mod.rs index 5191fe7b8..edac051d7 100644 --- a/locked-asset/token-unstake/tests/token_unstake_setup/mod.rs +++ b/locked-asset/token-unstake/tests/token_unstake_setup/mod.rs @@ -65,7 +65,7 @@ where energy_factory_builder: EnergyFactoryBuilder, unstake_sc_builder: UnstakeScBuilder, ) -> Self { - let _ = DebugApi::dummy(); + DebugApi::dummy(); let rust_zero = rust_biguint!(0u64); let mut b_mock = BlockchainStateWrapper::new(); let owner = b_mock.create_user_account(&rust_zero); diff --git a/locked-asset/token-unstake/tests/unlock_early_test.rs b/locked-asset/token-unstake/tests/unlock_early_test.rs index 5da1c4021..985796d94 100644 --- a/locked-asset/token-unstake/tests/unlock_early_test.rs +++ b/locked-asset/token-unstake/tests/unlock_early_test.rs @@ -9,7 +9,7 @@ use token_unstake_setup::*; #[test] fn double_unlock_early_test() { - let _ = DebugApi::dummy(); + DebugApi::dummy(); let mut setup = TokenUnstakeSetup::new(energy_factory::contract_obj, token_unstake::contract_obj); let first_user = setup.first_user.clone(); From 374f81fb93d2d2e27247ad063e4a6ab5b65b6e34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Thu, 7 Sep 2023 17:55:35 +0300 Subject: [PATCH 062/213] Governance-v2: Fix double withdraw fee --- .../governance-v2/src/errors.rs | 1 + energy-integration/governance-v2/src/lib.rs | 28 +++++++++++++------ .../governance-v2/src/proposal.rs | 1 + .../governance-v2/tests/gov_rust_test.rs | 5 ++++ 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/energy-integration/governance-v2/src/errors.rs b/energy-integration/governance-v2/src/errors.rs index cb399e14e..1656c165f 100644 --- a/energy-integration/governance-v2/src/errors.rs +++ b/energy-integration/governance-v2/src/errors.rs @@ -8,5 +8,6 @@ pub const ALREADY_VOTED_ERR_MSG: &[u8] = b"Already voted for this proposal"; pub const EXEEDED_MAX_ACTIONS: &[u8] = b"Exceeded max actions per proposal"; pub const ONLY_PROPOSER_CANCEL: &[u8] = b"Only original proposer may cancel a pending proposal"; pub const ONLY_PROPOSER_WITHDRAW: &[u8] = b"Only original proposer may withdraw a pending proposal"; +pub const FEE_ALREADY_WITHDRAWN: &[u8] = b"Fee already withdrawn!"; pub const NO_PROPOSAL: &[u8] = b"Proposal does not exist"; pub const WITHDRAW_NOT_ALLOWED: &[u8] = b"You may not withdraw funds from this proposal!"; diff --git a/energy-integration/governance-v2/src/lib.rs b/energy-integration/governance-v2/src/lib.rs index 17f0ba528..c2c0ed90a 100644 --- a/energy-integration/governance-v2/src/lib.rs +++ b/energy-integration/governance-v2/src/lib.rs @@ -136,6 +136,7 @@ pub trait GovernanceV2: withdraw_percentage_defeated, total_quorum: BigUint::zero(), proposal_start_block: current_block, + fee_withdrawn: false }; let proposal_id = self.proposals().push(&proposal); @@ -231,7 +232,7 @@ pub trait GovernanceV2: let caller = self.blockchain().get_caller(); require!(caller == proposal.proposer, ONLY_PROPOSER_CANCEL); - self.refund_proposal_fee(proposal_id, &proposal.fee_payment.amount); + self.refund_proposal_fee(&proposal, &proposal.fee_payment.amount); self.clear_proposal(proposal_id); self.proposal_canceled_event(proposal_id); } @@ -253,19 +254,31 @@ pub trait GovernanceV2: sc_panic!(NO_PROPOSAL); } GovernanceProposalStatus::Succeeded | GovernanceProposalStatus::Defeated => { - let proposal = self.proposals().get(proposal_id); + let mut proposal = self.proposals().get(proposal_id); require!(caller == proposal.proposer, ONLY_PROPOSER_WITHDRAW); + require!(!proposal.fee_withdrawn, FEE_ALREADY_WITHDRAWN); + + self.refund_proposal_fee(&proposal, &proposal.fee_payment.amount); + proposal.fee_withdrawn = true; + self.proposals().set(proposal_id, &proposal); - self.refund_proposal_fee(proposal_id, &proposal.fee_payment.amount); + proposal.fee_withdrawn = true; + self.proposals().set(proposal_id, &proposal); } GovernanceProposalStatus::DefeatedWithVeto => { - let proposal = self.proposals().get(proposal_id); + let mut proposal = self.proposals().get(proposal_id); + + require!(!proposal.fee_withdrawn, FEE_ALREADY_WITHDRAWN); + let refund_percentage = BigUint::from(proposal.withdraw_percentage_defeated); let refund_amount = refund_percentage * proposal.fee_payment.amount.clone() / FULL_PERCENTAGE; - self.refund_proposal_fee(proposal_id, &refund_amount); + self.refund_proposal_fee(&proposal, &refund_amount); + proposal.fee_withdrawn = true; + self.proposals().set(proposal_id, &proposal); + let remaining_fee = proposal.fee_payment.amount - refund_amount; self.proposal_remaining_fees().update(|fees| { @@ -295,10 +308,7 @@ pub trait GovernanceV2: total } - fn refund_proposal_fee(&self, proposal_id: ProposalId, refund_amount: &BigUint) { - let proposal: GovernanceProposal<::Api> = - self.proposals().get(proposal_id); - + fn refund_proposal_fee(&self, proposal: &GovernanceProposal, refund_amount: &BigUint) { self.send().direct_esdt( &proposal.proposer, &proposal.fee_payment.token_identifier, diff --git a/energy-integration/governance-v2/src/proposal.rs b/energy-integration/governance-v2/src/proposal.rs index 9ca71088e..8c60bc280 100644 --- a/energy-integration/governance-v2/src/proposal.rs +++ b/energy-integration/governance-v2/src/proposal.rs @@ -63,4 +63,5 @@ pub struct GovernanceProposal { pub withdraw_percentage_defeated: u64, pub total_quorum: BigUint, pub proposal_start_block: u64, + pub fee_withdrawn: bool, } diff --git a/energy-integration/governance-v2/tests/gov_rust_test.rs b/energy-integration/governance-v2/tests/gov_rust_test.rs index 12749ef43..7f7ad8fbb 100644 --- a/energy-integration/governance-v2/tests/gov_rust_test.rs +++ b/energy-integration/governance-v2/tests/gov_rust_test.rs @@ -518,6 +518,11 @@ fn gov_withdraw_no_with_veto_defeated_proposal_test() { &(min_fee / 2u64), None, ); + + // Withdraw the fee twice - error + gov_setup + .withdraw_after_defeated(&third_user_addr, proposal_id) + .assert_error(4, "Fee already withdrawn!"); } #[test] From b093f8265c9217eb2747a1246bd2e3abe78983ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Thu, 7 Sep 2023 18:12:56 +0300 Subject: [PATCH 063/213] Governance-v2: Withdraw percentage limits fix --- energy-integration/governance-v2/src/configurable.rs | 12 ++++++++++-- energy-integration/governance-v2/src/lib.rs | 4 +--- .../governance-v2/tests/gov_rust_test.rs | 4 ++++ .../governance-v2/tests/gov_test_setup/mod.rs | 9 ++++++++- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/energy-integration/governance-v2/src/configurable.rs b/energy-integration/governance-v2/src/configurable.rs index cccbede16..3fe44e7b0 100644 --- a/energy-integration/governance-v2/src/configurable.rs +++ b/energy-integration/governance-v2/src/configurable.rs @@ -1,4 +1,4 @@ -use crate::{errors::ERROR_NOT_AN_ESDT, FULL_PERCENTAGE}; +use crate::errors::ERROR_NOT_AN_ESDT; multiversx_sc::imports!(); @@ -39,6 +39,8 @@ const MAX_QUORUM: u64 = 6_000; // 60% const MIN_MIN_FEE_FOR_PROPOSE: u64 = 2_000_000; const MAX_MIN_FEE_FOR_PROPOSE: u64 = 200_000_000_000; const DECIMALS_CONST: u64 = 1_000_000_000_000_000_000; +pub const MAX_GAS_LIMIT_PER_BLOCK: u64 = 600_000_000; +pub const FULL_PERCENTAGE: u64 = 10_000; #[multiversx_sc::module] pub trait ConfigurablePropertiesModule: @@ -65,6 +67,12 @@ pub trait ConfigurablePropertiesModule: self.try_change_quorum_percentage(new_value); } + #[only_owner] + #[endpoint(changeWithdrawPercentage)] + fn change_withdraw_percentage(&self, new_value: u64) { + self.try_change_withdraw_percentage_defeated(new_value); + } + #[only_owner] #[endpoint(changeVotingDelayInBlocks)] fn change_voting_delay_in_blocks(&self, new_value: u64) { @@ -125,7 +133,7 @@ pub trait ConfigurablePropertiesModule: fn try_change_withdraw_percentage_defeated(&self, new_value: u64) { require!( - new_value > 0 && new_value < FULL_PERCENTAGE, + new_value <= FULL_PERCENTAGE, "Not valid value for withdraw percentage if defeated!" ); diff --git a/energy-integration/governance-v2/src/lib.rs b/energy-integration/governance-v2/src/lib.rs index c2c0ed90a..8ee3110c7 100644 --- a/energy-integration/governance-v2/src/lib.rs +++ b/energy-integration/governance-v2/src/lib.rs @@ -15,12 +15,10 @@ use proposal_storage::VoteType; use weekly_rewards_splitting::events::Week; use weekly_rewards_splitting::global_info::ProxyTrait as _; +use crate::configurable::{FULL_PERCENTAGE, MAX_GAS_LIMIT_PER_BLOCK}; use crate::errors::*; use crate::proposal_storage::ProposalVotes; -const MAX_GAS_LIMIT_PER_BLOCK: u64 = 600_000_000; -const FULL_PERCENTAGE: u64 = 10_000; - /// An empty contract. To be used as a template when starting a new contract from scratch. #[multiversx_sc::contract] pub trait GovernanceV2: diff --git a/energy-integration/governance-v2/tests/gov_rust_test.rs b/energy-integration/governance-v2/tests/gov_rust_test.rs index 7f7ad8fbb..352fd2125 100644 --- a/energy-integration/governance-v2/tests/gov_rust_test.rs +++ b/energy-integration/governance-v2/tests/gov_rust_test.rs @@ -420,6 +420,10 @@ fn gov_modify_withdraw_defeated_proposal_test() { gov_setup.increment_block_nonce(LOCKING_PERIOD_BLOCKS); + gov_setup + .change_withdraw_percentage(FULL_PERCENTAGE + 1u64) + .assert_error(4, "Not valid value for withdraw percentage if defeated!"); + gov_setup .b_mock .execute_query(&gov_setup.gov_wrapper, |sc| { diff --git a/energy-integration/governance-v2/tests/gov_test_setup/mod.rs b/energy-integration/governance-v2/tests/gov_test_setup/mod.rs index 8ea1ef5f0..5a6f17e33 100644 --- a/energy-integration/governance-v2/tests/gov_test_setup/mod.rs +++ b/energy-integration/governance-v2/tests/gov_test_setup/mod.rs @@ -30,7 +30,7 @@ pub const WITHDRAW_PERCENTAGE: u64 = 5_000; // 50% pub static WXMEX_TOKEN_ID: &[u8] = b"WXMEX-123456"; pub const LOCKED_TOKEN_ID: &[u8] = b"LOCKED-abcdef"; pub const DECIMALS_CONST: u64 = 1_000_000_000_000_000_000; - +pub const FULL_PERCENTAGE: u64 = 10_000; pub const USER_ENERGY: u64 = 1_000_000; pub const GAS_LIMIT: u64 = 1_000_000; @@ -260,6 +260,13 @@ where }) } + pub fn change_withdraw_percentage(&mut self, withdraw_value: u64) -> TxResult { + self.b_mock + .execute_tx(&self.owner, &self.gov_wrapper, &rust_biguint!(0), |sc| { + sc.change_withdraw_percentage(withdraw_value); + }) + } + pub fn cancel_proposal(&mut self, caller: &Address, proposal_id: usize) -> TxResult { self.b_mock .execute_tx(caller, &self.gov_wrapper, &rust_biguint!(0), |sc| { From f328ba4525ca4485d6c2820e60c23f57750078b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Thu, 7 Sep 2023 18:13:11 +0300 Subject: [PATCH 064/213] Governance-v2: Remove unused code --- .../governance-v2/src/proposal_storage.rs | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/energy-integration/governance-v2/src/proposal_storage.rs b/energy-integration/governance-v2/src/proposal_storage.rs index 1e7db1561..28dd58c1d 100644 --- a/energy-integration/governance-v2/src/proposal_storage.rs +++ b/energy-integration/governance-v2/src/proposal_storage.rs @@ -39,22 +39,6 @@ impl ProposalVotes { pub fn get_total_votes(&self) -> BigUint { &self.up_votes + &self.down_votes + &self.down_veto_votes + &self.abstain_votes } - pub fn get_up_votes_percentage(&self) -> BigUint { - let total_votes = self.get_total_votes(); - &self.up_votes / &total_votes - } - pub fn get_down_votes_percentage(&self) -> BigUint { - let total_votes = self.get_total_votes(); - &self.down_votes / &total_votes - } - pub fn get_down_veto_votes_percentage(&self) -> BigUint { - let total_votes = self.get_total_votes(); - &self.down_veto_votes / &total_votes - } - pub fn get_abstain_votes_percentage(&self) -> BigUint { - let total_votes = self.get_total_votes(); - &self.abstain_votes / &total_votes - } } #[multiversx_sc::module] From af57b8867763ec5e09edcd4e117cc9ab1c1c4e41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Thu, 7 Sep 2023 18:15:19 +0300 Subject: [PATCH 065/213] Governance-v2: Remove unused code --- energy-integration/governance-v2/src/views.rs | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/energy-integration/governance-v2/src/views.rs b/energy-integration/governance-v2/src/views.rs index 770f3b210..2699bd5a3 100644 --- a/energy-integration/governance-v2/src/views.rs +++ b/energy-integration/governance-v2/src/views.rs @@ -50,11 +50,6 @@ pub trait ViewsModule: fn vote_reached(&self, proposal_id: ProposalId) -> bool { let proposal_votes = self.proposal_votes(proposal_id).get(); let total_votes = proposal_votes.get_total_votes(); - - if total_votes == 0u64 { - return false; - } - let total_up_votes = proposal_votes.up_votes; let total_down_veto_votes = proposal_votes.down_veto_votes; let third_total_votes = &total_votes / 3u64; @@ -70,11 +65,6 @@ pub trait ViewsModule: fn vote_down_with_veto(&self, proposal_id: ProposalId) -> bool { let proposal_votes = self.proposal_votes(proposal_id).get(); let total_votes = proposal_votes.get_total_votes(); - - if total_votes == 0u64 { - return false; - } - let total_down_veto_votes = proposal_votes.down_veto_votes; let third_total_votes = &total_votes / 3u64; From e16dc32fa9219ef66480ad9be10caf1c847f7190 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Thu, 7 Sep 2023 18:21:49 +0300 Subject: [PATCH 066/213] Governance-v2: Code refactor --- energy-integration/governance-v2/src/lib.rs | 8 ++++++-- energy-integration/governance-v2/src/views.rs | 10 +--------- .../governance-v2/tests/gov_rust_test.rs | 8 ++++---- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/energy-integration/governance-v2/src/lib.rs b/energy-integration/governance-v2/src/lib.rs index 8ee3110c7..9f2228408 100644 --- a/energy-integration/governance-v2/src/lib.rs +++ b/energy-integration/governance-v2/src/lib.rs @@ -134,7 +134,7 @@ pub trait GovernanceV2: withdraw_percentage_defeated, total_quorum: BigUint::zero(), proposal_start_block: current_block, - fee_withdrawn: false + fee_withdrawn: false, }; let proposal_id = self.proposals().push(&proposal); @@ -306,7 +306,11 @@ pub trait GovernanceV2: total } - fn refund_proposal_fee(&self, proposal: &GovernanceProposal, refund_amount: &BigUint) { + fn refund_proposal_fee( + &self, + proposal: &GovernanceProposal, + refund_amount: &BigUint, + ) { self.send().direct_esdt( &proposal.proposer, &proposal.fee_payment.token_identifier, diff --git a/energy-integration/governance-v2/src/views.rs b/energy-integration/governance-v2/src/views.rs index 2699bd5a3..c6eb36916 100644 --- a/energy-integration/governance-v2/src/views.rs +++ b/energy-integration/governance-v2/src/views.rs @@ -74,18 +74,10 @@ pub trait ViewsModule: fn quorum_reached(&self, proposal_id: ProposalId) -> bool { let proposal = self.proposals().get(proposal_id); let total_quorum_for_proposal = proposal.total_quorum; - - if total_quorum_for_proposal == 0u64 { - return false; - } - let required_minimum_percentage = proposal.minimum_quorum; - let current_quorum = self.proposal_votes(proposal_id).get().quorum; - let current_quorum_percentage = - current_quorum * FULL_PERCENTAGE / total_quorum_for_proposal; - current_quorum_percentage >= required_minimum_percentage + current_quorum * FULL_PERCENTAGE >= required_minimum_percentage * total_quorum_for_proposal } fn require_valid_proposal_id(&self, proposal_id: ProposalId) { diff --git a/energy-integration/governance-v2/tests/gov_rust_test.rs b/energy-integration/governance-v2/tests/gov_rust_test.rs index 352fd2125..73ab392d1 100644 --- a/energy-integration/governance-v2/tests/gov_rust_test.rs +++ b/energy-integration/governance-v2/tests/gov_rust_test.rs @@ -421,8 +421,8 @@ fn gov_modify_withdraw_defeated_proposal_test() { gov_setup.increment_block_nonce(LOCKING_PERIOD_BLOCKS); gov_setup - .change_withdraw_percentage(FULL_PERCENTAGE + 1u64) - .assert_error(4, "Not valid value for withdraw percentage if defeated!"); + .change_withdraw_percentage(FULL_PERCENTAGE + 1u64) + .assert_error(4, "Not valid value for withdraw percentage if defeated!"); gov_setup .b_mock @@ -523,8 +523,8 @@ fn gov_withdraw_no_with_veto_defeated_proposal_test() { None, ); - // Withdraw the fee twice - error - gov_setup + // Withdraw the fee twice - error + gov_setup .withdraw_after_defeated(&third_user_addr, proposal_id) .assert_error(4, "Fee already withdrawn!"); } From 897aea861b6a7dc130f2c4b9003ff68797915c38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Thu, 7 Sep 2023 18:43:02 +0300 Subject: [PATCH 067/213] Governance-v2: Burn fees --- energy-integration/governance-v2/src/lib.rs | 19 +++++++------------ .../governance-v2/tests/gov_test_setup/mod.rs | 13 ++++++++++++- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/energy-integration/governance-v2/src/lib.rs b/energy-integration/governance-v2/src/lib.rs index 9f2228408..ca0be83bb 100644 --- a/energy-integration/governance-v2/src/lib.rs +++ b/energy-integration/governance-v2/src/lib.rs @@ -273,19 +273,18 @@ pub trait GovernanceV2: let refund_amount = refund_percentage * proposal.fee_payment.amount.clone() / FULL_PERCENTAGE; + // Mark this proposal - fee withdrawn self.refund_proposal_fee(&proposal, &refund_amount); proposal.fee_withdrawn = true; self.proposals().set(proposal_id, &proposal); + // Burn remaining fees let remaining_fee = proposal.fee_payment.amount - refund_amount; - - self.proposal_remaining_fees().update(|fees| { - fees.push(EsdtTokenPayment::new( - proposal.fee_payment.token_identifier, - proposal.fee_payment.token_nonce, - remaining_fee, - )); - }); + self.send().esdt_local_burn( + &proposal.fee_payment.token_identifier, + proposal.fee_payment.token_nonce, + &remaining_fee, + ); } _ => { sc_panic!(WITHDRAW_NOT_ALLOWED); @@ -318,8 +317,4 @@ pub trait GovernanceV2: refund_amount, ); } - - #[storage_mapper("proposalRemainingFees")] - fn proposal_remaining_fees(&self) - -> SingleValueMapper>>; } diff --git a/energy-integration/governance-v2/tests/gov_test_setup/mod.rs b/energy-integration/governance-v2/tests/gov_test_setup/mod.rs index 5a6f17e33..6a9d42d4c 100644 --- a/energy-integration/governance-v2/tests/gov_test_setup/mod.rs +++ b/energy-integration/governance-v2/tests/gov_test_setup/mod.rs @@ -10,7 +10,7 @@ use governance_v2::{ }; use multiversx_sc::{ codec::multi_types::OptionalValue, - types::{Address, BigInt, ManagedVec, MultiValueEncoded}, + types::{Address, BigInt, EsdtLocalRole, ManagedVec, MultiValueEncoded}, }; use multiversx_sc_scenario::{ managed_address, managed_biguint, managed_buffer, managed_token_id, rust_biguint, @@ -175,6 +175,17 @@ where }) .assert_ok(); + let vote_nft_roles = [ + EsdtLocalRole::NftCreate, + EsdtLocalRole::NftBurn, + EsdtLocalRole::NftUpdateAttributes, + ]; + b_mock.set_esdt_local_roles( + &gov_wrapper.address_ref(), + WXMEX_TOKEN_ID, + &vote_nft_roles[..], + ); + Self { b_mock, owner, From 9d87efab4e39ea6bfb098c0a1f5b6bebba5672e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Thu, 7 Sep 2023 18:46:55 +0300 Subject: [PATCH 068/213] Governance-v2: Clippy fixes for tests --- energy-integration/governance-v2/tests/gov_test_setup/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/energy-integration/governance-v2/tests/gov_test_setup/mod.rs b/energy-integration/governance-v2/tests/gov_test_setup/mod.rs index 6a9d42d4c..520b5b0b4 100644 --- a/energy-integration/governance-v2/tests/gov_test_setup/mod.rs +++ b/energy-integration/governance-v2/tests/gov_test_setup/mod.rs @@ -181,7 +181,7 @@ where EsdtLocalRole::NftUpdateAttributes, ]; b_mock.set_esdt_local_roles( - &gov_wrapper.address_ref(), + gov_wrapper.address_ref(), WXMEX_TOKEN_ID, &vote_nft_roles[..], ); From ff7424edbc22e7e6e8dcb80bf35a9c1b1198ab5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Fri, 8 Sep 2023 13:12:33 +0300 Subject: [PATCH 069/213] Governance-v2: Fixes after audit * Safely burn & send if amount = 0 * Removed redunant code --- energy-integration/governance-v2/src/lib.rs | 26 ++-- .../governance-v2/tests/gov_rust_test.rs | 125 ++++++++++++++++++ 2 files changed, 139 insertions(+), 12 deletions(-) diff --git a/energy-integration/governance-v2/src/lib.rs b/energy-integration/governance-v2/src/lib.rs index ca0be83bb..cf242f2f8 100644 --- a/energy-integration/governance-v2/src/lib.rs +++ b/energy-integration/governance-v2/src/lib.rs @@ -260,9 +260,6 @@ pub trait GovernanceV2: self.refund_proposal_fee(&proposal, &proposal.fee_payment.amount); proposal.fee_withdrawn = true; self.proposals().set(proposal_id, &proposal); - - proposal.fee_withdrawn = true; - self.proposals().set(proposal_id, &proposal); } GovernanceProposalStatus::DefeatedWithVeto => { let mut proposal = self.proposals().get(proposal_id); @@ -280,11 +277,14 @@ pub trait GovernanceV2: // Burn remaining fees let remaining_fee = proposal.fee_payment.amount - refund_amount; - self.send().esdt_local_burn( - &proposal.fee_payment.token_identifier, - proposal.fee_payment.token_nonce, - &remaining_fee, - ); + + if remaining_fee != BigUint::zero() { + self.send().esdt_local_burn( + &proposal.fee_payment.token_identifier, + proposal.fee_payment.token_nonce, + &remaining_fee, + ); + } } _ => { sc_panic!(WITHDRAW_NOT_ALLOWED); @@ -310,11 +310,13 @@ pub trait GovernanceV2: proposal: &GovernanceProposal, refund_amount: &BigUint, ) { - self.send().direct_esdt( + self.send().direct_non_zero_esdt_payment( &proposal.proposer, - &proposal.fee_payment.token_identifier, - proposal.fee_payment.token_nonce, - refund_amount, + &EsdtTokenPayment::new( + proposal.fee_payment.token_identifier.clone(), + proposal.fee_payment.token_nonce, + refund_amount.clone(), + ), ); } } diff --git a/energy-integration/governance-v2/tests/gov_rust_test.rs b/energy-integration/governance-v2/tests/gov_rust_test.rs index 73ab392d1..929e36945 100644 --- a/energy-integration/governance-v2/tests/gov_rust_test.rs +++ b/energy-integration/governance-v2/tests/gov_rust_test.rs @@ -529,6 +529,131 @@ fn gov_withdraw_no_with_veto_defeated_proposal_test() { .assert_error(4, "Fee already withdrawn!"); } +#[test] +fn gov_withdraw_no_with_veto_penalty_limits_test() { + let mut gov_setup = GovSetup::new(governance_v2::contract_obj); + + let first_user_addr = gov_setup.first_user.clone(); + let third_user_addr = gov_setup.third_user.clone(); + let sc_addr = gov_setup.gov_wrapper.address_ref().clone(); + let min_fee = rust_biguint!(MIN_FEE_FOR_PROPOSE) * DECIMALS_CONST; + // Give proposer the minimum fee + gov_setup + .b_mock + .set_nft_balance(&first_user_addr, WXMEX_TOKEN_ID, 1, &min_fee, &Empty); + + gov_setup.change_withdraw_percentage(0).assert_ok(); + let (result, proposal_id) = gov_setup.propose( + &first_user_addr, + &min_fee, + &sc_addr, + b"changeTODO", + vec![1_000u64.to_be_bytes().to_vec()], + ); + result.assert_ok(); + assert_eq!(proposal_id, 1); + + // Check proposer balance + gov_setup.b_mock.check_nft_balance::( + &first_user_addr, + WXMEX_TOKEN_ID, + 1, + &rust_biguint!(0), + None, + ); + + gov_setup.increment_block_nonce(VOTING_PERIOD_BLOCKS); + + gov_setup.up_vote(&first_user_addr, proposal_id).assert_ok(); + gov_setup + .down_veto_vote(&third_user_addr, proposal_id) + .assert_ok(); + + gov_setup.increment_block_nonce(LOCKING_PERIOD_BLOCKS); + + gov_setup + .b_mock + .execute_query(&gov_setup.gov_wrapper, |sc| { + assert!( + sc.get_proposal_status(1) == GovernanceProposalStatus::DefeatedWithVeto, + "Action should have been Defeated" + ); + }) + .assert_ok(); + + // Other user (not proposer) withdraw the fee + gov_setup + .withdraw_after_defeated(&third_user_addr, proposal_id) + .assert_ok(); + + // Check proposer balance (fee) + gov_setup.b_mock.check_nft_balance::( + &first_user_addr, + WXMEX_TOKEN_ID, + 1, + &rust_biguint!(0), + None, + ); + + // Give proposer the minimum fee + gov_setup + .b_mock + .set_nft_balance(&first_user_addr, WXMEX_TOKEN_ID, 1, &min_fee, &Empty); + + gov_setup.change_withdraw_percentage(10_000).assert_ok(); + let (result, proposal_id) = gov_setup.propose( + &first_user_addr, + &min_fee, + &sc_addr, + b"changeTODO", + vec![1_000u64.to_be_bytes().to_vec()], + ); + result.assert_ok(); + assert_eq!(proposal_id, 2); + + // Check proposer balance + gov_setup.b_mock.check_nft_balance::( + &first_user_addr, + WXMEX_TOKEN_ID, + 1, + &rust_biguint!(0), + None, + ); + + gov_setup.increment_block_nonce(VOTING_PERIOD_BLOCKS); + + gov_setup.up_vote(&first_user_addr, proposal_id).assert_ok(); + gov_setup + .down_veto_vote(&third_user_addr, proposal_id) + .assert_ok(); + + gov_setup.increment_block_nonce(LOCKING_PERIOD_BLOCKS); + + gov_setup + .b_mock + .execute_query(&gov_setup.gov_wrapper, |sc| { + assert!( + sc.get_proposal_status(1) == GovernanceProposalStatus::DefeatedWithVeto, + "Action should have been Defeated" + ); + }) + .assert_ok(); + + // Other user (not proposer) withdraw the fee + gov_setup + .withdraw_after_defeated(&third_user_addr, proposal_id) + .assert_ok(); + + // Check proposer balance (fee) + gov_setup.b_mock.check_nft_balance::( + &first_user_addr, + WXMEX_TOKEN_ID, + 1, + &min_fee, + None, + ); +} + #[test] fn gov_propose_cancel_proposal_id_test() { let mut gov_setup = GovSetup::new(governance_v2::contract_obj); From 0d463d789bc4992832bbab0b181b7192a62cec6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Fri, 8 Sep 2023 14:07:37 +0300 Subject: [PATCH 070/213] Governance-v2: fix withdraw after NoWithVeto First burn, then refund --- energy-integration/governance-v2/src/lib.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/energy-integration/governance-v2/src/lib.rs b/energy-integration/governance-v2/src/lib.rs index cf242f2f8..d5e53948e 100644 --- a/energy-integration/governance-v2/src/lib.rs +++ b/energy-integration/governance-v2/src/lib.rs @@ -270,13 +270,8 @@ pub trait GovernanceV2: let refund_amount = refund_percentage * proposal.fee_payment.amount.clone() / FULL_PERCENTAGE; - // Mark this proposal - fee withdrawn - self.refund_proposal_fee(&proposal, &refund_amount); - proposal.fee_withdrawn = true; - self.proposals().set(proposal_id, &proposal); - // Burn remaining fees - let remaining_fee = proposal.fee_payment.amount - refund_amount; + let remaining_fee = proposal.fee_payment.amount.clone() - refund_amount.clone(); if remaining_fee != BigUint::zero() { self.send().esdt_local_burn( @@ -285,6 +280,10 @@ pub trait GovernanceV2: &remaining_fee, ); } + // Mark this proposal - fee withdrawn + self.refund_proposal_fee(&proposal, &refund_amount); + proposal.fee_withdrawn = true; + self.proposals().set(proposal_id, &proposal); } _ => { sc_panic!(WITHDRAW_NOT_ALLOWED); From 7354488e07a0aec1bd911b81d10fd6dc88c53429 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Fri, 8 Sep 2023 16:47:30 +0300 Subject: [PATCH 071/213] Governance-v2 * Remove check_caller module - not necessary anymore * SC are not allowed to propose --- .../governance-v2/src/caller_check.rs | 14 ------------ .../governance-v2/src/errors.rs | 1 + energy-integration/governance-v2/src/lib.rs | 22 +++++++------------ energy-integration/governance-v2/src/views.rs | 1 - 4 files changed, 9 insertions(+), 29 deletions(-) delete mode 100644 energy-integration/governance-v2/src/caller_check.rs diff --git a/energy-integration/governance-v2/src/caller_check.rs b/energy-integration/governance-v2/src/caller_check.rs deleted file mode 100644 index f21475a58..000000000 --- a/energy-integration/governance-v2/src/caller_check.rs +++ /dev/null @@ -1,14 +0,0 @@ -multiversx_sc::imports!(); - -#[multiversx_sc::module] -pub trait CallerCheckModule { - fn require_caller_not_self(&self) { - let caller = self.blockchain().get_caller(); - let sc_address = self.blockchain().get_sc_address(); - - require!( - caller != sc_address, - "Cannot call this endpoint through proposed action" - ); - } -} diff --git a/energy-integration/governance-v2/src/errors.rs b/energy-integration/governance-v2/src/errors.rs index 1656c165f..f1100a5be 100644 --- a/energy-integration/governance-v2/src/errors.rs +++ b/energy-integration/governance-v2/src/errors.rs @@ -11,3 +11,4 @@ pub const ONLY_PROPOSER_WITHDRAW: &[u8] = b"Only original proposer may withdraw pub const FEE_ALREADY_WITHDRAWN: &[u8] = b"Fee already withdrawn!"; pub const NO_PROPOSAL: &[u8] = b"Proposal does not exist"; pub const WITHDRAW_NOT_ALLOWED: &[u8] = b"You may not withdraw funds from this proposal!"; +pub const PROPOSAL_NOT_ALLOWED_FOR_SC: &[u8] = b"Smart Contracts are not allowed to propose!"; diff --git a/energy-integration/governance-v2/src/lib.rs b/energy-integration/governance-v2/src/lib.rs index d5e53948e..4c4fe79fb 100644 --- a/energy-integration/governance-v2/src/lib.rs +++ b/energy-integration/governance-v2/src/lib.rs @@ -2,7 +2,6 @@ multiversx_sc::imports!(); -pub mod caller_check; pub mod configurable; mod errors; pub mod events; @@ -25,7 +24,6 @@ pub trait GovernanceV2: configurable::ConfigurablePropertiesModule + events::EventsModule + proposal_storage::ProposalStorageModule - + caller_check::CallerCheckModule + views::ViewsModule + energy_query::EnergyQueryModule + permissions_module::PermissionsModule @@ -76,14 +74,17 @@ pub trait GovernanceV2: description: ManagedBuffer, actions: MultiValueEncoded>, ) -> ProposalId { - self.require_caller_not_self(); + let proposer = self.blockchain().get_caller(); + require!( + !self.blockchain().is_smart_contract(&proposer), + PROPOSAL_NOT_ALLOWED_FOR_SC + ); require!( actions.len() <= MAX_GOVERNANCE_PROPOSAL_ACTIONS, EXEEDED_MAX_ACTIONS ); - let proposer = self.blockchain().get_caller(); let user_energy = self.get_energy_amount_non_zero(&proposer); let min_energy_for_propose = self.min_energy_for_propose().get(); require!(user_energy >= min_energy_for_propose, NOT_ENOUGH_ENERGY); @@ -148,7 +149,6 @@ pub trait GovernanceV2: /// Vote on a proposal. The voting power depends on the user's energy. #[endpoint] fn vote(&self, proposal_id: ProposalId, vote: VoteType) { - self.require_caller_not_self(); self.require_valid_proposal_id(proposal_id); require!( self.get_proposal_status(proposal_id) == GovernanceProposalStatus::Active, @@ -214,13 +214,9 @@ pub trait GovernanceV2: } } - /// Cancel a proposed action. This can be done: - /// - by the proposer, at any time - /// - by anyone, if the proposal was defeated + /// Cancel a proposed action. This can be done only during Pending status #[endpoint] fn cancel(&self, proposal_id: ProposalId) { - self.require_caller_not_self(); - match self.get_proposal_status(proposal_id) { GovernanceProposalStatus::None => { sc_panic!(NO_PROPOSAL); @@ -241,10 +237,9 @@ pub trait GovernanceV2: } /// When a proposal was defeated, the proposer can withdraw - /// a part of the FEE. + /// If DefeatedWithVeto only part of the fee can be withdrawn #[endpoint(withdrawDeposit)] fn withdraw_deposit(&self, proposal_id: ProposalId) { - self.require_caller_not_self(); let caller = self.blockchain().get_caller(); match self.get_proposal_status(proposal_id) { @@ -272,7 +267,6 @@ pub trait GovernanceV2: // Burn remaining fees let remaining_fee = proposal.fee_payment.amount.clone() - refund_amount.clone(); - if remaining_fee != BigUint::zero() { self.send().esdt_local_burn( &proposal.fee_payment.token_identifier, @@ -280,7 +274,7 @@ pub trait GovernanceV2: &remaining_fee, ); } - // Mark this proposal - fee withdrawn + // Mark this proposal that fee is withdrawn self.refund_proposal_fee(&proposal, &refund_amount); proposal.fee_withdrawn = true; self.proposals().set(proposal_id, &proposal); diff --git a/energy-integration/governance-v2/src/views.rs b/energy-integration/governance-v2/src/views.rs index c6eb36916..79b33c20c 100644 --- a/energy-integration/governance-v2/src/views.rs +++ b/energy-integration/governance-v2/src/views.rs @@ -9,7 +9,6 @@ use crate::{ pub trait ViewsModule: crate::proposal_storage::ProposalStorageModule + crate::configurable::ConfigurablePropertiesModule - + crate::caller_check::CallerCheckModule + permissions_module::PermissionsModule + energy_query::EnergyQueryModule { From a14de934fa1d97e280f0893e2672305c9506fe8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Fri, 8 Sep 2023 16:51:34 +0300 Subject: [PATCH 072/213] Framework upgrade 0.43.3 Governance-v2: use esdt_non_zero_local_burn --- common/common_errors/Cargo.toml | 2 +- common/common_structs/Cargo.toml | 2 +- common/modules/farm/config/Cargo.toml | 2 +- common/modules/farm/contexts/Cargo.toml | 4 ++-- common/modules/farm/events/Cargo.toml | 2 +- common/modules/farm/farm_base_impl/Cargo.toml | 6 +++--- common/modules/farm/farm_token/Cargo.toml | 4 ++-- common/modules/farm/farm_token_merge/Cargo.toml | 4 ++-- common/modules/farm/rewards/Cargo.toml | 4 ++-- .../modules/legacy_token_decode_module/Cargo.toml | 2 +- common/modules/locking_module/Cargo.toml | 2 +- common/modules/math/Cargo.toml | 2 +- common/modules/pausable/Cargo.toml | 2 +- common/modules/permissions_module/Cargo.toml | 2 +- common/modules/sc_whitelist_module/Cargo.toml | 2 +- common/modules/token_merge_helper/Cargo.toml | 2 +- common/modules/token_send/Cargo.toml | 2 +- common/modules/utils/Cargo.toml | 2 +- common/traits/fixed-supply-token/Cargo.toml | 2 +- common/traits/mergeable/Cargo.toml | 2 +- common/traits/unwrappable/Cargo.toml | 2 +- dex/Cargo.toml | 6 +++--- dex/farm-with-locked-rewards/Cargo.toml | 6 +++--- dex/farm-with-locked-rewards/wasm/Cargo.toml | 2 +- dex/farm/Cargo.toml | 6 +++--- dex/farm/wasm/Cargo.toml | 2 +- dex/fuzz/Cargo.toml | 4 ++-- dex/governance/Cargo.toml | 4 ++-- dex/governance/wasm/Cargo.toml | 2 +- dex/pair-mock/Cargo.toml | 4 ++-- dex/pair-mock/wasm/Cargo.toml | 2 +- dex/pair/Cargo.toml | 4 ++-- dex/pair/wasm-pair-full/Cargo.toml | 2 +- dex/pair/wasm-safe-price-view/Cargo.toml | 2 +- dex/pair/wasm/Cargo.toml | 2 +- dex/price-discovery/Cargo.toml | 6 +++--- dex/price-discovery/wasm/Cargo.toml | 2 +- dex/proxy-deployer/Cargo.toml | 4 ++-- dex/proxy-deployer/wasm/Cargo.toml | 2 +- dex/router/Cargo.toml | 4 ++-- dex/router/wasm/Cargo.toml | 2 +- .../common-modules/energy-query/Cargo.toml | 2 +- .../common-modules/week-timekeeping/Cargo.toml | 2 +- .../weekly-rewards-splitting/Cargo.toml | 2 +- energy-integration/common-types/Cargo.toml | 2 +- energy-integration/energy-factory-mock/Cargo.toml | 4 ++-- .../energy-factory-mock/wasm/Cargo.toml | 2 +- energy-integration/energy-update/Cargo.toml | 6 +++--- energy-integration/energy-update/wasm/Cargo.toml | 2 +- energy-integration/farm-boosted-yields/Cargo.toml | 2 +- energy-integration/fees-collector/Cargo.toml | 6 +++--- energy-integration/fees-collector/wasm/Cargo.toml | 2 +- energy-integration/governance-v2/Cargo.toml | 4 ++-- energy-integration/governance-v2/src/lib.rs | 13 ++++++------- energy-integration/governance-v2/wasm/Cargo.toml | 2 +- farm-staking/farm-staking-proxy/Cargo.toml | 6 +++--- farm-staking/farm-staking-proxy/wasm/Cargo.toml | 2 +- farm-staking/farm-staking/Cargo.toml | 6 +++--- farm-staking/farm-staking/wasm/Cargo.toml | 2 +- farm-staking/metabonding-staking/Cargo.toml | 6 +++--- farm-staking/metabonding-staking/wasm/Cargo.toml | 2 +- locked-asset/Cargo.toml | 6 +++--- locked-asset/distribution/Cargo.toml | 4 ++-- locked-asset/distribution/wasm/Cargo.toml | 2 +- locked-asset/energy-factory/Cargo.toml | 6 +++--- locked-asset/energy-factory/wasm/Cargo.toml | 2 +- locked-asset/factory/Cargo.toml | 6 +++--- locked-asset/factory/wasm/Cargo.toml | 2 +- locked-asset/lkmex-transfer/Cargo.toml | 6 +++--- locked-asset/lkmex-transfer/wasm/Cargo.toml | 2 +- locked-asset/locked-token-wrapper/Cargo.toml | 6 +++--- locked-asset/locked-token-wrapper/wasm/Cargo.toml | 2 +- locked-asset/proxy_dex/Cargo.toml | 6 +++--- locked-asset/proxy_dex/wasm/Cargo.toml | 2 +- locked-asset/simple-lock-whitelist/Cargo.toml | 6 +++--- locked-asset/simple-lock-whitelist/wasm/Cargo.toml | 2 +- locked-asset/simple-lock/Cargo.toml | 6 +++--- locked-asset/simple-lock/wasm/Cargo.toml | 2 +- locked-asset/token-unstake/Cargo.toml | 6 +++--- locked-asset/token-unstake/wasm/Cargo.toml | 2 +- pause-all/Cargo.toml | 6 +++--- pause-all/wasm/Cargo.toml | 2 +- 82 files changed, 140 insertions(+), 141 deletions(-) diff --git a/common/common_errors/Cargo.toml b/common/common_errors/Cargo.toml index 499450be3..cee6021cb 100644 --- a/common/common_errors/Cargo.toml +++ b/common/common_errors/Cargo.toml @@ -7,5 +7,5 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/common_structs/Cargo.toml b/common/common_structs/Cargo.toml index f1ab9094c..967fb2174 100644 --- a/common/common_structs/Cargo.toml +++ b/common/common_structs/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] [dependencies.mergeable] diff --git a/common/modules/farm/config/Cargo.toml b/common/modules/farm/config/Cargo.toml index 2bf5d119e..c1382c3a2 100644 --- a/common/modules/farm/config/Cargo.toml +++ b/common/modules/farm/config/Cargo.toml @@ -22,5 +22,5 @@ path = "../../pausable" path = "../../permissions_module" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/farm/contexts/Cargo.toml b/common/modules/farm/contexts/Cargo.toml index 8ab7c0cd5..61326685e 100644 --- a/common/modules/farm/contexts/Cargo.toml +++ b/common/modules/farm/contexts/Cargo.toml @@ -34,8 +34,8 @@ path = "../../pausable" path = "../../permissions_module" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.43.2" +version = "=0.43.3" diff --git a/common/modules/farm/events/Cargo.toml b/common/modules/farm/events/Cargo.toml index b19892e0b..14f710818 100644 --- a/common/modules/farm/events/Cargo.toml +++ b/common/modules/farm/events/Cargo.toml @@ -13,5 +13,5 @@ path = "../../../common_structs" path = "../contexts" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/farm/farm_base_impl/Cargo.toml b/common/modules/farm/farm_base_impl/Cargo.toml index e38957230..e303dc21f 100644 --- a/common/modules/farm/farm_base_impl/Cargo.toml +++ b/common/modules/farm/farm_base_impl/Cargo.toml @@ -49,10 +49,10 @@ path = "../../../traits/mergeable" path = "../../../traits/fixed-supply-token" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.43.2" +version = "=0.43.3" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.2" +version = "=0.43.3" diff --git a/common/modules/farm/farm_token/Cargo.toml b/common/modules/farm/farm_token/Cargo.toml index 27579b189..abcf49db3 100644 --- a/common/modules/farm/farm_token/Cargo.toml +++ b/common/modules/farm/farm_token/Cargo.toml @@ -25,8 +25,8 @@ path = "../../pausable" path = "../../permissions_module" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.43.2" +version = "=0.43.3" diff --git a/common/modules/farm/farm_token_merge/Cargo.toml b/common/modules/farm/farm_token_merge/Cargo.toml index 3458a9daa..a73eef274 100644 --- a/common/modules/farm/farm_token_merge/Cargo.toml +++ b/common/modules/farm/farm_token_merge/Cargo.toml @@ -22,8 +22,8 @@ path = "../../token_merge_helper" path = "../farm_token" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.43.2" +version = "=0.43.3" diff --git a/common/modules/farm/rewards/Cargo.toml b/common/modules/farm/rewards/Cargo.toml index 954b95342..0e3361f30 100644 --- a/common/modules/farm/rewards/Cargo.toml +++ b/common/modules/farm/rewards/Cargo.toml @@ -28,8 +28,8 @@ path = "../../pausable" path = "../../permissions_module" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.43.2" +version = "=0.43.3" diff --git a/common/modules/legacy_token_decode_module/Cargo.toml b/common/modules/legacy_token_decode_module/Cargo.toml index 50d697c77..7742f8d70 100644 --- a/common/modules/legacy_token_decode_module/Cargo.toml +++ b/common/modules/legacy_token_decode_module/Cargo.toml @@ -7,7 +7,7 @@ edition = "2018" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] [dependencies.common_structs] diff --git a/common/modules/locking_module/Cargo.toml b/common/modules/locking_module/Cargo.toml index 6dbd6e89c..2627818d2 100644 --- a/common/modules/locking_module/Cargo.toml +++ b/common/modules/locking_module/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] [dependencies.simple-lock] diff --git a/common/modules/math/Cargo.toml b/common/modules/math/Cargo.toml index d591a6aa5..212fbea3e 100644 --- a/common/modules/math/Cargo.toml +++ b/common/modules/math/Cargo.toml @@ -7,5 +7,5 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/pausable/Cargo.toml b/common/modules/pausable/Cargo.toml index c332aed4c..91c293650 100644 --- a/common/modules/pausable/Cargo.toml +++ b/common/modules/pausable/Cargo.toml @@ -10,5 +10,5 @@ path = "src/pausable.rs" path = "../permissions_module" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/permissions_module/Cargo.toml b/common/modules/permissions_module/Cargo.toml index ce9642965..3c016d8ce 100644 --- a/common/modules/permissions_module/Cargo.toml +++ b/common/modules/permissions_module/Cargo.toml @@ -14,5 +14,5 @@ bitflags = "1.3.2" path = "../../common_errors" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/sc_whitelist_module/Cargo.toml b/common/modules/sc_whitelist_module/Cargo.toml index 711661188..35dd61be5 100644 --- a/common/modules/sc_whitelist_module/Cargo.toml +++ b/common/modules/sc_whitelist_module/Cargo.toml @@ -10,5 +10,5 @@ path = "src/sc_whitelist_module.rs" path = "../../common_errors" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/token_merge_helper/Cargo.toml b/common/modules/token_merge_helper/Cargo.toml index 56585e019..80d3bcb6e 100644 --- a/common/modules/token_merge_helper/Cargo.toml +++ b/common/modules/token_merge_helper/Cargo.toml @@ -10,5 +10,5 @@ path = "src/lib.rs" path = "../../common_errors" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/token_send/Cargo.toml b/common/modules/token_send/Cargo.toml index bff76dcd0..5e155af70 100644 --- a/common/modules/token_send/Cargo.toml +++ b/common/modules/token_send/Cargo.toml @@ -13,5 +13,5 @@ path = "../../common_structs" path = "../../common_errors" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/utils/Cargo.toml b/common/modules/utils/Cargo.toml index 0b229c058..406bce549 100644 --- a/common/modules/utils/Cargo.toml +++ b/common/modules/utils/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] [dependencies.common_structs] diff --git a/common/traits/fixed-supply-token/Cargo.toml b/common/traits/fixed-supply-token/Cargo.toml index c8a2679f9..7922633a1 100644 --- a/common/traits/fixed-supply-token/Cargo.toml +++ b/common/traits/fixed-supply-token/Cargo.toml @@ -7,4 +7,4 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" diff --git a/common/traits/mergeable/Cargo.toml b/common/traits/mergeable/Cargo.toml index fce702ff2..d8e76fa93 100644 --- a/common/traits/mergeable/Cargo.toml +++ b/common/traits/mergeable/Cargo.toml @@ -7,5 +7,5 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/traits/unwrappable/Cargo.toml b/common/traits/unwrappable/Cargo.toml index 5ea86b7fb..01cf23ef0 100644 --- a/common/traits/unwrappable/Cargo.toml +++ b/common/traits/unwrappable/Cargo.toml @@ -7,5 +7,5 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] diff --git a/dex/Cargo.toml b/dex/Cargo.toml index 7bf3dc375..b62358245 100644 --- a/dex/Cargo.toml +++ b/dex/Cargo.toml @@ -4,17 +4,17 @@ version = "0.0.0" edition = "2021" publish = false [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-modules] -version = "=0.43.2" +version = "=0.43.3" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.2" +version = "=0.43.3" [dev-dependencies.config] path = "../common/modules/farm/config" diff --git a/dex/farm-with-locked-rewards/Cargo.toml b/dex/farm-with-locked-rewards/Cargo.toml index e111ba646..b250d12ad 100644 --- a/dex/farm-with-locked-rewards/Cargo.toml +++ b/dex/farm-with-locked-rewards/Cargo.toml @@ -74,17 +74,17 @@ path = "../../locked-asset/energy-factory" path = "../../energy-integration/common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.43.2" +version = "=0.43.3" [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.2" +version = "=0.43.3" [dev-dependencies.simple-lock] path = "../../locked-asset/simple-lock" diff --git a/dex/farm-with-locked-rewards/wasm/Cargo.toml b/dex/farm-with-locked-rewards/wasm/Cargo.toml index 7a33ece2d..6abffb966 100644 --- a/dex/farm-with-locked-rewards/wasm/Cargo.toml +++ b/dex/farm-with-locked-rewards/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.2" +version = "=0.43.3" diff --git a/dex/farm/Cargo.toml b/dex/farm/Cargo.toml index c75ce1fcb..b3df661f7 100644 --- a/dex/farm/Cargo.toml +++ b/dex/farm/Cargo.toml @@ -68,11 +68,11 @@ path = "../../energy-integration/common-modules/weekly-rewards-splitting" path = "../../energy-integration/common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.43.2" +version = "=0.43.3" [dev-dependencies] num-bigint = "0.4.2" @@ -81,7 +81,7 @@ num-bigint = "0.4.2" path = "../../energy-integration/energy-update" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.2" +version = "=0.43.3" [dev-dependencies.energy-factory-mock] path = "../../energy-integration/energy-factory-mock" diff --git a/dex/farm/wasm/Cargo.toml b/dex/farm/wasm/Cargo.toml index c43c76ab2..1e0b0a134 100644 --- a/dex/farm/wasm/Cargo.toml +++ b/dex/farm/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.2" +version = "=0.43.3" diff --git a/dex/fuzz/Cargo.toml b/dex/fuzz/Cargo.toml index bd8bc2d8e..34bbfa809 100644 --- a/dex/fuzz/Cargo.toml +++ b/dex/fuzz/Cargo.toml @@ -12,11 +12,11 @@ num-bigint = "0.4.2" rand = "0.8.4" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-scenario] -version = "=0.43.2" +version = "=0.43.3" [dependencies.pausable] path = "../../common/modules/pausable" diff --git a/dex/governance/Cargo.toml b/dex/governance/Cargo.toml index 5ceb95c9d..b38e75cf9 100644 --- a/dex/governance/Cargo.toml +++ b/dex/governance/Cargo.toml @@ -8,14 +8,14 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.2" +version = "=0.43.3" [dev-dependencies.pair-mock] path = "../pair-mock" diff --git a/dex/governance/wasm/Cargo.toml b/dex/governance/wasm/Cargo.toml index 964b6bf7c..8abd3ad55 100644 --- a/dex/governance/wasm/Cargo.toml +++ b/dex/governance/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.2" +version = "=0.43.3" diff --git a/dex/pair-mock/Cargo.toml b/dex/pair-mock/Cargo.toml index a335ee5da..d7c805e2f 100644 --- a/dex/pair-mock/Cargo.toml +++ b/dex/pair-mock/Cargo.toml @@ -11,11 +11,11 @@ path = "src/pair.rs" path = "../../common/common_errors" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] [dependencies.itertools] version = "0.10.1" default-features = false [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.2" +version = "=0.43.3" diff --git a/dex/pair-mock/wasm/Cargo.toml b/dex/pair-mock/wasm/Cargo.toml index 0e43165cd..d3c6f1947 100644 --- a/dex/pair-mock/wasm/Cargo.toml +++ b/dex/pair-mock/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.2" +version = "=0.43.3" diff --git a/dex/pair/Cargo.toml b/dex/pair/Cargo.toml index 32c1fae21..e3e80088c 100644 --- a/dex/pair/Cargo.toml +++ b/dex/pair/Cargo.toml @@ -33,11 +33,11 @@ version = "0.10.1" default-features = false [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.2" +version = "=0.43.3" diff --git a/dex/pair/wasm-pair-full/Cargo.toml b/dex/pair/wasm-pair-full/Cargo.toml index b9e1841c2..5d2901b79 100644 --- a/dex/pair/wasm-pair-full/Cargo.toml +++ b/dex/pair/wasm-pair-full/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.2" +version = "=0.43.3" diff --git a/dex/pair/wasm-safe-price-view/Cargo.toml b/dex/pair/wasm-safe-price-view/Cargo.toml index be0fd8731..2c2f6556d 100644 --- a/dex/pair/wasm-safe-price-view/Cargo.toml +++ b/dex/pair/wasm-safe-price-view/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.2" +version = "=0.43.3" diff --git a/dex/pair/wasm/Cargo.toml b/dex/pair/wasm/Cargo.toml index 02438d6bc..b94221364 100644 --- a/dex/pair/wasm/Cargo.toml +++ b/dex/pair/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.2" +version = "=0.43.3" diff --git a/dex/price-discovery/Cargo.toml b/dex/price-discovery/Cargo.toml index d62a52636..043f18403 100644 --- a/dex/price-discovery/Cargo.toml +++ b/dex/price-discovery/Cargo.toml @@ -12,11 +12,11 @@ path = "src/lib.rs" hex-literal = "0.3.1" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.43.2" +version = "=0.43.3" [dependencies.locking_module] path = "../../common/modules/locking_module" @@ -30,4 +30,4 @@ hex = "0.4" path = "../../locked-asset/simple-lock" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.2" +version = "=0.43.3" diff --git a/dex/price-discovery/wasm/Cargo.toml b/dex/price-discovery/wasm/Cargo.toml index 721537a54..70b97b365 100644 --- a/dex/price-discovery/wasm/Cargo.toml +++ b/dex/price-discovery/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.2" +version = "=0.43.3" diff --git a/dex/proxy-deployer/Cargo.toml b/dex/proxy-deployer/Cargo.toml index 85f723f1e..b9ed729a9 100644 --- a/dex/proxy-deployer/Cargo.toml +++ b/dex/proxy-deployer/Cargo.toml @@ -20,11 +20,11 @@ path = "../../common/modules/farm/config" path = "../../common/modules/farm/farm_token" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.2" +version = "=0.43.3" diff --git a/dex/proxy-deployer/wasm/Cargo.toml b/dex/proxy-deployer/wasm/Cargo.toml index 4cf22608e..76774d56a 100644 --- a/dex/proxy-deployer/wasm/Cargo.toml +++ b/dex/proxy-deployer/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.2" +version = "=0.43.3" diff --git a/dex/router/Cargo.toml b/dex/router/Cargo.toml index 401e90b89..bf147cedd 100644 --- a/dex/router/Cargo.toml +++ b/dex/router/Cargo.toml @@ -14,7 +14,7 @@ path = "../../common/modules/token_send" path = "../../common/modules/pausable" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] [dependencies.pair] @@ -26,4 +26,4 @@ path = "../../common/modules/locking_module" [dependencies.simple-lock] path = "../../locked-asset/simple-lock" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.2" +version = "=0.43.3" diff --git a/dex/router/wasm/Cargo.toml b/dex/router/wasm/Cargo.toml index f2a456292..02a08c8a8 100644 --- a/dex/router/wasm/Cargo.toml +++ b/dex/router/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.2" +version = "=0.43.3" diff --git a/energy-integration/common-modules/energy-query/Cargo.toml b/energy-integration/common-modules/energy-query/Cargo.toml index e4a52097c..1a87d9b18 100644 --- a/energy-integration/common-modules/energy-query/Cargo.toml +++ b/energy-integration/common-modules/energy-query/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] [dependencies.energy-factory] diff --git a/energy-integration/common-modules/week-timekeeping/Cargo.toml b/energy-integration/common-modules/week-timekeeping/Cargo.toml index 805abb126..7ee59bf06 100644 --- a/energy-integration/common-modules/week-timekeeping/Cargo.toml +++ b/energy-integration/common-modules/week-timekeeping/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] [dependencies.common-types] diff --git a/energy-integration/common-modules/weekly-rewards-splitting/Cargo.toml b/energy-integration/common-modules/weekly-rewards-splitting/Cargo.toml index 4cc3bb2c3..f2bf32dfb 100644 --- a/energy-integration/common-modules/weekly-rewards-splitting/Cargo.toml +++ b/energy-integration/common-modules/weekly-rewards-splitting/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] [dependencies.energy-query] diff --git a/energy-integration/common-types/Cargo.toml b/energy-integration/common-types/Cargo.toml index 43fdc4687..abaa00aa4 100644 --- a/energy-integration/common-types/Cargo.toml +++ b/energy-integration/common-types/Cargo.toml @@ -7,5 +7,5 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] diff --git a/energy-integration/energy-factory-mock/Cargo.toml b/energy-integration/energy-factory-mock/Cargo.toml index 2268f1472..1333cfccf 100644 --- a/energy-integration/energy-factory-mock/Cargo.toml +++ b/energy-integration/energy-factory-mock/Cargo.toml @@ -11,7 +11,7 @@ path = "src/lib.rs" path = "../common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.2" +version = "=0.43.3" diff --git a/energy-integration/energy-factory-mock/wasm/Cargo.toml b/energy-integration/energy-factory-mock/wasm/Cargo.toml index ec16f4fae..14191c202 100644 --- a/energy-integration/energy-factory-mock/wasm/Cargo.toml +++ b/energy-integration/energy-factory-mock/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.2" +version = "=0.43.3" diff --git a/energy-integration/energy-update/Cargo.toml b/energy-integration/energy-update/Cargo.toml index 09d479864..994ea2f20 100644 --- a/energy-integration/energy-update/Cargo.toml +++ b/energy-integration/energy-update/Cargo.toml @@ -8,11 +8,11 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.43.2" +version = "=0.43.3" [dependencies.farm] path = "../../dex/farm" @@ -24,4 +24,4 @@ path = "../common-modules/weekly-rewards-splitting" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.2" +version = "=0.43.3" diff --git a/energy-integration/energy-update/wasm/Cargo.toml b/energy-integration/energy-update/wasm/Cargo.toml index 5ccada06e..a9ee6ddde 100644 --- a/energy-integration/energy-update/wasm/Cargo.toml +++ b/energy-integration/energy-update/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.2" +version = "=0.43.3" diff --git a/energy-integration/farm-boosted-yields/Cargo.toml b/energy-integration/farm-boosted-yields/Cargo.toml index 443883813..c8ee30757 100644 --- a/energy-integration/farm-boosted-yields/Cargo.toml +++ b/energy-integration/farm-boosted-yields/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] [dependencies.config] diff --git a/energy-integration/fees-collector/Cargo.toml b/energy-integration/fees-collector/Cargo.toml index 1c01cc70f..adde4d6a5 100644 --- a/energy-integration/fees-collector/Cargo.toml +++ b/energy-integration/fees-collector/Cargo.toml @@ -8,11 +8,11 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.43.2" +version = "=0.43.3" [dependencies.energy-query] path = "../common-modules/energy-query" @@ -48,7 +48,7 @@ path = "../../common/common_errors" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.2" +version = "=0.43.3" [dev-dependencies.sc_whitelist_module] path = "../../common/modules/sc_whitelist_module" diff --git a/energy-integration/fees-collector/wasm/Cargo.toml b/energy-integration/fees-collector/wasm/Cargo.toml index 4c46ff2ee..5acfe555f 100644 --- a/energy-integration/fees-collector/wasm/Cargo.toml +++ b/energy-integration/fees-collector/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.2" +version = "=0.43.3" diff --git a/energy-integration/governance-v2/Cargo.toml b/energy-integration/governance-v2/Cargo.toml index ab9768c6b..063b9dab9 100644 --- a/energy-integration/governance-v2/Cargo.toml +++ b/energy-integration/governance-v2/Cargo.toml @@ -11,7 +11,7 @@ path = "src/lib.rs" path = "../common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] [dependencies.permissions_module] @@ -27,7 +27,7 @@ path = "../common-modules/weekly-rewards-splitting" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.2" +version = "=0.43.3" [dev-dependencies.energy-factory-mock] path = "../energy-factory-mock" diff --git a/energy-integration/governance-v2/src/lib.rs b/energy-integration/governance-v2/src/lib.rs index 4c4fe79fb..bdeba1326 100644 --- a/energy-integration/governance-v2/src/lib.rs +++ b/energy-integration/governance-v2/src/lib.rs @@ -267,13 +267,12 @@ pub trait GovernanceV2: // Burn remaining fees let remaining_fee = proposal.fee_payment.amount.clone() - refund_amount.clone(); - if remaining_fee != BigUint::zero() { - self.send().esdt_local_burn( - &proposal.fee_payment.token_identifier, - proposal.fee_payment.token_nonce, - &remaining_fee, - ); - } + self.send().esdt_non_zero_local_burn( + &proposal.fee_payment.token_identifier, + proposal.fee_payment.token_nonce, + &remaining_fee, + ); + // Mark this proposal that fee is withdrawn self.refund_proposal_fee(&proposal, &refund_amount); proposal.fee_withdrawn = true; diff --git a/energy-integration/governance-v2/wasm/Cargo.toml b/energy-integration/governance-v2/wasm/Cargo.toml index 767e42380..194776b0a 100644 --- a/energy-integration/governance-v2/wasm/Cargo.toml +++ b/energy-integration/governance-v2/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.2" +version = "=0.43.3" diff --git a/farm-staking/farm-staking-proxy/Cargo.toml b/farm-staking/farm-staking-proxy/Cargo.toml index a9fba8db2..088edab13 100644 --- a/farm-staking/farm-staking-proxy/Cargo.toml +++ b/farm-staking/farm-staking-proxy/Cargo.toml @@ -12,11 +12,11 @@ path = "src/lib.rs" hex-literal = "0.3.1" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.43.2" +version = "=0.43.3" [dependencies.farm] path = "../../dex/farm" @@ -61,7 +61,7 @@ path = "../../common/modules/sc_whitelist_module" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.2" +version = "=0.43.3" [dev-dependencies.farm_token] path = "../../common/modules/farm/farm_token" diff --git a/farm-staking/farm-staking-proxy/wasm/Cargo.toml b/farm-staking/farm-staking-proxy/wasm/Cargo.toml index 5e6c97a92..cf5c28357 100644 --- a/farm-staking/farm-staking-proxy/wasm/Cargo.toml +++ b/farm-staking/farm-staking-proxy/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.2" +version = "=0.43.3" diff --git a/farm-staking/farm-staking/Cargo.toml b/farm-staking/farm-staking/Cargo.toml index 48523fc76..9884e34ce 100644 --- a/farm-staking/farm-staking/Cargo.toml +++ b/farm-staking/farm-staking/Cargo.toml @@ -77,14 +77,14 @@ path = "../../common/common_structs" path = "../../common/common_errors" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.43.2" +version = "=0.43.3" [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.2" +version = "=0.43.3" diff --git a/farm-staking/farm-staking/wasm/Cargo.toml b/farm-staking/farm-staking/wasm/Cargo.toml index 8a48c1058..946b86b9b 100644 --- a/farm-staking/farm-staking/wasm/Cargo.toml +++ b/farm-staking/farm-staking/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.2" +version = "=0.43.3" diff --git a/farm-staking/metabonding-staking/Cargo.toml b/farm-staking/metabonding-staking/Cargo.toml index d618306bf..76fe4492e 100644 --- a/farm-staking/metabonding-staking/Cargo.toml +++ b/farm-staking/metabonding-staking/Cargo.toml @@ -8,11 +8,11 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.43.2" +version = "=0.43.3" [dependencies.factory] path = "../../locked-asset/factory" @@ -21,7 +21,7 @@ path = "../../locked-asset/factory" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.2" +version = "=0.43.3" [dev-dependencies.common_structs] path = "../../common/common_structs" diff --git a/farm-staking/metabonding-staking/wasm/Cargo.toml b/farm-staking/metabonding-staking/wasm/Cargo.toml index f4fab82b3..3765823a6 100644 --- a/farm-staking/metabonding-staking/wasm/Cargo.toml +++ b/farm-staking/metabonding-staking/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.2" +version = "=0.43.3" diff --git a/locked-asset/Cargo.toml b/locked-asset/Cargo.toml index 8c27ab608..c54180a85 100644 --- a/locked-asset/Cargo.toml +++ b/locked-asset/Cargo.toml @@ -4,7 +4,7 @@ version = "0.0.0" edition = "2021" publish = false [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] [dependencies.farm] @@ -49,7 +49,7 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-modules] -version = "=0.43.2" +version = "=0.43.3" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.2" +version = "=0.43.3" diff --git a/locked-asset/distribution/Cargo.toml b/locked-asset/distribution/Cargo.toml index f40090c14..56cc20ec2 100644 --- a/locked-asset/distribution/Cargo.toml +++ b/locked-asset/distribution/Cargo.toml @@ -13,7 +13,7 @@ path = "../../common/common_structs" path = "../factory" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.2" +version = "=0.43.3" diff --git a/locked-asset/distribution/wasm/Cargo.toml b/locked-asset/distribution/wasm/Cargo.toml index bb3466e11..9be455a14 100644 --- a/locked-asset/distribution/wasm/Cargo.toml +++ b/locked-asset/distribution/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.2" +version = "=0.43.3" diff --git a/locked-asset/energy-factory/Cargo.toml b/locked-asset/energy-factory/Cargo.toml index a6aa2276f..0fa92855a 100644 --- a/locked-asset/energy-factory/Cargo.toml +++ b/locked-asset/energy-factory/Cargo.toml @@ -32,11 +32,11 @@ path = "../../common/traits/unwrappable" path = "../../common/modules/legacy_token_decode_module" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.43.2" +version = "=0.43.3" [dev-dependencies] num-bigint = "0.4.2" @@ -44,4 +44,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.2" +version = "=0.43.3" diff --git a/locked-asset/energy-factory/wasm/Cargo.toml b/locked-asset/energy-factory/wasm/Cargo.toml index 64c23e954..1ffbf327b 100644 --- a/locked-asset/energy-factory/wasm/Cargo.toml +++ b/locked-asset/energy-factory/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.2" +version = "=0.43.3" diff --git a/locked-asset/factory/Cargo.toml b/locked-asset/factory/Cargo.toml index c353b9c9d..b0771ada1 100644 --- a/locked-asset/factory/Cargo.toml +++ b/locked-asset/factory/Cargo.toml @@ -26,11 +26,11 @@ path = "../../common/modules/token_merge_helper" path = "../energy-factory" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.43.2" +version = "=0.43.3" [dependencies.arrayvec] version = "0.7.1" @@ -49,4 +49,4 @@ hex = "0.4" path = "../simple-lock" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.2" +version = "=0.43.3" diff --git a/locked-asset/factory/wasm/Cargo.toml b/locked-asset/factory/wasm/Cargo.toml index 2d8adf3c9..591bb319a 100644 --- a/locked-asset/factory/wasm/Cargo.toml +++ b/locked-asset/factory/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.2" +version = "=0.43.3" diff --git a/locked-asset/lkmex-transfer/Cargo.toml b/locked-asset/lkmex-transfer/Cargo.toml index 05f05ce18..b7b076233 100644 --- a/locked-asset/lkmex-transfer/Cargo.toml +++ b/locked-asset/lkmex-transfer/Cargo.toml @@ -29,14 +29,14 @@ path = "../energy-factory" path = "../../energy-integration/common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.2" +version = "=0.43.3" [dev-dependencies.multiversx-sc-modules] -version = "=0.43.2" +version = "=0.43.3" diff --git a/locked-asset/lkmex-transfer/wasm/Cargo.toml b/locked-asset/lkmex-transfer/wasm/Cargo.toml index 7555038a6..7ca9c97ef 100644 --- a/locked-asset/lkmex-transfer/wasm/Cargo.toml +++ b/locked-asset/lkmex-transfer/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.2" +version = "=0.43.3" diff --git a/locked-asset/locked-token-wrapper/Cargo.toml b/locked-asset/locked-token-wrapper/Cargo.toml index 63c4884e1..576375026 100644 --- a/locked-asset/locked-token-wrapper/Cargo.toml +++ b/locked-asset/locked-token-wrapper/Cargo.toml @@ -8,10 +8,10 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" [dependencies.multiversx-sc-modules] -version = "=0.43.2" +version = "=0.43.3" [dependencies.utils] path = "../../common/modules/utils" @@ -43,4 +43,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.2" +version = "=0.43.3" diff --git a/locked-asset/locked-token-wrapper/wasm/Cargo.toml b/locked-asset/locked-token-wrapper/wasm/Cargo.toml index 198c12da9..31488c7c5 100644 --- a/locked-asset/locked-token-wrapper/wasm/Cargo.toml +++ b/locked-asset/locked-token-wrapper/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.2" +version = "=0.43.3" diff --git a/locked-asset/proxy_dex/Cargo.toml b/locked-asset/proxy_dex/Cargo.toml index 1038cdffa..2bbeec0d2 100644 --- a/locked-asset/proxy_dex/Cargo.toml +++ b/locked-asset/proxy_dex/Cargo.toml @@ -44,11 +44,11 @@ path = "../../common/traits/mergeable" path = "../../common/traits/fixed-supply-token" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.43.2" +version = "=0.43.3" [dependencies.energy-factory] path = "../energy-factory" @@ -65,7 +65,7 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.2" +version = "=0.43.3" [dev-dependencies.pausable] path = "../../common/modules/pausable" diff --git a/locked-asset/proxy_dex/wasm/Cargo.toml b/locked-asset/proxy_dex/wasm/Cargo.toml index 440f1a190..3ca1df49d 100644 --- a/locked-asset/proxy_dex/wasm/Cargo.toml +++ b/locked-asset/proxy_dex/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.2" +version = "=0.43.3" diff --git a/locked-asset/simple-lock-whitelist/Cargo.toml b/locked-asset/simple-lock-whitelist/Cargo.toml index e46c6f9d0..08671b883 100644 --- a/locked-asset/simple-lock-whitelist/Cargo.toml +++ b/locked-asset/simple-lock-whitelist/Cargo.toml @@ -14,11 +14,11 @@ path = "../simple-lock" path = "../../common/modules/utils" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.43.2" +version = "=0.43.3" [dev-dependencies] num-bigint = "0.4.2" @@ -26,4 +26,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.2" +version = "=0.43.3" diff --git a/locked-asset/simple-lock-whitelist/wasm/Cargo.toml b/locked-asset/simple-lock-whitelist/wasm/Cargo.toml index 638f49b8c..d89132156 100644 --- a/locked-asset/simple-lock-whitelist/wasm/Cargo.toml +++ b/locked-asset/simple-lock-whitelist/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.2" +version = "=0.43.3" diff --git a/locked-asset/simple-lock/Cargo.toml b/locked-asset/simple-lock/Cargo.toml index ca79b9b58..771d60639 100644 --- a/locked-asset/simple-lock/Cargo.toml +++ b/locked-asset/simple-lock/Cargo.toml @@ -8,11 +8,11 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.43.2" +version = "=0.43.3" [dependencies.common_structs] path = "../../common/common_structs" @@ -23,4 +23,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.2" +version = "=0.43.3" diff --git a/locked-asset/simple-lock/wasm/Cargo.toml b/locked-asset/simple-lock/wasm/Cargo.toml index 952e46e5d..12f9cf76d 100644 --- a/locked-asset/simple-lock/wasm/Cargo.toml +++ b/locked-asset/simple-lock/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.2" +version = "=0.43.3" diff --git a/locked-asset/token-unstake/Cargo.toml b/locked-asset/token-unstake/Cargo.toml index 303074c0d..95966aea4 100644 --- a/locked-asset/token-unstake/Cargo.toml +++ b/locked-asset/token-unstake/Cargo.toml @@ -8,7 +8,7 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] [dependencies.mergeable] @@ -38,7 +38,7 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.2" +version = "=0.43.3" [dev-dependencies.multiversx-sc-modules] -version = "=0.43.2" +version = "=0.43.3" diff --git a/locked-asset/token-unstake/wasm/Cargo.toml b/locked-asset/token-unstake/wasm/Cargo.toml index 1c9a3a43d..494c44b70 100644 --- a/locked-asset/token-unstake/wasm/Cargo.toml +++ b/locked-asset/token-unstake/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.2" +version = "=0.43.3" diff --git a/pause-all/Cargo.toml b/pause-all/Cargo.toml index 182a8459d..538678894 100644 --- a/pause-all/Cargo.toml +++ b/pause-all/Cargo.toml @@ -11,13 +11,13 @@ path = "src/lib.rs" path = "../common/modules/pausable" [dependencies.multiversx-sc] -version = "=0.43.2" +version = "=0.43.3" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.43.2" +version = "=0.43.3" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.2" +version = "=0.43.3" [dev-dependencies.farm] path = "../dex/farm" diff --git a/pause-all/wasm/Cargo.toml b/pause-all/wasm/Cargo.toml index 5bf81326a..0b22beec3 100644 --- a/pause-all/wasm/Cargo.toml +++ b/pause-all/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.2" +version = "=0.43.3" From 03899ea59a38d97135a3cb1bb9fcae47062253f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Fri, 8 Sep 2023 17:04:27 +0300 Subject: [PATCH 073/213] Framework update dependencies --- dex/farm-with-locked-rewards/wasm/Cargo.lock | 88 +++-------- dex/farm-with-locked-rewards/wasm/src/lib.rs | 133 +++++++++-------- dex/farm/wasm/Cargo.lock | 88 +++-------- dex/farm/wasm/src/lib.rs | 127 ++++++++-------- dex/governance/wasm/Cargo.lock | 84 ++--------- dex/governance/wasm/src/lib.rs | 50 ++++--- dex/pair-mock/wasm/Cargo.lock | 84 ++--------- dex/pair-mock/wasm/src/lib.rs | 12 +- dex/pair/wasm-pair-full/Cargo.lock | 88 +++-------- dex/pair/wasm-pair-full/src/lib.rs | 134 ++++++++--------- dex/pair/wasm-safe-price-view/Cargo.lock | 88 +++-------- dex/pair/wasm-safe-price-view/src/lib.rs | 27 ++-- dex/pair/wasm/Cargo.lock | 88 +++-------- dex/pair/wasm/src/lib.rs | 116 ++++++++------- dex/price-discovery/wasm/Cargo.lock | 88 +++-------- dex/price-discovery/wasm/src/lib.rs | 63 ++++---- dex/proxy-deployer/wasm/Cargo.lock | 88 +++-------- dex/proxy-deployer/wasm/src/lib.rs | 16 +- dex/router/wasm/Cargo.lock | 88 +++-------- dex/router/wasm/src/lib.rs | 74 +++++----- .../energy-factory-mock/wasm/Cargo.lock | 88 +++-------- .../energy-factory-mock/wasm/src/lib.rs | 16 +- .../energy-update/wasm/Cargo.lock | 88 +++-------- .../energy-update/wasm/src/lib.rs | 10 +- .../fees-collector/wasm/Cargo.lock | 88 +++-------- .../fees-collector/wasm/src/lib.rs | 78 +++++----- .../governance-v2/wasm/Cargo.lock | 112 ++++---------- .../governance-v2/wasm/src/lib.rs | 69 ++++----- .../farm-staking-proxy/wasm/Cargo.lock | 88 +++-------- .../farm-staking-proxy/wasm/src/lib.rs | 41 +++--- farm-staking/farm-staking/wasm/Cargo.lock | 88 +++-------- farm-staking/farm-staking/wasm/src/lib.rs | 137 +++++++++--------- .../metabonding-staking/wasm/Cargo.lock | 34 ++--- .../metabonding-staking/wasm/src/lib.rs | 28 ++-- locked-asset/distribution/wasm/Cargo.lock | 34 ++--- locked-asset/distribution/wasm/src/lib.rs | 38 ++--- locked-asset/energy-factory/wasm/Cargo.lock | 88 +++-------- locked-asset/energy-factory/wasm/src/lib.rs | 73 +++++----- locked-asset/factory/wasm/Cargo.lock | 34 ++--- locked-asset/factory/wasm/src/lib.rs | 57 ++++---- locked-asset/lkmex-transfer/wasm/Cargo.lock | 88 +++-------- locked-asset/lkmex-transfer/wasm/src/lib.rs | 30 ++-- .../locked-token-wrapper/wasm/Cargo.lock | 88 +++-------- .../locked-token-wrapper/wasm/src/lib.rs | 25 ++-- locked-asset/proxy_dex/wasm/Cargo.lock | 88 +++-------- locked-asset/proxy_dex/wasm/src/lib.rs | 59 ++++---- .../simple-lock-whitelist/wasm/Cargo.lock | 88 +++-------- .../simple-lock-whitelist/wasm/src/lib.rs | 57 ++++---- locked-asset/simple-lock/wasm/Cargo.lock | 88 +++-------- locked-asset/simple-lock/wasm/src/lib.rs | 47 +++--- locked-asset/token-unstake/wasm/Cargo.lock | 88 +++-------- locked-asset/token-unstake/wasm/src/lib.rs | 28 ++-- pause-all/wasm/Cargo.lock | 88 +++-------- pause-all/wasm/src/lib.rs | 22 +-- 54 files changed, 1308 insertions(+), 2489 deletions(-) diff --git a/dex/farm-with-locked-rewards/wasm/Cargo.lock b/dex/farm-with-locked-rewards/wasm/Cargo.lock index 83649b5f2..102fabc1d 100644 --- a/dex/farm-with-locked-rewards/wasm/Cargo.lock +++ b/dex/farm-with-locked-rewards/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -322,12 +316,6 @@ dependencies = [ "utils", ] -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - [[package]] name = "locking_module" version = "0.0.0" @@ -344,12 +332,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -359,9 +341,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" dependencies = [ "bitflags", "hashbrown", @@ -373,20 +355,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -396,9 +377,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" dependencies = [ "hex", "proc-macro2", @@ -409,21 +390,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -484,18 +464,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.23" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -605,18 +585,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -636,25 +604,3 @@ dependencies = [ "unwrappable", "week-timekeeping", ] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/dex/farm-with-locked-rewards/wasm/src/lib.rs b/dex/farm-with-locked-rewards/wasm/src/lib.rs index d4f9e0650..0daf55ccf 100644 --- a/dex/farm-with-locked-rewards/wasm/src/lib.rs +++ b/dex/farm-with-locked-rewards/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 64 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,68 +21,70 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { farm_with_locked_rewards ( - enterFarm - claimRewards - exitFarm - calculateRewardsForGivenPosition - mergeFarmTokens - startProduceRewards - endProduceRewards - setPerBlockRewardAmount - getRewardPerShare - getRewardReserve - getFarmingTokenId - getRewardTokenId - getPerBlockRewardAmount - getLastRewardBlockNonce - getDivisionSafetyConstant - setLockingScAddress - setLockEpochs - getLockingScAddress - getLockEpochs - registerFarmToken - getFarmTokenId - getFarmTokenSupply - addToPauseWhitelist - removeFromPauseWhitelist - pause - resume - getState - addAdmin - removeAdmin - updateOwnerOrAdmin - getPermissions - addSCAddressToWhitelist - removeSCAddressFromWhitelist - isSCAddressWhitelisted - set_penalty_percent - set_minimum_farming_epochs - set_burn_gas_limit - getPenaltyPercent - getMinimumFarmingEpoch - getBurnGasLimit - getPairContractManagedAddress - setBoostedYieldsRewardsPercentage - collectUndistributedBoostedRewards - getBoostedYieldsRewardsPercentage - getAccumulatedRewardsForWeek - getFarmSupplyForWeek - getRemainingBoostedRewardsToDistribute - getUndistributedBoostedRewards - setBoostedYieldsFactors - getBoostedYieldsFactors - getCurrentWeek - getFirstWeekStartEpoch - getLastActiveWeekForUser - getUserEnergyForWeek - getLastGlobalUpdateWeek - getTotalRewardsForWeek - getTotalEnergyForWeek - getTotalLockedTokensForWeek - updateEnergyForUser - getCurrentClaimProgress - setEnergyFactoryAddress - getEnergyFactoryAddress - callBack + init => init + enterFarm => enter_farm_endpoint + claimRewards => claim_rewards_endpoint + exitFarm => exit_farm_endpoint + calculateRewardsForGivenPosition => calculate_rewards_for_given_position + mergeFarmTokens => merge_farm_tokens_endpoint + startProduceRewards => start_produce_rewards_endpoint + endProduceRewards => end_produce_rewards_endpoint + setPerBlockRewardAmount => set_per_block_rewards_endpoint + getRewardPerShare => reward_per_share + getRewardReserve => reward_reserve + getFarmingTokenId => farming_token_id + getRewardTokenId => reward_token_id + getPerBlockRewardAmount => per_block_reward_amount + getLastRewardBlockNonce => last_reward_block_nonce + getDivisionSafetyConstant => division_safety_constant + setLockingScAddress => set_locking_sc_address + setLockEpochs => set_lock_epochs + getLockingScAddress => locking_sc_address + getLockEpochs => lock_epochs + registerFarmToken => register_farm_token + getFarmTokenId => farm_token + getFarmTokenSupply => farm_token_supply + addToPauseWhitelist => add_to_pause_whitelist + removeFromPauseWhitelist => remove_from_pause_whitelist + pause => pause + resume => resume + getState => state + addAdmin => add_admin_endpoint + removeAdmin => remove_admin_endpoint + updateOwnerOrAdmin => update_owner_or_admin_endpoint + getPermissions => permissions + addSCAddressToWhitelist => add_sc_address_to_whitelist + removeSCAddressFromWhitelist => remove_sc_address_from_whitelist + isSCAddressWhitelisted => is_sc_address_whitelisted + set_penalty_percent => set_penalty_percent + set_minimum_farming_epochs => set_minimum_farming_epochs + set_burn_gas_limit => set_burn_gas_limit + getPenaltyPercent => penalty_percent + getMinimumFarmingEpoch => minimum_farming_epochs + getBurnGasLimit => burn_gas_limit + getPairContractManagedAddress => pair_contract_address + setBoostedYieldsRewardsPercentage => set_boosted_yields_rewards_percentage + collectUndistributedBoostedRewards => collect_undistributed_boosted_rewards + getBoostedYieldsRewardsPercentage => boosted_yields_rewards_percentage + getAccumulatedRewardsForWeek => accumulated_rewards_for_week + getFarmSupplyForWeek => farm_supply_for_week + getRemainingBoostedRewardsToDistribute => remaining_boosted_rewards_to_distribute + getUndistributedBoostedRewards => undistributed_boosted_rewards + setBoostedYieldsFactors => set_boosted_yields_factors + getBoostedYieldsFactors => get_boosted_yields_factors + getCurrentWeek => get_current_week + getFirstWeekStartEpoch => first_week_start_epoch + getLastActiveWeekForUser => get_last_active_week_for_user_view + getUserEnergyForWeek => get_user_energy_for_week_view + getLastGlobalUpdateWeek => last_global_update_week + getTotalRewardsForWeek => total_rewards_for_week + getTotalEnergyForWeek => total_energy_for_week + getTotalLockedTokensForWeek => total_locked_tokens_for_week + updateEnergyForUser => update_energy_for_user + getCurrentClaimProgress => current_claim_progress + setEnergyFactoryAddress => set_energy_factory_address + getEnergyFactoryAddress => energy_factory_address ) } + +multiversx_sc_wasm_adapter::async_callback! { farm_with_locked_rewards } diff --git a/dex/farm/wasm/Cargo.lock b/dex/farm/wasm/Cargo.lock index 97ea7e292..7e9a4a925 100644 --- a/dex/farm/wasm/Cargo.lock +++ b/dex/farm/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -292,12 +286,6 @@ dependencies = [ "utils", ] -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - [[package]] name = "locking_module" version = "0.0.0" @@ -314,12 +302,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -329,9 +311,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" dependencies = [ "bitflags", "hashbrown", @@ -343,20 +325,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -366,9 +347,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" dependencies = [ "hex", "proc-macro2", @@ -379,21 +360,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -454,18 +434,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.23" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -575,18 +555,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -606,25 +574,3 @@ dependencies = [ "unwrappable", "week-timekeeping", ] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/dex/farm/wasm/src/lib.rs b/dex/farm/wasm/src/lib.rs index 9ec1c0a1c..305f48092 100644 --- a/dex/farm/wasm/src/lib.rs +++ b/dex/farm/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 61 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,65 +21,67 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { farm ( - enterFarm - claimRewards - compoundRewards - exitFarm - calculateRewardsForGivenPosition - mergeFarmTokens - startProduceRewards - endProduceRewards - setPerBlockRewardAmount - getRewardPerShare - getRewardReserve - getFarmingTokenId - getRewardTokenId - getPerBlockRewardAmount - getLastRewardBlockNonce - getDivisionSafetyConstant - registerFarmToken - getFarmTokenId - getFarmTokenSupply - addToPauseWhitelist - removeFromPauseWhitelist - pause - resume - getState - addAdmin - removeAdmin - updateOwnerOrAdmin - getPermissions - addSCAddressToWhitelist - removeSCAddressFromWhitelist - isSCAddressWhitelisted - set_penalty_percent - set_minimum_farming_epochs - set_burn_gas_limit - getPenaltyPercent - getMinimumFarmingEpoch - getBurnGasLimit - getPairContractManagedAddress - setBoostedYieldsRewardsPercentage - collectUndistributedBoostedRewards - getBoostedYieldsRewardsPercentage - getAccumulatedRewardsForWeek - getFarmSupplyForWeek - getRemainingBoostedRewardsToDistribute - getUndistributedBoostedRewards - setBoostedYieldsFactors - getBoostedYieldsFactors - getCurrentWeek - getFirstWeekStartEpoch - getLastActiveWeekForUser - getUserEnergyForWeek - getLastGlobalUpdateWeek - getTotalRewardsForWeek - getTotalEnergyForWeek - getTotalLockedTokensForWeek - updateEnergyForUser - getCurrentClaimProgress - setEnergyFactoryAddress - getEnergyFactoryAddress - callBack + init => init + enterFarm => enter_farm_endpoint + claimRewards => claim_rewards_endpoint + compoundRewards => compound_rewards_endpoint + exitFarm => exit_farm_endpoint + calculateRewardsForGivenPosition => calculate_rewards_for_given_position + mergeFarmTokens => merge_farm_tokens_endpoint + startProduceRewards => start_produce_rewards_endpoint + endProduceRewards => end_produce_rewards_endpoint + setPerBlockRewardAmount => set_per_block_rewards_endpoint + getRewardPerShare => reward_per_share + getRewardReserve => reward_reserve + getFarmingTokenId => farming_token_id + getRewardTokenId => reward_token_id + getPerBlockRewardAmount => per_block_reward_amount + getLastRewardBlockNonce => last_reward_block_nonce + getDivisionSafetyConstant => division_safety_constant + registerFarmToken => register_farm_token + getFarmTokenId => farm_token + getFarmTokenSupply => farm_token_supply + addToPauseWhitelist => add_to_pause_whitelist + removeFromPauseWhitelist => remove_from_pause_whitelist + pause => pause + resume => resume + getState => state + addAdmin => add_admin_endpoint + removeAdmin => remove_admin_endpoint + updateOwnerOrAdmin => update_owner_or_admin_endpoint + getPermissions => permissions + addSCAddressToWhitelist => add_sc_address_to_whitelist + removeSCAddressFromWhitelist => remove_sc_address_from_whitelist + isSCAddressWhitelisted => is_sc_address_whitelisted + set_penalty_percent => set_penalty_percent + set_minimum_farming_epochs => set_minimum_farming_epochs + set_burn_gas_limit => set_burn_gas_limit + getPenaltyPercent => penalty_percent + getMinimumFarmingEpoch => minimum_farming_epochs + getBurnGasLimit => burn_gas_limit + getPairContractManagedAddress => pair_contract_address + setBoostedYieldsRewardsPercentage => set_boosted_yields_rewards_percentage + collectUndistributedBoostedRewards => collect_undistributed_boosted_rewards + getBoostedYieldsRewardsPercentage => boosted_yields_rewards_percentage + getAccumulatedRewardsForWeek => accumulated_rewards_for_week + getFarmSupplyForWeek => farm_supply_for_week + getRemainingBoostedRewardsToDistribute => remaining_boosted_rewards_to_distribute + getUndistributedBoostedRewards => undistributed_boosted_rewards + setBoostedYieldsFactors => set_boosted_yields_factors + getBoostedYieldsFactors => get_boosted_yields_factors + getCurrentWeek => get_current_week + getFirstWeekStartEpoch => first_week_start_epoch + getLastActiveWeekForUser => get_last_active_week_for_user_view + getUserEnergyForWeek => get_user_energy_for_week_view + getLastGlobalUpdateWeek => last_global_update_week + getTotalRewardsForWeek => total_rewards_for_week + getTotalEnergyForWeek => total_energy_for_week + getTotalLockedTokensForWeek => total_locked_tokens_for_week + updateEnergyForUser => update_energy_for_user + getCurrentClaimProgress => current_claim_progress + setEnergyFactoryAddress => set_energy_factory_address + getEnergyFactoryAddress => energy_factory_address ) } + +multiversx_sc_wasm_adapter::async_callback! { farm } diff --git a/dex/governance/wasm/Cargo.lock b/dex/governance/wasm/Cargo.lock index ebe14cc18..80da9733b 100644 --- a/dex/governance/wasm/Cargo.lock +++ b/dex/governance/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -85,23 +79,11 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" dependencies = [ "bitflags", "hashbrown", @@ -113,20 +95,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -136,9 +117,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" dependencies = [ "hex", "proc-macro2", @@ -149,12 +130,11 @@ dependencies = [ [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -183,18 +163,18 @@ checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.23" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -237,37 +217,3 @@ name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/dex/governance/wasm/src/lib.rs b/dex/governance/wasm/src/lib.rs index bfedec764..3e106b05e 100644 --- a/dex/governance/wasm/src/lib.rs +++ b/dex/governance/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 23 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,28 +21,29 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { governance ( - propose - upvote - downvote - execute - redeem - changeQuorum - changeMinTokenBalanceForProposing - changeVotingDelayInBlocks - changeVotingPeriodInBlocks - changeGovernanceTokenIds - changePriceProviders - getGovernanceTokenId - getQuorum - getMinWeightForProposal - getVotingDelayInBlocks - getVotingPeriodInBlocks - getProposal - getProposalIdCounter - getVoteNFTId - getMexTokenId - getProposalStatus + init => init + propose => propose + upvote => upvote + downvote => downvote + execute => execute + redeem => redeem + changeQuorum => change_quorum + changeMinTokenBalanceForProposing => change_min_weight_for_proposal + changeVotingDelayInBlocks => change_voting_delay_in_blocks + changeVotingPeriodInBlocks => change_voting_period_in_blocks + changeGovernanceTokenIds => change_governance_token_ids + changePriceProviders => change_price_providers + getGovernanceTokenId => governance_token_ids + getQuorum => quorum + getMinWeightForProposal => min_weight_for_proposal + getVotingDelayInBlocks => voting_delay_in_blocks + getVotingPeriodInBlocks => voting_period_in_blocks + getProposal => proposal + getProposalIdCounter => proposal_id_counter + getVoteNFTId => vote_nft_id + getMexTokenId => mex_token_id + getProposalStatus => get_proposal_status_view ) } -multiversx_sc_wasm_adapter::empty_callback! {} +multiversx_sc_wasm_adapter::async_callback_empty! {} diff --git a/dex/pair-mock/wasm/Cargo.lock b/dex/pair-mock/wasm/Cargo.lock index fdfb68d12..e813b5155 100644 --- a/dex/pair-mock/wasm/Cargo.lock +++ b/dex/pair-mock/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -92,23 +86,11 @@ dependencies = [ "either", ] -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" dependencies = [ "bitflags", "hashbrown", @@ -120,20 +102,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -143,9 +124,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" dependencies = [ "hex", "proc-macro2", @@ -156,12 +137,11 @@ dependencies = [ [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -207,18 +187,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.23" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -261,37 +241,3 @@ name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/dex/pair-mock/wasm/src/lib.rs b/dex/pair-mock/wasm/src/lib.rs index 0634dae52..77325383a 100644 --- a/dex/pair-mock/wasm/src/lib.rs +++ b/dex/pair-mock/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 4 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,9 +21,10 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { pair_mock ( - addInitialLiquidity - updateAndGetTokensForGivenPositionWithSafePrice + init => init + addInitialLiquidity => add_initial_liquidity + getTokensForGivenPositionWithSafePrice => get_tokens_for_given_position_with_safe_price ) } -multiversx_sc_wasm_adapter::empty_callback! {} +multiversx_sc_wasm_adapter::async_callback_empty! {} diff --git a/dex/pair/wasm-pair-full/Cargo.lock b/dex/pair/wasm-pair-full/Cargo.lock index 9077209cd..75cf862d4 100644 --- a/dex/pair/wasm-pair-full/Cargo.lock +++ b/dex/pair/wasm-pair-full/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -168,12 +162,6 @@ dependencies = [ "utils", ] -[[package]] -name = "libc" -version = "0.2.144" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" - [[package]] name = "locking_module" version = "0.0.0" @@ -190,12 +178,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -205,9 +187,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" dependencies = [ "bitflags", "hashbrown", @@ -219,20 +201,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -242,9 +223,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" dependencies = [ "hex", "proc-macro2", @@ -255,21 +236,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -338,18 +318,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.56" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.27" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f4f29d145265ec1c483c7c654450edde0bfe043d3938d6972630663356d9500" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -436,18 +416,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -467,25 +435,3 @@ dependencies = [ "unwrappable", "week-timekeeping", ] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/dex/pair/wasm-pair-full/src/lib.rs b/dex/pair/wasm-pair-full/src/lib.rs index 30efb71cb..9c6650e16 100644 --- a/dex/pair/wasm-pair-full/src/lib.rs +++ b/dex/pair/wasm-pair-full/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 65 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,70 +21,71 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { pair ( - addInitialLiquidity - addLiquidity - removeLiquidity - removeLiquidityAndBuyBackAndBurnToken - swapNoFeeAndForward - swapTokensFixedInput - swapTokensFixedOutput - setLpTokenIdentifier - getTokensForGivenPosition - getReservesAndTotalSupply - getAmountOut - getAmountIn - getEquivalent - getFeeState - whitelist - removeWhitelist - addTrustedSwapPair - removeTrustedSwapPair - setupFeesCollector - setFeeOn - getFeeDestinations - getTrustedSwapPairs - getWhitelistedManagedAddresses - getFeesCollectorAddress - getFeesCollectorCutPercentage - setStateActiveNoSwaps - setFeePercents - getLpTokenIdentifier - getTotalFeePercent - getSpecialFee - getRouterManagedAddress - getFirstTokenId - getSecondTokenId - getTotalSupply - getInitialLiquidtyAdder - getReserve - getSafePriceCurrentIndex - updateAndGetTokensForGivenPositionWithSafePrice - updateAndGetSafePrice - setLockingDeadlineEpoch - setLockingScAddress - setUnlockEpoch - getLockingScAddress - getUnlockEpoch - getLockingDeadlineEpoch - addAdmin - removeAdmin - updateOwnerOrAdmin - getPermissions - addToPauseWhitelist - removeFromPauseWhitelist - pause - resume - getState - getLpTokensSafePriceByDefaultOffset - getLpTokensSafePriceByRoundOffset - getLpTokensSafePriceByTimestampOffset - getLpTokensSafePrice - getSafePriceByDefaultOffset - getSafePriceByRoundOffset - getSafePriceByTimestampOffset - getSafePrice - getPriceObservation + init => init + addInitialLiquidity => add_initial_liquidity + addLiquidity => add_liquidity + removeLiquidity => remove_liquidity + removeLiquidityAndBuyBackAndBurnToken => remove_liquidity_and_burn_token + swapNoFeeAndForward => swap_no_fee + swapTokensFixedInput => swap_tokens_fixed_input + swapTokensFixedOutput => swap_tokens_fixed_output + setLpTokenIdentifier => set_lp_token_identifier + getTokensForGivenPosition => get_tokens_for_given_position + getReservesAndTotalSupply => get_reserves_and_total_supply + getAmountOut => get_amount_out_view + getAmountIn => get_amount_in_view + getEquivalent => get_equivalent + getFeeState => is_fee_enabled + whitelist => whitelist_endpoint + removeWhitelist => remove_whitelist + addTrustedSwapPair => add_trusted_swap_pair + removeTrustedSwapPair => remove_trusted_swap_pair + setupFeesCollector => setup_fees_collector + setFeeOn => set_fee_on + getFeeDestinations => get_fee_destinations + getTrustedSwapPairs => get_trusted_swap_pairs + getWhitelistedManagedAddresses => get_whitelisted_managed_addresses + getFeesCollectorAddress => fees_collector_address + getFeesCollectorCutPercentage => fees_collector_cut_percentage + setStateActiveNoSwaps => set_state_active_no_swaps + setFeePercents => set_fee_percent + getLpTokenIdentifier => get_lp_token_identifier + getTotalFeePercent => total_fee_percent + getSpecialFee => special_fee_percent + getRouterManagedAddress => router_address + getFirstTokenId => first_token_id + getSecondTokenId => second_token_id + getTotalSupply => lp_token_supply + getInitialLiquidtyAdder => initial_liquidity_adder + getReserve => pair_reserve + getSafePriceCurrentIndex => safe_price_current_index + updateAndGetTokensForGivenPositionWithSafePrice => update_and_get_tokens_for_given_position_with_safe_price + updateAndGetSafePrice => update_and_get_safe_price + setLockingDeadlineEpoch => set_locking_deadline_epoch + setLockingScAddress => set_locking_sc_address + setUnlockEpoch => set_unlock_epoch + getLockingScAddress => locking_sc_address + getUnlockEpoch => unlock_epoch + getLockingDeadlineEpoch => locking_deadline_epoch + addAdmin => add_admin_endpoint + removeAdmin => remove_admin_endpoint + updateOwnerOrAdmin => update_owner_or_admin_endpoint + getPermissions => permissions + addToPauseWhitelist => add_to_pause_whitelist + removeFromPauseWhitelist => remove_from_pause_whitelist + pause => pause + resume => resume + getState => state + getLpTokensSafePriceByDefaultOffset => get_lp_tokens_safe_price_by_default_offset + getLpTokensSafePriceByRoundOffset => get_lp_tokens_safe_price_by_round_offset + getLpTokensSafePriceByTimestampOffset => get_lp_tokens_safe_price_by_timestamp_offset + getLpTokensSafePrice => get_lp_tokens_safe_price + getSafePriceByDefaultOffset => get_safe_price_by_default_offset + getSafePriceByRoundOffset => get_safe_price_by_round_offset + getSafePriceByTimestampOffset => get_safe_price_by_timestamp_offset + getSafePrice => get_safe_price + getPriceObservation => get_price_observation_view ) } -multiversx_sc_wasm_adapter::empty_callback! {} +multiversx_sc_wasm_adapter::async_callback_empty! {} diff --git a/dex/pair/wasm-safe-price-view/Cargo.lock b/dex/pair/wasm-safe-price-view/Cargo.lock index c8995accb..b2afa0021 100644 --- a/dex/pair/wasm-safe-price-view/Cargo.lock +++ b/dex/pair/wasm-safe-price-view/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -168,12 +162,6 @@ dependencies = [ "utils", ] -[[package]] -name = "libc" -version = "0.2.144" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" - [[package]] name = "locking_module" version = "0.0.0" @@ -190,12 +178,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -205,9 +187,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" dependencies = [ "bitflags", "hashbrown", @@ -219,20 +201,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -242,9 +223,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" dependencies = [ "hex", "proc-macro2", @@ -255,21 +236,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -330,18 +310,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.56" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.27" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f4f29d145265ec1c483c7c654450edde0bfe043d3938d6972630663356d9500" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -436,18 +416,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -467,25 +435,3 @@ dependencies = [ "unwrappable", "week-timekeeping", ] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/dex/pair/wasm-safe-price-view/src/lib.rs b/dex/pair/wasm-safe-price-view/src/lib.rs index a41f72fd1..c5f78382f 100644 --- a/dex/pair/wasm-safe-price-view/src/lib.rs +++ b/dex/pair/wasm-safe-price-view/src/lib.rs @@ -10,24 +10,29 @@ // Total number of exported functions: 11 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); +multiversx_sc_wasm_adapter::external_view_init! {} + multiversx_sc_wasm_adapter::external_view_endpoints! { pair ( - getLpTokensSafePriceByDefaultOffset - getLpTokensSafePriceByRoundOffset - getLpTokensSafePriceByTimestampOffset - getLpTokensSafePrice - getSafePriceByDefaultOffset - getSafePriceByRoundOffset - getSafePriceByTimestampOffset - getSafePrice - getPriceObservation + getLpTokensSafePriceByDefaultOffset => get_lp_tokens_safe_price_by_default_offset + getLpTokensSafePriceByRoundOffset => get_lp_tokens_safe_price_by_round_offset + getLpTokensSafePriceByTimestampOffset => get_lp_tokens_safe_price_by_timestamp_offset + getLpTokensSafePrice => get_lp_tokens_safe_price + getSafePriceByDefaultOffset => get_safe_price_by_default_offset + getSafePriceByRoundOffset => get_safe_price_by_round_offset + getSafePriceByTimestampOffset => get_safe_price_by_timestamp_offset + getSafePrice => get_safe_price + getPriceObservation => get_price_observation_view ) } -multiversx_sc_wasm_adapter::empty_callback! {} +multiversx_sc_wasm_adapter::async_callback_empty! {} diff --git a/dex/pair/wasm/Cargo.lock b/dex/pair/wasm/Cargo.lock index a2f6f1a44..9c045aa1d 100644 --- a/dex/pair/wasm/Cargo.lock +++ b/dex/pair/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -168,12 +162,6 @@ dependencies = [ "utils", ] -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - [[package]] name = "locking_module" version = "0.0.0" @@ -190,12 +178,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -205,9 +187,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" dependencies = [ "bitflags", "hashbrown", @@ -219,20 +201,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -242,9 +223,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" dependencies = [ "hex", "proc-macro2", @@ -255,21 +236,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -338,18 +318,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.23" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -436,18 +416,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -467,25 +435,3 @@ dependencies = [ "unwrappable", "week-timekeeping", ] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/dex/pair/wasm/src/lib.rs b/dex/pair/wasm/src/lib.rs index d692b1d2b..9f65c8a35 100644 --- a/dex/pair/wasm/src/lib.rs +++ b/dex/pair/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 56 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,61 +21,62 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { pair ( - addInitialLiquidity - addLiquidity - removeLiquidity - removeLiquidityAndBuyBackAndBurnToken - swapNoFeeAndForward - swapTokensFixedInput - swapTokensFixedOutput - setLpTokenIdentifier - getTokensForGivenPosition - getReservesAndTotalSupply - getAmountOut - getAmountIn - getEquivalent - getFeeState - whitelist - removeWhitelist - addTrustedSwapPair - removeTrustedSwapPair - setupFeesCollector - setFeeOn - getFeeDestinations - getTrustedSwapPairs - getWhitelistedManagedAddresses - getFeesCollectorAddress - getFeesCollectorCutPercentage - setStateActiveNoSwaps - setFeePercents - getLpTokenIdentifier - getTotalFeePercent - getSpecialFee - getRouterManagedAddress - getFirstTokenId - getSecondTokenId - getTotalSupply - getInitialLiquidtyAdder - getReserve - getSafePriceCurrentIndex - updateAndGetTokensForGivenPositionWithSafePrice - updateAndGetSafePrice - setLockingDeadlineEpoch - setLockingScAddress - setUnlockEpoch - getLockingScAddress - getUnlockEpoch - getLockingDeadlineEpoch - addAdmin - removeAdmin - updateOwnerOrAdmin - getPermissions - addToPauseWhitelist - removeFromPauseWhitelist - pause - resume - getState + init => init + addInitialLiquidity => add_initial_liquidity + addLiquidity => add_liquidity + removeLiquidity => remove_liquidity + removeLiquidityAndBuyBackAndBurnToken => remove_liquidity_and_burn_token + swapNoFeeAndForward => swap_no_fee + swapTokensFixedInput => swap_tokens_fixed_input + swapTokensFixedOutput => swap_tokens_fixed_output + setLpTokenIdentifier => set_lp_token_identifier + getTokensForGivenPosition => get_tokens_for_given_position + getReservesAndTotalSupply => get_reserves_and_total_supply + getAmountOut => get_amount_out_view + getAmountIn => get_amount_in_view + getEquivalent => get_equivalent + getFeeState => is_fee_enabled + whitelist => whitelist_endpoint + removeWhitelist => remove_whitelist + addTrustedSwapPair => add_trusted_swap_pair + removeTrustedSwapPair => remove_trusted_swap_pair + setupFeesCollector => setup_fees_collector + setFeeOn => set_fee_on + getFeeDestinations => get_fee_destinations + getTrustedSwapPairs => get_trusted_swap_pairs + getWhitelistedManagedAddresses => get_whitelisted_managed_addresses + getFeesCollectorAddress => fees_collector_address + getFeesCollectorCutPercentage => fees_collector_cut_percentage + setStateActiveNoSwaps => set_state_active_no_swaps + setFeePercents => set_fee_percent + getLpTokenIdentifier => get_lp_token_identifier + getTotalFeePercent => total_fee_percent + getSpecialFee => special_fee_percent + getRouterManagedAddress => router_address + getFirstTokenId => first_token_id + getSecondTokenId => second_token_id + getTotalSupply => lp_token_supply + getInitialLiquidtyAdder => initial_liquidity_adder + getReserve => pair_reserve + getSafePriceCurrentIndex => safe_price_current_index + updateAndGetTokensForGivenPositionWithSafePrice => update_and_get_tokens_for_given_position_with_safe_price + updateAndGetSafePrice => update_and_get_safe_price + setLockingDeadlineEpoch => set_locking_deadline_epoch + setLockingScAddress => set_locking_sc_address + setUnlockEpoch => set_unlock_epoch + getLockingScAddress => locking_sc_address + getUnlockEpoch => unlock_epoch + getLockingDeadlineEpoch => locking_deadline_epoch + addAdmin => add_admin_endpoint + removeAdmin => remove_admin_endpoint + updateOwnerOrAdmin => update_owner_or_admin_endpoint + getPermissions => permissions + addToPauseWhitelist => add_to_pause_whitelist + removeFromPauseWhitelist => remove_from_pause_whitelist + pause => pause + resume => resume + getState => state ) } -multiversx_sc_wasm_adapter::empty_callback! {} +multiversx_sc_wasm_adapter::async_callback_empty! {} diff --git a/dex/price-discovery/wasm/Cargo.lock b/dex/price-discovery/wasm/Cargo.lock index 7e6dc4c5b..71637c4d0 100644 --- a/dex/price-discovery/wasm/Cargo.lock +++ b/dex/price-discovery/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -120,12 +114,6 @@ dependencies = [ "utils", ] -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - [[package]] name = "locking_module" version = "0.0.0" @@ -142,12 +130,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -157,9 +139,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" dependencies = [ "bitflags", "hashbrown", @@ -171,20 +153,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -194,9 +175,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" dependencies = [ "hex", "proc-macro2", @@ -207,21 +188,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -268,18 +248,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.23" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -356,37 +336,3 @@ name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/dex/price-discovery/wasm/src/lib.rs b/dex/price-discovery/wasm/src/lib.rs index 7c227533c..0a3ed110d 100644 --- a/dex/price-discovery/wasm/src/lib.rs +++ b/dex/price-discovery/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 29 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,33 +21,35 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { price_discovery ( - deposit - withdraw - redeem - getCurrentPrice - getMinLaunchedTokenPrice - getPricePrecision - getLaunchedTokenId - getAcceptedTokenId - getLaunchedTokenBalance - getAcceptedTokenBalance - getStartBlock - getEndBlock - setLockingScAddress - setUnlockEpoch - getLockingScAddress - getUnlockEpoch - getCurrentPhase - getNoLimitPhaseDurationBlocks - getLinearPenaltyPhaseDurationBlocks - getFixedPenaltyPhaseDurationBlocks - getPenaltyMinPercentage - getPenaltyMaxPercentage - getFixedPenaltyPercentage - issueRedeemToken - createInitialRedeemTokens - getRedeemTokenId - getRedeemTokenTotalCirculatingSupply - callBack + init => init + deposit => deposit + withdraw => withdraw + redeem => redeem + getCurrentPrice => calculate_price + getMinLaunchedTokenPrice => min_launched_token_price + getPricePrecision => price_precision + getLaunchedTokenId => launched_token_id + getAcceptedTokenId => accepted_token_id + getLaunchedTokenBalance => launched_token_balance + getAcceptedTokenBalance => accepted_token_balance + getStartBlock => start_block + getEndBlock => end_block + setLockingScAddress => set_locking_sc_address + setUnlockEpoch => set_unlock_epoch + getLockingScAddress => locking_sc_address + getUnlockEpoch => unlock_epoch + getCurrentPhase => get_current_phase + getNoLimitPhaseDurationBlocks => no_limit_phase_duration_blocks + getLinearPenaltyPhaseDurationBlocks => linear_penalty_phase_duration_blocks + getFixedPenaltyPhaseDurationBlocks => fixed_penalty_phase_duration_blocks + getPenaltyMinPercentage => penalty_min_percentage + getPenaltyMaxPercentage => penalty_max_percentage + getFixedPenaltyPercentage => fixed_penalty_percentage + issueRedeemToken => issue_redeem_token + createInitialRedeemTokens => create_initial_redeem_tokens + getRedeemTokenId => redeem_token + getRedeemTokenTotalCirculatingSupply => redeem_token_total_circulating_supply ) } + +multiversx_sc_wasm_adapter::async_callback! { price_discovery } diff --git a/dex/proxy-deployer/wasm/Cargo.lock b/dex/proxy-deployer/wasm/Cargo.lock index 3d762a9be..26a4d02fc 100644 --- a/dex/proxy-deployer/wasm/Cargo.lock +++ b/dex/proxy-deployer/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -284,12 +278,6 @@ dependencies = [ "utils", ] -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - [[package]] name = "locking_module" version = "0.0.0" @@ -306,12 +294,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -321,9 +303,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" dependencies = [ "bitflags", "hashbrown", @@ -335,20 +317,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -358,9 +339,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" dependencies = [ "hex", "proc-macro2", @@ -371,21 +352,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -446,9 +426,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] @@ -474,9 +454,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.23" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -586,18 +566,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -617,25 +585,3 @@ dependencies = [ "unwrappable", "week-timekeeping", ] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/dex/proxy-deployer/wasm/src/lib.rs b/dex/proxy-deployer/wasm/src/lib.rs index bdf618263..b8d5311f2 100644 --- a/dex/proxy-deployer/wasm/src/lib.rs +++ b/dex/proxy-deployer/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 6 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,11 +21,12 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { proxy_deployer ( - deployFarm - callFarmEndpoint - getAllDeployedFarms - getDeployerFarmAddresses + init => init + deployFarm => deploy_farm + callFarmEndpoint => call_farm_endpoint + getAllDeployedFarms => get_all_deployed_farms + getDeployerFarmAddresses => deployer_farm_addresses ) } -multiversx_sc_wasm_adapter::empty_callback! {} +multiversx_sc_wasm_adapter::async_callback_empty! {} diff --git a/dex/router/wasm/Cargo.lock b/dex/router/wasm/Cargo.lock index 6746dd43d..22954b04d 100644 --- a/dex/router/wasm/Cargo.lock +++ b/dex/router/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -168,12 +162,6 @@ dependencies = [ "utils", ] -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - [[package]] name = "locking_module" version = "0.0.0" @@ -190,12 +178,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -205,9 +187,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" dependencies = [ "bitflags", "hashbrown", @@ -219,20 +201,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -242,9 +223,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" dependencies = [ "hex", "proc-macro2", @@ -255,21 +236,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -330,18 +310,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.23" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -448,18 +428,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -479,25 +447,3 @@ dependencies = [ "unwrappable", "week-timekeeping", ] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/dex/router/wasm/src/lib.rs b/dex/router/wasm/src/lib.rs index 28609e0ab..a33c1a146 100644 --- a/dex/router/wasm/src/lib.rs +++ b/dex/router/wasm/src/lib.rs @@ -5,12 +5,15 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 30 +// Endpoints: 31 // Async Callback: 1 -// Total number of exported functions: 32 +// Total number of exported functions: 33 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,36 +21,39 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { router ( - pause - resume - createPair - upgradePair - issueLpToken - setLocalRoles - setLocalRolesOwner - removePair - setFeeOn - setFeeOff - setPairCreationEnabled - getPairCreationEnabled - getState - getOwner - getAllPairsManagedAddresses - getAllPairTokens - getAllPairContractMetadata - getPair - clearPairTemporaryOwnerStorage - setTemporaryOwnerPeriod - setPairTemplateAddress - getPairTemplateAddress - getTemporaryOwnerPeriod - multiPairSwap - configEnableByUserParameters - addCommonTokensForUserPairs - removeCommonTokensForUserPairs - setSwapEnabledByUser - getEnableSwapByUserConfig - getCommonTokensForUserPairs - callBack + init => init + pause => pause + resume => resume + createPair => create_pair_endpoint + upgradePair => upgrade_pair_endpoint + issueLpToken => issue_lp_token + setLocalRoles => set_local_roles + setLocalRolesOwner => set_local_roles_owner + removePair => remove_pair + setFeeOn => set_fee_on + setFeeOff => set_fee_off + setPairCreationEnabled => set_pair_creation_enabled + migratePairMap => migrate_pair_map + getPairCreationEnabled => pair_creation_enabled + getState => state + getOwner => owner + getAllPairsManagedAddresses => get_all_pairs_addresses + getAllPairTokens => get_all_token_pairs + getAllPairContractMetadata => get_all_pair_contract_metadata + getPair => get_pair + clearPairTemporaryOwnerStorage => clear_pair_temporary_owner_storage + setTemporaryOwnerPeriod => set_temporary_owner_period + setPairTemplateAddress => set_pair_template_address + getPairTemplateAddress => pair_template_address + getTemporaryOwnerPeriod => temporary_owner_period + multiPairSwap => multi_pair_swap + configEnableByUserParameters => config_enable_by_user_parameters + addCommonTokensForUserPairs => add_common_tokens_for_user_pairs + removeCommonTokensForUserPairs => remove_common_tokens_for_user_pairs + setSwapEnabledByUser => set_swap_enabled_by_user + getEnableSwapByUserConfig => try_get_config + getCommonTokensForUserPairs => common_tokens_for_user_pairs ) } + +multiversx_sc_wasm_adapter::async_callback! { router } diff --git a/energy-integration/energy-factory-mock/wasm/Cargo.lock b/energy-integration/energy-factory-mock/wasm/Cargo.lock index 1b1924b82..f3ebd3fc5 100644 --- a/energy-integration/energy-factory-mock/wasm/Cargo.lock +++ b/energy-integration/energy-factory-mock/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -144,12 +138,6 @@ dependencies = [ "utils", ] -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - [[package]] name = "math" version = "0.0.0" @@ -157,12 +145,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -172,9 +154,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" dependencies = [ "bitflags", "hashbrown", @@ -186,20 +168,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -209,9 +190,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" dependencies = [ "hex", "proc-macro2", @@ -222,21 +203,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -265,18 +245,18 @@ checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.23" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -353,37 +333,3 @@ name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/energy-integration/energy-factory-mock/wasm/src/lib.rs b/energy-integration/energy-factory-mock/wasm/src/lib.rs index bfa562d58..89a4cb257 100644 --- a/energy-integration/energy-factory-mock/wasm/src/lib.rs +++ b/energy-integration/energy-factory-mock/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 6 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,11 +21,12 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { energy_factory_mock ( - setUserEnergy - getEnergyAmountForUser - getEnergyEntryForUser - setUserEnergyAfterLockedTokenTransfer + init => init + setUserEnergy => set_user_energy + getEnergyAmountForUser => get_energy_amount_for_user + getEnergyEntryForUser => get_energy_entry_for_user + setUserEnergyAfterLockedTokenTransfer => set_user_energy_after_locked_token_transfer ) } -multiversx_sc_wasm_adapter::empty_callback! {} +multiversx_sc_wasm_adapter::async_callback_empty! {} diff --git a/energy-integration/energy-update/wasm/Cargo.lock b/energy-integration/energy-update/wasm/Cargo.lock index 5173db1ce..6b131311e 100644 --- a/energy-integration/energy-update/wasm/Cargo.lock +++ b/energy-integration/energy-update/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -302,12 +296,6 @@ dependencies = [ "utils", ] -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - [[package]] name = "locking_module" version = "0.0.0" @@ -324,12 +312,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -339,9 +321,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" dependencies = [ "bitflags", "hashbrown", @@ -353,20 +335,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -376,9 +357,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" dependencies = [ "hex", "proc-macro2", @@ -389,21 +370,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -464,18 +444,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.23" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -585,18 +565,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -616,25 +584,3 @@ dependencies = [ "unwrappable", "week-timekeeping", ] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/energy-integration/energy-update/wasm/src/lib.rs b/energy-integration/energy-update/wasm/src/lib.rs index 9ddd60e4c..18eb3df45 100644 --- a/energy-integration/energy-update/wasm/src/lib.rs +++ b/energy-integration/energy-update/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 3 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,8 +21,9 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { energy_update ( - updateFarmsEnergyForUser + init => init + updateFarmsEnergyForUser => update_farms_energy_for_user ) } -multiversx_sc_wasm_adapter::empty_callback! {} +multiversx_sc_wasm_adapter::async_callback_empty! {} diff --git a/energy-integration/fees-collector/wasm/Cargo.lock b/energy-integration/fees-collector/wasm/Cargo.lock index 601610441..0c9a34eaf 100644 --- a/energy-integration/fees-collector/wasm/Cargo.lock +++ b/energy-integration/fees-collector/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -161,12 +155,6 @@ dependencies = [ "utils", ] -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - [[package]] name = "locking_module" version = "0.0.0" @@ -183,12 +171,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -198,9 +180,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" dependencies = [ "bitflags", "hashbrown", @@ -212,20 +194,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -235,9 +216,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" dependencies = [ "hex", "proc-macro2", @@ -248,21 +229,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -291,18 +271,18 @@ checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.23" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -380,18 +360,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -411,25 +379,3 @@ dependencies = [ "unwrappable", "week-timekeeping", ] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/energy-integration/fees-collector/wasm/src/lib.rs b/energy-integration/fees-collector/wasm/src/lib.rs index 74fbfdf40..ee768b13f 100644 --- a/energy-integration/fees-collector/wasm/src/lib.rs +++ b/energy-integration/fees-collector/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 37 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,42 +21,43 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { fees_collector ( - claimRewards - addKnownContracts - removeKnownContracts - addKnownTokens - removeKnownTokens - getLockedTokenId - getAllTokens - getAllKnownContracts - getLastActiveWeekForUser - getUserEnergyForWeek - getLastGlobalUpdateWeek - getTotalRewardsForWeek - getTotalEnergyForWeek - getTotalLockedTokensForWeek - updateEnergyForUser - getCurrentClaimProgress - depositSwapFees - getAccumulatedFees - setLockedTokensPerBlock - getLastLockedTokensAddWeek - getLockedTokensPerBlock - setLockingScAddress - setLockEpochs - getLockingScAddress - getLockEpochs - setEnergyFactoryAddress - getEnergyFactoryAddress - getCurrentWeek - getFirstWeekStartEpoch - pause - unpause - isPaused - addSCAddressToWhitelist - removeSCAddressFromWhitelist - isSCAddressWhitelisted + init => init + claimRewards => claim_rewards + addKnownContracts => add_known_contracts + removeKnownContracts => remove_known_contracts + addKnownTokens => add_known_tokens + removeKnownTokens => remove_known_tokens + getLockedTokenId => locked_token_id + getAllTokens => get_all_tokens + getAllKnownContracts => known_contracts + getLastActiveWeekForUser => get_last_active_week_for_user_view + getUserEnergyForWeek => get_user_energy_for_week_view + getLastGlobalUpdateWeek => last_global_update_week + getTotalRewardsForWeek => total_rewards_for_week + getTotalEnergyForWeek => total_energy_for_week + getTotalLockedTokensForWeek => total_locked_tokens_for_week + updateEnergyForUser => update_energy_for_user + getCurrentClaimProgress => current_claim_progress + depositSwapFees => deposit_swap_fees + getAccumulatedFees => accumulated_fees + setLockedTokensPerBlock => set_locked_tokens_per_block + getLastLockedTokensAddWeek => last_locked_token_add_week + getLockedTokensPerBlock => locked_tokens_per_block + setLockingScAddress => set_locking_sc_address + setLockEpochs => set_lock_epochs + getLockingScAddress => locking_sc_address + getLockEpochs => lock_epochs + setEnergyFactoryAddress => set_energy_factory_address + getEnergyFactoryAddress => energy_factory_address + getCurrentWeek => get_current_week + getFirstWeekStartEpoch => first_week_start_epoch + pause => pause_endpoint + unpause => unpause_endpoint + isPaused => paused_status + addSCAddressToWhitelist => add_sc_address_to_whitelist + removeSCAddressFromWhitelist => remove_sc_address_from_whitelist + isSCAddressWhitelisted => is_sc_address_whitelisted ) } -multiversx_sc_wasm_adapter::empty_callback! {} +multiversx_sc_wasm_adapter::async_callback_empty! {} diff --git a/energy-integration/governance-v2/wasm/Cargo.lock b/energy-integration/governance-v2/wasm/Cargo.lock index 40bcf7baa..f214936de 100644 --- a/energy-integration/governance-v2/wasm/Cargo.lock +++ b/energy-integration/governance-v2/wasm/Cargo.lock @@ -8,16 +8,16 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] [[package]] name = "arrayvec" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "autocfg" @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -172,12 +166,6 @@ dependencies = [ "utils", ] -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - [[package]] name = "locking_module" version = "0.0.0" @@ -194,12 +182,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -209,9 +191,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" dependencies = [ "bitflags", "hashbrown", @@ -223,20 +205,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -246,9 +227,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" dependencies = [ "hex", "proc-macro2", @@ -259,21 +240,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -287,18 +267,18 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" dependencies = [ "autocfg", ] [[package]] name = "once_cell" -version = "1.17.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "permissions_module" @@ -311,18 +291,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.23" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -356,15 +336,15 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" [[package]] name = "syn" -version = "1.0.107" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", @@ -373,9 +353,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.6" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" [[package]] name = "unwrappable" @@ -400,18 +380,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -431,25 +399,3 @@ dependencies = [ "unwrappable", "week-timekeeping", ] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/energy-integration/governance-v2/wasm/src/lib.rs b/energy-integration/governance-v2/wasm/src/lib.rs index 5115397b6..7b63bb856 100644 --- a/energy-integration/governance-v2/wasm/src/lib.rs +++ b/energy-integration/governance-v2/wasm/src/lib.rs @@ -5,12 +5,15 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 29 +// Endpoints: 28 // Async Callback (empty): 1 -// Total number of exported functions: 31 +// Total number of exported functions: 30 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,36 +21,36 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { governance_v2 ( - propose - vote - cancel - withdrawDeposit - changeMinEnergyForProposal - changeMinFeeForProposal - changeQuorumPercentage - changeVotingDelayInBlocks - changeVotingPeriodInBlocks - getMinEnergyForPropose - getMinFeeForPropose - getQuorum - getVotingDelayInBlocks - getVotingPeriodInBlocks - getFeeTokenId - getWithdrawPercentageDefeated - getProposals - getUserVotedProposals - getProposalVotes - getProposalStatus - getUserVotingPower - getVotingPowerEquivalent - getFeesCollectorAddress - setEnergyFactoryAddress - getEnergyFactoryAddress - addAdmin - removeAdmin - updateOwnerOrAdmin - getPermissions + init => init + propose => propose + vote => vote + cancel => cancel + withdrawDeposit => withdraw_deposit + changeMinEnergyForProposal => change_min_energy_for_propose + changeMinFeeForProposal => change_min_fee_for_propose + changeQuorumPercentage => change_quorum_percentage + changeWithdrawPercentage => change_withdraw_percentage + changeVotingDelayInBlocks => change_voting_delay_in_blocks + changeVotingPeriodInBlocks => change_voting_period_in_blocks + getMinEnergyForPropose => min_energy_for_propose + getMinFeeForPropose => min_fee_for_propose + getQuorum => quorum_percentage + getVotingDelayInBlocks => voting_delay_in_blocks + getVotingPeriodInBlocks => voting_period_in_blocks + getFeeTokenId => fee_token_id + getWithdrawPercentageDefeated => withdraw_percentage_defeated + getProposals => proposals + getUserVotedProposals => user_voted_proposals + getProposalVotes => proposal_votes + getProposalStatus => get_proposal_status + getFeesCollectorAddress => fees_collector_address + setEnergyFactoryAddress => set_energy_factory_address + getEnergyFactoryAddress => energy_factory_address + addAdmin => add_admin_endpoint + removeAdmin => remove_admin_endpoint + updateOwnerOrAdmin => update_owner_or_admin_endpoint + getPermissions => permissions ) } -multiversx_sc_wasm_adapter::empty_callback! {} +multiversx_sc_wasm_adapter::async_callback_empty! {} diff --git a/farm-staking/farm-staking-proxy/wasm/Cargo.lock b/farm-staking/farm-staking-proxy/wasm/Cargo.lock index 6b8cfa51d..b39a7d277 100644 --- a/farm-staking/farm-staking-proxy/wasm/Cargo.lock +++ b/farm-staking/farm-staking-proxy/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -345,12 +339,6 @@ dependencies = [ "utils", ] -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - [[package]] name = "locking_module" version = "0.0.0" @@ -367,12 +355,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -382,9 +364,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" dependencies = [ "bitflags", "hashbrown", @@ -396,20 +378,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -419,9 +400,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" dependencies = [ "hex", "proc-macro2", @@ -432,21 +413,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -507,18 +487,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.23" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -628,18 +608,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -659,25 +627,3 @@ dependencies = [ "unwrappable", "week-timekeeping", ] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/farm-staking/farm-staking-proxy/wasm/src/lib.rs b/farm-staking/farm-staking-proxy/wasm/src/lib.rs index 5aea5b134..60c524a7a 100644 --- a/farm-staking/farm-staking-proxy/wasm/src/lib.rs +++ b/farm-staking/farm-staking-proxy/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 18 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,22 +21,24 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { farm_staking_proxy ( - registerDualYieldToken - getDualYieldTokenId - getLpFarmAddress - getStakingFarmAddress - getPairAddress - getStakingTokenId - getFarmTokenId - getLpTokenId - getLpFarmTokenId - addSCAddressToWhitelist - removeSCAddressFromWhitelist - isSCAddressWhitelisted - stakeFarmTokens - claimDualYield - unstakeFarmTokens - mergeMetastakingWithStakingToken - callBack + init => init + registerDualYieldToken => register_dual_yield_token + getDualYieldTokenId => dual_yield_token + getLpFarmAddress => lp_farm_address + getStakingFarmAddress => staking_farm_address + getPairAddress => pair_address + getStakingTokenId => staking_token_id + getFarmTokenId => staking_farm_token_id + getLpTokenId => lp_token_id + getLpFarmTokenId => lp_farm_token_id + addSCAddressToWhitelist => add_sc_address_to_whitelist + removeSCAddressFromWhitelist => remove_sc_address_from_whitelist + isSCAddressWhitelisted => is_sc_address_whitelisted + stakeFarmTokens => stake_farm_tokens + claimDualYield => claim_dual_yield_endpoint + unstakeFarmTokens => unstake_farm_tokens + mergeMetastakingWithStakingToken => merge_metastaking_with_staking_token ) } + +multiversx_sc_wasm_adapter::async_callback! { farm_staking_proxy } diff --git a/farm-staking/farm-staking/wasm/Cargo.lock b/farm-staking/farm-staking/wasm/Cargo.lock index 4584bdf1a..6f95fbf0e 100644 --- a/farm-staking/farm-staking/wasm/Cargo.lock +++ b/farm-staking/farm-staking/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -323,12 +317,6 @@ dependencies = [ "utils", ] -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - [[package]] name = "locking_module" version = "0.0.0" @@ -345,12 +333,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -360,9 +342,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" dependencies = [ "bitflags", "hashbrown", @@ -374,20 +356,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -397,9 +378,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" dependencies = [ "hex", "proc-macro2", @@ -410,21 +391,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -485,18 +465,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.23" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -606,18 +586,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -637,25 +605,3 @@ dependencies = [ "unwrappable", "week-timekeeping", ] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/farm-staking/farm-staking/wasm/src/lib.rs b/farm-staking/farm-staking/wasm/src/lib.rs index f168969c1..59a998e10 100644 --- a/farm-staking/farm-staking/wasm/src/lib.rs +++ b/farm-staking/farm-staking/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 66 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,70 +21,72 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { farm_staking ( - mergeFarmTokens - calculateRewardsForGivenPosition - topUpRewards - endProduceRewards - setPerBlockRewardAmount - setMaxApr - setMinUnbondEpochs - startProduceRewards - getAccumulatedRewards - getRewardCapacity - getAnnualPercentageRewards - getMinUnbondEpochs - getRewardPerShare - getRewardReserve - getFarmingTokenId - getRewardTokenId - getPerBlockRewardAmount - getLastRewardBlockNonce - getDivisionSafetyConstant - registerFarmToken - getFarmTokenId - getFarmTokenSupply - addSCAddressToWhitelist - removeSCAddressFromWhitelist - isSCAddressWhitelisted - addToPauseWhitelist - removeFromPauseWhitelist - pause - resume - getState - addAdmin - removeAdmin - updateOwnerOrAdmin - getPermissions - setBurnRoleForAddress - stakeFarmThroughProxy - stakeFarm - claimRewards - claimRewardsWithNewValue - compoundRewards - unstakeFarm - unstakeFarmThroughProxy - unbondFarm - setBoostedYieldsRewardsPercentage - collectUndistributedBoostedRewards - getBoostedYieldsRewardsPercentage - getAccumulatedRewardsForWeek - getFarmSupplyForWeek - getRemainingBoostedRewardsToDistribute - getUndistributedBoostedRewards - setBoostedYieldsFactors - getBoostedYieldsFactors - getCurrentWeek - getFirstWeekStartEpoch - getLastActiveWeekForUser - getUserEnergyForWeek - getLastGlobalUpdateWeek - getTotalRewardsForWeek - getTotalEnergyForWeek - getTotalLockedTokensForWeek - updateEnergyForUser - getCurrentClaimProgress - setEnergyFactoryAddress - getEnergyFactoryAddress - callBack + init => init + mergeFarmTokens => merge_farm_tokens_endpoint + calculateRewardsForGivenPosition => calculate_rewards_for_given_position + topUpRewards => top_up_rewards + endProduceRewards => end_produce_rewards + setPerBlockRewardAmount => set_per_block_rewards + setMaxApr => set_max_apr + setMinUnbondEpochs => set_min_unbond_epochs_endpoint + startProduceRewards => start_produce_rewards_endpoint + getAccumulatedRewards => accumulated_rewards + getRewardCapacity => reward_capacity + getAnnualPercentageRewards => max_annual_percentage_rewards + getMinUnbondEpochs => min_unbond_epochs + getRewardPerShare => reward_per_share + getRewardReserve => reward_reserve + getFarmingTokenId => farming_token_id + getRewardTokenId => reward_token_id + getPerBlockRewardAmount => per_block_reward_amount + getLastRewardBlockNonce => last_reward_block_nonce + getDivisionSafetyConstant => division_safety_constant + registerFarmToken => register_farm_token + getFarmTokenId => farm_token + getFarmTokenSupply => farm_token_supply + addSCAddressToWhitelist => add_sc_address_to_whitelist + removeSCAddressFromWhitelist => remove_sc_address_from_whitelist + isSCAddressWhitelisted => is_sc_address_whitelisted + addToPauseWhitelist => add_to_pause_whitelist + removeFromPauseWhitelist => remove_from_pause_whitelist + pause => pause + resume => resume + getState => state + addAdmin => add_admin_endpoint + removeAdmin => remove_admin_endpoint + updateOwnerOrAdmin => update_owner_or_admin_endpoint + getPermissions => permissions + setBurnRoleForAddress => set_burn_role_for_address + stakeFarmThroughProxy => stake_farm_through_proxy + stakeFarm => stake_farm_endpoint + claimRewards => claim_rewards + claimRewardsWithNewValue => claim_rewards_with_new_value + compoundRewards => compound_rewards + unstakeFarm => unstake_farm + unstakeFarmThroughProxy => unstake_farm_through_proxy + unbondFarm => unbond_farm + setBoostedYieldsRewardsPercentage => set_boosted_yields_rewards_percentage + collectUndistributedBoostedRewards => collect_undistributed_boosted_rewards + getBoostedYieldsRewardsPercentage => boosted_yields_rewards_percentage + getAccumulatedRewardsForWeek => accumulated_rewards_for_week + getFarmSupplyForWeek => farm_supply_for_week + getRemainingBoostedRewardsToDistribute => remaining_boosted_rewards_to_distribute + getUndistributedBoostedRewards => undistributed_boosted_rewards + setBoostedYieldsFactors => set_boosted_yields_factors + getBoostedYieldsFactors => get_boosted_yields_factors + getCurrentWeek => get_current_week + getFirstWeekStartEpoch => first_week_start_epoch + getLastActiveWeekForUser => get_last_active_week_for_user_view + getUserEnergyForWeek => get_user_energy_for_week_view + getLastGlobalUpdateWeek => last_global_update_week + getTotalRewardsForWeek => total_rewards_for_week + getTotalEnergyForWeek => total_energy_for_week + getTotalLockedTokensForWeek => total_locked_tokens_for_week + updateEnergyForUser => update_energy_for_user + getCurrentClaimProgress => current_claim_progress + setEnergyFactoryAddress => set_energy_factory_address + getEnergyFactoryAddress => energy_factory_address ) } + +multiversx_sc_wasm_adapter::async_callback! { farm_staking } diff --git a/farm-staking/metabonding-staking/wasm/Cargo.lock b/farm-staking/metabonding-staking/wasm/Cargo.lock index dbb5e6cc5..82f364c2e 100644 --- a/farm-staking/metabonding-staking/wasm/Cargo.lock +++ b/farm-staking/metabonding-staking/wasm/Cargo.lock @@ -196,9 +196,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" dependencies = [ "bitflags", "hashbrown", @@ -210,20 +210,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -233,9 +232,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" dependencies = [ "hex", "proc-macro2", @@ -246,21 +245,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -289,18 +287,18 @@ checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.23" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] diff --git a/farm-staking/metabonding-staking/wasm/src/lib.rs b/farm-staking/metabonding-staking/wasm/src/lib.rs index 337c0ea4b..ce110b30f 100644 --- a/farm-staking/metabonding-staking/wasm/src/lib.rs +++ b/farm-staking/metabonding-staking/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 12 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,17 +21,18 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { metabonding_staking ( - stakeLockedAsset - unstake - unbond - getStakedAmountForUser - getUserEntry - getSnapshot - getLockedAssetTokenId - getLockedAssetFactoryAddress - getTotalLockedAssetSupply - getUserList + init => init + stakeLockedAsset => stake_locked_asset + unstake => unstake + unbond => unbond + getStakedAmountForUser => get_staked_amount_for_user + getUserEntry => get_user_entry + getSnapshot => get_snapshot + getLockedAssetTokenId => locked_asset_token_id + getLockedAssetFactoryAddress => locked_asset_factory_address + getTotalLockedAssetSupply => total_locked_asset_supply + getUserList => user_list ) } -multiversx_sc_wasm_adapter::empty_callback! {} +multiversx_sc_wasm_adapter::async_callback_empty! {} diff --git a/locked-asset/distribution/wasm/Cargo.lock b/locked-asset/distribution/wasm/Cargo.lock index e1cc0fc9e..87717fb9d 100644 --- a/locked-asset/distribution/wasm/Cargo.lock +++ b/locked-asset/distribution/wasm/Cargo.lock @@ -196,9 +196,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" dependencies = [ "bitflags", "hashbrown", @@ -210,20 +210,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -233,9 +232,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" dependencies = [ "hex", "proc-macro2", @@ -246,21 +245,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -289,18 +287,18 @@ checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.23" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] diff --git a/locked-asset/distribution/wasm/src/lib.rs b/locked-asset/distribution/wasm/src/lib.rs index 829e87945..7713b182b 100644 --- a/locked-asset/distribution/wasm/src/lib.rs +++ b/locked-asset/distribution/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 17 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,22 +21,23 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { distribution ( - setCommunityDistribution - setPerUserDistributedLockedAssets - claimLockedAssets - clearUnclaimableAssets - undoLastCommunityDistribution - undoUserDistributedAssetsBetweenEpochs - setUnlockPeriod - calculateLockedAssets - deleteUserDistributedLockedAssets - getUsersDistributedLockedAssetsLength - getUnlockPeriod - getCommunityDistributionList - getAssetTokenId - startGlobalOperation - endGlobalOperation + init => init + setCommunityDistribution => set_community_distribution + setPerUserDistributedLockedAssets => set_per_user_distributed_locked_assets + claimLockedAssets => claim_locked_assets + clearUnclaimableAssets => clear_unclaimable_assets + undoLastCommunityDistribution => undo_last_community_distrib + undoUserDistributedAssetsBetweenEpochs => undo_user_assets_between_epochs + setUnlockPeriod => set_unlock_period + calculateLockedAssets => calculate_locked_assets_view + deleteUserDistributedLockedAssets => delete_user_distributed_locked_assets + getUsersDistributedLockedAssetsLength => get_users_distributed_locked_assets_length + getUnlockPeriod => unlock_period + getCommunityDistributionList => community_distribution_list + getAssetTokenId => asset_token_id + startGlobalOperation => global_op_start + endGlobalOperation => global_op_stop ) } -multiversx_sc_wasm_adapter::empty_callback! {} +multiversx_sc_wasm_adapter::async_callback_empty! {} diff --git a/locked-asset/energy-factory/wasm/Cargo.lock b/locked-asset/energy-factory/wasm/Cargo.lock index 4ce7c14d7..b51127ae1 100644 --- a/locked-asset/energy-factory/wasm/Cargo.lock +++ b/locked-asset/energy-factory/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -128,12 +122,6 @@ dependencies = [ "utils", ] -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - [[package]] name = "math" version = "0.0.0" @@ -141,12 +129,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -156,9 +138,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" dependencies = [ "bitflags", "hashbrown", @@ -170,20 +152,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -193,9 +174,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" dependencies = [ "hex", "proc-macro2", @@ -206,21 +187,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -249,18 +229,18 @@ checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.23" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -337,37 +317,3 @@ name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/locked-asset/energy-factory/wasm/src/lib.rs b/locked-asset/energy-factory/wasm/src/lib.rs index d496bd0d2..213c94146 100644 --- a/locked-asset/energy-factory/wasm/src/lib.rs +++ b/locked-asset/energy-factory/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 34 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,38 +21,40 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { energy_factory ( - lockTokens - unlockTokens - issueLockedToken - getLockedTokenId - getBaseAssetTokenId - getLegacyLockedTokenId - getEnergyEntryForUser - getEnergyAmountForUser - addLockOptions - getLockOptions - unlockEarly - reduceLockPeriod - getPenaltyAmount - setTokenUnstakeAddress - revertUnstake - getTokenUnstakeScAddress - setEnergyForOldTokens - updateEnergyAfterOldTokenUnlock - migrateOldTokens - pause - unpause - isPaused - setTransferRoleLockedToken - setBurnRoleLockedToken - mergeTokens - lockVirtual - addSCAddressToWhitelist - removeSCAddressFromWhitelist - isSCAddressWhitelisted - addToTokenTransferWhitelist - removeFromTokenTransferWhitelist - setUserEnergyAfterLockedTokenTransfer - callBack + init => init + lockTokens => lock_tokens_endpoint + unlockTokens => unlock_tokens_endpoint + issueLockedToken => issue_locked_token + getLockedTokenId => locked_token + getBaseAssetTokenId => base_asset_token_id + getLegacyLockedTokenId => legacy_locked_token_id + getEnergyEntryForUser => get_updated_energy_entry_for_user + getEnergyAmountForUser => get_energy_amount_for_user + addLockOptions => add_lock_options + getLockOptions => get_lock_options_view + unlockEarly => unlock_early + reduceLockPeriod => reduce_lock_period + getPenaltyAmount => calculate_penalty_amount + setTokenUnstakeAddress => set_token_unstake_address + revertUnstake => revert_unstake + getTokenUnstakeScAddress => token_unstake_sc_address + setEnergyForOldTokens => set_energy_for_old_tokens + updateEnergyAfterOldTokenUnlock => update_energy_after_old_token_unlock + migrateOldTokens => migrate_old_tokens + pause => pause_endpoint + unpause => unpause_endpoint + isPaused => paused_status + setTransferRoleLockedToken => set_transfer_role + setBurnRoleLockedToken => set_burn_role + mergeTokens => merge_tokens_endpoint + lockVirtual => lock_virtual + addSCAddressToWhitelist => add_sc_address_to_whitelist + removeSCAddressFromWhitelist => remove_sc_address_from_whitelist + isSCAddressWhitelisted => is_sc_address_whitelisted + addToTokenTransferWhitelist => add_to_token_transfer_whitelist + removeFromTokenTransferWhitelist => remove_from_token_transfer_whitelist + setUserEnergyAfterLockedTokenTransfer => set_user_energy_after_locked_token_transfer ) } + +multiversx_sc_wasm_adapter::async_callback! { energy_factory } diff --git a/locked-asset/factory/wasm/Cargo.lock b/locked-asset/factory/wasm/Cargo.lock index ca5df67df..5b759e551 100644 --- a/locked-asset/factory/wasm/Cargo.lock +++ b/locked-asset/factory/wasm/Cargo.lock @@ -187,9 +187,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" dependencies = [ "bitflags", "hashbrown", @@ -201,20 +201,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -224,9 +223,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" dependencies = [ "hex", "proc-macro2", @@ -237,21 +236,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -280,18 +278,18 @@ checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.23" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] diff --git a/locked-asset/factory/wasm/src/lib.rs b/locked-asset/factory/wasm/src/lib.rs index e5250b664..3593ccb49 100644 --- a/locked-asset/factory/wasm/src/lib.rs +++ b/locked-asset/factory/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 26 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,30 +21,32 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { factory ( - whitelist - removeWhitelist - createAndForwardCustomPeriod - createAndForward - unlockAssets - lockAssets - setUnlockPeriod - registerLockedAssetToken - setInitEpoch - getInitEpoch - getWhitelistedContracts - getDefaultUnlockPeriod - getLockedAssetTokenId - getAssetTokenId - getUnlockScheduleForSFTNonce - getCacheSize - mergeTokens - getExtendedAttributesActivationNonce - setLockedTokenBurnRoleForAddress - setTransferRoleOldLockedToken - setNewFactoryAddress - pause - unpause - isPaused - callBack + init => init + whitelist => whitelist + removeWhitelist => remove_whitelist + createAndForwardCustomPeriod => create_and_forward_custom_period + createAndForward => create_and_forward + unlockAssets => unlock_assets + lockAssets => lock_assets + setUnlockPeriod => set_unlock_period + registerLockedAssetToken => register_locked_asset_token + setInitEpoch => set_init_epoch + getInitEpoch => init_epoch + getWhitelistedContracts => whitelisted_contracts + getDefaultUnlockPeriod => default_unlock_period + getLockedAssetTokenId => locked_asset_token + getAssetTokenId => asset_token_id + getUnlockScheduleForSFTNonce => get_unlock_schedule_for_sft_nonce + getCacheSize => get_cache_size + mergeTokens => merge_tokens + getExtendedAttributesActivationNonce => extended_attributes_activation_nonce + setLockedTokenBurnRoleForAddress => set_locked_token_burn_role_for_address + setTransferRoleOldLockedToken => set_transfer_role_old_locked_token + setNewFactoryAddress => set_new_factory_address + pause => pause_endpoint + unpause => unpause_endpoint + isPaused => paused_status ) } + +multiversx_sc_wasm_adapter::async_callback! { factory } diff --git a/locked-asset/lkmex-transfer/wasm/Cargo.lock b/locked-asset/lkmex-transfer/wasm/Cargo.lock index 0956bbfca..de13098e5 100644 --- a/locked-asset/lkmex-transfer/wasm/Cargo.lock +++ b/locked-asset/lkmex-transfer/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -128,12 +122,6 @@ dependencies = [ "utils", ] -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - [[package]] name = "lkmex-transfer" version = "0.0.0" @@ -163,12 +151,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -178,9 +160,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" dependencies = [ "bitflags", "hashbrown", @@ -192,20 +174,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -215,9 +196,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" dependencies = [ "hex", "proc-macro2", @@ -228,21 +209,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -280,18 +260,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.23" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -368,37 +348,3 @@ name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/locked-asset/lkmex-transfer/wasm/src/lib.rs b/locked-asset/lkmex-transfer/wasm/src/lib.rs index 5b48ab16b..88d45c5f9 100644 --- a/locked-asset/lkmex-transfer/wasm/src/lib.rs +++ b/locked-asset/lkmex-transfer/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 13 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,18 +21,19 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { lkmex_transfer ( - withdraw - cancelTransfer - lockFunds - getScheduledTransfers - getAllSenders - setEnergyFactoryAddress - getEnergyFactoryAddress - addAdmin - removeAdmin - updateOwnerOrAdmin - getPermissions + init => init + withdraw => withdraw + cancelTransfer => cancel_transfer + lockFunds => lock_funds + getScheduledTransfers => get_scheduled_transfers + getAllSenders => all_senders + setEnergyFactoryAddress => set_energy_factory_address + getEnergyFactoryAddress => energy_factory_address + addAdmin => add_admin_endpoint + removeAdmin => remove_admin_endpoint + updateOwnerOrAdmin => update_owner_or_admin_endpoint + getPermissions => permissions ) } -multiversx_sc_wasm_adapter::empty_callback! {} +multiversx_sc_wasm_adapter::async_callback_empty! {} diff --git a/locked-asset/locked-token-wrapper/wasm/Cargo.lock b/locked-asset/locked-token-wrapper/wasm/Cargo.lock index 389a26cc8..023c10693 100644 --- a/locked-asset/locked-token-wrapper/wasm/Cargo.lock +++ b/locked-asset/locked-token-wrapper/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -136,12 +130,6 @@ dependencies = [ "utils", ] -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - [[package]] name = "lkmex-transfer" version = "0.0.0" @@ -187,12 +175,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -202,9 +184,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" dependencies = [ "bitflags", "hashbrown", @@ -216,20 +198,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -239,9 +220,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" dependencies = [ "hex", "proc-macro2", @@ -252,21 +233,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -304,18 +284,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.23" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -392,37 +372,3 @@ name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/locked-asset/locked-token-wrapper/wasm/src/lib.rs b/locked-asset/locked-token-wrapper/wasm/src/lib.rs index efae1ed5e..dd7c8fd96 100644 --- a/locked-asset/locked-token-wrapper/wasm/src/lib.rs +++ b/locked-asset/locked-token-wrapper/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 10 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,14 +21,16 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { locked_token_wrapper ( - wrapLockedToken - unwrapLockedToken - issueWrappedToken - setTransferRoleWrappedToken - unsetTransferRoleWrappedToken - getWrappedTokenId - setEnergyFactoryAddress - getEnergyFactoryAddress - callBack + init => init + wrapLockedToken => wrap_locked_token_endpoint + unwrapLockedToken => unwrap_locked_token_endpoint + issueWrappedToken => issue_wrapped_token + setTransferRoleWrappedToken => set_transfer_role + unsetTransferRoleWrappedToken => unset_transfer_role + getWrappedTokenId => wrapped_token + setEnergyFactoryAddress => set_energy_factory_address + getEnergyFactoryAddress => energy_factory_address ) } + +multiversx_sc_wasm_adapter::async_callback! { locked_token_wrapper } diff --git a/locked-asset/proxy_dex/wasm/Cargo.lock b/locked-asset/proxy_dex/wasm/Cargo.lock index fe099d430..b40656523 100644 --- a/locked-asset/proxy_dex/wasm/Cargo.lock +++ b/locked-asset/proxy_dex/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -314,12 +308,6 @@ dependencies = [ "utils", ] -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - [[package]] name = "locking_module" version = "0.0.0" @@ -336,12 +324,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -351,9 +333,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" dependencies = [ "bitflags", "hashbrown", @@ -365,20 +347,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -388,9 +369,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" dependencies = [ "hex", "proc-macro2", @@ -401,21 +382,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -476,9 +456,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] @@ -516,9 +496,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.23" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -628,18 +608,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -659,25 +627,3 @@ dependencies = [ "unwrappable", "week-timekeeping", ] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/locked-asset/proxy_dex/wasm/src/lib.rs b/locked-asset/proxy_dex/wasm/src/lib.rs index 892463480..096dff097 100644 --- a/locked-asset/proxy_dex/wasm/src/lib.rs +++ b/locked-asset/proxy_dex/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 27 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,31 +21,33 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { proxy_dex ( - registerProxyPair - setTransferRoleWrappedLpToken - registerProxyFarm - setTransferRoleWrappedFarmToken - getAssetTokenId - getLockedTokenIds - getOldLockedTokenId - getOldFactoryAddress - getWrappedLpTokenId - getWrappedFarmTokenId - addPairToIntermediate - removeIntermediatedPair - addFarmToIntermediate - removeIntermediatedFarm - getIntermediatedPairs - getIntermediatedFarms - addLiquidityProxy - removeLiquidityProxy - enterFarmProxy - exitFarmProxy - claimRewardsProxy - mergeWrappedFarmTokens - mergeWrappedLpTokens - setEnergyFactoryAddress - getEnergyFactoryAddress - callBack + init => init + registerProxyPair => register_proxy_pair + setTransferRoleWrappedLpToken => set_transfer_role_wrapped_lp_token + registerProxyFarm => register_proxy_farm + setTransferRoleWrappedFarmToken => set_transfer_role_wrapped_farm_token + getAssetTokenId => get_asset_token_id_view + getLockedTokenIds => get_locked_token_ids_view + getOldLockedTokenId => old_locked_token_id + getOldFactoryAddress => old_factory_address + getWrappedLpTokenId => wrapped_lp_token + getWrappedFarmTokenId => wrapped_farm_token + addPairToIntermediate => add_pair_to_intermediate + removeIntermediatedPair => remove_intermediated_pair + addFarmToIntermediate => add_farm_to_intermediate + removeIntermediatedFarm => remove_intermediated_farm + getIntermediatedPairs => intermediated_pairs + getIntermediatedFarms => intermediated_farms + addLiquidityProxy => add_liquidity_proxy + removeLiquidityProxy => remove_liquidity_proxy + enterFarmProxy => enter_farm_proxy_endpoint + exitFarmProxy => exit_farm_proxy + claimRewardsProxy => claim_rewards_proxy + mergeWrappedFarmTokens => merge_wrapped_farm_tokens_endpoint + mergeWrappedLpTokens => merge_wrapped_lp_tokens_endpoint + setEnergyFactoryAddress => set_energy_factory_address + getEnergyFactoryAddress => energy_factory_address ) } + +multiversx_sc_wasm_adapter::async_callback! { proxy_dex } diff --git a/locked-asset/simple-lock-whitelist/wasm/Cargo.lock b/locked-asset/simple-lock-whitelist/wasm/Cargo.lock index 678cb0db6..294b59f7c 100644 --- a/locked-asset/simple-lock-whitelist/wasm/Cargo.lock +++ b/locked-asset/simple-lock-whitelist/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -88,12 +82,6 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - [[package]] name = "math" version = "0.0.0" @@ -101,12 +89,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -116,9 +98,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" dependencies = [ "bitflags", "hashbrown", @@ -130,20 +112,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -153,9 +134,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" dependencies = [ "hex", "proc-macro2", @@ -166,21 +147,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -209,18 +189,18 @@ checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.23" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -307,37 +287,3 @@ name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/locked-asset/simple-lock-whitelist/wasm/src/lib.rs b/locked-asset/simple-lock-whitelist/wasm/src/lib.rs index 2d42f0f2c..8d60bed84 100644 --- a/locked-asset/simple-lock-whitelist/wasm/src/lib.rs +++ b/locked-asset/simple-lock-whitelist/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 26 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,30 +21,32 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { simple_lock_whitelist ( - setTransferRoleLockedToken - setTransferRoleProxyLpToken - setTransferRoleProxyFarmToken - setLockedToken - lockTokens - unlockTokens - getTokenWhitelist - issueLockedToken - getLockedTokenId - issueLpProxyToken - addLpToWhitelist - removeLpFromWhitelist - addLiquidityLockedToken - removeLiquidityLockedToken - getKnownLiquidityPools - getLpProxyTokenId - issueFarmProxyToken - addFarmToWhitelist - removeFarmFromWhitelist - enterFarmLockedToken - exitFarmLockedToken - farmClaimRewardsLockedToken - getKnownFarms - getFarmProxyTokenId - callBack + init => init + setTransferRoleLockedToken => set_transfer_role + setTransferRoleProxyLpToken => set_transfer_role_proxy_lp + setTransferRoleProxyFarmToken => set_transfer_role_proxy_farm + setLockedToken => set_locked_token + lockTokens => lock_tokens_endpoint + unlockTokens => unlock_tokens_endpoint + getTokenWhitelist => token_whitelist + issueLockedToken => issue_locked_token + getLockedTokenId => locked_token + issueLpProxyToken => issue_lp_proxy_token + addLpToWhitelist => add_lp_to_whitelist + removeLpFromWhitelist => remove_lp_from_whitelist + addLiquidityLockedToken => add_liquidity_locked_token + removeLiquidityLockedToken => remove_liquidity_locked_token + getKnownLiquidityPools => known_liquidity_pools + getLpProxyTokenId => lp_proxy_token + issueFarmProxyToken => issue_farm_proxy_token + addFarmToWhitelist => add_farm_to_whitelist + removeFarmFromWhitelist => remove_farm_from_whitelist + enterFarmLockedToken => enter_farm_locked_token + exitFarmLockedToken => exit_farm_locked_token + farmClaimRewardsLockedToken => farm_claim_rewards_locked_token + getKnownFarms => known_farms + getFarmProxyTokenId => farm_proxy_token ) } + +multiversx_sc_wasm_adapter::async_callback! { simple_lock_whitelist } diff --git a/locked-asset/simple-lock/wasm/Cargo.lock b/locked-asset/simple-lock/wasm/Cargo.lock index 270c2aca4..3e1b222c7 100644 --- a/locked-asset/simple-lock/wasm/Cargo.lock +++ b/locked-asset/simple-lock/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -88,12 +82,6 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - [[package]] name = "math" version = "0.0.0" @@ -101,12 +89,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -116,9 +98,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" dependencies = [ "bitflags", "hashbrown", @@ -130,20 +112,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -153,9 +134,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" dependencies = [ "hex", "proc-macro2", @@ -166,21 +147,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -209,18 +189,18 @@ checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.23" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -287,37 +267,3 @@ name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/locked-asset/simple-lock/wasm/src/lib.rs b/locked-asset/simple-lock/wasm/src/lib.rs index 042660883..afe83b5ff 100644 --- a/locked-asset/simple-lock/wasm/src/lib.rs +++ b/locked-asset/simple-lock/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 21 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,25 +21,27 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { simple_lock ( - lockTokens - unlockTokens - issueLockedToken - getLockedTokenId - issueLpProxyToken - addLpToWhitelist - removeLpFromWhitelist - addLiquidityLockedToken - removeLiquidityLockedToken - getKnownLiquidityPools - getLpProxyTokenId - issueFarmProxyToken - addFarmToWhitelist - removeFarmFromWhitelist - enterFarmLockedToken - exitFarmLockedToken - farmClaimRewardsLockedToken - getKnownFarms - getFarmProxyTokenId - callBack + init => init + lockTokens => lock_tokens_endpoint + unlockTokens => unlock_tokens_endpoint + issueLockedToken => issue_locked_token + getLockedTokenId => locked_token + issueLpProxyToken => issue_lp_proxy_token + addLpToWhitelist => add_lp_to_whitelist + removeLpFromWhitelist => remove_lp_from_whitelist + addLiquidityLockedToken => add_liquidity_locked_token + removeLiquidityLockedToken => remove_liquidity_locked_token + getKnownLiquidityPools => known_liquidity_pools + getLpProxyTokenId => lp_proxy_token + issueFarmProxyToken => issue_farm_proxy_token + addFarmToWhitelist => add_farm_to_whitelist + removeFarmFromWhitelist => remove_farm_from_whitelist + enterFarmLockedToken => enter_farm_locked_token + exitFarmLockedToken => exit_farm_locked_token + farmClaimRewardsLockedToken => farm_claim_rewards_locked_token + getKnownFarms => known_farms + getFarmProxyTokenId => farm_proxy_token ) } + +multiversx_sc_wasm_adapter::async_callback! { simple_lock } diff --git a/locked-asset/token-unstake/wasm/Cargo.lock b/locked-asset/token-unstake/wasm/Cargo.lock index 4a78e1d16..9558941a9 100644 --- a/locked-asset/token-unstake/wasm/Cargo.lock +++ b/locked-asset/token-unstake/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -135,12 +129,6 @@ dependencies = [ "utils", ] -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - [[package]] name = "math" version = "0.0.0" @@ -148,12 +136,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -163,9 +145,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" dependencies = [ "bitflags", "hashbrown", @@ -177,20 +159,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -200,9 +181,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" dependencies = [ "hex", "proc-macro2", @@ -213,21 +194,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -256,18 +236,18 @@ checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.23" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -367,18 +347,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -386,25 +354,3 @@ dependencies = [ "common-types", "multiversx-sc", ] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/locked-asset/token-unstake/wasm/src/lib.rs b/locked-asset/token-unstake/wasm/src/lib.rs index e0ac873af..f2f371c21 100644 --- a/locked-asset/token-unstake/wasm/src/lib.rs +++ b/locked-asset/token-unstake/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 12 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,17 +21,18 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { token_unstake ( - getUnbondEpochs - getUnlockedTokensForUser - claimUnlockedTokens - cancelUnbond - depositUserTokens - depositFees - getFeesBurnPercentage - getFeesCollectorAddress - setEnergyFactoryAddress - getEnergyFactoryAddress + init => init + getUnbondEpochs => unbond_epochs + getUnlockedTokensForUser => unlocked_tokens_for_user + claimUnlockedTokens => claim_unlocked_tokens + cancelUnbond => cancel_unbond + depositUserTokens => deposit_user_tokens + depositFees => deposit_fees + getFeesBurnPercentage => fees_burn_percentage + getFeesCollectorAddress => fees_collector_address + setEnergyFactoryAddress => set_energy_factory_address + getEnergyFactoryAddress => energy_factory_address ) } -multiversx_sc_wasm_adapter::empty_callback! {} +multiversx_sc_wasm_adapter::async_callback_empty! {} diff --git a/pause-all/wasm/Cargo.lock b/pause-all/wasm/Cargo.lock index 8dfdb7105..ef99da944 100644 --- a/pause-all/wasm/Cargo.lock +++ b/pause-all/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -77,23 +71,11 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" dependencies = [ "bitflags", "hashbrown", @@ -105,20 +87,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -128,9 +109,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" dependencies = [ "hex", "proc-macro2", @@ -141,21 +122,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -218,18 +198,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.23" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -272,37 +252,3 @@ name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/pause-all/wasm/src/lib.rs b/pause-all/wasm/src/lib.rs index 6177d8585..d92fcfc45 100644 --- a/pause-all/wasm/src/lib.rs +++ b/pause-all/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 9 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,14 +21,15 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { pause_all ( - addPausableContracts - removePausableContracts - pauseSelected - pauseAll - resumeSelected - resumeAll - getPausableContracts + init => init + addPausableContracts => add_pausable_contracts + removePausableContracts => remove_pausable_contracts + pauseSelected => pause_selected + pauseAll => pause_all + resumeSelected => resume_selected + resumeAll => resume_all + getPausableContracts => pausable_contracts ) } -multiversx_sc_wasm_adapter::empty_callback! {} +multiversx_sc_wasm_adapter::async_callback_empty! {} From 4b4e0b713f54349a47ecd0dba0ff866d6bcd6689 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Wed, 13 Sep 2023 11:14:56 +0300 Subject: [PATCH 074/213] farm position first audit fixes --- common/modules/farm/config/src/config.rs | 48 ++++-- .../farm_base_impl/src/base_traits_impl.rs | 41 +++-- .../farm/farm_base_impl/src/claim_rewards.rs | 4 +- .../farm_base_impl/src/compound_rewards.rs | 3 +- dex/farm-with-locked-rewards/src/lib.rs | 121 +++++++++------ dex/farm-with-locked-rewards/wasm/Cargo.lock | 84 ++-------- dex/farm-with-locked-rewards/wasm/src/lib.rs | 142 +++++++++-------- dex/farm/src/base_functions.rs | 29 ++-- dex/farm/src/claim_boost_only.rs | 90 ----------- dex/farm/src/lib.rs | 107 ++++++++----- dex/farm/src/progress_update.rs | 27 ---- dex/farm/tests/farm_multi_user_test.rs | 8 +- .../tests/farm_setup/multi_user_farm_setup.rs | 9 +- dex/farm/wasm/Cargo.lock | 84 ++-------- dex/farm/wasm/src/lib.rs | 136 ++++++++-------- .../farm-boosted-yields/src/lib.rs | 9 +- energy-integration/fees-collector/elrond.json | 3 - .../fees-collector/src/config.rs | 7 + .../fees-collector/wasm/Cargo.lock | 84 ++-------- .../fees-collector/wasm/src/lib.rs | 85 +++++----- .../src/proxy_actions/merge_pos.rs | 2 +- .../farm-staking-proxy/wasm/Cargo.lock | 84 ++-------- .../farm-staking-proxy/wasm/src/lib.rs | 39 +++-- farm-staking/farm-staking/elrond.json | 3 - .../farm-staking/src/base_impl_wrapper.rs | 34 ++-- .../src/claim_only_boosted_staking_rewards.rs | 41 ++--- .../farm-staking/src/custom_rewards.rs | 2 +- farm-staking/farm-staking/src/lib.rs | 30 +++- farm-staking/farm-staking/src/stake_farm.rs | 20 ++- farm-staking/farm-staking/src/unstake_farm.rs | 6 +- .../tests/farm_staking_setup/mod.rs | 4 +- farm-staking/farm-staking/wasm/Cargo.lock | 84 ++-------- farm-staking/farm-staking/wasm/src/lib.rs | 146 +++++++++--------- 33 files changed, 682 insertions(+), 934 deletions(-) delete mode 100644 dex/farm/src/claim_boost_only.rs delete mode 100644 dex/farm/src/progress_update.rs delete mode 100644 energy-integration/fees-collector/elrond.json delete mode 100644 farm-staking/farm-staking/elrond.json diff --git a/common/modules/farm/config/src/config.rs b/common/modules/farm/config/src/config.rs index c7768500f..cb1385ba3 100644 --- a/common/modules/farm/config/src/config.rs +++ b/common/modules/farm/config/src/config.rs @@ -19,11 +19,20 @@ pub const DEFAULT_NFT_DEPOSIT_MAX_LEN: usize = 10; PartialEq, Debug, )] -pub struct UserTotalFarmPositionStruct { +pub struct UserTotalFarmPosition { pub total_farm_position: BigUint, pub allow_external_claim_boosted_rewards: bool, } +impl Default for UserTotalFarmPosition { + fn default() -> Self { + Self { + total_farm_position: BigUint::zero(), + allow_external_claim_boosted_rewards: false, + } + } +} + #[multiversx_sc::module] pub trait ConfigModule: pausable::PausableModule + permissions_module::PermissionsModule { #[inline] @@ -32,17 +41,36 @@ pub trait ConfigModule: pausable::PausableModule + permissions_module::Permissio state == State::Active } - fn get_user_total_farm_position_struct( + fn get_user_total_farm_position( &self, user: &ManagedAddress, - ) -> UserTotalFarmPositionStruct { - self.user_total_farm_position(user) - .set_if_empty(UserTotalFarmPositionStruct { - total_farm_position: BigUint::zero(), - allow_external_claim_boosted_rewards: false, - }); + ) -> UserTotalFarmPosition { + let user_total_farm_position_mapper = self.user_total_farm_position(user); + if user_total_farm_position_mapper.is_empty() { + UserTotalFarmPosition::default() + } else { + user_total_farm_position_mapper.get() + } + } - self.user_total_farm_position(user).get() + #[endpoint(allowExternalClaimBoostedRewards)] + fn allow_external_claim_boosted_rewards(&self, allow_external_claim: bool) { + let caller = self.blockchain().get_caller(); + let user_total_farm_position_mapper = self.user_total_farm_position(&caller); + if user_total_farm_position_mapper.is_empty() { + require!( + allow_external_claim, + "Can only set to true if there is no farm position" + ); + let mut new_user_farm_position: UserTotalFarmPosition = + UserTotalFarmPosition::default(); + new_user_farm_position.allow_external_claim_boosted_rewards = allow_external_claim; + } else { + user_total_farm_position_mapper.update(|user_total_farm_position| { + user_total_farm_position.allow_external_claim_boosted_rewards = + allow_external_claim; + }); + } } #[view(getFarmingTokenId)] @@ -73,5 +101,5 @@ pub trait ConfigModule: pausable::PausableModule + permissions_module::Permissio fn user_total_farm_position( &self, user: &ManagedAddress, - ) -> SingleValueMapper>; + ) -> SingleValueMapper>; } diff --git a/common/modules/farm/farm_base_impl/src/base_traits_impl.rs b/common/modules/farm/farm_base_impl/src/base_traits_impl.rs index 964c014fe..728d7097f 100644 --- a/common/modules/farm/farm_base_impl/src/base_traits_impl.rs +++ b/common/modules/farm/farm_base_impl/src/base_traits_impl.rs @@ -210,8 +210,10 @@ pub trait FarmContract { } } - let user_total_farm_position_struct = sc.get_user_total_farm_position_struct(user); - if user_total_farm_position_struct.total_farm_position == BigUint::zero() { + let user_total_farm_position = sc.get_user_total_farm_position(user); + if user_total_farm_position.total_farm_position == BigUint::zero() + && total_farm_position > 0 + { Self::increase_user_farm_position(sc, user, &total_farm_position); } else if farm_position_increase > 0 { Self::increase_user_farm_position(sc, user, &farm_position_increase); @@ -224,10 +226,10 @@ pub trait FarmContract { user: &ManagedAddress<::Api>, increase_farm_position_amount: &BigUint<::Api>, ) { + let mut user_total_farm_position = sc.get_user_total_farm_position(user); + user_total_farm_position.total_farm_position += increase_farm_position_amount; sc.user_total_farm_position(user) - .update(|user_farm_position_struct| { - user_farm_position_struct.total_farm_position += increase_farm_position_amount - }); + .set(user_total_farm_position); } fn decrease_user_farm_position( @@ -238,17 +240,24 @@ pub trait FarmContract { let token_attributes: FarmTokenAttributes<::Api> = farm_token_mapper.get_token_attributes(farm_position.token_nonce); - sc.user_total_farm_position(&token_attributes.original_owner) - .update(|user_farm_position_struct| { - let mut user_total_farm_position = - user_farm_position_struct.total_farm_position.clone(); - if user_total_farm_position > farm_position.amount { - user_total_farm_position -= &farm_position.amount; - } else { - user_total_farm_position = BigUint::zero(); - } - user_farm_position_struct.total_farm_position = user_total_farm_position; - }); + let mut user_total_farm_position = + sc.get_user_total_farm_position(&token_attributes.original_owner); + + if user_total_farm_position.total_farm_position > farm_position.amount { + user_total_farm_position.total_farm_position -= &farm_position.amount; + } else { + user_total_farm_position.total_farm_position = BigUint::zero(); + } + + if user_total_farm_position.total_farm_position == 0 + && user_total_farm_position.allow_external_claim_boosted_rewards == false + { + sc.user_total_farm_position(&token_attributes.original_owner) + .clear(); + } else { + sc.user_total_farm_position(&token_attributes.original_owner) + .set(user_total_farm_position); + } } } diff --git a/common/modules/farm/farm_base_impl/src/claim_rewards.rs b/common/modules/farm/farm_base_impl/src/claim_rewards.rs index 85b0e7ef6..d9dfe293e 100644 --- a/common/modules/farm/farm_base_impl/src/claim_rewards.rs +++ b/common/modules/farm/farm_base_impl/src/claim_rewards.rs @@ -63,8 +63,6 @@ pub trait BaseClaimRewardsModule: self.blockchain(), ); - FC::check_and_update_user_farm_position(self, &caller, &payments); - FC::generate_aggregated_rewards(self, &mut storage_cache); let farm_token_amount = &claim_rewards_context.first_farm_token.payment.amount; @@ -83,6 +81,8 @@ pub trait BaseClaimRewardsModule: ); storage_cache.reward_reserve -= &reward; + FC::check_and_update_user_farm_position(self, &caller, &payments); + let farm_token_mapper = self.farm_token(); let base_attributes = FC::create_claim_rewards_initial_attributes( self, diff --git a/common/modules/farm/farm_base_impl/src/compound_rewards.rs b/common/modules/farm/farm_base_impl/src/compound_rewards.rs index 74a5f74d6..06e52585c 100644 --- a/common/modules/farm/farm_base_impl/src/compound_rewards.rs +++ b/common/modules/farm/farm_base_impl/src/compound_rewards.rs @@ -51,7 +51,6 @@ pub trait BaseCompoundRewardsModule: self.blockchain(), ); - FC::check_and_update_user_farm_position(self, &caller, &payments); FC::generate_aggregated_rewards(self, &mut storage_cache); let farm_token_amount = &compound_rewards_context.first_farm_token.payment.amount; @@ -71,6 +70,8 @@ pub trait BaseCompoundRewardsModule: storage_cache.reward_reserve -= &reward; storage_cache.farm_token_supply += &reward; + FC::check_and_update_user_farm_position(self, &caller, &payments); + let farm_token_mapper = self.farm_token(); let base_attributes = FC::create_compound_rewards_initial_attributes( self, diff --git a/dex/farm-with-locked-rewards/src/lib.rs b/dex/farm-with-locked-rewards/src/lib.rs index 948ed0739..0205b1fca 100644 --- a/dex/farm-with-locked-rewards/src/lib.rs +++ b/dex/farm-with-locked-rewards/src/lib.rs @@ -11,7 +11,7 @@ use core::marker::PhantomData; use mergeable::Mergeable; use farm::{ - base_functions::{BaseFunctionsModule, ClaimRewardsResultType, Wrapper}, + base_functions::{BaseFunctionsModule, ClaimRewardsResultType, DoubleMultiPayment, Wrapper}, exit_penalty::{ DEFAULT_BURN_GAS_LIMIT, DEFAULT_MINUMUM_FARMING_EPOCHS, DEFAULT_PENALTY_PERCENT, }, @@ -34,8 +34,6 @@ pub trait Farm: + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule + farm::base_functions::BaseFunctionsModule + farm::exit_penalty::ExitPenaltyModule - + farm::progress_update::ProgressUpdateModule - + farm::claim_boost_only::ClaimBoostOnlyModule + farm_base_impl::base_farm_init::BaseFarmInitModule + farm_base_impl::base_farm_validation::BaseFarmValidationModule + farm_base_impl::enter_farm::BaseEnterFarmModule @@ -89,19 +87,16 @@ pub trait Farm: let caller = self.blockchain().get_caller(); let orig_caller = self.get_orig_caller_from_opt(&caller, opt_orig_caller); - let payments = self.get_non_empty_payments(); - let first_additional_payment_index = 1; - let boosted_rewards = match payments.try_get(first_additional_payment_index) { - Some(p) => { - let unlocked_rewards = self.claim_only_boosted_payment(&orig_caller, &p); - self.send_to_lock_contract_non_zero( - unlocked_rewards.token_identifier, - unlocked_rewards.amount, - caller.clone(), - orig_caller.clone(), - ) - } - None => EsdtTokenPayment::new(self.reward_token_id().get(), 0, BigUint::zero()), + let boosted_rewards = self.claim_only_boosted_payment(&orig_caller); + let boosted_rewards_payment = if boosted_rewards > 0 { + self.send_to_lock_contract_non_zero( + self.reward_token_id().get(), + boosted_rewards, + caller.clone(), + orig_caller.clone(), + ) + } else { + EsdtTokenPayment::new(self.reward_token_id().get(), 0, BigUint::zero()) }; let new_farm_token = self.enter_farm::>(orig_caller.clone()); @@ -109,7 +104,7 @@ pub trait Farm: self.update_energy_and_progress(&orig_caller); - (new_farm_token, boosted_rewards).into() + (new_farm_token, boosted_rewards_payment).into() } #[payable("*")] @@ -163,7 +158,10 @@ pub trait Farm: "Exit amount is bigger than the payment amount" ); - let boosted_rewards_full_position = self.claim_only_boosted_payment(&orig_caller, &payment); + let boosted_rewards = self.claim_only_boosted_payment(&orig_caller); + let boosted_rewards_full_position = + EsdtTokenPayment::new(self.reward_token_id().get(), 0, boosted_rewards); + let remaining_farm_payment = EsdtTokenPayment::new( payment.token_identifier.clone(), payment.token_nonce, @@ -186,7 +184,7 @@ pub trait Farm: orig_caller.clone(), ); - self.clear_user_energy_if_needed(&orig_caller, &remaining_farm_payment.amount); + self.clear_user_energy_if_needed(&orig_caller); ( exit_farm_result.farming_tokens, @@ -196,41 +194,57 @@ pub trait Farm: .into() } - #[view(calculateRewardsForGivenPosition)] - fn calculate_rewards_for_given_position( - &self, - user: ManagedAddress, - farm_token_amount: BigUint, - attributes: FarmTokenAttributes, - ) -> BigUint { - self.require_queried(); - - let mut storage_cache = StorageCache::new(self); - NoMintWrapper::::generate_aggregated_rewards(self, &mut storage_cache); - - NoMintWrapper::::calculate_rewards( - self, - &user, - &farm_token_amount, - &attributes, - &storage_cache, - ) - } - #[payable("*")] #[endpoint(mergeFarmTokens)] fn merge_farm_tokens_endpoint( &self, opt_orig_caller: OptionalValue, - ) -> EsdtTokenPayment { + ) -> DoubleMultiPayment { let caller = self.blockchain().get_caller(); let orig_caller = self.get_orig_caller_from_opt(&caller, opt_orig_caller); - self.check_claim_progress_for_merge(&orig_caller); + + let boosted_rewards = self.claim_only_boosted_payment(&orig_caller); let merged_farm_token = self.merge_farm_tokens::>(); self.send_payment_non_zero(&caller, &merged_farm_token); - merged_farm_token + let locked_rewards_payment = self.send_to_lock_contract_non_zero( + self.reward_token_id().get(), + boosted_rewards, + caller, + orig_caller.clone(), + ); + + (merged_farm_token, locked_rewards_payment).into() + } + + #[endpoint(claimBoostedRewards)] + fn claim_boosted_rewards( + &self, + opt_user: OptionalValue, + ) -> EsdtTokenPayment { + let caller = self.blockchain().get_caller(); + let user = match &opt_user { + OptionalValue::Some(user) => user, + OptionalValue::None => &caller, + }; + let user_total_farm_position = self.get_user_total_farm_position(user); + if user != &caller { + require!( + user_total_farm_position.allow_external_claim_boosted_rewards, + "Cannot claim rewards for this address" + ); + } + + let boosted_rewards = self.claim_only_boosted_payment(&user); + let locked_rewards_payment = self.send_to_lock_contract_non_zero( + self.reward_token_id().get(), + boosted_rewards, + caller.clone(), + user.clone(), + ); + + locked_rewards_payment } #[endpoint(startProduceRewards)] @@ -251,6 +265,27 @@ pub trait Farm: self.set_per_block_rewards::>(per_block_amount); } + #[view(calculateRewardsForGivenPosition)] + fn calculate_rewards_for_given_position( + &self, + user: ManagedAddress, + farm_token_amount: BigUint, + attributes: FarmTokenAttributes, + ) -> BigUint { + self.require_queried(); + + let mut storage_cache = StorageCache::new(self); + NoMintWrapper::::generate_aggregated_rewards(self, &mut storage_cache); + + NoMintWrapper::::calculate_rewards( + self, + &user, + &farm_token_amount, + &attributes, + &storage_cache, + ) + } + fn send_to_lock_contract_non_zero( &self, token_id: TokenIdentifier, diff --git a/dex/farm-with-locked-rewards/wasm/Cargo.lock b/dex/farm-with-locked-rewards/wasm/Cargo.lock index 83649b5f2..edf24d617 100644 --- a/dex/farm-with-locked-rewards/wasm/Cargo.lock +++ b/dex/farm-with-locked-rewards/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -322,12 +316,6 @@ dependencies = [ "utils", ] -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - [[package]] name = "locking_module" version = "0.0.0" @@ -344,12 +332,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -359,9 +341,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "386c2727eba66bc5e502e470d7afa55fdd69aedff440c508bb9ba85aec36a52a" dependencies = [ "bitflags", "hashbrown", @@ -373,20 +355,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -396,9 +377,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "050510b6b9836b24b4a73bb7878c58c268d56bde1c6eb0f9a88dce9a6518507b" dependencies = [ "hex", "proc-macro2", @@ -409,21 +390,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "3b55fe3585cbc745bd7b9793be4bcb3aa7f1869ced7a0981f3d47e6a832c6311" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "b059f22dfc3eb45aa015f6f20f28ed34dc42a65b42d282f8ac9b799b12e2942c" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -484,9 +464,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] @@ -605,18 +585,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -636,25 +604,3 @@ dependencies = [ "unwrappable", "week-timekeeping", ] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/dex/farm-with-locked-rewards/wasm/src/lib.rs b/dex/farm-with-locked-rewards/wasm/src/lib.rs index a124d3269..eab8f6b92 100644 --- a/dex/farm-with-locked-rewards/wasm/src/lib.rs +++ b/dex/farm-with-locked-rewards/wasm/src/lib.rs @@ -5,12 +5,15 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 64 +// Endpoints: 65 // Async Callback: 1 -// Total number of exported functions: 66 +// Total number of exported functions: 67 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,70 +21,73 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { farm_with_locked_rewards ( - enterFarm - claimRewards - exitFarm - calculateRewardsForGivenPosition - mergeFarmTokens - startProduceRewards - endProduceRewards - setPerBlockRewardAmount - getRewardPerShare - getRewardReserve - getFarmingTokenId - getRewardTokenId - getPerBlockRewardAmount - getLastRewardBlockNonce - getDivisionSafetyConstant - getUserTotalFarmPosition - setLockingScAddress - setLockEpochs - getLockingScAddress - getLockEpochs - registerFarmToken - getFarmTokenId - getFarmTokenSupply - addToPauseWhitelist - removeFromPauseWhitelist - pause - resume - getState - addAdmin - removeAdmin - updateOwnerOrAdmin - getPermissions - addSCAddressToWhitelist - removeSCAddressFromWhitelist - isSCAddressWhitelisted - set_penalty_percent - set_minimum_farming_epochs - set_burn_gas_limit - getPenaltyPercent - getMinimumFarmingEpoch - getBurnGasLimit - getPairContractManagedAddress - claimBoostedRewards - setBoostedYieldsRewardsPercentage - collectUndistributedBoostedRewards - getBoostedYieldsRewardsPercentage - getAccumulatedRewardsForWeek - getFarmSupplyForWeek - getRemainingBoostedRewardsToDistribute - getUndistributedBoostedRewards - setBoostedYieldsFactors - getBoostedYieldsFactors - getCurrentWeek - getFirstWeekStartEpoch - getLastActiveWeekForUser - getUserEnergyForWeek - getLastGlobalUpdateWeek - getTotalRewardsForWeek - getTotalEnergyForWeek - getTotalLockedTokensForWeek - updateEnergyForUser - getCurrentClaimProgress - setEnergyFactoryAddress - getEnergyFactoryAddress - callBack + init => init + enterFarm => enter_farm_endpoint + claimRewards => claim_rewards_endpoint + exitFarm => exit_farm_endpoint + mergeFarmTokens => merge_farm_tokens_endpoint + claimBoostedRewards => claim_boosted_rewards + startProduceRewards => start_produce_rewards_endpoint + endProduceRewards => end_produce_rewards_endpoint + setPerBlockRewardAmount => set_per_block_rewards_endpoint + calculateRewardsForGivenPosition => calculate_rewards_for_given_position + getRewardPerShare => reward_per_share + getRewardReserve => reward_reserve + allowExternalClaimBoostedRewards => allow_external_claim_boosted_rewards + getFarmingTokenId => farming_token_id + getRewardTokenId => reward_token_id + getPerBlockRewardAmount => per_block_reward_amount + getLastRewardBlockNonce => last_reward_block_nonce + getDivisionSafetyConstant => division_safety_constant + getUserTotalFarmPosition => user_total_farm_position + setLockingScAddress => set_locking_sc_address + setLockEpochs => set_lock_epochs + getLockingScAddress => locking_sc_address + getLockEpochs => lock_epochs + registerFarmToken => register_farm_token + getFarmTokenId => farm_token + getFarmTokenSupply => farm_token_supply + addToPauseWhitelist => add_to_pause_whitelist + removeFromPauseWhitelist => remove_from_pause_whitelist + pause => pause + resume => resume + getState => state + addAdmin => add_admin_endpoint + removeAdmin => remove_admin_endpoint + updateOwnerOrAdmin => update_owner_or_admin_endpoint + getPermissions => permissions + addSCAddressToWhitelist => add_sc_address_to_whitelist + removeSCAddressFromWhitelist => remove_sc_address_from_whitelist + isSCAddressWhitelisted => is_sc_address_whitelisted + set_penalty_percent => set_penalty_percent + set_minimum_farming_epochs => set_minimum_farming_epochs + set_burn_gas_limit => set_burn_gas_limit + getPenaltyPercent => penalty_percent + getMinimumFarmingEpoch => minimum_farming_epochs + getBurnGasLimit => burn_gas_limit + getPairContractManagedAddress => pair_contract_address + setBoostedYieldsRewardsPercentage => set_boosted_yields_rewards_percentage + collectUndistributedBoostedRewards => collect_undistributed_boosted_rewards + getBoostedYieldsRewardsPercentage => boosted_yields_rewards_percentage + getAccumulatedRewardsForWeek => accumulated_rewards_for_week + getFarmSupplyForWeek => farm_supply_for_week + getRemainingBoostedRewardsToDistribute => remaining_boosted_rewards_to_distribute + getUndistributedBoostedRewards => undistributed_boosted_rewards + setBoostedYieldsFactors => set_boosted_yields_factors + getBoostedYieldsFactors => get_boosted_yields_factors + getCurrentWeek => get_current_week + getFirstWeekStartEpoch => first_week_start_epoch + getLastActiveWeekForUser => get_last_active_week_for_user_view + getUserEnergyForWeek => get_user_energy_for_week_view + getLastGlobalUpdateWeek => last_global_update_week + getTotalRewardsForWeek => total_rewards_for_week + getTotalEnergyForWeek => total_energy_for_week + getTotalLockedTokensForWeek => total_locked_tokens_for_week + updateEnergyForUser => update_energy_for_user + getCurrentClaimProgress => current_claim_progress + setEnergyFactoryAddress => set_energy_factory_address + getEnergyFactoryAddress => energy_factory_address ) } + +multiversx_sc_wasm_adapter::async_callback! { farm_with_locked_rewards } diff --git a/dex/farm/src/base_functions.rs b/dex/farm/src/base_functions.rs index 38fd37014..d67d5db7d 100644 --- a/dex/farm/src/base_functions.rs +++ b/dex/farm/src/base_functions.rs @@ -195,6 +195,15 @@ pub trait BaseFunctionsModule: token_mapper.nft_create(new_token_amount, &output_attributes) } + fn claim_only_boosted_payment(&self, caller: &ManagedAddress) -> BigUint { + let reward = Wrapper::::calculate_boosted_rewards(self, caller); + if reward > 0 { + self.reward_reserve().update(|reserve| *reserve -= &reward); + } + + reward + } + fn end_produce_rewards>(&self) { let mut storage = StorageCache::new(self); FC::generate_aggregated_rewards(self, &mut storage); @@ -238,22 +247,16 @@ where pub fn calculate_boosted_rewards( sc: &::FarmSc, caller: &ManagedAddress<<::FarmSc as ContractBase>::Api>, - token_attributes: &::AttributesType, ) -> BigUint<<::FarmSc as ContractBase>::Api> { - let original_owner = &token_attributes.original_owner; - - if original_owner != caller { - sc.update_energy_and_progress(caller); - } + let user_total_farm_position = sc.get_user_total_farm_position(caller); + let user_farm_position = user_total_farm_position.total_farm_position; + let mut boosted_rewards = BigUint::zero(); - let user_total_farm_position_struct = - sc.get_user_total_farm_position_struct(original_owner); - let user_total_farm_position = user_total_farm_position_struct.total_farm_position; - if user_total_farm_position == BigUint::zero() { - return BigUint::zero(); + if user_farm_position > 0 { + boosted_rewards = sc.claim_boosted_yields_rewards(caller, user_farm_position); } - sc.claim_boosted_yields_rewards(caller, user_total_farm_position) + boosted_rewards } } @@ -297,7 +300,7 @@ where token_attributes, storage_cache, ); - let boosted_yield_rewards = Self::calculate_boosted_rewards(sc, caller, token_attributes); + let boosted_yield_rewards = Self::calculate_boosted_rewards(sc, caller); base_farm_reward + boosted_yield_rewards } diff --git a/dex/farm/src/claim_boost_only.rs b/dex/farm/src/claim_boost_only.rs deleted file mode 100644 index 82a2d4ffc..000000000 --- a/dex/farm/src/claim_boost_only.rs +++ /dev/null @@ -1,90 +0,0 @@ -multiversx_sc::imports!(); - -use crate::base_functions::Wrapper; - -#[multiversx_sc::module] -pub trait ClaimBoostOnlyModule: - config::ConfigModule - + rewards::RewardsModule - + farm_token::FarmTokenModule - + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule - + week_timekeeping::WeekTimekeepingModule - + pausable::PausableModule - + permissions_module::PermissionsModule - + weekly_rewards_splitting::WeeklyRewardsSplittingModule - + weekly_rewards_splitting::events::WeeklyRewardsSplittingEventsModule - + weekly_rewards_splitting::global_info::WeeklyRewardsGlobalInfo - + weekly_rewards_splitting::locked_token_buckets::WeeklyRewardsLockedTokenBucketsModule - + weekly_rewards_splitting::update_claim_progress_energy::UpdateClaimProgressEnergyModule - + energy_query::EnergyQueryModule - + token_send::TokenSendModule - + events::EventsModule - + crate::exit_penalty::ExitPenaltyModule - + farm_base_impl::base_farm_init::BaseFarmInitModule - + farm_base_impl::base_farm_validation::BaseFarmValidationModule - + farm_base_impl::enter_farm::BaseEnterFarmModule - + farm_base_impl::claim_rewards::BaseClaimRewardsModule - + farm_base_impl::compound_rewards::BaseCompoundRewardsModule - + farm_base_impl::exit_farm::BaseExitFarmModule - + utils::UtilsModule - + farm_boosted_yields::FarmBoostedYieldsModule - + farm_boosted_yields::boosted_yields_factors::BoostedYieldsFactorsModule - + crate::base_functions::BaseFunctionsModule -{ - #[payable("*")] - #[endpoint(claimBoostedRewards)] - fn claim_boosted_rewards( - &self, - opt_user: OptionalValue, - ) -> EsdtTokenPayment { - let caller = self.blockchain().get_caller(); - let user = match &opt_user { - OptionalValue::Some(user) => user, - OptionalValue::None => &caller, - }; - let user_total_farm_position_struct = self.get_user_total_farm_position_struct(user); - if user != &caller { - require!( - user_total_farm_position_struct.allow_external_claim_boosted_rewards, - "Cannot claim rewards for this address" - ); - } - - let reward_token_id = self.reward_token_id().get(); - let user_total_farm_position = user_total_farm_position_struct.total_farm_position; - if user_total_farm_position == BigUint::zero() { - return EsdtTokenPayment::new(reward_token_id, 0, BigUint::zero()); - } - - let reward = self.claim_boosted_yields_rewards(user, user_total_farm_position); - if reward > 0 { - self.reward_reserve().update(|reserve| *reserve -= &reward); - } - - let boosted_rewards = EsdtTokenPayment::new(reward_token_id, 0, reward); - self.send_payment_non_zero(user, &boosted_rewards); - - self.update_energy_and_progress(user); - - boosted_rewards - } - - fn claim_only_boosted_payment( - &self, - caller: &ManagedAddress, - payment: &EsdtTokenPayment, - ) -> EsdtTokenPayment { - let farm_token_mapper = self.farm_token(); - farm_token_mapper.require_same_token(&payment.token_identifier); - - let token_attributes = - self.get_attributes_as_part_of_fixed_supply(payment, &farm_token_mapper); - let reward = Wrapper::::calculate_boosted_rewards(self, caller, &token_attributes); - if reward > 0 { - self.reward_reserve().update(|reserve| *reserve -= &reward); - } - - let reward_token_id = self.reward_token_id().get(); - EsdtTokenPayment::new(reward_token_id, 0, reward) - } -} diff --git a/dex/farm/src/lib.rs b/dex/farm/src/lib.rs index cf53e0b68..79204f89e 100644 --- a/dex/farm/src/lib.rs +++ b/dex/farm/src/lib.rs @@ -6,9 +6,7 @@ multiversx_sc::imports!(); multiversx_sc::derive_imports!(); pub mod base_functions; -pub mod claim_boost_only; pub mod exit_penalty; -pub mod progress_update; use base_functions::{ClaimRewardsResultType, DoubleMultiPayment, Wrapper}; use common_structs::FarmTokenAttributes; @@ -37,8 +35,6 @@ pub trait Farm: + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule + base_functions::BaseFunctionsModule + exit_penalty::ExitPenaltyModule - + progress_update::ProgressUpdateModule - + claim_boost_only::ClaimBoostOnlyModule + farm_base_impl::base_farm_init::BaseFarmInitModule + farm_base_impl::base_farm_validation::BaseFarmValidationModule + farm_base_impl::enter_farm::BaseEnterFarmModule @@ -93,20 +89,20 @@ pub trait Farm: let caller = self.blockchain().get_caller(); let orig_caller = self.get_orig_caller_from_opt(&caller, opt_orig_caller); - let payments = self.get_non_empty_payments(); - let first_additional_payment_index = 1; - let boosted_rewards = match payments.try_get(first_additional_payment_index) { - Some(p) => self.claim_only_boosted_payment(&orig_caller, &p), - None => EsdtTokenPayment::new(self.reward_token_id().get(), 0, BigUint::zero()), + let boosted_rewards = self.claim_only_boosted_payment(&orig_caller); + let boosted_rewards_payment = if boosted_rewards > 0 { + EsdtTokenPayment::new(self.reward_token_id().get(), 0, boosted_rewards) + } else { + EsdtTokenPayment::new(self.reward_token_id().get(), 0, BigUint::zero()) }; let new_farm_token = self.enter_farm::>(orig_caller.clone()); self.send_payment_non_zero(&caller, &new_farm_token); - self.send_payment_non_zero(&caller, &boosted_rewards); + self.send_payment_non_zero(&caller, &boosted_rewards_payment); self.update_energy_and_progress(&orig_caller); - (new_farm_token, boosted_rewards).into() + (new_farm_token, boosted_rewards_payment).into() } #[payable("*")] @@ -123,8 +119,6 @@ pub trait Farm: self.send_payment_non_zero(&caller, &claim_rewards_result.new_farm_token); self.send_payment_non_zero(&caller, &claim_rewards_result.rewards); - self.update_energy_and_progress(&orig_caller); - claim_rewards_result.into() } @@ -162,7 +156,10 @@ pub trait Farm: "Exit amount is bigger than the payment amount" ); - let boosted_rewards_full_position = self.claim_only_boosted_payment(&orig_caller, &payment); + let boosted_rewards = self.claim_only_boosted_payment(&orig_caller); + let boosted_rewards_full_position = + EsdtTokenPayment::new(self.reward_token_id().get(), 0, boosted_rewards); + let remaining_farm_payment = EsdtTokenPayment::new( payment.token_identifier.clone(), payment.token_nonce, @@ -180,7 +177,7 @@ pub trait Farm: self.send_payment_non_zero(&caller, &exit_farm_result.rewards); self.send_payment_non_zero(&caller, &remaining_farm_payment); - self.clear_user_energy_if_needed(&orig_caller, &remaining_farm_payment.amount); + self.clear_user_energy_if_needed(&orig_caller); ( exit_farm_result.farming_tokens, @@ -190,41 +187,52 @@ pub trait Farm: .into() } - #[view(calculateRewardsForGivenPosition)] - fn calculate_rewards_for_given_position( - &self, - user: ManagedAddress, - farm_token_amount: BigUint, - attributes: FarmTokenAttributes, - ) -> BigUint { - self.require_queried(); - - let mut storage_cache = StorageCache::new(self); - Wrapper::::generate_aggregated_rewards(self, &mut storage_cache); - - Wrapper::::calculate_rewards( - self, - &user, - &farm_token_amount, - &attributes, - &storage_cache, - ) - } - #[payable("*")] #[endpoint(mergeFarmTokens)] fn merge_farm_tokens_endpoint( &self, opt_orig_caller: OptionalValue, - ) -> EsdtTokenPayment { + ) -> DoubleMultiPayment { let caller = self.blockchain().get_caller(); let orig_caller = self.get_orig_caller_from_opt(&caller, opt_orig_caller); - self.check_claim_progress_for_merge(&orig_caller); + + let boosted_rewards = self.claim_only_boosted_payment(&orig_caller); + let boosted_rewards_full_position = + EsdtTokenPayment::new(self.reward_token_id().get(), 0, boosted_rewards); let merged_farm_token = self.merge_farm_tokens::>(); + self.send_payment_non_zero(&caller, &merged_farm_token); + self.send_payment_non_zero(&orig_caller, &boosted_rewards_full_position); - merged_farm_token + (merged_farm_token, boosted_rewards_full_position).into() + } + + #[endpoint(claimBoostedRewards)] + fn claim_boosted_rewards( + &self, + opt_user: OptionalValue, + ) -> EsdtTokenPayment { + let caller = self.blockchain().get_caller(); + let user = match &opt_user { + OptionalValue::Some(user) => user, + OptionalValue::None => &caller, + }; + let user_total_farm_position = self.get_user_total_farm_position(user); + if user != &caller { + require!( + user_total_farm_position.allow_external_claim_boosted_rewards, + "Cannot claim rewards for this address" + ); + } + + let boosted_rewards = self.claim_only_boosted_payment(&user); + let boosted_rewards_payment = + EsdtTokenPayment::new(self.reward_token_id().get(), 0, boosted_rewards); + + self.send_payment_non_zero(user, &boosted_rewards_payment); + + boosted_rewards_payment } #[endpoint(startProduceRewards)] @@ -244,4 +252,25 @@ pub trait Farm: self.require_caller_has_admin_permissions(); self.set_per_block_rewards::>(per_block_amount); } + + #[view(calculateRewardsForGivenPosition)] + fn calculate_rewards_for_given_position( + &self, + user: ManagedAddress, + farm_token_amount: BigUint, + attributes: FarmTokenAttributes, + ) -> BigUint { + self.require_queried(); + + let mut storage_cache = StorageCache::new(self); + Wrapper::::generate_aggregated_rewards(self, &mut storage_cache); + + Wrapper::::calculate_rewards( + self, + &user, + &farm_token_amount, + &attributes, + &storage_cache, + ) + } } diff --git a/dex/farm/src/progress_update.rs b/dex/farm/src/progress_update.rs deleted file mode 100644 index 48e4b7644..000000000 --- a/dex/farm/src/progress_update.rs +++ /dev/null @@ -1,27 +0,0 @@ -multiversx_sc::imports!(); - -#[multiversx_sc::module] -pub trait ProgressUpdateModule: - week_timekeeping::WeekTimekeepingModule - + weekly_rewards_splitting::WeeklyRewardsSplittingModule - + weekly_rewards_splitting::events::WeeklyRewardsSplittingEventsModule - + weekly_rewards_splitting::global_info::WeeklyRewardsGlobalInfo - + weekly_rewards_splitting::locked_token_buckets::WeeklyRewardsLockedTokenBucketsModule - + weekly_rewards_splitting::update_claim_progress_energy::UpdateClaimProgressEnergyModule - + energy_query::EnergyQueryModule - + utils::UtilsModule -{ - fn check_claim_progress_for_merge(&self, caller: &ManagedAddress) { - let claim_progress_mapper = self.current_claim_progress(caller); - if claim_progress_mapper.is_empty() { - return; - } - - let current_week = self.get_current_week(); - let claim_progress = claim_progress_mapper.get(); - require!( - claim_progress.week == current_week, - "The user claim progress must be up to date." - ) - } -} diff --git a/dex/farm/tests/farm_multi_user_test.rs b/dex/farm/tests/farm_multi_user_test.rs index 182de5c8c..8dfac6b79 100644 --- a/dex/farm/tests/farm_multi_user_test.rs +++ b/dex/farm/tests/farm_multi_user_test.rs @@ -459,11 +459,15 @@ fn farm_boosted_yields_claim_with_different_user_pos_test() { ); // second user claim with first user's pos - // user will only receive rewards for base farm, no boosted rewards + // user will receive both base and boosted rewards, as the claims uses his already saved total token amount let second_base_farm_amt = first_farm_token_amount * 7_500 / total_farm_tokens; + let second_boosted_rewards = 1_533; let second_receveived_reward_amt = farm_setup.claim_rewards(&second_user, 3, first_farm_token_amount); - assert_eq!(second_receveived_reward_amt, second_base_farm_amt); + assert_eq!( + second_receveived_reward_amt, + second_base_farm_amt + second_boosted_rewards + ); farm_setup .b_mock diff --git a/dex/farm/tests/farm_setup/multi_user_farm_setup.rs b/dex/farm/tests/farm_setup/multi_user_farm_setup.rs index 9c8926160..f619c64fa 100644 --- a/dex/farm/tests/farm_setup/multi_user_farm_setup.rs +++ b/dex/farm/tests/farm_setup/multi_user_farm_setup.rs @@ -3,7 +3,6 @@ use common_structs::FarmTokenAttributes; use config::ConfigModule; -use farm::claim_boost_only::ClaimBoostOnlyModule; use multiversx_sc::codec::multi_types::OptionalValue; use multiversx_sc::{ storage::mappers::StorageTokenWrapper, @@ -336,7 +335,9 @@ where self.b_mock .execute_esdt_multi_transfer(user, &self.farm_wrapper, &payments, |sc| { - let out_farm_token = sc.merge_farm_tokens_endpoint(OptionalValue::None); + let (out_farm_token, _) = sc + .merge_farm_tokens_endpoint(OptionalValue::None) + .into_tuple(); assert_eq!( out_farm_token.token_identifier, managed_token_id!(FARM_TOKEN_ID) @@ -567,8 +568,8 @@ where self.b_mock .execute_tx(user, &self.farm_wrapper, &rust_biguint!(0), |sc| { sc.user_total_farm_position(&managed_address!(user)).update( - |user_total_farm_position_struct| { - user_total_farm_position_struct.allow_external_claim_boosted_rewards = true; + |user_total_farm_position| { + user_total_farm_position.allow_external_claim_boosted_rewards = true; }, ); }) diff --git a/dex/farm/wasm/Cargo.lock b/dex/farm/wasm/Cargo.lock index 97ea7e292..c987ae22b 100644 --- a/dex/farm/wasm/Cargo.lock +++ b/dex/farm/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -292,12 +286,6 @@ dependencies = [ "utils", ] -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - [[package]] name = "locking_module" version = "0.0.0" @@ -314,12 +302,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -329,9 +311,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "386c2727eba66bc5e502e470d7afa55fdd69aedff440c508bb9ba85aec36a52a" dependencies = [ "bitflags", "hashbrown", @@ -343,20 +325,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -366,9 +347,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "050510b6b9836b24b4a73bb7878c58c268d56bde1c6eb0f9a88dce9a6518507b" dependencies = [ "hex", "proc-macro2", @@ -379,21 +360,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "3b55fe3585cbc745bd7b9793be4bcb3aa7f1869ced7a0981f3d47e6a832c6311" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "b059f22dfc3eb45aa015f6f20f28ed34dc42a65b42d282f8ac9b799b12e2942c" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -454,9 +434,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] @@ -575,18 +555,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -606,25 +574,3 @@ dependencies = [ "unwrappable", "week-timekeeping", ] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/dex/farm/wasm/src/lib.rs b/dex/farm/wasm/src/lib.rs index 4f3c13441..a522fc32f 100644 --- a/dex/farm/wasm/src/lib.rs +++ b/dex/farm/wasm/src/lib.rs @@ -5,12 +5,15 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 61 +// Endpoints: 62 // Async Callback: 1 -// Total number of exported functions: 63 +// Total number of exported functions: 64 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,67 +21,70 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { farm ( - enterFarm - claimRewards - compoundRewards - exitFarm - calculateRewardsForGivenPosition - mergeFarmTokens - startProduceRewards - endProduceRewards - setPerBlockRewardAmount - getRewardPerShare - getRewardReserve - getFarmingTokenId - getRewardTokenId - getPerBlockRewardAmount - getLastRewardBlockNonce - getDivisionSafetyConstant - getUserTotalFarmPosition - registerFarmToken - getFarmTokenId - getFarmTokenSupply - addToPauseWhitelist - removeFromPauseWhitelist - pause - resume - getState - addAdmin - removeAdmin - updateOwnerOrAdmin - getPermissions - addSCAddressToWhitelist - removeSCAddressFromWhitelist - isSCAddressWhitelisted - set_penalty_percent - set_minimum_farming_epochs - set_burn_gas_limit - getPenaltyPercent - getMinimumFarmingEpoch - getBurnGasLimit - getPairContractManagedAddress - claimBoostedRewards - setBoostedYieldsRewardsPercentage - collectUndistributedBoostedRewards - getBoostedYieldsRewardsPercentage - getAccumulatedRewardsForWeek - getFarmSupplyForWeek - getRemainingBoostedRewardsToDistribute - getUndistributedBoostedRewards - setBoostedYieldsFactors - getBoostedYieldsFactors - getCurrentWeek - getFirstWeekStartEpoch - getLastActiveWeekForUser - getUserEnergyForWeek - getLastGlobalUpdateWeek - getTotalRewardsForWeek - getTotalEnergyForWeek - getTotalLockedTokensForWeek - updateEnergyForUser - getCurrentClaimProgress - setEnergyFactoryAddress - getEnergyFactoryAddress - callBack + init => init + enterFarm => enter_farm_endpoint + claimRewards => claim_rewards_endpoint + compoundRewards => compound_rewards_endpoint + exitFarm => exit_farm_endpoint + mergeFarmTokens => merge_farm_tokens_endpoint + claimBoostedRewards => claim_boosted_rewards + startProduceRewards => start_produce_rewards_endpoint + endProduceRewards => end_produce_rewards_endpoint + setPerBlockRewardAmount => set_per_block_rewards_endpoint + calculateRewardsForGivenPosition => calculate_rewards_for_given_position + getRewardPerShare => reward_per_share + getRewardReserve => reward_reserve + allowExternalClaimBoostedRewards => allow_external_claim_boosted_rewards + getFarmingTokenId => farming_token_id + getRewardTokenId => reward_token_id + getPerBlockRewardAmount => per_block_reward_amount + getLastRewardBlockNonce => last_reward_block_nonce + getDivisionSafetyConstant => division_safety_constant + getUserTotalFarmPosition => user_total_farm_position + registerFarmToken => register_farm_token + getFarmTokenId => farm_token + getFarmTokenSupply => farm_token_supply + addToPauseWhitelist => add_to_pause_whitelist + removeFromPauseWhitelist => remove_from_pause_whitelist + pause => pause + resume => resume + getState => state + addAdmin => add_admin_endpoint + removeAdmin => remove_admin_endpoint + updateOwnerOrAdmin => update_owner_or_admin_endpoint + getPermissions => permissions + addSCAddressToWhitelist => add_sc_address_to_whitelist + removeSCAddressFromWhitelist => remove_sc_address_from_whitelist + isSCAddressWhitelisted => is_sc_address_whitelisted + set_penalty_percent => set_penalty_percent + set_minimum_farming_epochs => set_minimum_farming_epochs + set_burn_gas_limit => set_burn_gas_limit + getPenaltyPercent => penalty_percent + getMinimumFarmingEpoch => minimum_farming_epochs + getBurnGasLimit => burn_gas_limit + getPairContractManagedAddress => pair_contract_address + setBoostedYieldsRewardsPercentage => set_boosted_yields_rewards_percentage + collectUndistributedBoostedRewards => collect_undistributed_boosted_rewards + getBoostedYieldsRewardsPercentage => boosted_yields_rewards_percentage + getAccumulatedRewardsForWeek => accumulated_rewards_for_week + getFarmSupplyForWeek => farm_supply_for_week + getRemainingBoostedRewardsToDistribute => remaining_boosted_rewards_to_distribute + getUndistributedBoostedRewards => undistributed_boosted_rewards + setBoostedYieldsFactors => set_boosted_yields_factors + getBoostedYieldsFactors => get_boosted_yields_factors + getCurrentWeek => get_current_week + getFirstWeekStartEpoch => first_week_start_epoch + getLastActiveWeekForUser => get_last_active_week_for_user_view + getUserEnergyForWeek => get_user_energy_for_week_view + getLastGlobalUpdateWeek => last_global_update_week + getTotalRewardsForWeek => total_rewards_for_week + getTotalEnergyForWeek => total_energy_for_week + getTotalLockedTokensForWeek => total_locked_tokens_for_week + updateEnergyForUser => update_energy_for_user + getCurrentClaimProgress => current_claim_progress + setEnergyFactoryAddress => set_energy_factory_address + getEnergyFactoryAddress => energy_factory_address ) } + +multiversx_sc_wasm_adapter::async_callback! { farm } diff --git a/energy-integration/farm-boosted-yields/src/lib.rs b/energy-integration/farm-boosted-yields/src/lib.rs index fc441b515..931c58f9d 100644 --- a/energy-integration/farm-boosted-yields/src/lib.rs +++ b/energy-integration/farm-boosted-yields/src/lib.rs @@ -129,17 +129,14 @@ pub trait FarmBoostedYieldsModule: self.farm_supply_for_week(current_week).set(farm_supply); } - fn clear_user_energy_if_needed( - &self, - original_caller: &ManagedAddress, - user_remaining_farm_tokens: &BigUint, - ) { + fn clear_user_energy_if_needed(&self, original_caller: &ManagedAddress) { let opt_config = self.try_get_boosted_yields_config(); + let user_total_farm_position = self.get_user_total_farm_position(original_caller); if let Some(config) = opt_config { let boosted_yields_factors = config.get_latest_factors(); self.clear_user_energy( original_caller, - user_remaining_farm_tokens, + &user_total_farm_position.total_farm_position, &boosted_yields_factors.min_farm_amount, ); } diff --git a/energy-integration/fees-collector/elrond.json b/energy-integration/fees-collector/elrond.json deleted file mode 100644 index 736553962..000000000 --- a/energy-integration/fees-collector/elrond.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "language": "rust" -} \ No newline at end of file diff --git a/energy-integration/fees-collector/src/config.rs b/energy-integration/fees-collector/src/config.rs index 1e1a850a0..a21dc6d6b 100644 --- a/energy-integration/fees-collector/src/config.rs +++ b/energy-integration/fees-collector/src/config.rs @@ -60,6 +60,13 @@ pub trait ConfigModule { self.all_tokens().set(&all_tokens_vec); } + #[endpoint(setAllowExternalClaimRewards)] + fn set_allow_external_claim_rewards(&self, allow_external_claim_rewards: bool) { + let caller = self.blockchain().get_caller(); + self.allow_external_claim_rewards(&caller) + .set(allow_external_claim_rewards); + } + #[view(getLockedTokenId)] #[storage_mapper("lockedTokenId")] fn locked_token_id(&self) -> SingleValueMapper; diff --git a/energy-integration/fees-collector/wasm/Cargo.lock b/energy-integration/fees-collector/wasm/Cargo.lock index 601610441..86c6f1c94 100644 --- a/energy-integration/fees-collector/wasm/Cargo.lock +++ b/energy-integration/fees-collector/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -161,12 +155,6 @@ dependencies = [ "utils", ] -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - [[package]] name = "locking_module" version = "0.0.0" @@ -183,12 +171,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -198,9 +180,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "386c2727eba66bc5e502e470d7afa55fdd69aedff440c508bb9ba85aec36a52a" dependencies = [ "bitflags", "hashbrown", @@ -212,20 +194,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -235,9 +216,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "050510b6b9836b24b4a73bb7878c58c268d56bde1c6eb0f9a88dce9a6518507b" dependencies = [ "hex", "proc-macro2", @@ -248,21 +229,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "3b55fe3585cbc745bd7b9793be4bcb3aa7f1869ced7a0981f3d47e6a832c6311" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "b059f22dfc3eb45aa015f6f20f28ed34dc42a65b42d282f8ac9b799b12e2942c" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -291,9 +271,9 @@ checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] @@ -380,18 +360,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -411,25 +379,3 @@ dependencies = [ "unwrappable", "week-timekeeping", ] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/energy-integration/fees-collector/wasm/src/lib.rs b/energy-integration/fees-collector/wasm/src/lib.rs index 141b80dc6..a3065aeaf 100644 --- a/energy-integration/fees-collector/wasm/src/lib.rs +++ b/energy-integration/fees-collector/wasm/src/lib.rs @@ -5,12 +5,15 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 36 +// Endpoints: 37 // Async Callback (empty): 1 -// Total number of exported functions: 38 +// Total number of exported functions: 39 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,43 +21,45 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { fees_collector ( - claimRewards - addKnownContracts - removeKnownContracts - addKnownTokens - removeKnownTokens - getLockedTokenId - getAllTokens - getAllKnownContracts - getAllowExternalClaimRewards - getLastActiveWeekForUser - getUserEnergyForWeek - getLastGlobalUpdateWeek - getTotalRewardsForWeek - getTotalEnergyForWeek - getTotalLockedTokensForWeek - updateEnergyForUser - getCurrentClaimProgress - depositSwapFees - getAccumulatedFees - setLockedTokensPerBlock - getLastLockedTokensAddWeek - getLockedTokensPerBlock - setLockingScAddress - setLockEpochs - getLockingScAddress - getLockEpochs - setEnergyFactoryAddress - getEnergyFactoryAddress - getCurrentWeek - getFirstWeekStartEpoch - pause - unpause - isPaused - addSCAddressToWhitelist - removeSCAddressFromWhitelist - isSCAddressWhitelisted + init => init + claimRewards => claim_rewards + addKnownContracts => add_known_contracts + removeKnownContracts => remove_known_contracts + addKnownTokens => add_known_tokens + removeKnownTokens => remove_known_tokens + setAllowExternalClaimRewards => set_allow_external_claim_rewards + getLockedTokenId => locked_token_id + getAllTokens => get_all_tokens + getAllKnownContracts => known_contracts + getAllowExternalClaimRewards => allow_external_claim_rewards + getLastActiveWeekForUser => get_last_active_week_for_user_view + getUserEnergyForWeek => get_user_energy_for_week_view + getLastGlobalUpdateWeek => last_global_update_week + getTotalRewardsForWeek => total_rewards_for_week + getTotalEnergyForWeek => total_energy_for_week + getTotalLockedTokensForWeek => total_locked_tokens_for_week + updateEnergyForUser => update_energy_for_user + getCurrentClaimProgress => current_claim_progress + depositSwapFees => deposit_swap_fees + getAccumulatedFees => accumulated_fees + setLockedTokensPerBlock => set_locked_tokens_per_block + getLastLockedTokensAddWeek => last_locked_token_add_week + getLockedTokensPerBlock => locked_tokens_per_block + setLockingScAddress => set_locking_sc_address + setLockEpochs => set_lock_epochs + getLockingScAddress => locking_sc_address + getLockEpochs => lock_epochs + setEnergyFactoryAddress => set_energy_factory_address + getEnergyFactoryAddress => energy_factory_address + getCurrentWeek => get_current_week + getFirstWeekStartEpoch => first_week_start_epoch + pause => pause_endpoint + unpause => unpause_endpoint + isPaused => paused_status + addSCAddressToWhitelist => add_sc_address_to_whitelist + removeSCAddressFromWhitelist => remove_sc_address_from_whitelist + isSCAddressWhitelisted => is_sc_address_whitelisted ) } -multiversx_sc_wasm_adapter::empty_callback! {} +multiversx_sc_wasm_adapter::async_callback_empty! {} diff --git a/farm-staking/farm-staking-proxy/src/proxy_actions/merge_pos.rs b/farm-staking/farm-staking-proxy/src/proxy_actions/merge_pos.rs index 2a81f2cf4..84be38ae0 100644 --- a/farm-staking/farm-staking-proxy/src/proxy_actions/merge_pos.rs +++ b/farm-staking/farm-staking-proxy/src/proxy_actions/merge_pos.rs @@ -1,4 +1,4 @@ -farm-staking/farm-staking-proxy/tests/composed_pos_test.rsuse common_structs::PaymentsVec; +use common_structs::PaymentsVec; use crate::{dual_yield_token::DualYieldTokenAttributes, result_types::MergeResult}; diff --git a/farm-staking/farm-staking-proxy/wasm/Cargo.lock b/farm-staking/farm-staking-proxy/wasm/Cargo.lock index 6b8cfa51d..45a3fea4f 100644 --- a/farm-staking/farm-staking-proxy/wasm/Cargo.lock +++ b/farm-staking/farm-staking-proxy/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -345,12 +339,6 @@ dependencies = [ "utils", ] -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - [[package]] name = "locking_module" version = "0.0.0" @@ -367,12 +355,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -382,9 +364,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "386c2727eba66bc5e502e470d7afa55fdd69aedff440c508bb9ba85aec36a52a" dependencies = [ "bitflags", "hashbrown", @@ -396,20 +378,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -419,9 +400,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "050510b6b9836b24b4a73bb7878c58c268d56bde1c6eb0f9a88dce9a6518507b" dependencies = [ "hex", "proc-macro2", @@ -432,21 +413,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "3b55fe3585cbc745bd7b9793be4bcb3aa7f1869ced7a0981f3d47e6a832c6311" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "b059f22dfc3eb45aa015f6f20f28ed34dc42a65b42d282f8ac9b799b12e2942c" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -507,9 +487,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] @@ -628,18 +608,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -659,25 +627,3 @@ dependencies = [ "unwrappable", "week-timekeeping", ] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/farm-staking/farm-staking-proxy/wasm/src/lib.rs b/farm-staking/farm-staking-proxy/wasm/src/lib.rs index 57bdc0840..4223b260d 100644 --- a/farm-staking/farm-staking-proxy/wasm/src/lib.rs +++ b/farm-staking/farm-staking-proxy/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 17 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,21 +21,23 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { farm_staking_proxy ( - registerDualYieldToken - getDualYieldTokenId - getLpFarmAddress - getStakingFarmAddress - getPairAddress - getStakingTokenId - getFarmTokenId - getLpTokenId - getLpFarmTokenId - addSCAddressToWhitelist - removeSCAddressFromWhitelist - isSCAddressWhitelisted - stakeFarmTokens - claimDualYield - unstakeFarmTokens - callBack + init => init + registerDualYieldToken => register_dual_yield_token + getDualYieldTokenId => dual_yield_token + getLpFarmAddress => lp_farm_address + getStakingFarmAddress => staking_farm_address + getPairAddress => pair_address + getStakingTokenId => staking_token_id + getFarmTokenId => staking_farm_token_id + getLpTokenId => lp_token_id + getLpFarmTokenId => lp_farm_token_id + addSCAddressToWhitelist => add_sc_address_to_whitelist + removeSCAddressFromWhitelist => remove_sc_address_from_whitelist + isSCAddressWhitelisted => is_sc_address_whitelisted + stakeFarmTokens => stake_farm_tokens + claimDualYield => claim_dual_yield_endpoint + unstakeFarmTokens => unstake_farm_tokens ) } + +multiversx_sc_wasm_adapter::async_callback! { farm_staking_proxy } diff --git a/farm-staking/farm-staking/elrond.json b/farm-staking/farm-staking/elrond.json deleted file mode 100644 index 736553962..000000000 --- a/farm-staking/farm-staking/elrond.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "language": "rust" -} \ No newline at end of file diff --git a/farm-staking/farm-staking/src/base_impl_wrapper.rs b/farm-staking/farm-staking/src/base_impl_wrapper.rs index adf6136a5..54e221a95 100644 --- a/farm-staking/farm-staking/src/base_impl_wrapper.rs +++ b/farm-staking/farm-staking/src/base_impl_wrapper.rs @@ -47,18 +47,16 @@ where pub fn calculate_boosted_rewards( sc: &::FarmSc, caller: &ManagedAddress<<::FarmSc as ContractBase>::Api>, - token_attributes: &::AttributesType, ) -> BigUint<<::FarmSc as ContractBase>::Api> { - if &token_attributes.original_owner != caller { - sc.update_energy_and_progress(caller); - } - let user_total_farm_position_struct = sc.get_user_total_farm_position_struct(caller); - let user_total_farm_position = user_total_farm_position_struct.total_farm_position; - if user_total_farm_position == BigUint::zero() { - return BigUint::zero(); + let user_total_farm_position = sc.get_user_total_farm_position(caller); + let user_farm_position = user_total_farm_position.total_farm_position; + let mut boosted_rewards = BigUint::zero(); + + if user_farm_position > 0 { + boosted_rewards = sc.claim_boosted_yields_rewards(caller, user_farm_position); } - sc.claim_boosted_yields_rewards(caller, user_total_farm_position) + boosted_rewards } } @@ -137,7 +135,7 @@ where ) -> BigUint<::Api> { let base_farm_reward = Self::calculate_base_farm_rewards(farm_token_amount, token_attributes, storage_cache); - let boosted_yield_rewards = Self::calculate_boosted_rewards(sc, caller, token_attributes); + let boosted_yield_rewards = Self::calculate_boosted_rewards(sc, caller); base_farm_reward + boosted_yield_rewards } @@ -207,8 +205,10 @@ where farm_position_increase += &farm_position.amount; } } - let user_total_farm_position_struct = sc.get_user_total_farm_position_struct(user); - if user_total_farm_position_struct.total_farm_position == BigUint::zero() { + let user_total_farm_position = sc.get_user_total_farm_position(user); + if user_total_farm_position.total_farm_position == BigUint::zero() + && total_farm_position > 0 + { Self::increase_user_farm_position(sc, user, &total_farm_position); } else if farm_position_increase > 0 { Self::increase_user_farm_position(sc, user, &farm_position_increase); @@ -220,10 +220,10 @@ where user: &ManagedAddress<::Api>, new_farm_position_amount: &BigUint<::Api>, ) { + let mut user_total_farm_position = sc.get_user_total_farm_position(user); + user_total_farm_position.total_farm_position += new_farm_position_amount; sc.user_total_farm_position(user) - .update(|user_farm_position_struct| { - user_farm_position_struct.total_farm_position += new_farm_position_amount - }); + .set(user_total_farm_position); } fn decrease_user_farm_position( @@ -235,8 +235,8 @@ where farm_token_mapper.get_token_attributes(farm_position.token_nonce); sc.user_total_farm_position(&token_attributes.original_owner) - .update(|user_farm_position_struct| { - user_farm_position_struct.total_farm_position -= farm_position.amount.clone() + .update(|user_total_farm_position| { + user_total_farm_position.total_farm_position -= farm_position.amount.clone() }); } } diff --git a/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs b/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs index 03253057b..83e609e92 100644 --- a/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs +++ b/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs @@ -30,53 +30,32 @@ pub trait ClaimOnlyBoostedStakingRewardsModule: let caller = self.blockchain().get_caller(); let user = match &opt_user { OptionalValue::Some(user) => user, - #[allow(clippy::redundant_clone)] OptionalValue::None => &caller, }; - let user_total_farm_position_struct = self.get_user_total_farm_position_struct(user); + let user_total_farm_position = self.get_user_total_farm_position(user); if user != &caller { require!( - user_total_farm_position_struct.allow_external_claim_boosted_rewards, + user_total_farm_position.allow_external_claim_boosted_rewards, "Cannot claim rewards for this address" ); } - let reward_token_id = self.reward_token_id().get(); - let user_total_farm_position = user_total_farm_position_struct.total_farm_position; - if user_total_farm_position == BigUint::zero() { - return EsdtTokenPayment::new(reward_token_id, 0, BigUint::zero()); - } - - let reward = self.claim_boosted_yields_rewards(user, user_total_farm_position); - if reward > 0 { - self.reward_reserve().update(|reserve| *reserve -= &reward); - } - let boosted_rewards = EsdtTokenPayment::new(reward_token_id, 0, reward); - self.send_payment_non_zero(user, &boosted_rewards); + let boosted_rewards = self.claim_only_boosted_payment(&user); + let boosted_rewards_payment = + EsdtTokenPayment::new(self.reward_token_id().get(), 0, boosted_rewards); - self.update_energy_and_progress(user); + self.send_payment_non_zero(user, &boosted_rewards_payment); - boosted_rewards + boosted_rewards_payment } // Cannot import the one from farm, as the Wrapper struct has different dependencies - fn claim_only_boosted_payment( - &self, - caller: &ManagedAddress, - payment: &EsdtTokenPayment, - ) -> EsdtTokenPayment { - let farm_token_mapper = self.farm_token(); - farm_token_mapper.require_same_token(&payment.token_identifier); - - let token_attributes = - self.get_attributes_as_part_of_fixed_supply(payment, &farm_token_mapper); - let reward = - FarmStakingWrapper::::calculate_boosted_rewards(self, caller, &token_attributes); + fn claim_only_boosted_payment(&self, caller: &ManagedAddress) -> BigUint { + let reward = FarmStakingWrapper::::calculate_boosted_rewards(self, caller); if reward > 0 { self.reward_reserve().update(|reserve| *reserve -= &reward); } - let reward_token_id = self.reward_token_id().get(); - EsdtTokenPayment::new(reward_token_id, 0, reward) + reward } } diff --git a/farm-staking/farm-staking/src/custom_rewards.rs b/farm-staking/farm-staking/src/custom_rewards.rs index 4677cae1d..de7fd29a0 100644 --- a/farm-staking/farm-staking/src/custom_rewards.rs +++ b/farm-staking/farm-staking/src/custom_rewards.rs @@ -9,7 +9,7 @@ use crate::base_impl_wrapper::FarmStakingWrapper; pub const MAX_PERCENT: u64 = 10_000; pub const BLOCKS_IN_YEAR: u64 = 31_536_000 / 6; // seconds_in_year / 6_seconds_per_block -const MAX_MIN_UNBOND_EPOCHS: u64 = 30; +pub const MAX_MIN_UNBOND_EPOCHS: u64 = 30; #[multiversx_sc::module] pub trait CustomRewardsModule: diff --git a/farm-staking/farm-staking/src/lib.rs b/farm-staking/farm-staking/src/lib.rs index d1874d0b4..e22ae0dfe 100644 --- a/farm-staking/farm-staking/src/lib.rs +++ b/farm-staking/farm-staking/src/lib.rs @@ -2,14 +2,17 @@ #![allow(clippy::from_over_into)] #![feature(trait_alias)] +multiversx_sc::imports!(); +multiversx_sc::derive_imports!(); + use base_impl_wrapper::FarmStakingWrapper; use contexts::storage_cache::StorageCache; +use farm::base_functions::DoubleMultiPayment; use farm_base_impl::base_traits_impl::FarmContract; use fixed_supply_token::FixedSupplyToken; use token_attributes::StakingFarmTokenAttributes; -multiversx_sc::imports!(); -multiversx_sc::derive_imports!(); +use crate::custom_rewards::MAX_MIN_UNBOND_EPOCHS; pub mod base_impl_wrapper; pub mod claim_only_boosted_staking_rewards; @@ -40,7 +43,6 @@ pub trait FarmStaking: + farm_base_impl::claim_rewards::BaseClaimRewardsModule + farm_base_impl::compound_rewards::BaseCompoundRewardsModule + farm_base_impl::exit_farm::BaseExitFarmModule - + farm::progress_update::ProgressUpdateModule + utils::UtilsModule + farm_token_roles::FarmTokenRolesModule + stake_farm::StakeFarmModule @@ -79,16 +81,27 @@ pub trait FarmStaking: ); require!(max_apr > 0u64, "Invalid max APR percentage"); - self.max_annual_percentage_rewards().set(&max_apr); + self.max_annual_percentage_rewards().set_if_empty(&max_apr); - self.try_set_min_unbond_epochs(min_unbond_epochs); + require!( + min_unbond_epochs <= MAX_MIN_UNBOND_EPOCHS, + "Invalid min unbond epochs" + ); + self.min_unbond_epochs().set_if_empty(min_unbond_epochs); } #[payable("*")] #[endpoint(mergeFarmTokens)] - fn merge_farm_tokens_endpoint(&self) -> EsdtTokenPayment { + fn merge_farm_tokens_endpoint( + &self, + opt_orig_caller: OptionalValue, + ) -> DoubleMultiPayment { let caller = self.blockchain().get_caller(); - self.check_claim_progress_for_merge(&caller); + let orig_caller = self.get_orig_caller_from_opt(&caller, opt_orig_caller); + + let boosted_rewards = self.claim_only_boosted_payment(&orig_caller); + let boosted_rewards_full_position = + EsdtTokenPayment::new(self.reward_token_id().get(), 0, boosted_rewards); let payments = self.get_non_empty_payments(); let token_mapper = self.farm_token(); @@ -98,8 +111,9 @@ pub trait FarmStaking: let merged_farm_token = token_mapper.nft_create(new_token_amount, &output_attributes); self.send_payment_non_zero(&caller, &merged_farm_token); + self.send_payment_non_zero(&orig_caller, &boosted_rewards_full_position); - merged_farm_token + (merged_farm_token, boosted_rewards_full_position).into() } #[view(calculateRewardsForGivenPosition)] diff --git a/farm-staking/farm-staking/src/stake_farm.rs b/farm-staking/farm-staking/src/stake_farm.rs index 8524a2b4f..2da477f52 100644 --- a/farm-staking/farm-staking/src/stake_farm.rs +++ b/farm-staking/farm-staking/src/stake_farm.rs @@ -71,22 +71,26 @@ pub trait StakeFarmModule: original_caller: ManagedAddress, payments: PaymentsVec, ) -> EnterFarmResultType { - let first_additional_payment_index = 1; - let boosted_rewards = match payments.try_get(first_additional_payment_index) { - Some(p) => self.claim_only_boosted_payment(&original_caller, &p), - None => EsdtTokenPayment::new(self.reward_token_id().get(), 0, BigUint::zero()), + let caller = self.blockchain().get_caller(); + + let boosted_rewards = self.claim_only_boosted_payment(&original_caller); + let boosted_rewards_payment = if boosted_rewards > 0 { + EsdtTokenPayment::new(self.reward_token_id().get(), 0, boosted_rewards) + } else { + EsdtTokenPayment::new(self.reward_token_id().get(), 0, BigUint::zero()) }; let enter_result = - self.enter_farm_base::>(original_caller, payments); + self.enter_farm_base::>(original_caller.clone(), payments); - let caller = self.blockchain().get_caller(); let new_farm_token = enter_result.new_farm_token.payment.clone(); self.send_payment_non_zero(&caller, &new_farm_token); - self.send_payment_non_zero(&caller, &boosted_rewards); + self.send_payment_non_zero(&caller, &boosted_rewards_payment); self.set_farm_supply_for_current_week(&enter_result.storage_cache.farm_token_supply); + self.update_energy_and_progress(&original_caller); + self.emit_enter_farm_event( &caller, enter_result.context.farming_token_payment, @@ -95,6 +99,6 @@ pub trait StakeFarmModule: enter_result.storage_cache, ); - (new_farm_token, boosted_rewards).into() + (new_farm_token, boosted_rewards_payment).into() } } diff --git a/farm-staking/farm-staking/src/unstake_farm.rs b/farm-staking/farm-staking/src/unstake_farm.rs index 4c9675153..39acc348d 100644 --- a/farm-staking/farm-staking/src/unstake_farm.rs +++ b/farm-staking/farm-staking/src/unstake_farm.rs @@ -86,8 +86,10 @@ pub trait UnstakeFarmModule: "Exit amount is bigger than the payment amount" ); + let boosted_rewards = self.claim_only_boosted_payment(&original_caller); let boosted_rewards_full_position = - self.claim_only_boosted_payment(&original_caller, &payment); + EsdtTokenPayment::new(self.reward_token_id().get(), 0, boosted_rewards); + let remaining_farm_payment = EsdtTokenPayment::new( payment.token_identifier.clone(), payment.token_nonce, @@ -113,7 +115,7 @@ pub trait UnstakeFarmModule: self.send_payment_non_zero(&caller, &exit_result.reward_payment); self.send_payment_non_zero(&caller, &remaining_farm_payment); - self.clear_user_energy_if_needed(&original_caller, &remaining_farm_payment.amount); + self.clear_user_energy_if_needed(&original_caller); self.set_farm_supply_for_current_week(&exit_result.storage_cache.farm_token_supply); self.emit_exit_farm_event( diff --git a/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs b/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs index f46b63dbd..01e768862 100644 --- a/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs +++ b/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs @@ -421,8 +421,8 @@ where self.b_mock .execute_tx(user, &self.farm_wrapper, &rust_biguint!(0), |sc| { sc.user_total_farm_position(&managed_address!(user)).update( - |user_total_farm_position_struct| { - user_total_farm_position_struct.allow_external_claim_boosted_rewards = true; + |user_total_farm_position| { + user_total_farm_position.allow_external_claim_boosted_rewards = true; }, ); }) diff --git a/farm-staking/farm-staking/wasm/Cargo.lock b/farm-staking/farm-staking/wasm/Cargo.lock index 4584bdf1a..6b4032061 100644 --- a/farm-staking/farm-staking/wasm/Cargo.lock +++ b/farm-staking/farm-staking/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -323,12 +317,6 @@ dependencies = [ "utils", ] -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - [[package]] name = "locking_module" version = "0.0.0" @@ -345,12 +333,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -360,9 +342,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "386c2727eba66bc5e502e470d7afa55fdd69aedff440c508bb9ba85aec36a52a" dependencies = [ "bitflags", "hashbrown", @@ -374,20 +356,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -397,9 +378,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "050510b6b9836b24b4a73bb7878c58c268d56bde1c6eb0f9a88dce9a6518507b" dependencies = [ "hex", "proc-macro2", @@ -410,21 +391,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "3b55fe3585cbc745bd7b9793be4bcb3aa7f1869ced7a0981f3d47e6a832c6311" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "b059f22dfc3eb45aa015f6f20f28ed34dc42a65b42d282f8ac9b799b12e2942c" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -485,9 +465,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] @@ -606,18 +586,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -637,25 +605,3 @@ dependencies = [ "unwrappable", "week-timekeeping", ] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/farm-staking/farm-staking/wasm/src/lib.rs b/farm-staking/farm-staking/wasm/src/lib.rs index d3322ea4e..1ff8628b8 100644 --- a/farm-staking/farm-staking/wasm/src/lib.rs +++ b/farm-staking/farm-staking/wasm/src/lib.rs @@ -5,12 +5,15 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 66 +// Endpoints: 67 // Async Callback: 1 -// Total number of exported functions: 68 +// Total number of exported functions: 69 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,72 +21,75 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { farm_staking ( - mergeFarmTokens - calculateRewardsForGivenPosition - topUpRewards - endProduceRewards - setPerBlockRewardAmount - setMaxApr - setMinUnbondEpochs - startProduceRewards - getAccumulatedRewards - getRewardCapacity - getAnnualPercentageRewards - getMinUnbondEpochs - getRewardPerShare - getRewardReserve - getFarmingTokenId - getRewardTokenId - getPerBlockRewardAmount - getLastRewardBlockNonce - getDivisionSafetyConstant - getUserTotalFarmPosition - registerFarmToken - getFarmTokenId - getFarmTokenSupply - addSCAddressToWhitelist - removeSCAddressFromWhitelist - isSCAddressWhitelisted - addToPauseWhitelist - removeFromPauseWhitelist - pause - resume - getState - addAdmin - removeAdmin - updateOwnerOrAdmin - getPermissions - setBurnRoleForAddress - stakeFarmThroughProxy - stakeFarm - claimRewards - claimRewardsWithNewValue - compoundRewards - unstakeFarm - unstakeFarmThroughProxy - unbondFarm - claimBoostedRewards - setBoostedYieldsRewardsPercentage - collectUndistributedBoostedRewards - getBoostedYieldsRewardsPercentage - getAccumulatedRewardsForWeek - getFarmSupplyForWeek - getRemainingBoostedRewardsToDistribute - getUndistributedBoostedRewards - setBoostedYieldsFactors - getBoostedYieldsFactors - getCurrentWeek - getFirstWeekStartEpoch - getLastActiveWeekForUser - getUserEnergyForWeek - getLastGlobalUpdateWeek - getTotalRewardsForWeek - getTotalEnergyForWeek - getTotalLockedTokensForWeek - updateEnergyForUser - getCurrentClaimProgress - setEnergyFactoryAddress - getEnergyFactoryAddress - callBack + init => init + mergeFarmTokens => merge_farm_tokens_endpoint + calculateRewardsForGivenPosition => calculate_rewards_for_given_position + topUpRewards => top_up_rewards + endProduceRewards => end_produce_rewards + setPerBlockRewardAmount => set_per_block_rewards + setMaxApr => set_max_apr + setMinUnbondEpochs => set_min_unbond_epochs_endpoint + startProduceRewards => start_produce_rewards_endpoint + getAccumulatedRewards => accumulated_rewards + getRewardCapacity => reward_capacity + getAnnualPercentageRewards => max_annual_percentage_rewards + getMinUnbondEpochs => min_unbond_epochs + getRewardPerShare => reward_per_share + getRewardReserve => reward_reserve + allowExternalClaimBoostedRewards => allow_external_claim_boosted_rewards + getFarmingTokenId => farming_token_id + getRewardTokenId => reward_token_id + getPerBlockRewardAmount => per_block_reward_amount + getLastRewardBlockNonce => last_reward_block_nonce + getDivisionSafetyConstant => division_safety_constant + getUserTotalFarmPosition => user_total_farm_position + registerFarmToken => register_farm_token + getFarmTokenId => farm_token + getFarmTokenSupply => farm_token_supply + addSCAddressToWhitelist => add_sc_address_to_whitelist + removeSCAddressFromWhitelist => remove_sc_address_from_whitelist + isSCAddressWhitelisted => is_sc_address_whitelisted + addToPauseWhitelist => add_to_pause_whitelist + removeFromPauseWhitelist => remove_from_pause_whitelist + pause => pause + resume => resume + getState => state + addAdmin => add_admin_endpoint + removeAdmin => remove_admin_endpoint + updateOwnerOrAdmin => update_owner_or_admin_endpoint + getPermissions => permissions + setBurnRoleForAddress => set_burn_role_for_address + stakeFarmThroughProxy => stake_farm_through_proxy + stakeFarm => stake_farm_endpoint + claimRewards => claim_rewards + claimRewardsWithNewValue => claim_rewards_with_new_value + compoundRewards => compound_rewards + unstakeFarm => unstake_farm + unstakeFarmThroughProxy => unstake_farm_through_proxy + unbondFarm => unbond_farm + claimBoostedRewards => claim_boosted_rewards + setBoostedYieldsRewardsPercentage => set_boosted_yields_rewards_percentage + collectUndistributedBoostedRewards => collect_undistributed_boosted_rewards + getBoostedYieldsRewardsPercentage => boosted_yields_rewards_percentage + getAccumulatedRewardsForWeek => accumulated_rewards_for_week + getFarmSupplyForWeek => farm_supply_for_week + getRemainingBoostedRewardsToDistribute => remaining_boosted_rewards_to_distribute + getUndistributedBoostedRewards => undistributed_boosted_rewards + setBoostedYieldsFactors => set_boosted_yields_factors + getBoostedYieldsFactors => get_boosted_yields_factors + getCurrentWeek => get_current_week + getFirstWeekStartEpoch => first_week_start_epoch + getLastActiveWeekForUser => get_last_active_week_for_user_view + getUserEnergyForWeek => get_user_energy_for_week_view + getLastGlobalUpdateWeek => last_global_update_week + getTotalRewardsForWeek => total_rewards_for_week + getTotalEnergyForWeek => total_energy_for_week + getTotalLockedTokensForWeek => total_locked_tokens_for_week + updateEnergyForUser => update_energy_for_user + getCurrentClaimProgress => current_claim_progress + setEnergyFactoryAddress => set_energy_factory_address + getEnergyFactoryAddress => energy_factory_address ) } + +multiversx_sc_wasm_adapter::async_callback! { farm_staking } From c044821d4f0c6cd85b1571e5210beaaaa82aea3e Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Mon, 18 Sep 2023 13:25:46 +0300 Subject: [PATCH 075/213] metastaking refactor --- common/modules/farm/config/src/config.rs | 30 +++---- .../farm_base_impl/src/base_traits_impl.rs | 45 +++-------- dex/farm-with-locked-rewards/wasm/src/lib.rs | 5 +- dex/farm/src/base_functions.rs | 7 +- dex/farm/src/lib.rs | 5 ++ dex/farm/wasm/src/lib.rs | 5 +- .../src/dual_yield_token.rs | 81 ++----------------- .../src/external_contracts_interactions.rs | 24 ------ .../src/proxy_actions/claim.rs | 12 ++- .../src/proxy_actions/stake.rs | 14 +--- .../src/proxy_actions/unstake.rs | 59 ++++---------- .../farm-staking-proxy/src/result_types.rs | 5 -- .../tests/staking_farm_with_lp.rs | 41 +++------- .../mod.rs | 5 +- .../farm-staking/src/base_impl_wrapper.rs | 24 +++--- farm-staking/farm-staking/wasm/src/lib.rs | 5 +- 16 files changed, 96 insertions(+), 271 deletions(-) diff --git a/common/modules/farm/config/src/config.rs b/common/modules/farm/config/src/config.rs index cb1385ba3..2f5f4935c 100644 --- a/common/modules/farm/config/src/config.rs +++ b/common/modules/farm/config/src/config.rs @@ -53,24 +53,22 @@ pub trait ConfigModule: pausable::PausableModule + permissions_module::Permissio } } + fn is_old_farm_position(&self, token_nonce: Nonce) -> bool { + let farm_position_migration_block_nonce = self.farm_position_migration_block_nonce().get(); + token_nonce < farm_position_migration_block_nonce + } + #[endpoint(allowExternalClaimBoostedRewards)] fn allow_external_claim_boosted_rewards(&self, allow_external_claim: bool) { let caller = self.blockchain().get_caller(); let user_total_farm_position_mapper = self.user_total_farm_position(&caller); - if user_total_farm_position_mapper.is_empty() { - require!( - allow_external_claim, - "Can only set to true if there is no farm position" - ); - let mut new_user_farm_position: UserTotalFarmPosition = - UserTotalFarmPosition::default(); - new_user_farm_position.allow_external_claim_boosted_rewards = allow_external_claim; - } else { - user_total_farm_position_mapper.update(|user_total_farm_position| { - user_total_farm_position.allow_external_claim_boosted_rewards = - allow_external_claim; - }); - } + require!( + !user_total_farm_position_mapper.is_empty(), + "User must have a farm position" + ); + user_total_farm_position_mapper.update(|user_total_farm_position| { + user_total_farm_position.allow_external_claim_boosted_rewards = allow_external_claim; + }); } #[view(getFarmingTokenId)] @@ -102,4 +100,8 @@ pub trait ConfigModule: pausable::PausableModule + permissions_module::Permissio &self, user: &ManagedAddress, ) -> SingleValueMapper>; + + #[view(getFarmPositionMigrationBlockNonce)] + #[storage_mapper("farm_position_migration_block_nonce")] + fn farm_position_migration_block_nonce(&self) -> SingleValueMapper; } diff --git a/common/modules/farm/farm_base_impl/src/base_traits_impl.rs b/common/modules/farm/farm_base_impl/src/base_traits_impl.rs index 728d7097f..c03775abc 100644 --- a/common/modules/farm/farm_base_impl/src/base_traits_impl.rs +++ b/common/modules/farm/farm_base_impl/src/base_traits_impl.rs @@ -195,29 +195,20 @@ pub trait FarmContract { farm_positions: &PaymentsVec<::Api>, ) { let farm_token_mapper = sc.farm_token(); - let mut total_farm_position = BigUint::zero(); - let mut farm_position_increase = BigUint::zero(); for farm_position in farm_positions { + let is_old_farm_position = sc.is_old_farm_position(farm_position.token_nonce); farm_token_mapper.require_same_token(&farm_position.token_identifier); - total_farm_position += &farm_position.amount; let token_attributes: FarmTokenAttributes<::Api> = farm_token_mapper.get_token_attributes(farm_position.token_nonce); - if &token_attributes.original_owner != user { + if is_old_farm_position { + Self::increase_user_farm_position(sc, user, &farm_position.amount); + } else if &token_attributes.original_owner != user { Self::decrease_user_farm_position(sc, &farm_position); - farm_position_increase += &farm_position.amount; + Self::increase_user_farm_position(sc, user, &farm_position.amount); } } - - let user_total_farm_position = sc.get_user_total_farm_position(user); - if user_total_farm_position.total_farm_position == BigUint::zero() - && total_farm_position > 0 - { - Self::increase_user_farm_position(sc, user, &total_farm_position); - } else if farm_position_increase > 0 { - Self::increase_user_farm_position(sc, user, &farm_position_increase); - } } #[inline] @@ -240,24 +231,14 @@ pub trait FarmContract { let token_attributes: FarmTokenAttributes<::Api> = farm_token_mapper.get_token_attributes(farm_position.token_nonce); - let mut user_total_farm_position = - sc.get_user_total_farm_position(&token_attributes.original_owner); - - if user_total_farm_position.total_farm_position > farm_position.amount { - user_total_farm_position.total_farm_position -= &farm_position.amount; - } else { - user_total_farm_position.total_farm_position = BigUint::zero(); - } - - if user_total_farm_position.total_farm_position == 0 - && user_total_farm_position.allow_external_claim_boosted_rewards == false - { - sc.user_total_farm_position(&token_attributes.original_owner) - .clear(); - } else { - sc.user_total_farm_position(&token_attributes.original_owner) - .set(user_total_farm_position); - } + sc.user_total_farm_position(&token_attributes.original_owner) + .update(|user_total_farm_position| { + if user_total_farm_position.total_farm_position > farm_position.amount { + user_total_farm_position.total_farm_position -= &farm_position.amount; + } else { + user_total_farm_position.total_farm_position = BigUint::zero(); + } + }); } } diff --git a/dex/farm-with-locked-rewards/wasm/src/lib.rs b/dex/farm-with-locked-rewards/wasm/src/lib.rs index eab8f6b92..ae9c8fced 100644 --- a/dex/farm-with-locked-rewards/wasm/src/lib.rs +++ b/dex/farm-with-locked-rewards/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 65 +// Endpoints: 66 // Async Callback: 1 -// Total number of exported functions: 67 +// Total number of exported functions: 68 #![no_std] @@ -40,6 +40,7 @@ multiversx_sc_wasm_adapter::endpoints! { getLastRewardBlockNonce => last_reward_block_nonce getDivisionSafetyConstant => division_safety_constant getUserTotalFarmPosition => user_total_farm_position + getFarmPositionMigrationBlockNonce => farm_position_migration_block_nonce setLockingScAddress => set_locking_sc_address setLockEpochs => set_lock_epochs getLockingScAddress => locking_sc_address diff --git a/dex/farm/src/base_functions.rs b/dex/farm/src/base_functions.rs index d67d5db7d..fb5c5dfce 100644 --- a/dex/farm/src/base_functions.rs +++ b/dex/farm/src/base_functions.rs @@ -250,13 +250,8 @@ where ) -> BigUint<<::FarmSc as ContractBase>::Api> { let user_total_farm_position = sc.get_user_total_farm_position(caller); let user_farm_position = user_total_farm_position.total_farm_position; - let mut boosted_rewards = BigUint::zero(); - if user_farm_position > 0 { - boosted_rewards = sc.claim_boosted_yields_rewards(caller, user_farm_position); - } - - boosted_rewards + sc.claim_boosted_yields_rewards(caller, user_farm_position) } } diff --git a/dex/farm/src/lib.rs b/dex/farm/src/lib.rs index 79204f89e..f7cfbd5f6 100644 --- a/dex/farm/src/lib.rs +++ b/dex/farm/src/lib.rs @@ -78,6 +78,11 @@ pub trait Farm: let current_epoch = self.blockchain().get_block_epoch(); self.first_week_start_epoch().set_if_empty(current_epoch); + + // Farm position migration code + let block_nonce = self.blockchain().get_block_nonce(); + self.farm_position_migration_block_nonce() + .set_if_empty(block_nonce); } #[payable("*")] diff --git a/dex/farm/wasm/src/lib.rs b/dex/farm/wasm/src/lib.rs index a522fc32f..4acae57d7 100644 --- a/dex/farm/wasm/src/lib.rs +++ b/dex/farm/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 62 +// Endpoints: 63 // Async Callback: 1 -// Total number of exported functions: 64 +// Total number of exported functions: 65 #![no_std] @@ -41,6 +41,7 @@ multiversx_sc_wasm_adapter::endpoints! { getLastRewardBlockNonce => last_reward_block_nonce getDivisionSafetyConstant => division_safety_constant getUserTotalFarmPosition => user_total_farm_position + getFarmPositionMigrationBlockNonce => farm_position_migration_block_nonce registerFarmToken => register_farm_token getFarmTokenId => farm_token getFarmTokenSupply => farm_token_supply diff --git a/farm-staking/farm-staking-proxy/src/dual_yield_token.rs b/farm-staking/farm-staking-proxy/src/dual_yield_token.rs index f1e2eedd0..56a311d85 100644 --- a/farm-staking/farm-staking-proxy/src/dual_yield_token.rs +++ b/farm-staking/farm-staking-proxy/src/dual_yield_token.rs @@ -1,84 +1,19 @@ use fixed_supply_token::FixedSupplyToken; -use multiversx_sc::codec::{NestedDecodeInput, TopDecodeInput}; multiversx_sc::imports!(); multiversx_sc::derive_imports!(); -#[derive(TypeAbi, TopEncode, PartialEq, Debug, Clone)] +#[derive(TypeAbi, TopEncode, TopDecode, Clone, PartialEq, Debug)] pub struct DualYieldTokenAttributes { pub lp_farm_token_nonce: u64, pub lp_farm_token_amount: BigUint, - pub virtual_pos_token_nonce: u64, - pub virtual_pos_token_amount: BigUint, - pub real_pos_token_amount: BigUint, -} - -impl DualYieldTokenAttributes { - pub fn new( - lp_farm_token_nonce: u64, - lp_farm_token_amount: BigUint, - virtual_pos_token_nonce: u64, - virtual_pos_token_amount: BigUint, - ) -> Self { - DualYieldTokenAttributes { - lp_farm_token_nonce, - lp_farm_token_amount, - virtual_pos_token_nonce, - virtual_pos_token_amount, - real_pos_token_amount: BigUint::zero(), - } - } - - pub fn get_total_staking_token_amount(&self) -> BigUint { - &self.virtual_pos_token_amount + &self.real_pos_token_amount - } -} - -impl TopDecode for DualYieldTokenAttributes { - fn top_decode(input: I) -> Result - where - I: TopDecodeInput, - { - let mut buffer = input.into_nested_buffer(); - Self::dep_decode(&mut buffer) - } -} - -impl NestedDecode for DualYieldTokenAttributes { - fn dep_decode(input: &mut I) -> Result { - let lp_farm_token_nonce = u64::dep_decode(input)?; - let lp_farm_token_amount = BigUint::dep_decode(input)?; - let virtual_pos_token_nonce = u64::dep_decode(input)?; - let virtual_pos_token_amount = BigUint::dep_decode(input)?; - - if input.is_depleted() { - return Result::Ok(DualYieldTokenAttributes::new( - lp_farm_token_nonce, - lp_farm_token_amount, - virtual_pos_token_nonce, - virtual_pos_token_amount, - )); - } - - let real_pos_token_amount = BigUint::dep_decode(input)?; - - if !input.is_depleted() { - return Result::Err(DecodeError::INPUT_TOO_LONG); - } - - Result::Ok(DualYieldTokenAttributes { - lp_farm_token_nonce, - lp_farm_token_amount, - virtual_pos_token_nonce, - virtual_pos_token_amount, - real_pos_token_amount, - }) - } + pub staking_farm_token_nonce: u64, + pub staking_farm_token_amount: BigUint, } impl FixedSupplyToken for DualYieldTokenAttributes { fn get_total_supply(&self) -> BigUint { - self.virtual_pos_token_amount.clone() + self.staking_farm_token_amount.clone() } fn into_part(self, payment_amount: &BigUint) -> Self { @@ -88,15 +23,13 @@ impl FixedSupplyToken for DualYieldTokenAttributes { let new_lp_farm_token_amount = self.rule_of_three_non_zero_result(payment_amount, &self.lp_farm_token_amount); - let new_virtual_pos_amount = payment_amount.clone(); - let new_real_pos_amount = self.rule_of_three(payment_amount, &self.real_pos_token_amount); + let new_staking_farm_token_amount = payment_amount.clone(); DualYieldTokenAttributes { lp_farm_token_nonce: self.lp_farm_token_nonce, lp_farm_token_amount: new_lp_farm_token_amount, - virtual_pos_token_nonce: self.virtual_pos_token_nonce, - virtual_pos_token_amount: new_virtual_pos_amount, - real_pos_token_amount: new_real_pos_amount, + staking_farm_token_nonce: self.staking_farm_token_nonce, + staking_farm_token_amount: new_staking_farm_token_amount, } } } diff --git a/farm-staking/farm-staking-proxy/src/external_contracts_interactions.rs b/farm-staking/farm-staking-proxy/src/external_contracts_interactions.rs index 933a93cfd..d8b3a5258 100644 --- a/farm-staking/farm-staking-proxy/src/external_contracts_interactions.rs +++ b/farm-staking/farm-staking-proxy/src/external_contracts_interactions.rs @@ -164,30 +164,6 @@ pub trait ExternalContractsInteractionsModule: } } - fn staking_farm_unstake_user_position( - &self, - orig_caller: ManagedAddress, - farm_token_nonce: u64, - farm_token_amount: BigUint, - exit_amount: BigUint, - ) -> StakingFarmExitResult { - let staking_farm_token_id = self.staking_farm_token_id().get(); - let staking_farm_address = self.staking_farm_address().get(); - let unstake_result: ExitFarmWithPartialPosResultType = self - .staking_farm_proxy_obj(staking_farm_address) - .unstake_farm(exit_amount, orig_caller) - .with_esdt_transfer((staking_farm_token_id, farm_token_nonce, farm_token_amount)) - .execute_on_dest_context(); - let (unbond_staking_farm_token, staking_rewards, remaining_farm_tokens) = - unstake_result.into_tuple(); - - StakingFarmExitResult { - unbond_staking_farm_token, - staking_rewards, - remaining_farm_tokens, - } - } - // pair fn pair_remove_liquidity( diff --git a/farm-staking/farm-staking-proxy/src/proxy_actions/claim.rs b/farm-staking/farm-staking-proxy/src/proxy_actions/claim.rs index 3f90583e2..fe84fa65d 100644 --- a/farm-staking/farm-staking-proxy/src/proxy_actions/claim.rs +++ b/farm-staking/farm-staking-proxy/src/proxy_actions/claim.rs @@ -34,7 +34,7 @@ pub trait ProxyClaimModule: let internal_claim_result = self.claim_dual_yield( &caller, opt_orig_caller, - attributes.get_total_staking_token_amount(), + attributes.staking_farm_token_amount.clone(), attributes, ); @@ -66,8 +66,7 @@ pub trait ProxyClaimModule: attributes.lp_farm_token_nonce, &attributes.lp_farm_token_amount, ); - let lp_tokens_safe_price = self.get_lp_tokens_safe_price(lp_tokens_in_position); - let new_staking_farm_value = &lp_tokens_safe_price + &attributes.real_pos_token_amount; + let new_staking_farm_value = self.get_lp_tokens_safe_price(lp_tokens_in_position); let staking_farm_token_id = self.staking_farm_token_id().get(); let lp_farm_token_id = self.lp_farm_token_id().get(); @@ -80,7 +79,7 @@ pub trait ProxyClaimModule: let staking_farm_claim_rewards_result = self.staking_farm_claim_rewards( orig_caller, staking_farm_token_id, - attributes.virtual_pos_token_nonce, + attributes.staking_farm_token_nonce, staking_claim_amount, new_staking_farm_value, ); @@ -90,9 +89,8 @@ pub trait ProxyClaimModule: let new_attributes = DualYieldTokenAttributes { lp_farm_token_nonce: new_lp_farm_tokens.token_nonce, lp_farm_token_amount: new_lp_farm_tokens.amount, - virtual_pos_token_nonce: new_staking_farm_tokens.token_nonce, - virtual_pos_token_amount: lp_tokens_safe_price, - real_pos_token_amount: attributes.real_pos_token_amount, + staking_farm_token_nonce: new_staking_farm_tokens.token_nonce, + staking_farm_token_amount: new_staking_farm_tokens.amount, }; InternalClaimResult { diff --git a/farm-staking/farm-staking-proxy/src/proxy_actions/stake.rs b/farm-staking/farm-staking-proxy/src/proxy_actions/stake.rs index 1cfe2047c..d39dd7f2c 100644 --- a/farm-staking/farm-staking-proxy/src/proxy_actions/stake.rs +++ b/farm-staking/farm-staking-proxy/src/proxy_actions/stake.rs @@ -36,15 +36,14 @@ pub trait ProxyStakeModule: let staking_farm_token_id = self.staking_farm_token_id().get(); let mut additional_staking_farm_tokens = ManagedVec::new(); let mut additional_lp_farm_tokens = ManagedVec::new(); - let mut total_user_real_staking_tokens = BigUint::zero(); for p in &additional_payments { let attributes: DualYieldTokenAttributes = self.get_attributes_as_part_of_fixed_supply(&p, &dual_yield_token_mapper); additional_staking_farm_tokens.push(EsdtTokenPayment::new( staking_farm_token_id.clone(), - attributes.virtual_pos_token_nonce, - attributes.get_total_staking_token_amount(), + attributes.staking_farm_token_nonce, + attributes.staking_farm_token_amount, )); additional_lp_farm_tokens.push(EsdtTokenPayment::new( @@ -53,8 +52,6 @@ pub trait ProxyStakeModule: attributes.lp_farm_token_amount, )); - total_user_real_staking_tokens += attributes.real_pos_token_amount; - dual_yield_token_mapper.nft_burn(p.token_nonce, &p.amount); } @@ -76,14 +73,11 @@ pub trait ProxyStakeModule: additional_lp_farm_tokens, ); - let new_staking_farm_token_amount = - &received_staking_farm_token.amount - &total_user_real_staking_tokens; let new_attributes = DualYieldTokenAttributes { lp_farm_token_nonce: merged_lp_farm_tokens.token_nonce, lp_farm_token_amount: merged_lp_farm_tokens.amount, - virtual_pos_token_nonce: received_staking_farm_token.token_nonce, - virtual_pos_token_amount: new_staking_farm_token_amount, - real_pos_token_amount: total_user_real_staking_tokens, + staking_farm_token_nonce: received_staking_farm_token.token_nonce, + staking_farm_token_amount: received_staking_farm_token.amount, }; let new_dual_yield_tokens = self.create_dual_yield_tokens(&dual_yield_token_mapper, &new_attributes); diff --git a/farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs b/farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs index 59e65f4e0..c78527aa6 100644 --- a/farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs +++ b/farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs @@ -1,5 +1,4 @@ use fixed_supply_token::FixedSupplyToken; -use mergeable::Mergeable; use crate::{dual_yield_token::DualYieldTokenAttributes, result_types::UnstakeResult}; @@ -32,24 +31,21 @@ pub trait ProxyUnstakeModule: let full_attributes: DualYieldTokenAttributes = dual_yield_token_mapper.get_token_attributes(payment.token_nonce); - let total_for_nonce = full_attributes.get_total_supply(); - require!( - payment.amount == total_for_nonce, - "Must exit with full position as payment" - ); + require!( exit_amount > 0 && exit_amount <= payment.amount, "Invalid exit amount" ); - let full_staking_token_amount = full_attributes.get_total_staking_token_amount(); + let full_attributes_adjusted: DualYieldTokenAttributes = + full_attributes.clone().into_part(&payment.amount); let exit_attributes: DualYieldTokenAttributes = full_attributes.clone().into_part(&exit_amount); let lp_farm_exit_result = self.lp_farm_exit( orig_caller.clone(), - full_attributes.lp_farm_token_nonce, - full_attributes.lp_farm_token_amount, + full_attributes_adjusted.lp_farm_token_nonce, + full_attributes_adjusted.lp_farm_token_amount, exit_attributes.lp_farm_token_amount, ); let remove_liq_result = self.pair_remove_liquidity( @@ -58,40 +54,23 @@ pub trait ProxyUnstakeModule: pair_second_token_min_amount, ); - let remaining_total_staking_farm_tokens = - &full_staking_token_amount - &exit_attributes.virtual_pos_token_amount; let staking_farm_exit_result = self.staking_farm_unstake( orig_caller.clone(), remove_liq_result.staking_token_payment, - full_attributes.virtual_pos_token_nonce, - full_staking_token_amount, - exit_attributes.virtual_pos_token_amount.clone(), + full_attributes_adjusted.staking_farm_token_nonce, + full_attributes_adjusted.staking_farm_token_amount.clone(), + exit_attributes.staking_farm_token_amount.clone(), ); - let opt_unstake_user_pos_result = if exit_attributes.real_pos_token_amount > 0 { - let res = self.staking_farm_unstake_user_position( - orig_caller, - full_attributes.virtual_pos_token_nonce, - remaining_total_staking_farm_tokens, - exit_attributes.real_pos_token_amount.clone(), - ); - Some(res) - } else { - None - }; - - let opt_new_dual_yield_tokens = if exit_amount != total_for_nonce { + let opt_new_dual_yield_tokens = if exit_amount < payment.amount { let remaining_lp_farm_tokens = lp_farm_exit_result.remaining_farm_tokens.amount; - let remaining_virtual_farm_tokens = - full_attributes.virtual_pos_token_amount - exit_attributes.virtual_pos_token_amount; - let remaining_real_farm_tokens = - full_attributes.real_pos_token_amount - exit_attributes.real_pos_token_amount; + let remaining_staking_farm_tokens = full_attributes_adjusted.staking_farm_token_amount + - exit_attributes.staking_farm_token_amount; let new_attributes = DualYieldTokenAttributes { - lp_farm_token_nonce: full_attributes.lp_farm_token_nonce, + lp_farm_token_nonce: full_attributes_adjusted.lp_farm_token_nonce, lp_farm_token_amount: remaining_lp_farm_tokens, - virtual_pos_token_nonce: full_attributes.virtual_pos_token_nonce, - virtual_pos_token_amount: remaining_virtual_farm_tokens, - real_pos_token_amount: remaining_real_farm_tokens, + staking_farm_token_nonce: full_attributes_adjusted.staking_farm_token_nonce, + staking_farm_token_amount: remaining_staking_farm_tokens, }; let new_dual_yield_tokens = self.create_dual_yield_tokens(&dual_yield_token_mapper, &new_attributes); @@ -101,20 +80,12 @@ pub trait ProxyUnstakeModule: None }; - let mut total_staking_rewards = staking_farm_exit_result.staking_rewards; - let opt_unbond_token = opt_unstake_user_pos_result.map(|res| { - total_staking_rewards.merge_with(res.staking_rewards); - - res.unbond_staking_farm_token - }); - let caller = self.blockchain().get_caller(); let unstake_result = UnstakeResult { other_token_payment: remove_liq_result.other_token_payment, lp_farm_rewards: lp_farm_exit_result.lp_farm_rewards, - staking_rewards: total_staking_rewards, + staking_rewards: staking_farm_exit_result.staking_rewards, unbond_staking_farm_token: staking_farm_exit_result.unbond_staking_farm_token, - opt_unbond_staking_farm_token_for_user_pos: opt_unbond_token, opt_new_dual_yield_tokens, }; diff --git a/farm-staking/farm-staking-proxy/src/result_types.rs b/farm-staking/farm-staking-proxy/src/result_types.rs index f1adc4335..af40a59f0 100644 --- a/farm-staking/farm-staking-proxy/src/result_types.rs +++ b/farm-staking/farm-staking-proxy/src/result_types.rs @@ -92,7 +92,6 @@ pub struct UnstakeResult { pub lp_farm_rewards: EsdtTokenPayment, pub staking_rewards: EsdtTokenPayment, pub unbond_staking_farm_token: EsdtTokenPayment, - pub opt_unbond_staking_farm_token_for_user_pos: Option>, pub opt_new_dual_yield_tokens: Option>, } @@ -108,10 +107,6 @@ impl UnstakeResult { payments.push(self.staking_rewards.clone()); payments.push(self.unbond_staking_farm_token.clone()); - if let Some(unbond_for_user_pos) = &self.opt_unbond_staking_farm_token_for_user_pos { - payments.push(unbond_for_user_pos.clone()); - } - if let Some(new_dual_yield_tokens) = &self.opt_new_dual_yield_tokens { payments.push(new_dual_yield_tokens.clone()); } diff --git a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp.rs b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp.rs index b15c69cc0..5eae751fd 100644 --- a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp.rs +++ b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp.rs @@ -226,26 +226,6 @@ fn unstake_partial_position_test() { let dual_yield_token_amount = 1_001_000_000; - // unstake with half position - wrong payment amount - setup - .b_mock - .execute_esdt_transfer( - &setup.user_addr, - &setup.proxy_wrapper, - DUAL_YIELD_TOKEN_ID, - dual_yield_token_nonce_after_stake, - &rust_biguint!(dual_yield_token_amount / 2), - |sc| { - let _ = sc.unstake_farm_tokens( - managed_biguint!(1), - managed_biguint!(1), - managed_biguint!(dual_yield_token_amount / 4), - OptionalValue::None, - ); - }, - ) - .assert_user_error("Must exit with full position as payment"); - // unstake with half position - ok setup .b_mock @@ -268,7 +248,7 @@ fn unstake_partial_position_test() { wegld_payment.token_identifier, managed_token_id!(WEGLD_TOKEN_ID) ); - assert_eq!(wegld_payment.amount, 1_001_000_000 / 2); + assert_eq!(wegld_payment.amount, dual_yield_token_amount / 2); let lp_farm_rewards = results.lp_farm_rewards; assert_eq!( @@ -289,14 +269,14 @@ fn unstake_partial_position_test() { unbond_tokens.token_identifier, managed_token_id!(STAKING_FARM_TOKEN_ID) ); - assert_eq!(unbond_tokens.amount, 1_001_000_000 / 2); + assert_eq!(unbond_tokens.amount, dual_yield_token_amount / 2); let new_dual_yield_tokens = results.opt_new_dual_yield_tokens.unwrap(); assert_eq!( new_dual_yield_tokens.token_identifier, managed_token_id!(DUAL_YIELD_TOKEN_ID) ); - assert_eq!(new_dual_yield_tokens.amount, 1_001_000_000 / 2); + assert_eq!(new_dual_yield_tokens.amount, dual_yield_token_amount / 2); }, ) .assert_ok(); @@ -304,9 +284,8 @@ fn unstake_partial_position_test() { let expected_new_dual_yield_attributes = DualYieldTokenAttributes:: { lp_farm_token_nonce: 1, lp_farm_token_amount: managed_biguint!(USER_TOTAL_LP_TOKENS / 2), - virtual_pos_token_nonce: 1, - virtual_pos_token_amount: managed_biguint!(1_001_000_000 / 2), - real_pos_token_amount: managed_biguint!(0), + staking_farm_token_nonce: 1, + staking_farm_token_amount: managed_biguint!(1_001_000_000 / 2), }; let new_dual_yield_token_nonce = dual_yield_token_nonce_after_stake + 1; let new_dual_yield_token_amount = dual_yield_token_amount / 2; @@ -464,9 +443,8 @@ fn test_stake_farm_through_proxy_with_merging() { Some(&DualYieldTokenAttributes:: { lp_farm_token_nonce: 1, lp_farm_token_amount: managed_biguint!(400_000_000), - virtual_pos_token_nonce: 1, - virtual_pos_token_amount: managed_biguint!(400_000_000), - real_pos_token_amount: managed_biguint!(0), + staking_farm_token_nonce: 1, + staking_farm_token_amount: managed_biguint!(400_000_000), }), ) }); @@ -495,9 +473,8 @@ fn test_stake_farm_through_proxy_with_merging() { Some(&DualYieldTokenAttributes:: { lp_farm_token_nonce: 2, lp_farm_token_amount: managed_biguint!(1_000_000_000), - virtual_pos_token_nonce: 2, - virtual_pos_token_amount: managed_biguint!(1_000_000_000), - real_pos_token_amount: managed_biguint!(0), + staking_farm_token_nonce: 2, + staking_farm_token_amount: managed_biguint!(1_000_000_000), }), ) }); diff --git a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_interactions/mod.rs b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_interactions/mod.rs index 8be6d9b13..945a36418 100644 --- a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_interactions/mod.rs +++ b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_interactions/mod.rs @@ -156,9 +156,8 @@ where let expected_dual_yield_attributes = DualYieldTokenAttributes:: { lp_farm_token_nonce, lp_farm_token_amount: managed_biguint!(lp_farm_token_stake_amount), - virtual_pos_token_nonce: expected_staking_farm_token_nonce, - virtual_pos_token_amount: managed_biguint!(expected_staking_token_amount), - real_pos_token_amount: managed_biguint!(0), + staking_farm_token_nonce: expected_staking_farm_token_nonce, + staking_farm_token_amount: managed_biguint!(expected_staking_token_amount), }; self.b_mock.check_nft_balance( diff --git a/farm-staking/farm-staking/src/base_impl_wrapper.rs b/farm-staking/farm-staking/src/base_impl_wrapper.rs index 54e221a95..72a5f7f56 100644 --- a/farm-staking/farm-staking/src/base_impl_wrapper.rs +++ b/farm-staking/farm-staking/src/base_impl_wrapper.rs @@ -191,28 +191,20 @@ where farm_positions: &PaymentsVec<::Api>, ) { let farm_token_mapper = sc.farm_token(); - let mut total_farm_position = BigUint::zero(); - let mut farm_position_increase = BigUint::zero(); for farm_position in farm_positions { + let is_old_farm_position = sc.is_old_farm_position(farm_position.token_nonce); farm_token_mapper.require_same_token(&farm_position.token_identifier); - total_farm_position += &farm_position.amount; let token_attributes: StakingFarmTokenAttributes<::Api> = farm_token_mapper.get_token_attributes(farm_position.token_nonce); - if &token_attributes.original_owner != user { + if is_old_farm_position { + Self::increase_user_farm_position(sc, user, &farm_position.amount); + } else if &token_attributes.original_owner != user { Self::decrease_user_farm_position(sc, &farm_position); - farm_position_increase += &farm_position.amount; + Self::increase_user_farm_position(sc, user, &farm_position.amount); } } - let user_total_farm_position = sc.get_user_total_farm_position(user); - if user_total_farm_position.total_farm_position == BigUint::zero() - && total_farm_position > 0 - { - Self::increase_user_farm_position(sc, user, &total_farm_position); - } else if farm_position_increase > 0 { - Self::increase_user_farm_position(sc, user, &farm_position_increase); - } } fn increase_user_farm_position( @@ -236,7 +228,11 @@ where sc.user_total_farm_position(&token_attributes.original_owner) .update(|user_total_farm_position| { - user_total_farm_position.total_farm_position -= farm_position.amount.clone() + if user_total_farm_position.total_farm_position > farm_position.amount { + user_total_farm_position.total_farm_position -= &farm_position.amount; + } else { + user_total_farm_position.total_farm_position = BigUint::zero(); + } }); } } diff --git a/farm-staking/farm-staking/wasm/src/lib.rs b/farm-staking/farm-staking/wasm/src/lib.rs index 1ff8628b8..9dfb64c19 100644 --- a/farm-staking/farm-staking/wasm/src/lib.rs +++ b/farm-staking/farm-staking/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 67 +// Endpoints: 68 // Async Callback: 1 -// Total number of exported functions: 69 +// Total number of exported functions: 70 #![no_std] @@ -43,6 +43,7 @@ multiversx_sc_wasm_adapter::endpoints! { getLastRewardBlockNonce => last_reward_block_nonce getDivisionSafetyConstant => division_safety_constant getUserTotalFarmPosition => user_total_farm_position + getFarmPositionMigrationBlockNonce => farm_position_migration_block_nonce registerFarmToken => register_farm_token getFarmTokenId => farm_token getFarmTokenSupply => farm_token_supply From 16576f1b0ad91ddfbfb02c9b3a37ea2feecd69eb Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Mon, 18 Sep 2023 14:05:12 +0300 Subject: [PATCH 076/213] readded claim progress check --- .github/workflows/actions.yml | 1 - dex/farm-with-locked-rewards/src/lib.rs | 17 ++++-------- dex/farm/src/lib.rs | 13 ++++----- dex/farm/src/progress_update.rs | 27 +++++++++++++++++++ .../tests/farm_setup/multi_user_farm_setup.rs | 4 +-- farm-staking/farm-staking/src/lib.rs | 16 +++-------- 6 files changed, 42 insertions(+), 36 deletions(-) create mode 100644 dex/farm/src/progress_update.rs diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index c5fdba201..f6acbaa50 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -4,7 +4,6 @@ on: push: branches: [ main, feat/* ] pull_request: - branches: [ main, feat/* ] workflow_dispatch: permissions: diff --git a/dex/farm-with-locked-rewards/src/lib.rs b/dex/farm-with-locked-rewards/src/lib.rs index 0205b1fca..30d02d00c 100644 --- a/dex/farm-with-locked-rewards/src/lib.rs +++ b/dex/farm-with-locked-rewards/src/lib.rs @@ -11,7 +11,7 @@ use core::marker::PhantomData; use mergeable::Mergeable; use farm::{ - base_functions::{BaseFunctionsModule, ClaimRewardsResultType, DoubleMultiPayment, Wrapper}, + base_functions::{BaseFunctionsModule, ClaimRewardsResultType, Wrapper}, exit_penalty::{ DEFAULT_BURN_GAS_LIMIT, DEFAULT_MINUMUM_FARMING_EPOCHS, DEFAULT_PENALTY_PERCENT, }, @@ -34,6 +34,7 @@ pub trait Farm: + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule + farm::base_functions::BaseFunctionsModule + farm::exit_penalty::ExitPenaltyModule + + farm::progress_update::ProgressUpdateModule + farm_base_impl::base_farm_init::BaseFarmInitModule + farm_base_impl::base_farm_validation::BaseFarmValidationModule + farm_base_impl::enter_farm::BaseEnterFarmModule @@ -199,23 +200,15 @@ pub trait Farm: fn merge_farm_tokens_endpoint( &self, opt_orig_caller: OptionalValue, - ) -> DoubleMultiPayment { + ) -> EsdtTokenPayment { let caller = self.blockchain().get_caller(); let orig_caller = self.get_orig_caller_from_opt(&caller, opt_orig_caller); - - let boosted_rewards = self.claim_only_boosted_payment(&orig_caller); + self.check_claim_progress_for_merge(&orig_caller); let merged_farm_token = self.merge_farm_tokens::>(); self.send_payment_non_zero(&caller, &merged_farm_token); - let locked_rewards_payment = self.send_to_lock_contract_non_zero( - self.reward_token_id().get(), - boosted_rewards, - caller, - orig_caller.clone(), - ); - - (merged_farm_token, locked_rewards_payment).into() + merged_farm_token } #[endpoint(claimBoostedRewards)] diff --git a/dex/farm/src/lib.rs b/dex/farm/src/lib.rs index f7cfbd5f6..77d96d25a 100644 --- a/dex/farm/src/lib.rs +++ b/dex/farm/src/lib.rs @@ -7,6 +7,7 @@ multiversx_sc::derive_imports!(); pub mod base_functions; pub mod exit_penalty; +pub mod progress_update; use base_functions::{ClaimRewardsResultType, DoubleMultiPayment, Wrapper}; use common_structs::FarmTokenAttributes; @@ -35,6 +36,7 @@ pub trait Farm: + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule + base_functions::BaseFunctionsModule + exit_penalty::ExitPenaltyModule + + progress_update::ProgressUpdateModule + farm_base_impl::base_farm_init::BaseFarmInitModule + farm_base_impl::base_farm_validation::BaseFarmValidationModule + farm_base_impl::enter_farm::BaseEnterFarmModule @@ -197,20 +199,15 @@ pub trait Farm: fn merge_farm_tokens_endpoint( &self, opt_orig_caller: OptionalValue, - ) -> DoubleMultiPayment { + ) -> EsdtTokenPayment { let caller = self.blockchain().get_caller(); let orig_caller = self.get_orig_caller_from_opt(&caller, opt_orig_caller); - - let boosted_rewards = self.claim_only_boosted_payment(&orig_caller); - let boosted_rewards_full_position = - EsdtTokenPayment::new(self.reward_token_id().get(), 0, boosted_rewards); + self.check_claim_progress_for_merge(&orig_caller); let merged_farm_token = self.merge_farm_tokens::>(); - self.send_payment_non_zero(&caller, &merged_farm_token); - self.send_payment_non_zero(&orig_caller, &boosted_rewards_full_position); - (merged_farm_token, boosted_rewards_full_position).into() + merged_farm_token } #[endpoint(claimBoostedRewards)] diff --git a/dex/farm/src/progress_update.rs b/dex/farm/src/progress_update.rs new file mode 100644 index 000000000..48e4b7644 --- /dev/null +++ b/dex/farm/src/progress_update.rs @@ -0,0 +1,27 @@ +multiversx_sc::imports!(); + +#[multiversx_sc::module] +pub trait ProgressUpdateModule: + week_timekeeping::WeekTimekeepingModule + + weekly_rewards_splitting::WeeklyRewardsSplittingModule + + weekly_rewards_splitting::events::WeeklyRewardsSplittingEventsModule + + weekly_rewards_splitting::global_info::WeeklyRewardsGlobalInfo + + weekly_rewards_splitting::locked_token_buckets::WeeklyRewardsLockedTokenBucketsModule + + weekly_rewards_splitting::update_claim_progress_energy::UpdateClaimProgressEnergyModule + + energy_query::EnergyQueryModule + + utils::UtilsModule +{ + fn check_claim_progress_for_merge(&self, caller: &ManagedAddress) { + let claim_progress_mapper = self.current_claim_progress(caller); + if claim_progress_mapper.is_empty() { + return; + } + + let current_week = self.get_current_week(); + let claim_progress = claim_progress_mapper.get(); + require!( + claim_progress.week == current_week, + "The user claim progress must be up to date." + ) + } +} diff --git a/dex/farm/tests/farm_setup/multi_user_farm_setup.rs b/dex/farm/tests/farm_setup/multi_user_farm_setup.rs index f619c64fa..b50f5ecde 100644 --- a/dex/farm/tests/farm_setup/multi_user_farm_setup.rs +++ b/dex/farm/tests/farm_setup/multi_user_farm_setup.rs @@ -335,9 +335,7 @@ where self.b_mock .execute_esdt_multi_transfer(user, &self.farm_wrapper, &payments, |sc| { - let (out_farm_token, _) = sc - .merge_farm_tokens_endpoint(OptionalValue::None) - .into_tuple(); + let out_farm_token = sc.merge_farm_tokens_endpoint(OptionalValue::None); assert_eq!( out_farm_token.token_identifier, managed_token_id!(FARM_TOKEN_ID) diff --git a/farm-staking/farm-staking/src/lib.rs b/farm-staking/farm-staking/src/lib.rs index e22ae0dfe..c4142784a 100644 --- a/farm-staking/farm-staking/src/lib.rs +++ b/farm-staking/farm-staking/src/lib.rs @@ -7,7 +7,6 @@ multiversx_sc::derive_imports!(); use base_impl_wrapper::FarmStakingWrapper; use contexts::storage_cache::StorageCache; -use farm::base_functions::DoubleMultiPayment; use farm_base_impl::base_traits_impl::FarmContract; use fixed_supply_token::FixedSupplyToken; use token_attributes::StakingFarmTokenAttributes; @@ -43,6 +42,7 @@ pub trait FarmStaking: + farm_base_impl::claim_rewards::BaseClaimRewardsModule + farm_base_impl::compound_rewards::BaseCompoundRewardsModule + farm_base_impl::exit_farm::BaseExitFarmModule + + farm::progress_update::ProgressUpdateModule + utils::UtilsModule + farm_token_roles::FarmTokenRolesModule + stake_farm::StakeFarmModule @@ -92,16 +92,9 @@ pub trait FarmStaking: #[payable("*")] #[endpoint(mergeFarmTokens)] - fn merge_farm_tokens_endpoint( - &self, - opt_orig_caller: OptionalValue, - ) -> DoubleMultiPayment { + fn merge_farm_tokens_endpoint(&self) -> EsdtTokenPayment { let caller = self.blockchain().get_caller(); - let orig_caller = self.get_orig_caller_from_opt(&caller, opt_orig_caller); - - let boosted_rewards = self.claim_only_boosted_payment(&orig_caller); - let boosted_rewards_full_position = - EsdtTokenPayment::new(self.reward_token_id().get(), 0, boosted_rewards); + self.check_claim_progress_for_merge(&caller); let payments = self.get_non_empty_payments(); let token_mapper = self.farm_token(); @@ -111,9 +104,8 @@ pub trait FarmStaking: let merged_farm_token = token_mapper.nft_create(new_token_amount, &output_attributes); self.send_payment_non_zero(&caller, &merged_farm_token); - self.send_payment_non_zero(&orig_caller, &boosted_rewards_full_position); - (merged_farm_token, boosted_rewards_full_position).into() + merged_farm_token } #[view(calculateRewardsForGivenPosition)] From 3fc935a05a15f2d88f31e49265faf8d6d6b2f681 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Mon, 18 Sep 2023 14:12:13 +0300 Subject: [PATCH 077/213] clippy fixes --- .github/workflows/actions.yml | 1 + dex/farm-with-locked-rewards/src/lib.rs | 8 +++----- dex/farm/src/lib.rs | 2 +- .../src/claim_only_boosted_staking_rewards.rs | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index f6acbaa50..c5fdba201 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -4,6 +4,7 @@ on: push: branches: [ main, feat/* ] pull_request: + branches: [ main, feat/* ] workflow_dispatch: permissions: diff --git a/dex/farm-with-locked-rewards/src/lib.rs b/dex/farm-with-locked-rewards/src/lib.rs index 30d02d00c..b189cfd80 100644 --- a/dex/farm-with-locked-rewards/src/lib.rs +++ b/dex/farm-with-locked-rewards/src/lib.rs @@ -229,15 +229,13 @@ pub trait Farm: ); } - let boosted_rewards = self.claim_only_boosted_payment(&user); - let locked_rewards_payment = self.send_to_lock_contract_non_zero( + let boosted_rewards = self.claim_only_boosted_payment(user); + self.send_to_lock_contract_non_zero( self.reward_token_id().get(), boosted_rewards, caller.clone(), user.clone(), - ); - - locked_rewards_payment + ) } #[endpoint(startProduceRewards)] diff --git a/dex/farm/src/lib.rs b/dex/farm/src/lib.rs index 77d96d25a..d1775471c 100644 --- a/dex/farm/src/lib.rs +++ b/dex/farm/src/lib.rs @@ -228,7 +228,7 @@ pub trait Farm: ); } - let boosted_rewards = self.claim_only_boosted_payment(&user); + let boosted_rewards = self.claim_only_boosted_payment(user); let boosted_rewards_payment = EsdtTokenPayment::new(self.reward_token_id().get(), 0, boosted_rewards); diff --git a/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs b/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs index 83e609e92..f1138d6c0 100644 --- a/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs +++ b/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs @@ -40,7 +40,7 @@ pub trait ClaimOnlyBoostedStakingRewardsModule: ); } - let boosted_rewards = self.claim_only_boosted_payment(&user); + let boosted_rewards = self.claim_only_boosted_payment(user); let boosted_rewards_payment = EsdtTokenPayment::new(self.reward_token_id().get(), 0, boosted_rewards); From be142a314f9a0fb56403c97fbc7ab75d21bd44f4 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Mon, 18 Sep 2023 18:22:27 +0300 Subject: [PATCH 078/213] dedicated migration function for old positions --- .../farm_base_impl/src/base_traits_impl.rs | 13 +++++++---- dex/farm-with-locked-rewards/src/lib.rs | 4 ++++ dex/farm/src/base_functions.rs | 21 +++++++++++++++++ dex/farm/src/lib.rs | 6 +++++ .../farm-staking/src/base_impl_wrapper.rs | 18 ++++++++++----- .../src/claim_only_boosted_staking_rewards.rs | 23 ++++++++++++++++++- .../src/claim_stake_farm_rewards.rs | 2 ++ .../src/compound_stake_farm_rewards.rs | 2 ++ farm-staking/farm-staking/src/lib.rs | 1 + farm-staking/farm-staking/src/stake_farm.rs | 2 +- 10 files changed, 80 insertions(+), 12 deletions(-) diff --git a/common/modules/farm/farm_base_impl/src/base_traits_impl.rs b/common/modules/farm/farm_base_impl/src/base_traits_impl.rs index c03775abc..8f44e8971 100644 --- a/common/modules/farm/farm_base_impl/src/base_traits_impl.rs +++ b/common/modules/farm/farm_base_impl/src/base_traits_impl.rs @@ -196,15 +196,16 @@ pub trait FarmContract { ) { let farm_token_mapper = sc.farm_token(); for farm_position in farm_positions { - let is_old_farm_position = sc.is_old_farm_position(farm_position.token_nonce); + if sc.is_old_farm_position(farm_position.token_nonce) { + continue; + } + farm_token_mapper.require_same_token(&farm_position.token_identifier); let token_attributes: FarmTokenAttributes<::Api> = farm_token_mapper.get_token_attributes(farm_position.token_nonce); - if is_old_farm_position { - Self::increase_user_farm_position(sc, user, &farm_position.amount); - } else if &token_attributes.original_owner != user { + if &token_attributes.original_owner != user { Self::decrease_user_farm_position(sc, &farm_position); Self::increase_user_farm_position(sc, user, &farm_position.amount); } @@ -227,6 +228,10 @@ pub trait FarmContract { sc: &Self::FarmSc, farm_position: &EsdtTokenPayment<::Api>, ) { + if sc.is_old_farm_position(farm_position.token_nonce) { + return; + } + let farm_token_mapper = sc.farm_token(); let token_attributes: FarmTokenAttributes<::Api> = farm_token_mapper.get_token_attributes(farm_position.token_nonce); diff --git a/dex/farm-with-locked-rewards/src/lib.rs b/dex/farm-with-locked-rewards/src/lib.rs index b189cfd80..c2723738e 100644 --- a/dex/farm-with-locked-rewards/src/lib.rs +++ b/dex/farm-with-locked-rewards/src/lib.rs @@ -88,6 +88,7 @@ pub trait Farm: let caller = self.blockchain().get_caller(); let orig_caller = self.get_orig_caller_from_opt(&caller, opt_orig_caller); + self.migrate_old_farm_positions(&orig_caller); let boosted_rewards = self.claim_only_boosted_payment(&orig_caller); let boosted_rewards_payment = if boosted_rewards > 0 { self.send_to_lock_contract_non_zero( @@ -117,6 +118,8 @@ pub trait Farm: let caller = self.blockchain().get_caller(); let orig_caller = self.get_orig_caller_from_opt(&caller, opt_orig_caller); + self.migrate_old_farm_positions(&orig_caller); + let payments = self.call_value().all_esdt_transfers().clone_value(); let base_claim_rewards_result = self.claim_rewards_base::>(orig_caller.clone(), payments); @@ -204,6 +207,7 @@ pub trait Farm: let caller = self.blockchain().get_caller(); let orig_caller = self.get_orig_caller_from_opt(&caller, opt_orig_caller); self.check_claim_progress_for_merge(&orig_caller); + self.migrate_old_farm_positions(&orig_caller); let merged_farm_token = self.merge_farm_tokens::>(); self.send_payment_non_zero(&caller, &merged_farm_token); diff --git a/dex/farm/src/base_functions.rs b/dex/farm/src/base_functions.rs index fb5c5dfce..f3512a5f8 100644 --- a/dex/farm/src/base_functions.rs +++ b/dex/farm/src/base_functions.rs @@ -204,6 +204,27 @@ pub trait BaseFunctionsModule: reward } + fn migrate_old_farm_positions(&self, caller: &ManagedAddress) { + let payments = self.get_non_empty_payments(); + let farm_token_mapper = self.farm_token(); + let farm_token_id = farm_token_mapper.get_token_id(); + for farm_position in &payments { + if farm_position.token_identifier == farm_token_id + && self.is_old_farm_position(farm_position.token_nonce) + { + let token_attributes: FarmTokenAttributes = + farm_token_mapper.get_token_attributes(farm_position.token_nonce); + + if &token_attributes.original_owner == caller { + let mut user_total_farm_position = self.get_user_total_farm_position(caller); + user_total_farm_position.total_farm_position += farm_position.amount; + self.user_total_farm_position(caller) + .set(user_total_farm_position); + } + } + } + } + fn end_produce_rewards>(&self) { let mut storage = StorageCache::new(self); FC::generate_aggregated_rewards(self, &mut storage); diff --git a/dex/farm/src/lib.rs b/dex/farm/src/lib.rs index d1775471c..f4f23bc78 100644 --- a/dex/farm/src/lib.rs +++ b/dex/farm/src/lib.rs @@ -96,6 +96,7 @@ pub trait Farm: let caller = self.blockchain().get_caller(); let orig_caller = self.get_orig_caller_from_opt(&caller, opt_orig_caller); + self.migrate_old_farm_positions(&orig_caller); let boosted_rewards = self.claim_only_boosted_payment(&orig_caller); let boosted_rewards_payment = if boosted_rewards > 0 { EsdtTokenPayment::new(self.reward_token_id().get(), 0, boosted_rewards) @@ -121,6 +122,8 @@ pub trait Farm: let caller = self.blockchain().get_caller(); let orig_caller = self.get_orig_caller_from_opt(&caller, opt_orig_caller); + self.migrate_old_farm_positions(&orig_caller); + let claim_rewards_result = self.claim_rewards::>(orig_caller.clone()); self.send_payment_non_zero(&caller, &claim_rewards_result.new_farm_token); @@ -138,6 +141,8 @@ pub trait Farm: let caller = self.blockchain().get_caller(); let orig_caller = self.get_orig_caller_from_opt(&caller, opt_orig_caller); + self.migrate_old_farm_positions(&orig_caller); + let output_farm_token_payment = self.compound_rewards::>(orig_caller.clone()); self.send_payment_non_zero(&caller, &output_farm_token_payment); @@ -203,6 +208,7 @@ pub trait Farm: let caller = self.blockchain().get_caller(); let orig_caller = self.get_orig_caller_from_opt(&caller, opt_orig_caller); self.check_claim_progress_for_merge(&orig_caller); + self.migrate_old_farm_positions(&orig_caller); let merged_farm_token = self.merge_farm_tokens::>(); self.send_payment_non_zero(&caller, &merged_farm_token); diff --git a/farm-staking/farm-staking/src/base_impl_wrapper.rs b/farm-staking/farm-staking/src/base_impl_wrapper.rs index 72a5f7f56..2b671677f 100644 --- a/farm-staking/farm-staking/src/base_impl_wrapper.rs +++ b/farm-staking/farm-staking/src/base_impl_wrapper.rs @@ -192,28 +192,30 @@ where ) { let farm_token_mapper = sc.farm_token(); for farm_position in farm_positions { - let is_old_farm_position = sc.is_old_farm_position(farm_position.token_nonce); + if sc.is_old_farm_position(farm_position.token_nonce) { + continue; + } + farm_token_mapper.require_same_token(&farm_position.token_identifier); let token_attributes: StakingFarmTokenAttributes<::Api> = farm_token_mapper.get_token_attributes(farm_position.token_nonce); - if is_old_farm_position { - Self::increase_user_farm_position(sc, user, &farm_position.amount); - } else if &token_attributes.original_owner != user { + if &token_attributes.original_owner != user { Self::decrease_user_farm_position(sc, &farm_position); Self::increase_user_farm_position(sc, user, &farm_position.amount); } } } + #[inline] fn increase_user_farm_position( sc: &Self::FarmSc, user: &ManagedAddress<::Api>, - new_farm_position_amount: &BigUint<::Api>, + increase_farm_position_amount: &BigUint<::Api>, ) { let mut user_total_farm_position = sc.get_user_total_farm_position(user); - user_total_farm_position.total_farm_position += new_farm_position_amount; + user_total_farm_position.total_farm_position += increase_farm_position_amount; sc.user_total_farm_position(user) .set(user_total_farm_position); } @@ -222,6 +224,10 @@ where sc: &Self::FarmSc, farm_position: &EsdtTokenPayment<::Api>, ) { + if sc.is_old_farm_position(farm_position.token_nonce) { + return; + } + let farm_token_mapper = sc.farm_token(); let token_attributes: StakingFarmTokenAttributes<::Api> = farm_token_mapper.get_token_attributes(farm_position.token_nonce); diff --git a/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs b/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs index f1138d6c0..9144e0b29 100644 --- a/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs +++ b/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs @@ -1,4 +1,4 @@ -use crate::base_impl_wrapper::FarmStakingWrapper; +use crate::{base_impl_wrapper::FarmStakingWrapper, token_attributes::StakingFarmTokenAttributes}; multiversx_sc::imports!(); @@ -49,6 +49,27 @@ pub trait ClaimOnlyBoostedStakingRewardsModule: boosted_rewards_payment } + fn migrate_old_farm_positions(&self, caller: &ManagedAddress) { + let payments = self.get_non_empty_payments(); + let farm_token_mapper = self.farm_token(); + let farm_token_id = farm_token_mapper.get_token_id(); + for farm_position in &payments { + if farm_position.token_identifier == farm_token_id + && self.is_old_farm_position(farm_position.token_nonce) + { + let token_attributes: StakingFarmTokenAttributes = + farm_token_mapper.get_token_attributes(farm_position.token_nonce); + + if &token_attributes.original_owner == caller { + let mut user_total_farm_position = self.get_user_total_farm_position(caller); + user_total_farm_position.total_farm_position += farm_position.amount; + self.user_total_farm_position(caller) + .set(user_total_farm_position); + } + } + } + } + // Cannot import the one from farm, as the Wrapper struct has different dependencies fn claim_only_boosted_payment(&self, caller: &ManagedAddress) -> BigUint { let reward = FarmStakingWrapper::::calculate_boosted_rewards(self, caller); diff --git a/farm-staking/farm-staking/src/claim_stake_farm_rewards.rs b/farm-staking/farm-staking/src/claim_stake_farm_rewards.rs index bea77d267..e3d0b1dc4 100644 --- a/farm-staking/farm-staking/src/claim_stake_farm_rewards.rs +++ b/farm-staking/farm-staking/src/claim_stake_farm_rewards.rs @@ -7,6 +7,7 @@ use crate::base_impl_wrapper::FarmStakingWrapper; #[multiversx_sc::module] pub trait ClaimStakeFarmRewardsModule: crate::custom_rewards::CustomRewardsModule + + crate::claim_only_boosted_staking_rewards::ClaimOnlyBoostedStakingRewardsModule + rewards::RewardsModule + config::ConfigModule + events::EventsModule @@ -60,6 +61,7 @@ pub trait ClaimStakeFarmRewardsModule: original_caller: ManagedAddress, opt_new_farming_amount: Option, ) -> ClaimRewardsResultType { + self.migrate_old_farm_positions(&original_caller); let payment = self.call_value().single_esdt(); let mut claim_result = self .claim_rewards_base_no_farm_token_mint::>( diff --git a/farm-staking/farm-staking/src/compound_stake_farm_rewards.rs b/farm-staking/farm-staking/src/compound_stake_farm_rewards.rs index e51f3b66e..a7d83d574 100644 --- a/farm-staking/farm-staking/src/compound_stake_farm_rewards.rs +++ b/farm-staking/farm-staking/src/compound_stake_farm_rewards.rs @@ -5,6 +5,7 @@ multiversx_sc::imports!(); #[multiversx_sc::module] pub trait CompoundStakeFarmRewardsModule: crate::custom_rewards::CustomRewardsModule + + crate::claim_only_boosted_staking_rewards::ClaimOnlyBoostedStakingRewardsModule + rewards::RewardsModule + config::ConfigModule + events::EventsModule @@ -32,6 +33,7 @@ pub trait CompoundStakeFarmRewardsModule: #[endpoint(compoundRewards)] fn compound_rewards(&self) -> EsdtTokenPayment { let caller = self.blockchain().get_caller(); + self.migrate_old_farm_positions(&caller); let payments = self.get_non_empty_payments(); let compound_result = self.compound_rewards_base::>(caller.clone(), payments); diff --git a/farm-staking/farm-staking/src/lib.rs b/farm-staking/farm-staking/src/lib.rs index c4142784a..c9941ced1 100644 --- a/farm-staking/farm-staking/src/lib.rs +++ b/farm-staking/farm-staking/src/lib.rs @@ -95,6 +95,7 @@ pub trait FarmStaking: fn merge_farm_tokens_endpoint(&self) -> EsdtTokenPayment { let caller = self.blockchain().get_caller(); self.check_claim_progress_for_merge(&caller); + self.migrate_old_farm_positions(&caller); let payments = self.get_non_empty_payments(); let token_mapper = self.farm_token(); diff --git a/farm-staking/farm-staking/src/stake_farm.rs b/farm-staking/farm-staking/src/stake_farm.rs index 2da477f52..bd5f6481a 100644 --- a/farm-staking/farm-staking/src/stake_farm.rs +++ b/farm-staking/farm-staking/src/stake_farm.rs @@ -72,7 +72,7 @@ pub trait StakeFarmModule: payments: PaymentsVec, ) -> EnterFarmResultType { let caller = self.blockchain().get_caller(); - + self.migrate_old_farm_positions(&original_caller); let boosted_rewards = self.claim_only_boosted_payment(&original_caller); let boosted_rewards_payment = if boosted_rewards > 0 { EsdtTokenPayment::new(self.reward_token_id().get(), 0, boosted_rewards) From a77b7609f7167c215f74e76e2c958131f6162393 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Tue, 19 Sep 2023 13:39:42 +0300 Subject: [PATCH 079/213] remove caller check in migrate old position func --- dex/farm/src/base_functions.rs | 13 ++++--------- .../src/claim_only_boosted_staking_rewards.rs | 15 +++++---------- 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/dex/farm/src/base_functions.rs b/dex/farm/src/base_functions.rs index f3512a5f8..b98a49d5f 100644 --- a/dex/farm/src/base_functions.rs +++ b/dex/farm/src/base_functions.rs @@ -212,15 +212,10 @@ pub trait BaseFunctionsModule: if farm_position.token_identifier == farm_token_id && self.is_old_farm_position(farm_position.token_nonce) { - let token_attributes: FarmTokenAttributes = - farm_token_mapper.get_token_attributes(farm_position.token_nonce); - - if &token_attributes.original_owner == caller { - let mut user_total_farm_position = self.get_user_total_farm_position(caller); - user_total_farm_position.total_farm_position += farm_position.amount; - self.user_total_farm_position(caller) - .set(user_total_farm_position); - } + let mut user_total_farm_position = self.get_user_total_farm_position(caller); + user_total_farm_position.total_farm_position += farm_position.amount; + self.user_total_farm_position(caller) + .set(user_total_farm_position); } } } diff --git a/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs b/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs index 9144e0b29..556a2ef17 100644 --- a/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs +++ b/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs @@ -1,4 +1,4 @@ -use crate::{base_impl_wrapper::FarmStakingWrapper, token_attributes::StakingFarmTokenAttributes}; +use crate::base_impl_wrapper::FarmStakingWrapper; multiversx_sc::imports!(); @@ -57,15 +57,10 @@ pub trait ClaimOnlyBoostedStakingRewardsModule: if farm_position.token_identifier == farm_token_id && self.is_old_farm_position(farm_position.token_nonce) { - let token_attributes: StakingFarmTokenAttributes = - farm_token_mapper.get_token_attributes(farm_position.token_nonce); - - if &token_attributes.original_owner == caller { - let mut user_total_farm_position = self.get_user_total_farm_position(caller); - user_total_farm_position.total_farm_position += farm_position.amount; - self.user_total_farm_position(caller) - .set(user_total_farm_position); - } + let mut user_total_farm_position = self.get_user_total_farm_position(caller); + user_total_farm_position.total_farm_position += farm_position.amount; + self.user_total_farm_position(caller) + .set(user_total_farm_position); } } } From 3fe300e1b0949c7edd51bd48d9bc005c0d0bbb79 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Tue, 19 Sep 2023 16:53:54 +0300 Subject: [PATCH 080/213] remove exit amount parameter from farms --- .github/workflows/actions.yml | 1 - common/modules/farm/config/src/config.rs | 2 +- .../farm/farm_base_impl/src/exit_farm.rs | 4 +- dex/farm-with-locked-rewards/src/lib.rs | 31 +------ .../farm_with_locked_rewards_setup/mod.rs | 15 +--- .../tests/farm_with_locked_rewards_test.rs | 2 +- dex/farm/src/lib.rs | 36 ++------ dex/farm/tests/farm_multi_user_test.rs | 16 ++-- .../farm_setup/farm_rewards_distr_setup.rs | 5 +- .../tests/farm_setup/multi_user_farm_setup.rs | 23 ++--- .../farm_setup/single_user_farm_setup.rs | 9 +- dex/farm/tests/farm_single_user_test.rs | 4 +- dex/fuzz/src/fuzz_farm.rs | 4 +- .../src/external_contracts_interactions.rs | 13 +-- .../src/proxy_actions/unstake.rs | 35 +------- .../farm-staking-proxy/src/result_types.rs | 7 -- .../tests/staking_farm_with_lp.rs | 36 +------- .../mod.rs | 6 +- .../src/claim_only_boosted_staking_rewards.rs | 2 +- farm-staking/farm-staking/src/unstake_farm.rs | 45 ++-------- .../tests/farm_staking_energy_test.rs | 6 +- .../tests/farm_staking_setup/mod.rs | 5 +- .../proxy_dex/src/farm_interactions.rs | 7 +- locked-asset/proxy_dex/src/proxy_farm.rs | 35 ++------ .../proxy_dex/tests/proxy_farm_test.rs | 29 ++----- locked-asset/proxy_dex/wasm/Cargo.lock | 84 ++++--------------- locked-asset/proxy_dex/wasm/src/lib.rs | 59 +++++++------ locked-asset/simple-lock/elrond.json | 3 - .../simple-lock/src/farm_interactions.rs | 9 +- locked-asset/simple-lock/src/proxy_farm.rs | 28 ++----- locked-asset/simple-lock/wasm/Cargo.lock | 84 ++++--------------- locked-asset/simple-lock/wasm/src/lib.rs | 47 ++++++----- 32 files changed, 175 insertions(+), 517 deletions(-) delete mode 100644 locked-asset/simple-lock/elrond.json diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index c5fdba201..f6acbaa50 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -4,7 +4,6 @@ on: push: branches: [ main, feat/* ] pull_request: - branches: [ main, feat/* ] workflow_dispatch: permissions: diff --git a/common/modules/farm/config/src/config.rs b/common/modules/farm/config/src/config.rs index 2f5f4935c..a823a71c7 100644 --- a/common/modules/farm/config/src/config.rs +++ b/common/modules/farm/config/src/config.rs @@ -55,7 +55,7 @@ pub trait ConfigModule: pausable::PausableModule + permissions_module::Permissio fn is_old_farm_position(&self, token_nonce: Nonce) -> bool { let farm_position_migration_block_nonce = self.farm_position_migration_block_nonce().get(); - token_nonce < farm_position_migration_block_nonce + token_nonce > 0 && token_nonce < farm_position_migration_block_nonce } #[endpoint(allowExternalClaimBoostedRewards)] diff --git a/common/modules/farm/farm_base_impl/src/exit_farm.rs b/common/modules/farm/farm_base_impl/src/exit_farm.rs index eefe7c65f..315abe421 100644 --- a/common/modules/farm/farm_base_impl/src/exit_farm.rs +++ b/common/modules/farm/farm_base_impl/src/exit_farm.rs @@ -44,8 +44,6 @@ pub trait BaseExitFarmModule: self.blockchain(), ); - FC::decrease_user_farm_position(self, &payment); - FC::generate_aggregated_rewards(self, &mut storage_cache); let farm_token_amount = &exit_farm_context.farm_token.payment.amount; @@ -64,6 +62,8 @@ pub trait BaseExitFarmModule: ); storage_cache.reward_reserve -= &reward; + FC::decrease_user_farm_position(self, &payment); + let farming_token_amount = token_attributes.get_total_supply(); let farming_token_payment = EsdtTokenPayment::new( storage_cache.farming_token_id.clone(), diff --git a/dex/farm-with-locked-rewards/src/lib.rs b/dex/farm-with-locked-rewards/src/lib.rs index c2723738e..60130ad11 100644 --- a/dex/farm-with-locked-rewards/src/lib.rs +++ b/dex/farm-with-locked-rewards/src/lib.rs @@ -8,7 +8,6 @@ multiversx_sc::derive_imports!(); use common_structs::FarmTokenAttributes; use contexts::storage_cache::StorageCache; use core::marker::PhantomData; -use mergeable::Mergeable; use farm::{ base_functions::{BaseFunctionsModule, ClaimRewardsResultType, Wrapper}, @@ -150,36 +149,19 @@ pub trait Farm: #[endpoint(exitFarm)] fn exit_farm_endpoint( &self, - exit_amount: BigUint, opt_orig_caller: OptionalValue, ) -> ExitFarmWithPartialPosResultType { let caller = self.blockchain().get_caller(); let orig_caller = self.get_orig_caller_from_opt(&caller, opt_orig_caller); - let mut payment = self.call_value().single_esdt(); - require!( - payment.amount >= exit_amount, - "Exit amount is bigger than the payment amount" - ); - - let boosted_rewards = self.claim_only_boosted_payment(&orig_caller); - let boosted_rewards_full_position = - EsdtTokenPayment::new(self.reward_token_id().get(), 0, boosted_rewards); + let payment = self.call_value().single_esdt(); - let remaining_farm_payment = EsdtTokenPayment::new( - payment.token_identifier.clone(), - payment.token_nonce, - &payment.amount - &exit_amount, - ); - - payment.amount = exit_amount; + self.migrate_old_farm_positions(&orig_caller); let exit_farm_result = self.exit_farm::>(orig_caller.clone(), payment); - let mut rewards = exit_farm_result.rewards; - rewards.merge_with(boosted_rewards_full_position); + let rewards = exit_farm_result.rewards; self.send_payment_non_zero(&caller, &exit_farm_result.farming_tokens); - self.send_payment_non_zero(&caller, &remaining_farm_payment); let locked_rewards_payment = self.send_to_lock_contract_non_zero( rewards.token_identifier.clone(), @@ -190,12 +172,7 @@ pub trait Farm: self.clear_user_energy_if_needed(&orig_caller); - ( - exit_farm_result.farming_tokens, - locked_rewards_payment, - remaining_farm_payment, - ) - .into() + (exit_farm_result.farming_tokens, locked_rewards_payment).into() } #[payable("*")] diff --git a/dex/farm-with-locked-rewards/tests/farm_with_locked_rewards_setup/mod.rs b/dex/farm-with-locked-rewards/tests/farm_with_locked_rewards_setup/mod.rs index f795108e6..f8858aaf8 100644 --- a/dex/farm-with-locked-rewards/tests/farm_with_locked_rewards_setup/mod.rs +++ b/dex/farm-with-locked-rewards/tests/farm_with_locked_rewards_setup/mod.rs @@ -413,25 +413,16 @@ where result } - pub fn exit_farm( - &mut self, - user: &Address, - farm_token_nonce: u64, - farm_token_amount: u64, - exit_farm_amount: u64, - ) { + pub fn exit_farm(&mut self, user: &Address, farm_token_nonce: u64, exit_farm_amount: u64) { self.b_mock .execute_esdt_transfer( user, &self.farm_wrapper, FARM_TOKEN_ID, farm_token_nonce, - &rust_biguint!(farm_token_amount), + &rust_biguint!(exit_farm_amount), |sc| { - let _ = sc.exit_farm_endpoint( - managed_biguint!(exit_farm_amount), - OptionalValue::Some(managed_address!(user)), - ); + let _ = sc.exit_farm_endpoint(OptionalValue::Some(managed_address!(user))); }, ) .assert_ok(); diff --git a/dex/farm-with-locked-rewards/tests/farm_with_locked_rewards_test.rs b/dex/farm-with-locked-rewards/tests/farm_with_locked_rewards_test.rs index db4f9e7bc..5d7bdf7be 100644 --- a/dex/farm-with-locked-rewards/tests/farm_with_locked_rewards_test.rs +++ b/dex/farm-with-locked-rewards/tests/farm_with_locked_rewards_test.rs @@ -149,7 +149,7 @@ fn farm_with_boosted_yields_no_proxy_test() { farm_setup.set_user_energy(&second_user, 4_000, 6, 1); farm_setup.set_user_energy(&third_user, 1, 6, 1); farm_setup.enter_farm(&third_user, 1); - farm_setup.exit_farm(&third_user, 5, 1, 1); + farm_setup.exit_farm(&third_user, 5, 1); // advance 1 week farm_setup.b_mock.set_block_epoch(10); diff --git a/dex/farm/src/lib.rs b/dex/farm/src/lib.rs index f4f23bc78..7f019ed08 100644 --- a/dex/farm/src/lib.rs +++ b/dex/farm/src/lib.rs @@ -17,11 +17,9 @@ use exit_penalty::{ DEFAULT_BURN_GAS_LIMIT, DEFAULT_MINUMUM_FARMING_EPOCHS, DEFAULT_PENALTY_PERCENT, }; use farm_base_impl::base_traits_impl::FarmContract; -use mergeable::Mergeable; pub type EnterFarmResultType = DoubleMultiPayment; -pub type ExitFarmWithPartialPosResultType = - MultiValue3, EsdtTokenPayment, EsdtTokenPayment>; +pub type ExitFarmWithPartialPosResultType = DoubleMultiPayment; #[multiversx_sc::contract] pub trait Farm: @@ -156,47 +154,23 @@ pub trait Farm: #[endpoint(exitFarm)] fn exit_farm_endpoint( &self, - exit_amount: BigUint, opt_orig_caller: OptionalValue, ) -> ExitFarmWithPartialPosResultType { let caller = self.blockchain().get_caller(); let orig_caller = self.get_orig_caller_from_opt(&caller, opt_orig_caller); - let mut payment = self.call_value().single_esdt(); - require!( - payment.amount >= exit_amount, - "Exit amount is bigger than the payment amount" - ); - - let boosted_rewards = self.claim_only_boosted_payment(&orig_caller); - let boosted_rewards_full_position = - EsdtTokenPayment::new(self.reward_token_id().get(), 0, boosted_rewards); + let payment = self.call_value().single_esdt(); - let remaining_farm_payment = EsdtTokenPayment::new( - payment.token_identifier.clone(), - payment.token_nonce, - &payment.amount - &exit_amount, - ); - - payment.amount = exit_amount; + self.migrate_old_farm_positions(&orig_caller); - let mut exit_farm_result = self.exit_farm::>(orig_caller.clone(), payment); - exit_farm_result - .rewards - .merge_with(boosted_rewards_full_position); + let exit_farm_result = self.exit_farm::>(orig_caller.clone(), payment); self.send_payment_non_zero(&caller, &exit_farm_result.farming_tokens); self.send_payment_non_zero(&caller, &exit_farm_result.rewards); - self.send_payment_non_zero(&caller, &remaining_farm_payment); self.clear_user_energy_if_needed(&orig_caller); - ( - exit_farm_result.farming_tokens, - exit_farm_result.rewards, - remaining_farm_payment, - ) - .into() + (exit_farm_result.farming_tokens, exit_farm_result.rewards).into() } #[payable("*")] diff --git a/dex/farm/tests/farm_multi_user_test.rs b/dex/farm/tests/farm_multi_user_test.rs index 8dfac6b79..7fe7c53d3 100644 --- a/dex/farm/tests/farm_multi_user_test.rs +++ b/dex/farm/tests/farm_multi_user_test.rs @@ -149,7 +149,7 @@ fn farm_with_boosted_yields_test() { farm_setup.set_user_energy(&second_user, 4_000, 6, 1); farm_setup.set_user_energy(&third_user, 1, 6, 1); farm_setup.enter_farm(&third_user, 1); - farm_setup.exit_farm(&third_user, 5, 1, 1); + farm_setup.exit_farm(&third_user, 5, 1); // advance 1 week farm_setup.b_mock.set_block_epoch(10); @@ -262,7 +262,7 @@ fn farm_claim_boosted_yields_for_other_user_test() { farm_setup.set_user_energy(&second_user, 4_000, 6, 1); farm_setup.set_user_energy(&third_user, 1, 6, 1); farm_setup.enter_farm(&third_user, 1); - farm_setup.exit_farm(&third_user, 5, 1, 1); + farm_setup.exit_farm(&third_user, 5, 1); // advance 1 week farm_setup.b_mock.set_block_epoch(10); @@ -434,7 +434,7 @@ fn farm_boosted_yields_claim_with_different_user_pos_test() { farm_setup.set_user_energy(&second_user, 4_000, 6, 1); farm_setup.set_user_energy(&third_user, 1, 6, 1); farm_setup.enter_farm(&third_user, 1); - farm_setup.exit_farm(&third_user, 5, 1, 1); + farm_setup.exit_farm(&third_user, 5, 1); // advance 1 week farm_setup.b_mock.set_block_epoch(10); @@ -625,7 +625,7 @@ fn farm_multiple_claim_weeks_with_collect_undistributed_rewards_test() { farm_setup.set_user_energy(&second_user, 4_000, 6, 1); farm_setup.set_user_energy(&third_user, 1, 6, 1); farm_setup.enter_farm(&third_user, 1); - farm_setup.exit_farm(&third_user, 5, 1, 1); + farm_setup.exit_farm(&third_user, 5, 1); // advance 1 week farm_setup.b_mock.set_block_epoch(10); @@ -706,7 +706,7 @@ fn farm_multiple_claim_weeks_with_collect_undistributed_rewards_test() { farm_setup.set_user_energy(&second_user, 4_000, 13, 1); farm_setup.set_user_energy(&third_user, 1, 13, 1); farm_setup.enter_farm(&third_user, 1); - farm_setup.exit_farm(&third_user, 8, 1, 1); + farm_setup.exit_farm(&third_user, 8, 1); // advance blocks - 10 blocks - 10 * 1_000 = 10_000 total rewards // 7_500 base farm, 2_500 boosted yields @@ -718,7 +718,7 @@ fn farm_multiple_claim_weeks_with_collect_undistributed_rewards_test() { farm_setup.set_user_energy(&second_user, 4_000, 20, 1); farm_setup.set_user_energy(&third_user, 1, 20, 1); farm_setup.enter_farm(&third_user, 1); - farm_setup.exit_farm(&third_user, 9, 1, 1); + farm_setup.exit_farm(&third_user, 9, 1); // advance week farm_setup.b_mock.set_block_epoch(22); @@ -875,7 +875,7 @@ fn farm_enter_with_multiple_farm_token() { farm_setup.set_user_energy(&second_user, 4_000, 6, 1); farm_setup.set_user_energy(&third_user, 1, 6, 1); farm_setup.enter_farm(&third_user, 1); - farm_setup.exit_farm(&third_user, 5, 1, 1); + farm_setup.exit_farm(&third_user, 5, 1); // advance 1 week farm_setup.b_mock.set_block_epoch(10); @@ -990,7 +990,7 @@ fn farm_claim_with_minimum_tokens() { farm_setup.set_user_energy(&second_user, 90_000, 6, 1); farm_setup.set_user_energy(&third_user, 1, 6, 1); farm_setup.enter_farm(&third_user, 1); - farm_setup.exit_farm(&third_user, 5, 1, 1); + farm_setup.exit_farm(&third_user, 5, 1); // advance 1 week farm_setup.b_mock.set_block_epoch(10); diff --git a/dex/farm/tests/farm_setup/farm_rewards_distr_setup.rs b/dex/farm/tests/farm_setup/farm_rewards_distr_setup.rs index 7c610556c..4f144d8c4 100644 --- a/dex/farm/tests/farm_setup/farm_rewards_distr_setup.rs +++ b/dex/farm/tests/farm_setup/farm_rewards_distr_setup.rs @@ -185,10 +185,9 @@ where farm_token_nonce, &farm_out_amount.clone(), |sc| { - let exit_amount = to_managed_biguint(farm_out_amount); - let multi_result = sc.exit_farm_endpoint(exit_amount, OptionalValue::None); + let multi_result = sc.exit_farm_endpoint(OptionalValue::None); - let (first_result, second_result, _third_result) = multi_result.into_tuple(); + let (first_result, second_result) = multi_result.into_tuple(); assert_eq!( first_result.token_identifier, diff --git a/dex/farm/tests/farm_setup/multi_user_farm_setup.rs b/dex/farm/tests/farm_setup/multi_user_farm_setup.rs index b50f5ecde..819d87cfe 100644 --- a/dex/farm/tests/farm_setup/multi_user_farm_setup.rs +++ b/dex/farm/tests/farm_setup/multi_user_farm_setup.rs @@ -513,25 +513,16 @@ where result } - pub fn exit_farm( - &mut self, - user: &Address, - farm_token_nonce: u64, - farm_token_amount: u64, - exit_farm_amount: u64, - ) { + pub fn exit_farm(&mut self, user: &Address, farm_token_nonce: u64, exit_farm_amount: u64) { self.b_mock .execute_esdt_transfer( user, &self.farm_wrapper, FARM_TOKEN_ID, farm_token_nonce, - &rust_biguint!(farm_token_amount), + &rust_biguint!(exit_farm_amount), |sc| { - let _ = sc.exit_farm_endpoint( - managed_biguint!(exit_farm_amount), - OptionalValue::None, - ); + let _ = sc.exit_farm_endpoint(OptionalValue::None); }, ) .assert_ok(); @@ -541,7 +532,6 @@ where &mut self, user: &Address, farm_token_nonce: u64, - farm_token_amount: u64, exit_farm_amount: u64, known_proxy: &Address, ) { @@ -551,12 +541,9 @@ where &self.farm_wrapper, FARM_TOKEN_ID, farm_token_nonce, - &rust_biguint!(farm_token_amount), + &rust_biguint!(exit_farm_amount), |sc| { - let _ = sc.exit_farm_endpoint( - managed_biguint!(exit_farm_amount), - OptionalValue::Some(managed_address!(user)), - ); + let _ = sc.exit_farm_endpoint(OptionalValue::Some(managed_address!(user))); }, ) .assert_ok(); diff --git a/dex/farm/tests/farm_setup/single_user_farm_setup.rs b/dex/farm/tests/farm_setup/single_user_farm_setup.rs index 13644ee88..1e23f999b 100644 --- a/dex/farm/tests/farm_setup/single_user_farm_setup.rs +++ b/dex/farm/tests/farm_setup/single_user_farm_setup.rs @@ -222,13 +222,9 @@ where farm_token_nonce, &rust_biguint!(farm_token_amount), |sc| { - let multi_result = sc.exit_farm_endpoint( - managed_biguint!(farm_token_amount), - OptionalValue::None, - ); + let multi_result = sc.exit_farm_endpoint(OptionalValue::None); - let (first_result, second_result, remaining_farm_amount) = - multi_result.into_tuple(); + let (first_result, second_result) = multi_result.into_tuple(); assert_eq!( first_result.token_identifier, @@ -246,7 +242,6 @@ where ); assert_eq!(second_result.token_nonce, 0); assert_eq!(second_result.amount, managed_biguint!(expected_mex_out)); - assert_eq!(remaining_farm_amount.amount, managed_biguint!(0)); }, ) .assert_ok(); diff --git a/dex/farm/tests/farm_single_user_test.rs b/dex/farm/tests/farm_single_user_test.rs index 9adc893fa..c3df21b83 100644 --- a/dex/farm/tests/farm_single_user_test.rs +++ b/dex/farm/tests/farm_single_user_test.rs @@ -396,7 +396,7 @@ fn test_farm_through_simple_lock() { 2, &rust_biguint!(1_000_000_000), |sc| { - let exit_farm_result = sc.exit_farm_locked_token(managed_biguint!(1_000_000_000)); + let exit_farm_result = sc.exit_farm_locked_token(); let (locked_tokens, reward_tokens) = exit_farm_result.into_tuple(); assert_eq!( @@ -594,7 +594,7 @@ fn test_farm_through_simple_lock() { 7, &rust_biguint!(1_000_000_000), |sc| { - let exit_farm_result = sc.exit_farm_locked_token(managed_biguint!(1_000_000_000)); + let exit_farm_result = sc.exit_farm_locked_token(); let (locked_tokens, _reward_tokens) = exit_farm_result.into_tuple(); assert_eq!( diff --git a/dex/fuzz/src/fuzz_farm.rs b/dex/fuzz/src/fuzz_farm.rs index 1ef8e2463..c30e94442 100644 --- a/dex/fuzz/src/fuzz_farm.rs +++ b/dex/fuzz/src/fuzz_farm.rs @@ -8,7 +8,7 @@ pub mod fuzz_farm_test { use std::cmp::Ordering; use multiversx_sc_scenario::whitebox_legacy::TxTokenTransfer; - use multiversx_sc_scenario::{managed_biguint, rust_biguint, DebugApi}; + use multiversx_sc_scenario::{rust_biguint, DebugApi}; use crate::fuzz_data::fuzz_data_tests::*; use farm::*; @@ -179,7 +179,7 @@ pub mod fuzz_farm_test { farm_token_nonce, &farm_out_amount, |sc| { - sc.exit_farm_endpoint(managed_biguint!(seed), OptionalValue::None); + sc.exit_farm_endpoint(OptionalValue::None); }, ); diff --git a/farm-staking/farm-staking-proxy/src/external_contracts_interactions.rs b/farm-staking/farm-staking-proxy/src/external_contracts_interactions.rs index d8b3a5258..17d32d056 100644 --- a/farm-staking/farm-staking-proxy/src/external_contracts_interactions.rs +++ b/farm-staking/farm-staking-proxy/src/external_contracts_interactions.rs @@ -47,21 +47,19 @@ pub trait ExternalContractsInteractionsModule: orig_caller: ManagedAddress, lp_farm_token_nonce: u64, lp_farm_token_amount: BigUint, - exit_amount: BigUint, ) -> LpFarmExitResult { let lp_farm_token_id = self.lp_farm_token_id().get(); let lp_farm_address = self.lp_farm_address().get(); let exit_farm_result: ExitFarmWithPartialPosResultType = self .lp_farm_proxy_obj(lp_farm_address) - .exit_farm_endpoint(exit_amount, orig_caller) + .exit_farm_endpoint(orig_caller) .with_esdt_transfer((lp_farm_token_id, lp_farm_token_nonce, lp_farm_token_amount)) .execute_on_dest_context(); - let (lp_tokens, lp_farm_rewards, remaining_farm_tokens) = exit_farm_result.into_tuple(); + let (lp_tokens, lp_farm_rewards) = exit_farm_result.into_tuple(); LpFarmExitResult { lp_tokens, lp_farm_rewards, - remaining_farm_tokens, } } @@ -138,7 +136,6 @@ pub trait ExternalContractsInteractionsModule: staking_tokens: EsdtTokenPayment, farm_token_nonce: u64, farm_token_amount: BigUint, - exit_amount: BigUint, ) -> StakingFarmExitResult { let staking_farm_token_id = self.staking_farm_token_id().get(); let mut payments = ManagedVec::from_single_item(staking_tokens); @@ -151,16 +148,14 @@ pub trait ExternalContractsInteractionsModule: let staking_farm_address = self.staking_farm_address().get(); let unstake_result: ExitFarmWithPartialPosResultType = self .staking_farm_proxy_obj(staking_farm_address) - .unstake_farm_through_proxy(exit_amount, orig_caller) + .unstake_farm_through_proxy(orig_caller) .with_multi_token_transfer(payments) .execute_on_dest_context(); - let (unbond_staking_farm_token, staking_rewards, remaining_farm_tokens) = - unstake_result.into_tuple(); + let (unbond_staking_farm_token, staking_rewards) = unstake_result.into_tuple(); StakingFarmExitResult { unbond_staking_farm_token, staking_rewards, - remaining_farm_tokens, } } diff --git a/farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs b/farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs index c78527aa6..f17fb26b7 100644 --- a/farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs +++ b/farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs @@ -20,7 +20,6 @@ pub trait ProxyUnstakeModule: &self, pair_first_token_min_amount: BigUint, pair_second_token_min_amount: BigUint, - exit_amount: BigUint, opt_orig_caller: OptionalValue, ) -> UnstakeResult { let caller = self.blockchain().get_caller(); @@ -32,20 +31,12 @@ pub trait ProxyUnstakeModule: let full_attributes: DualYieldTokenAttributes = dual_yield_token_mapper.get_token_attributes(payment.token_nonce); - require!( - exit_amount > 0 && exit_amount <= payment.amount, - "Invalid exit amount" - ); - - let full_attributes_adjusted: DualYieldTokenAttributes = - full_attributes.clone().into_part(&payment.amount); let exit_attributes: DualYieldTokenAttributes = - full_attributes.clone().into_part(&exit_amount); + full_attributes.clone().into_part(&payment.amount); let lp_farm_exit_result = self.lp_farm_exit( orig_caller.clone(), - full_attributes_adjusted.lp_farm_token_nonce, - full_attributes_adjusted.lp_farm_token_amount, + exit_attributes.lp_farm_token_nonce, exit_attributes.lp_farm_token_amount, ); let remove_liq_result = self.pair_remove_liquidity( @@ -57,36 +48,16 @@ pub trait ProxyUnstakeModule: let staking_farm_exit_result = self.staking_farm_unstake( orig_caller.clone(), remove_liq_result.staking_token_payment, - full_attributes_adjusted.staking_farm_token_nonce, - full_attributes_adjusted.staking_farm_token_amount.clone(), + exit_attributes.staking_farm_token_nonce, exit_attributes.staking_farm_token_amount.clone(), ); - let opt_new_dual_yield_tokens = if exit_amount < payment.amount { - let remaining_lp_farm_tokens = lp_farm_exit_result.remaining_farm_tokens.amount; - let remaining_staking_farm_tokens = full_attributes_adjusted.staking_farm_token_amount - - exit_attributes.staking_farm_token_amount; - let new_attributes = DualYieldTokenAttributes { - lp_farm_token_nonce: full_attributes_adjusted.lp_farm_token_nonce, - lp_farm_token_amount: remaining_lp_farm_tokens, - staking_farm_token_nonce: full_attributes_adjusted.staking_farm_token_nonce, - staking_farm_token_amount: remaining_staking_farm_tokens, - }; - let new_dual_yield_tokens = - self.create_dual_yield_tokens(&dual_yield_token_mapper, &new_attributes); - - Some(new_dual_yield_tokens) - } else { - None - }; - let caller = self.blockchain().get_caller(); let unstake_result = UnstakeResult { other_token_payment: remove_liq_result.other_token_payment, lp_farm_rewards: lp_farm_exit_result.lp_farm_rewards, staking_rewards: staking_farm_exit_result.staking_rewards, unbond_staking_farm_token: staking_farm_exit_result.unbond_staking_farm_token, - opt_new_dual_yield_tokens, }; dual_yield_token_mapper.nft_burn(payment.token_nonce, &payment.amount); diff --git a/farm-staking/farm-staking-proxy/src/result_types.rs b/farm-staking/farm-staking-proxy/src/result_types.rs index af40a59f0..65e0cf238 100644 --- a/farm-staking/farm-staking-proxy/src/result_types.rs +++ b/farm-staking/farm-staking-proxy/src/result_types.rs @@ -13,7 +13,6 @@ pub struct LpFarmClaimRewardsResult { pub struct LpFarmExitResult { pub lp_tokens: EsdtTokenPayment, pub lp_farm_rewards: EsdtTokenPayment, - pub remaining_farm_tokens: EsdtTokenPayment, } // staking farm @@ -31,7 +30,6 @@ pub struct StakingFarmClaimRewardsResult { pub struct StakingFarmExitResult { pub unbond_staking_farm_token: EsdtTokenPayment, pub staking_rewards: EsdtTokenPayment, - pub remaining_farm_tokens: EsdtTokenPayment, } // pair @@ -92,7 +90,6 @@ pub struct UnstakeResult { pub lp_farm_rewards: EsdtTokenPayment, pub staking_rewards: EsdtTokenPayment, pub unbond_staking_farm_token: EsdtTokenPayment, - pub opt_new_dual_yield_tokens: Option>, } impl UnstakeResult { @@ -107,10 +104,6 @@ impl UnstakeResult { payments.push(self.staking_rewards.clone()); payments.push(self.unbond_staking_farm_token.clone()); - if let Some(new_dual_yield_tokens) = &self.opt_new_dual_yield_tokens { - payments.push(new_dual_yield_tokens.clone()); - } - sc.send_multiple_tokens_if_not_zero(to, &payments); self diff --git a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp.rs b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp.rs index 5eae751fd..c81d579ab 100644 --- a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp.rs +++ b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp.rs @@ -234,12 +234,11 @@ fn unstake_partial_position_test() { &setup.proxy_wrapper, DUAL_YIELD_TOKEN_ID, dual_yield_token_nonce_after_stake, - &rust_biguint!(dual_yield_token_amount), + &rust_biguint!(dual_yield_token_amount / 2), |sc| { let results = sc.unstake_farm_tokens( managed_biguint!(1), managed_biguint!(1), - managed_biguint!(dual_yield_token_amount / 2), OptionalValue::None, ); @@ -270,47 +269,23 @@ fn unstake_partial_position_test() { managed_token_id!(STAKING_FARM_TOKEN_ID) ); assert_eq!(unbond_tokens.amount, dual_yield_token_amount / 2); - - let new_dual_yield_tokens = results.opt_new_dual_yield_tokens.unwrap(); - assert_eq!( - new_dual_yield_tokens.token_identifier, - managed_token_id!(DUAL_YIELD_TOKEN_ID) - ); - assert_eq!(new_dual_yield_tokens.amount, dual_yield_token_amount / 2); }, ) .assert_ok(); - let expected_new_dual_yield_attributes = DualYieldTokenAttributes:: { - lp_farm_token_nonce: 1, - lp_farm_token_amount: managed_biguint!(USER_TOTAL_LP_TOKENS / 2), - staking_farm_token_nonce: 1, - staking_farm_token_amount: managed_biguint!(1_001_000_000 / 2), - }; - let new_dual_yield_token_nonce = dual_yield_token_nonce_after_stake + 1; - let new_dual_yield_token_amount = dual_yield_token_amount / 2; - setup.b_mock.check_nft_balance( - &setup.user_addr, - DUAL_YIELD_TOKEN_ID, - new_dual_yield_token_nonce, - &rust_biguint!(new_dual_yield_token_amount), - Some(&expected_new_dual_yield_attributes), - ); - - // unstake with the new dual yield tokens + // unstake with the remaining dual yield tokens setup .b_mock .execute_esdt_transfer( &setup.user_addr, &setup.proxy_wrapper, DUAL_YIELD_TOKEN_ID, - new_dual_yield_token_nonce, - &rust_biguint!(new_dual_yield_token_amount), + dual_yield_token_nonce_after_stake, + &rust_biguint!(dual_yield_token_amount / 2), |sc| { let results = sc.unstake_farm_tokens( managed_biguint!(1), managed_biguint!(1), - managed_biguint!(new_dual_yield_token_amount), OptionalValue::None, ); @@ -341,9 +316,6 @@ fn unstake_partial_position_test() { managed_token_id!(STAKING_FARM_TOKEN_ID) ); assert_eq!(unbond_tokens.amount, 1_001_000_000 / 2); - - // no new dual yield tokens created - assert!(results.opt_new_dual_yield_tokens.is_none()); }, ) .assert_ok(); diff --git a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_interactions/mod.rs b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_interactions/mod.rs index 945a36418..00b2e2e0f 100644 --- a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_interactions/mod.rs +++ b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_interactions/mod.rs @@ -271,7 +271,6 @@ where let received_tokens = sc.unstake_farm_tokens( managed_biguint!(1), managed_biguint!(1), - managed_biguint!(dual_yield_token_amount), OptionalValue::None, ); @@ -405,9 +404,8 @@ where farm_token_nonce, &rust_biguint!(farm_token_amount), |sc| { - let (unbond_farm_tokens, reward_tokens, _) = sc - .unstake_farm(managed_biguint!(farm_token_amount), OptionalValue::None) - .into_tuple(); + let (unbond_farm_tokens, reward_tokens) = + sc.unstake_farm(OptionalValue::None).into_tuple(); unbond_token_nonce = unbond_farm_tokens.token_nonce; assert_eq!(reward_tokens.amount, expected_rewards_amount); diff --git a/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs b/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs index 556a2ef17..4e31662b2 100644 --- a/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs +++ b/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs @@ -50,7 +50,7 @@ pub trait ClaimOnlyBoostedStakingRewardsModule: } fn migrate_old_farm_positions(&self, caller: &ManagedAddress) { - let payments = self.get_non_empty_payments(); + let payments = self.call_value().all_esdt_transfers().clone_value(); let farm_token_mapper = self.farm_token(); let farm_token_id = farm_token_mapper.get_token_id(); for farm_position in &payments { diff --git a/farm-staking/farm-staking/src/unstake_farm.rs b/farm-staking/farm-staking/src/unstake_farm.rs index 39acc348d..6b529e0fb 100644 --- a/farm-staking/farm-staking/src/unstake_farm.rs +++ b/farm-staking/farm-staking/src/unstake_farm.rs @@ -1,7 +1,6 @@ multiversx_sc::imports!(); use farm::ExitFarmWithPartialPosResultType; -use mergeable::Mergeable; use crate::{base_impl_wrapper::FarmStakingWrapper, token_attributes::UnbondSftAttributes}; @@ -36,21 +35,19 @@ pub trait UnstakeFarmModule: #[endpoint(unstakeFarm)] fn unstake_farm( &self, - exit_amount: BigUint, opt_original_caller: OptionalValue, ) -> ExitFarmWithPartialPosResultType { let caller = self.blockchain().get_caller(); let original_caller = self.get_orig_caller_from_opt(&caller, opt_original_caller); let payment = self.call_value().single_esdt(); - self.unstake_farm_common(original_caller, payment, exit_amount, None) + self.unstake_farm_common(original_caller, payment, None) } #[payable("*")] #[endpoint(unstakeFarmThroughProxy)] fn unstake_farm_through_proxy( &self, - exit_amount: BigUint, original_caller: ManagedAddress, ) -> ExitFarmWithPartialPosResultType { let caller = self.blockchain().get_caller(); @@ -66,43 +63,19 @@ pub trait UnstakeFarmModule: "Invalid staking token received" ); - self.unstake_farm_common( - original_caller, - second_payment, - exit_amount, - Some(first_payment.amount), - ) + self.unstake_farm_common(original_caller, second_payment, Some(first_payment.amount)) } fn unstake_farm_common( &self, original_caller: ManagedAddress, - mut payment: EsdtTokenPayment, - exit_amount: BigUint, + payment: EsdtTokenPayment, opt_unbond_amount: Option, ) -> ExitFarmWithPartialPosResultType { - require!( - payment.amount >= exit_amount, - "Exit amount is bigger than the payment amount" - ); - - let boosted_rewards = self.claim_only_boosted_payment(&original_caller); - let boosted_rewards_full_position = - EsdtTokenPayment::new(self.reward_token_id().get(), 0, boosted_rewards); - - let remaining_farm_payment = EsdtTokenPayment::new( - payment.token_identifier.clone(), - payment.token_nonce, - &payment.amount - &exit_amount, - ); - - payment.amount = exit_amount; + self.migrate_old_farm_positions(&original_caller); - let mut exit_result = + let exit_result = self.exit_farm_base::>(original_caller.clone(), payment); - exit_result - .reward_payment - .merge_with(boosted_rewards_full_position); let unbond_token_amount = opt_unbond_amount.unwrap_or(exit_result.farming_token_payment.amount); @@ -113,7 +86,6 @@ pub trait UnstakeFarmModule: self.create_and_send_unbond_tokens(&caller, farm_token_id, unbond_token_amount); self.send_payment_non_zero(&caller, &exit_result.reward_payment); - self.send_payment_non_zero(&caller, &remaining_farm_payment); self.clear_user_energy_if_needed(&original_caller); self.set_farm_supply_for_current_week(&exit_result.storage_cache.farm_token_supply); @@ -126,12 +98,7 @@ pub trait UnstakeFarmModule: exit_result.storage_cache, ); - ( - unbond_farm_token, - exit_result.reward_payment, - remaining_farm_payment, - ) - .into() + (unbond_farm_token, exit_result.reward_payment).into() } fn create_and_send_unbond_tokens( diff --git a/farm-staking/farm-staking/tests/farm_staking_energy_test.rs b/farm-staking/farm-staking/tests/farm_staking_energy_test.rs index 9ce3d963e..b2c3c5b3f 100644 --- a/farm-staking/farm-staking/tests/farm_staking_energy_test.rs +++ b/farm-staking/farm-staking/tests/farm_staking_energy_test.rs @@ -7,7 +7,7 @@ use farm_staking::{ }; use farm_staking_setup::*; use multiversx_sc::codec::multi_types::OptionalValue; -use multiversx_sc_scenario::{managed_biguint, rust_biguint, DebugApi}; +use multiversx_sc_scenario::{rust_biguint, DebugApi}; #[test] fn farm_staking_with_energy_setup_test() { @@ -121,7 +121,7 @@ fn farm_staking_boosted_rewards_with_energy_test() { 3, &rust_biguint!(10), |sc| { - let _ = sc.unstake_farm(managed_biguint!(10), OptionalValue::None); + let _ = sc.unstake_farm(OptionalValue::None); }, ) .assert_ok(); @@ -217,7 +217,7 @@ fn farm_staking_claim_boosted_rewards_for_user_test() { 3, &rust_biguint!(10), |sc| { - let _ = sc.unstake_farm(managed_biguint!(10), OptionalValue::None); + let _ = sc.unstake_farm(OptionalValue::None); }, ) .assert_ok(); diff --git a/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs b/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs index 01e768862..51841149f 100644 --- a/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs +++ b/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs @@ -328,10 +328,9 @@ where farm_token_nonce, &rust_biguint!(farm_token_amount), |sc| { - let multi_result = - sc.unstake_farm(managed_biguint!(farm_token_amount), OptionalValue::None); + let multi_result = sc.unstake_farm(OptionalValue::None); - let (first_result, second_result, _) = multi_result.into_tuple(); + let (first_result, second_result) = multi_result.into_tuple(); assert_eq!( first_result.token_identifier, diff --git a/locked-asset/proxy_dex/src/farm_interactions.rs b/locked-asset/proxy_dex/src/farm_interactions.rs index ee9a62f30..0ccabdb33 100644 --- a/locked-asset/proxy_dex/src/farm_interactions.rs +++ b/locked-asset/proxy_dex/src/farm_interactions.rs @@ -13,7 +13,6 @@ pub struct EnterFarmResultWrapper { pub struct ExitFarmResultWrapper { pub farming_tokens: EsdtTokenPayment, pub reward_tokens: EsdtTokenPayment, - pub remaining_farm_tokens: EsdtTokenPayment, } #[multiversx_sc::module] @@ -43,20 +42,18 @@ pub trait FarmInteractionsModule { &self, farm_address: ManagedAddress, farm_token: EsdtTokenPayment, - exit_amount: BigUint, ) -> ExitFarmResultWrapper { let original_caller = self.blockchain().get_caller(); let raw_result: ExitFarmWithPartialPosResultType = self .farm_contract_proxy(farm_address) - .exit_farm_endpoint(exit_amount, original_caller) + .exit_farm_endpoint(original_caller) .with_esdt_transfer(farm_token) .execute_on_dest_context(); - let (farming_tokens, reward_tokens, remaining_farm_tokens) = raw_result.into_tuple(); + let (farming_tokens, reward_tokens) = raw_result.into_tuple(); ExitFarmResultWrapper { farming_tokens, reward_tokens, - remaining_farm_tokens, } } diff --git a/locked-asset/proxy_dex/src/proxy_farm.rs b/locked-asset/proxy_dex/src/proxy_farm.rs index beb6cf425..49db77bd4 100644 --- a/locked-asset/proxy_dex/src/proxy_farm.rs +++ b/locked-asset/proxy_dex/src/proxy_farm.rs @@ -16,8 +16,7 @@ pub struct FarmingFarmTokenPair { pub farm_token: EsdtTokenPayment, } -pub type ExitFarmProxyResultType = - MultiValue3, EsdtTokenPayment, EsdtTokenPayment>; +pub type ExitFarmProxyResultType = MultiValue2, EsdtTokenPayment>; pub type ClaimRewardsFarmProxyResultType = MultiValue2, EsdtTokenPayment>; #[multiversx_sc::module] @@ -152,11 +151,7 @@ pub trait ProxyFarmModule: #[payable("*")] #[endpoint(exitFarmProxy)] - fn exit_farm_proxy( - &self, - farm_address: ManagedAddress, - exit_amount: BigUint, - ) -> ExitFarmProxyResultType { + fn exit_farm_proxy(&self, farm_address: ManagedAddress) -> ExitFarmProxyResultType { self.require_is_intermediated_farm(&farm_address); self.require_wrapped_farm_token_id_not_empty(); self.require_wrapped_lp_token_id_not_empty(); @@ -175,22 +170,14 @@ pub trait ProxyFarmModule: .into_part(&payment.amount); let exit_result = self.call_exit_farm( farm_address.clone(), - wrapped_farm_attributes_for_exit.farm_token, - exit_amount.clone(), + wrapped_farm_attributes_for_exit.farm_token.clone(), ); - let mut remaining_wrapped_tokens = payment.clone(); - remaining_wrapped_tokens.amount = exit_result.remaining_farm_tokens.amount; - self.burn_if_base_asset(&exit_result.farming_tokens); - let mut payment_used_for_exit = payment.clone(); - payment_used_for_exit.amount = exit_amount.clone(); - let wrapped_attributes_used_for_exit_farm: WrappedFarmTokenAttributes = - full_wrapped_farm_attributes.into_part(&exit_amount); let wrapped_farm_tokens_for_initial_tokens = WrappedFarmToken { - payment: payment_used_for_exit, - attributes: wrapped_attributes_used_for_exit_farm.clone(), + payment: payment.clone(), + attributes: wrapped_farm_attributes_for_exit.clone(), }; let caller = self.blockchain().get_caller(); @@ -203,24 +190,18 @@ pub trait ProxyFarmModule: self.send_payment_non_zero(&caller, &initial_proxy_farming_tokens); self.send_payment_non_zero(&caller, &exit_result.reward_tokens); - self.send_payment_non_zero(&caller, &remaining_wrapped_tokens); - wrapped_farm_token_mapper.nft_burn(payment.token_nonce, &exit_amount); + wrapped_farm_token_mapper.nft_burn(payment.token_nonce, &payment.amount); self.emit_exit_farm_proxy_event( &caller, &farm_address, payment, - wrapped_attributes_used_for_exit_farm, + wrapped_farm_attributes_for_exit, exit_result.reward_tokens.clone(), ); - ( - initial_proxy_farming_tokens, - exit_result.reward_tokens, - remaining_wrapped_tokens, - ) - .into() + (initial_proxy_farming_tokens, exit_result.reward_tokens).into() } fn handle_farm_penalty_and_get_output_proxy_farming_token( diff --git a/locked-asset/proxy_dex/tests/proxy_farm_test.rs b/locked-asset/proxy_dex/tests/proxy_farm_test.rs index bfa289fde..8463560e5 100644 --- a/locked-asset/proxy_dex/tests/proxy_farm_test.rs +++ b/locked-asset/proxy_dex/tests/proxy_farm_test.rs @@ -240,8 +240,7 @@ fn farm_proxy_actions_test() { 3, &rust_biguint!(USER_BALANCE), |sc| { - let output = sc - .exit_farm_proxy(managed_address!(&farm_addr), managed_biguint!(USER_BALANCE)); + let output = sc.exit_farm_proxy(managed_address!(&farm_addr)); let output_lp_token = output.0 .0; assert_eq!(output_lp_token.token_nonce, 1); assert_eq!(output_lp_token.amount, USER_BALANCE); @@ -442,12 +441,9 @@ fn farm_with_wrapped_lp_test() { &setup.proxy_wrapper, WRAPPED_FARM_TOKEN_ID, 1, - &expected_lp_token_amount, + &(expected_lp_token_amount.clone() / rust_biguint!(2)), |sc| { - sc.exit_farm_proxy( - managed_address!(&farm_locked_addr), - managed_biguint!(expected_lp_token_amount.to_u64().unwrap() / 2), - ); + sc.exit_farm_proxy(managed_address!(&farm_locked_addr)); }, ) .assert_ok(); @@ -758,12 +754,9 @@ fn farm_proxy_partial_exit_test() { &setup.proxy_wrapper, WRAPPED_FARM_TOKEN_ID, 1, - &rust_biguint!(USER_BALANCE), + &rust_biguint!(USER_BALANCE / 2), |sc| { - sc.exit_farm_proxy( - managed_address!(&farm_locked_addr), - managed_biguint!(USER_BALANCE / 2), - ); + sc.exit_farm_proxy(managed_address!(&farm_locked_addr)); }, ) .assert_ok(); @@ -936,12 +929,9 @@ fn farm_proxy_partial_exit_with_penalty_test() { &setup.proxy_wrapper, WRAPPED_FARM_TOKEN_ID, 1, - &rust_biguint!(USER_BALANCE), + &rust_biguint!(USER_BALANCE / 2), |sc| { - sc.exit_farm_proxy( - managed_address!(&farm_locked_addr), - managed_biguint!(USER_BALANCE / 2), - ); + sc.exit_farm_proxy(managed_address!(&farm_locked_addr)); }, ) .assert_ok(); @@ -1159,10 +1149,7 @@ fn different_farm_locked_token_nonce_merging_test() { 3, &rust_biguint!(USER_BALANCE * 2), |sc| { - sc.exit_farm_proxy( - managed_address!(&farm_addr), - managed_biguint!(USER_BALANCE * 2), - ); + sc.exit_farm_proxy(managed_address!(&farm_addr)); }, ) .assert_ok(); diff --git a/locked-asset/proxy_dex/wasm/Cargo.lock b/locked-asset/proxy_dex/wasm/Cargo.lock index fe099d430..1d5339db2 100644 --- a/locked-asset/proxy_dex/wasm/Cargo.lock +++ b/locked-asset/proxy_dex/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -314,12 +308,6 @@ dependencies = [ "utils", ] -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - [[package]] name = "locking_module" version = "0.0.0" @@ -336,12 +324,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -351,9 +333,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "386c2727eba66bc5e502e470d7afa55fdd69aedff440c508bb9ba85aec36a52a" dependencies = [ "bitflags", "hashbrown", @@ -365,20 +347,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -388,9 +369,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "050510b6b9836b24b4a73bb7878c58c268d56bde1c6eb0f9a88dce9a6518507b" dependencies = [ "hex", "proc-macro2", @@ -401,21 +382,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "3b55fe3585cbc745bd7b9793be4bcb3aa7f1869ced7a0981f3d47e6a832c6311" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "b059f22dfc3eb45aa015f6f20f28ed34dc42a65b42d282f8ac9b799b12e2942c" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -476,9 +456,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] @@ -628,18 +608,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -659,25 +627,3 @@ dependencies = [ "unwrappable", "week-timekeeping", ] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/locked-asset/proxy_dex/wasm/src/lib.rs b/locked-asset/proxy_dex/wasm/src/lib.rs index 892463480..096dff097 100644 --- a/locked-asset/proxy_dex/wasm/src/lib.rs +++ b/locked-asset/proxy_dex/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 27 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,31 +21,33 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { proxy_dex ( - registerProxyPair - setTransferRoleWrappedLpToken - registerProxyFarm - setTransferRoleWrappedFarmToken - getAssetTokenId - getLockedTokenIds - getOldLockedTokenId - getOldFactoryAddress - getWrappedLpTokenId - getWrappedFarmTokenId - addPairToIntermediate - removeIntermediatedPair - addFarmToIntermediate - removeIntermediatedFarm - getIntermediatedPairs - getIntermediatedFarms - addLiquidityProxy - removeLiquidityProxy - enterFarmProxy - exitFarmProxy - claimRewardsProxy - mergeWrappedFarmTokens - mergeWrappedLpTokens - setEnergyFactoryAddress - getEnergyFactoryAddress - callBack + init => init + registerProxyPair => register_proxy_pair + setTransferRoleWrappedLpToken => set_transfer_role_wrapped_lp_token + registerProxyFarm => register_proxy_farm + setTransferRoleWrappedFarmToken => set_transfer_role_wrapped_farm_token + getAssetTokenId => get_asset_token_id_view + getLockedTokenIds => get_locked_token_ids_view + getOldLockedTokenId => old_locked_token_id + getOldFactoryAddress => old_factory_address + getWrappedLpTokenId => wrapped_lp_token + getWrappedFarmTokenId => wrapped_farm_token + addPairToIntermediate => add_pair_to_intermediate + removeIntermediatedPair => remove_intermediated_pair + addFarmToIntermediate => add_farm_to_intermediate + removeIntermediatedFarm => remove_intermediated_farm + getIntermediatedPairs => intermediated_pairs + getIntermediatedFarms => intermediated_farms + addLiquidityProxy => add_liquidity_proxy + removeLiquidityProxy => remove_liquidity_proxy + enterFarmProxy => enter_farm_proxy_endpoint + exitFarmProxy => exit_farm_proxy + claimRewardsProxy => claim_rewards_proxy + mergeWrappedFarmTokens => merge_wrapped_farm_tokens_endpoint + mergeWrappedLpTokens => merge_wrapped_lp_tokens_endpoint + setEnergyFactoryAddress => set_energy_factory_address + getEnergyFactoryAddress => energy_factory_address ) } + +multiversx_sc_wasm_adapter::async_callback! { proxy_dex } diff --git a/locked-asset/simple-lock/elrond.json b/locked-asset/simple-lock/elrond.json deleted file mode 100644 index 736553962..000000000 --- a/locked-asset/simple-lock/elrond.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "language": "rust" -} \ No newline at end of file diff --git a/locked-asset/simple-lock/src/farm_interactions.rs b/locked-asset/simple-lock/src/farm_interactions.rs index d68e5ae62..4748f8ec5 100644 --- a/locked-asset/simple-lock/src/farm_interactions.rs +++ b/locked-asset/simple-lock/src/farm_interactions.rs @@ -11,7 +11,7 @@ type ClaimRewardsResultType = MultiValue2, EsdtTokenPayment>; const ENTER_FARM_RESULTS_LEN: usize = 2; -const EXIT_FARM_RESULTS_LEN: usize = 3; +const EXIT_FARM_RESULTS_LEN: usize = 2; const CLAIM_REWARDS_RESULTS_LEN: usize = 2; pub struct EnterFarmResultWrapper { @@ -22,7 +22,6 @@ pub struct EnterFarmResultWrapper { pub struct ExitFarmResultWrapper { pub initial_farming_tokens: EsdtTokenPayment, pub reward_tokens: EsdtTokenPayment, - pub remaining_farm_tokens: EsdtTokenPayment, } pub struct FarmClaimRewardsResultWrapper { @@ -51,7 +50,6 @@ mod farm_proxy { #[endpoint(exitFarm)] fn exit_farm( &self, - exit_amount: BigUint, opt_orig_caller: OptionalValue, ) -> ExitFarmResultType; @@ -106,12 +104,11 @@ pub trait FarmInteractionsModule { farm_token: TokenIdentifier, farm_token_nonce: u64, farm_token_amount: BigUint, - exit_amount: BigUint, caller: ManagedAddress, ) -> ExitFarmResultWrapper { let raw_results: RawResultsType = self .farm_proxy(farm_address) - .exit_farm(exit_amount, caller) + .exit_farm(caller) .with_esdt_transfer(EsdtTokenPayment::new( farm_token, farm_token_nonce, @@ -124,12 +121,10 @@ pub trait FarmInteractionsModule { let initial_farming_tokens = results_wrapper.decode_next_result(); let reward_tokens = results_wrapper.decode_next_result(); - let remaining_farm_tokens = results_wrapper.decode_next_result(); ExitFarmResultWrapper { initial_farming_tokens, reward_tokens, - remaining_farm_tokens, } } diff --git a/locked-asset/simple-lock/src/proxy_farm.rs b/locked-asset/simple-lock/src/proxy_farm.rs index 43ea8b6c8..c6ab28659 100644 --- a/locked-asset/simple-lock/src/proxy_farm.rs +++ b/locked-asset/simple-lock/src/proxy_farm.rs @@ -199,18 +199,11 @@ pub trait ProxyFarmModule: /// - farm reward tokens #[payable("*")] #[endpoint(exitFarmLockedToken)] - fn exit_farm_locked_token( - &self, - exit_amount: BigUint, - ) -> ExitFarmThroughProxyResultType { - require!(exit_amount > 0u64, "Exit amount must be greater than 0"); + fn exit_farm_locked_token(&self) -> ExitFarmThroughProxyResultType { let payment: EsdtTokenPayment = self.call_value().single_esdt(); - require!( - exit_amount > 0u64 && exit_amount <= payment.amount, - "Invalid exit amount" - ); + let farm_proxy_token_attributes: FarmProxyTokenAttributes = - self.validate_payment_and_get_farm_proxy_token_attributes(&payment, &exit_amount); + self.validate_payment_and_get_farm_proxy_token_attributes(&payment); let farm_address = self.try_get_farm_address( &farm_proxy_token_attributes.farming_token_id, @@ -222,7 +215,6 @@ pub trait ProxyFarmModule: farm_proxy_token_attributes.farm_token_id, farm_proxy_token_attributes.farm_token_nonce, payment.amount, - exit_amount, caller.clone(), ); require!( @@ -253,15 +245,6 @@ pub trait ProxyFarmModule: ); } - if exit_farm_result.remaining_farm_tokens.amount > 0 { - self.send().direct_esdt( - &caller, - &payment.token_identifier, - payment.token_nonce, - &exit_farm_result.remaining_farm_tokens.amount, - ); - } - (lp_proxy_token_payment, exit_farm_result.reward_tokens).into() } @@ -279,7 +262,7 @@ pub trait ProxyFarmModule: fn farm_claim_rewards_locked_token(&self) -> FarmClaimRewardsThroughProxyResultType { let payment: EsdtTokenPayment = self.call_value().single_esdt(); let mut farm_proxy_token_attributes: FarmProxyTokenAttributes = - self.validate_payment_and_get_farm_proxy_token_attributes(&payment, &payment.amount); + self.validate_payment_and_get_farm_proxy_token_attributes(&payment); let farm_address = self.try_get_farm_address( &farm_proxy_token_attributes.farming_token_id, @@ -337,7 +320,6 @@ pub trait ProxyFarmModule: fn validate_payment_and_get_farm_proxy_token_attributes( &self, payment: &EsdtTokenPayment, - exit_amount: &BigUint, ) -> FarmProxyTokenAttributes { require!(payment.amount > 0, NO_PAYMENT_ERR_MSG); @@ -347,7 +329,7 @@ pub trait ProxyFarmModule: let farm_proxy_token_attributes: FarmProxyTokenAttributes = farm_proxy_token_mapper.get_token_attributes(payment.token_nonce); - farm_proxy_token_mapper.nft_burn(payment.token_nonce, exit_amount); + farm_proxy_token_mapper.nft_burn(payment.token_nonce, &payment.amount); farm_proxy_token_attributes } diff --git a/locked-asset/simple-lock/wasm/Cargo.lock b/locked-asset/simple-lock/wasm/Cargo.lock index 270c2aca4..cb879951a 100644 --- a/locked-asset/simple-lock/wasm/Cargo.lock +++ b/locked-asset/simple-lock/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -88,12 +82,6 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - [[package]] name = "math" version = "0.0.0" @@ -101,12 +89,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -116,9 +98,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "386c2727eba66bc5e502e470d7afa55fdd69aedff440c508bb9ba85aec36a52a" dependencies = [ "bitflags", "hashbrown", @@ -130,20 +112,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -153,9 +134,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "050510b6b9836b24b4a73bb7878c58c268d56bde1c6eb0f9a88dce9a6518507b" dependencies = [ "hex", "proc-macro2", @@ -166,21 +147,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "3b55fe3585cbc745bd7b9793be4bcb3aa7f1869ced7a0981f3d47e6a832c6311" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "b059f22dfc3eb45aa015f6f20f28ed34dc42a65b42d282f8ac9b799b12e2942c" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -209,9 +189,9 @@ checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] @@ -287,37 +267,3 @@ name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/locked-asset/simple-lock/wasm/src/lib.rs b/locked-asset/simple-lock/wasm/src/lib.rs index 042660883..afe83b5ff 100644 --- a/locked-asset/simple-lock/wasm/src/lib.rs +++ b/locked-asset/simple-lock/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 21 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,25 +21,27 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { simple_lock ( - lockTokens - unlockTokens - issueLockedToken - getLockedTokenId - issueLpProxyToken - addLpToWhitelist - removeLpFromWhitelist - addLiquidityLockedToken - removeLiquidityLockedToken - getKnownLiquidityPools - getLpProxyTokenId - issueFarmProxyToken - addFarmToWhitelist - removeFarmFromWhitelist - enterFarmLockedToken - exitFarmLockedToken - farmClaimRewardsLockedToken - getKnownFarms - getFarmProxyTokenId - callBack + init => init + lockTokens => lock_tokens_endpoint + unlockTokens => unlock_tokens_endpoint + issueLockedToken => issue_locked_token + getLockedTokenId => locked_token + issueLpProxyToken => issue_lp_proxy_token + addLpToWhitelist => add_lp_to_whitelist + removeLpFromWhitelist => remove_lp_from_whitelist + addLiquidityLockedToken => add_liquidity_locked_token + removeLiquidityLockedToken => remove_liquidity_locked_token + getKnownLiquidityPools => known_liquidity_pools + getLpProxyTokenId => lp_proxy_token + issueFarmProxyToken => issue_farm_proxy_token + addFarmToWhitelist => add_farm_to_whitelist + removeFarmFromWhitelist => remove_farm_from_whitelist + enterFarmLockedToken => enter_farm_locked_token + exitFarmLockedToken => exit_farm_locked_token + farmClaimRewardsLockedToken => farm_claim_rewards_locked_token + getKnownFarms => known_farms + getFarmProxyTokenId => farm_proxy_token ) } + +multiversx_sc_wasm_adapter::async_callback! { simple_lock } From 37c9ebc9ee73a5980a21b337fc7ff8ebec682df8 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Tue, 19 Sep 2023 16:58:49 +0300 Subject: [PATCH 081/213] clippy fix --- farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs b/farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs index f17fb26b7..920b96eb0 100644 --- a/farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs +++ b/farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs @@ -32,7 +32,7 @@ pub trait ProxyUnstakeModule: dual_yield_token_mapper.get_token_attributes(payment.token_nonce); let exit_attributes: DualYieldTokenAttributes = - full_attributes.clone().into_part(&payment.amount); + full_attributes.into_part(&payment.amount); let lp_farm_exit_result = self.lp_farm_exit( orig_caller.clone(), From 9859e47cdcee4df9b42b63b9a61a538194c4def6 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Tue, 19 Sep 2023 17:21:26 +0300 Subject: [PATCH 082/213] tests fixes --- dex/scenarios/exit_farm.scen.json | 9 +------ dex/scenarios/exit_farm_too_soon.scen.json | 18 ++----------- dex/scenarios/exit_mex_farm.scen.json | 9 +------ .../farm_reward_distr_scen_1.scen.json | 18 ++----------- .../farm_reward_distr_scen_2.scen.json | 27 +++---------------- .../farm_reward_distr_scen_3.scen.json | 27 +++---------------- .../farm_reward_distr_scen_4.scen.json | 27 +++---------------- 7 files changed, 15 insertions(+), 120 deletions(-) diff --git a/dex/scenarios/exit_farm.scen.json b/dex/scenarios/exit_farm.scen.json index 9a3ec697d..495520be4 100644 --- a/dex/scenarios/exit_farm.scen.json +++ b/dex/scenarios/exit_farm.scen.json @@ -25,9 +25,7 @@ } ], "function": "exitFarm", - "arguments": [ - "100,000" - ], + "arguments": [], "gasLimit": "100,000,000", "gasPrice": "0" }, @@ -42,11 +40,6 @@ "1-token_id": "nested:str:WEGLD-abcdef", "2-nonce": "u64:0", "3-amount": "biguint:0" - }, - { - "1-token_id": "nested:str:FARM-abcdef", - "2-nonce": "u64:2", - "3-amount": "biguint:0" } ], "status": "0", diff --git a/dex/scenarios/exit_farm_too_soon.scen.json b/dex/scenarios/exit_farm_too_soon.scen.json index 8280af81e..72b596bda 100644 --- a/dex/scenarios/exit_farm_too_soon.scen.json +++ b/dex/scenarios/exit_farm_too_soon.scen.json @@ -47,9 +47,7 @@ } ], "function": "exitFarm", - "arguments": [ - "100,000" - ], + "arguments": [], "gasLimit": "1,000,000,000", "gasPrice": "0" }, @@ -64,11 +62,6 @@ "1-token_id": "nested:str:WEGLD-abcdef", "2-nonce": "u64:0", "3-amount": "biguint:0" - }, - { - "1-token_id": "nested:str:FARM-abcdef", - "2-nonce": "u64:2", - "3-amount": "biguint:0" } ], "status": "0", @@ -125,9 +118,7 @@ } ], "function": "exitFarm", - "arguments": [ - "100,000" - ], + "arguments": [], "gasLimit": "1,000,000,000", "gasPrice": "0" }, @@ -142,11 +133,6 @@ "1-token_id": "nested:str:WEGLD-abcdef", "2-nonce": "u64:0", "3-amount": "biguint:0" - }, - { - "1-token_id": "nested:str:FARM-abcdef", - "2-nonce": "u64:2", - "3-amount": "biguint:0" } ], "status": "0", diff --git a/dex/scenarios/exit_mex_farm.scen.json b/dex/scenarios/exit_mex_farm.scen.json index 03e17bb16..3cc9dca89 100644 --- a/dex/scenarios/exit_mex_farm.scen.json +++ b/dex/scenarios/exit_mex_farm.scen.json @@ -26,9 +26,7 @@ } ], "function": "exitFarm", - "arguments": [ - "100,000,000" - ], + "arguments": [], "gasLimit": "100,000,000", "gasPrice": "0" }, @@ -43,11 +41,6 @@ "1-token_id": "nested:str:MEX-abcdef", "2-nonce": "u64:0", "3-amount": "biguint:50,000" - }, - { - "1-token_id": "nested:str:FARM-abcdef", - "2-nonce": "u64:1", - "3-amount": "biguint:0" } ], "status": "0", diff --git a/dex/scenarios/farm_reward_distr_scen_1.scen.json b/dex/scenarios/farm_reward_distr_scen_1.scen.json index 348847c77..e45afaa8e 100644 --- a/dex/scenarios/farm_reward_distr_scen_1.scen.json +++ b/dex/scenarios/farm_reward_distr_scen_1.scen.json @@ -167,9 +167,7 @@ } ], "function": "exitFarm", - "arguments": [ - "1,000" - ], + "arguments": [], "gasLimit": "100,000,000", "gasPrice": "0" }, @@ -184,11 +182,6 @@ "1-token_id": "nested:str:MEX-abcdef", "2-nonce": "u64:0", "3-amount": "biguint:450" - }, - { - "1-token_id": "nested:str:FARM-abcdef", - "2-nonce": "u64:1", - "3-amount": "biguint:0" } ], "status": "0", @@ -211,9 +204,7 @@ } ], "function": "exitFarm", - "arguments": [ - "1,000" - ], + "arguments": [], "gasLimit": "100,000,000", "gasPrice": "0" }, @@ -228,11 +219,6 @@ "1-token_id": "nested:str:MEX-abcdef", "2-nonce": "u64:0", "3-amount": "biguint:350" - }, - { - "1-token_id": "nested:str:FARM-abcdef", - "2-nonce": "u64:2", - "3-amount": "biguint:0" } ], "status": "0", diff --git a/dex/scenarios/farm_reward_distr_scen_2.scen.json b/dex/scenarios/farm_reward_distr_scen_2.scen.json index bcab014a5..fc607055a 100644 --- a/dex/scenarios/farm_reward_distr_scen_2.scen.json +++ b/dex/scenarios/farm_reward_distr_scen_2.scen.json @@ -210,9 +210,7 @@ } ], "function": "exitFarm", - "arguments": [ - "2,000" - ], + "arguments": [], "gasLimit": "100,000,000", "gasPrice": "0" }, @@ -227,11 +225,6 @@ "1-token_id": "nested:str:MEX-abcdef", "2-nonce": "u64:0", "3-amount": "biguint:428" - }, - { - "1-token_id": "nested:str:FARM-abcdef", - "2-nonce": "u64:2", - "3-amount": "biguint:0" } ], "status": "0", @@ -260,9 +253,7 @@ } ], "function": "exitFarm", - "arguments": [ - "1,000" - ], + "arguments": [], "gasLimit": "100,000,000", "gasPrice": "0" }, @@ -277,11 +268,6 @@ "1-token_id": "nested:str:MEX-abcdef", "2-nonce": "u64:0", "3-amount": "biguint:414" - }, - { - "1-token_id": "nested:str:FARM-abcdef", - "2-nonce": "u64:1", - "3-amount": "biguint:0" } ], "status": "0", @@ -310,9 +296,7 @@ } ], "function": "exitFarm", - "arguments": [ - "500" - ], + "arguments": [], "gasLimit": "100,000,000", "gasPrice": "0" }, @@ -327,11 +311,6 @@ "1-token_id": "nested:str:MEX-abcdef", "2-nonce": "u64:0", "3-amount": "biguint:457" - }, - { - "1-token_id": "nested:str:FARM-abcdef", - "2-nonce": "u64:3", - "3-amount": "biguint:0" } ], "status": "0", diff --git a/dex/scenarios/farm_reward_distr_scen_3.scen.json b/dex/scenarios/farm_reward_distr_scen_3.scen.json index b3a3442a4..b850e7bd9 100644 --- a/dex/scenarios/farm_reward_distr_scen_3.scen.json +++ b/dex/scenarios/farm_reward_distr_scen_3.scen.json @@ -260,9 +260,7 @@ } ], "function": "exitFarm", - "arguments": [ - "2,000" - ], + "arguments": [], "gasLimit": "100,000,000", "gasPrice": "0" }, @@ -277,11 +275,6 @@ "1-token_id": "nested:str:MEX-abcdef", "2-nonce": "u64:0", "3-amount": "biguint:371" - }, - { - "1-token_id": "nested:str:FARM-abcdef", - "2-nonce": "u64:2", - "3-amount": "biguint:0" } ], "status": "0", @@ -310,9 +303,7 @@ } ], "function": "exitFarm", - "arguments": [ - "1,000" - ], + "arguments": [], "gasLimit": "100,000,000", "gasPrice": "0" }, @@ -327,11 +318,6 @@ "1-token_id": "nested:str:MEX-abcdef", "2-nonce": "u64:0", "3-amount": "biguint:285" - }, - { - "1-token_id": "nested:str:FARM-abcdef", - "2-nonce": "u64:1", - "3-amount": "biguint:0" } ], "status": "0", @@ -360,9 +346,7 @@ } ], "function": "exitFarm", - "arguments": [ - "500" - ], + "arguments": [], "gasLimit": "100,000,000", "gasPrice": "0" }, @@ -377,11 +361,6 @@ "1-token_id": "nested:str:MEX-abcdef", "2-nonce": "u64:0", "3-amount": "biguint:242" - }, - { - "1-token_id": "nested:str:FARM-abcdef", - "2-nonce": "u64:3", - "3-amount": "biguint:0" } ], "status": "0", diff --git a/dex/scenarios/farm_reward_distr_scen_4.scen.json b/dex/scenarios/farm_reward_distr_scen_4.scen.json index 629b2f5f9..0a9dbaf60 100644 --- a/dex/scenarios/farm_reward_distr_scen_4.scen.json +++ b/dex/scenarios/farm_reward_distr_scen_4.scen.json @@ -260,9 +260,7 @@ } ], "function": "exitFarm", - "arguments": [ - "2,000,000,000,000,000,000,000" - ], + "arguments": [], "gasLimit": "100,000,000", "gasPrice": "0" }, @@ -277,11 +275,6 @@ "1-token_id": "nested:str:MEX-abcdef", "2-nonce": "u64:0", "3-amount": "biguint:3,714,285,714,284,000,000,000" - }, - { - "1-token_id": "nested:str:FARM-abcdef", - "2-nonce": "u64:2", - "3-amount": "biguint:0" } ], "status": "0", @@ -310,9 +303,7 @@ } ], "function": "exitFarm", - "arguments": [ - "1,000,000,000,000,000,000,000" - ], + "arguments": [], "gasLimit": "100,000,000", "gasPrice": "0" }, @@ -327,11 +318,6 @@ "1-token_id": "nested:str:MEX-abcdef", "2-nonce": "u64:0", "3-amount": "biguint:2,857,142,857,142,000,000,000" - }, - { - "1-token_id": "nested:str:FARM-abcdef", - "2-nonce": "u64:1", - "3-amount": "biguint:0" } ], "status": "0", @@ -360,9 +346,7 @@ } ], "function": "exitFarm", - "arguments": [ - "500,000,000,000,000,000,000" - ], + "arguments": [], "gasLimit": "100,000,000", "gasPrice": "0" }, @@ -377,11 +361,6 @@ "1-token_id": "nested:str:MEX-abcdef", "2-nonce": "u64:0", "3-amount": "biguint:2,428,571,428,571,000,000,000" - }, - { - "1-token_id": "nested:str:FARM-abcdef", - "2-nonce": "u64:3", - "3-amount": "biguint:0" } ], "status": "0", From d9fd8418184e3207daea03145ebd25eb1754a4af Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Wed, 20 Sep 2023 10:38:49 +0300 Subject: [PATCH 083/213] remove metastaking ProxyMergePosModule --- .../src/proxy_actions/merge_pos.rs | 108 ------------------ 1 file changed, 108 deletions(-) delete mode 100644 farm-staking/farm-staking-proxy/src/proxy_actions/merge_pos.rs diff --git a/farm-staking/farm-staking-proxy/src/proxy_actions/merge_pos.rs b/farm-staking/farm-staking-proxy/src/proxy_actions/merge_pos.rs deleted file mode 100644 index 84be38ae0..000000000 --- a/farm-staking/farm-staking-proxy/src/proxy_actions/merge_pos.rs +++ /dev/null @@ -1,108 +0,0 @@ -use common_structs::PaymentsVec; - -use crate::{dual_yield_token::DualYieldTokenAttributes, result_types::MergeResult}; - -use mergeable::Mergeable; -use unwrappable::Unwrappable; - -multiversx_sc::imports!(); -multiversx_sc::derive_imports!(); - -#[multiversx_sc::module] -pub trait ProxyMergePosModule: - crate::dual_yield_token::DualYieldTokenModule - + crate::external_contracts_interactions::ExternalContractsInteractionsModule - + crate::lp_farm_token::LpFarmTokenModule - + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule - + utils::UtilsModule - + token_send::TokenSendModule - + sc_whitelist_module::SCWhitelistModule - + super::claim::ProxyClaimModule -{ - #[payable("*")] - #[endpoint(mergeMetastakingWithStakingToken)] - fn merge_metastaking_with_staking_token(&self) -> MergeResult { - let mut payments = self.call_value().all_esdt_transfers().clone_value(); - require!( - payments.len() >= 2, - "Must send metastaking token and at least a staking token" - ); - - let dual_yield_token = self.pop_first_payment(&mut payments); - let dual_yield_token_mapper = self.dual_yield_token(); - dual_yield_token_mapper.require_same_token(&dual_yield_token.token_identifier); - - let mut attributes: DualYieldTokenAttributes = self - .get_attributes_as_part_of_fixed_supply(&dual_yield_token, &dual_yield_token_mapper); - dual_yield_token_mapper.nft_burn(dual_yield_token.token_nonce, &dual_yield_token.amount); - - let caller = self.blockchain().get_caller(); - let staking_farm_rewards = self.claim_staking_rewards_before_merge(&caller, &payments); - - let staking_amount_before_merge = attributes.get_total_staking_token_amount(); - for farm_staking_token in &payments { - attributes.real_pos_token_amount += &farm_staking_token.amount; - } - - let mut dual_yield_claim_result = self.claim_dual_yield( - &caller, - OptionalValue::None, - staking_amount_before_merge, - attributes, - ); - dual_yield_claim_result - .staking_farm_rewards - .merge_with(staking_farm_rewards); - - let new_dual_yield_tokens = self.create_dual_yield_tokens( - &dual_yield_token_mapper, - &dual_yield_claim_result.new_dual_yield_attributes, - ); - let merge_result = MergeResult { - lp_farm_rewards: dual_yield_claim_result.lp_farm_rewards, - staking_farm_rewards: dual_yield_claim_result.staking_farm_rewards, - new_dual_yield_tokens, - }; - - merge_result.send_and_return(self, &caller) - } - - fn claim_staking_rewards_before_merge( - &self, - caller: &ManagedAddress, - farm_staking_tokens: &PaymentsVec, - ) -> EsdtTokenPayment { - let staking_farm_token_id = self.staking_farm_token_id().get(); - let mut opt_staking_farm_rewards = Option::::None; - for farm_staking_token in farm_staking_tokens { - require!( - farm_staking_token.token_identifier == staking_farm_token_id, - "Invalid staking farm token" - ); - - let staking_claim_result = self.staking_farm_claim_rewards( - caller.clone(), - farm_staking_token.token_identifier, - farm_staking_token.token_nonce, - farm_staking_token.amount.clone(), - farm_staking_token.amount, - ); - - match &mut opt_staking_farm_rewards { - Some(rew) => rew.merge_with(staking_claim_result.staking_farm_rewards), - None => { - opt_staking_farm_rewards = Some(staking_claim_result.staking_farm_rewards); - } - }; - - let new_staking_farm_tokens = staking_claim_result.new_staking_farm_tokens; - self.send().esdt_local_burn( - &new_staking_farm_tokens.token_identifier, - new_staking_farm_tokens.token_nonce, - &new_staking_farm_tokens.amount, - ); - } - - opt_staking_farm_rewards.unwrap_or_panic::() - } -} From 65930cea8e24edad99369e17ce0bc9e35798cd6e Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Wed, 20 Sep 2023 10:59:12 +0300 Subject: [PATCH 084/213] send rewards to user in claim_boosted_rewards --- dex/farm-with-locked-rewards/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dex/farm-with-locked-rewards/src/lib.rs b/dex/farm-with-locked-rewards/src/lib.rs index 60130ad11..dbc7ea16b 100644 --- a/dex/farm-with-locked-rewards/src/lib.rs +++ b/dex/farm-with-locked-rewards/src/lib.rs @@ -214,7 +214,7 @@ pub trait Farm: self.send_to_lock_contract_non_zero( self.reward_token_id().get(), boosted_rewards, - caller.clone(), + user.clone(), user.clone(), ) } From ee6644c7675d1aa700b12f2781394ef745947692 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Wed, 20 Sep 2023 13:51:01 +0300 Subject: [PATCH 085/213] claim boosted in merge endpoints --- dex/farm-with-locked-rewards/src/lib.rs | 17 ++++++++---- dex/farm/src/lib.rs | 15 +++++++---- dex/farm/src/progress_update.rs | 27 ------------------- .../tests/farm_setup/multi_user_farm_setup.rs | 4 ++- farm-staking/farm-staking/src/lib.rs | 15 ++++++++--- 5 files changed, 36 insertions(+), 42 deletions(-) delete mode 100644 dex/farm/src/progress_update.rs diff --git a/dex/farm-with-locked-rewards/src/lib.rs b/dex/farm-with-locked-rewards/src/lib.rs index dbc7ea16b..f998d6d1c 100644 --- a/dex/farm-with-locked-rewards/src/lib.rs +++ b/dex/farm-with-locked-rewards/src/lib.rs @@ -10,7 +10,7 @@ use contexts::storage_cache::StorageCache; use core::marker::PhantomData; use farm::{ - base_functions::{BaseFunctionsModule, ClaimRewardsResultType, Wrapper}, + base_functions::{BaseFunctionsModule, ClaimRewardsResultType, DoubleMultiPayment, Wrapper}, exit_penalty::{ DEFAULT_BURN_GAS_LIMIT, DEFAULT_MINUMUM_FARMING_EPOCHS, DEFAULT_PENALTY_PERCENT, }, @@ -33,7 +33,6 @@ pub trait Farm: + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule + farm::base_functions::BaseFunctionsModule + farm::exit_penalty::ExitPenaltyModule - + farm::progress_update::ProgressUpdateModule + farm_base_impl::base_farm_init::BaseFarmInitModule + farm_base_impl::base_farm_validation::BaseFarmValidationModule + farm_base_impl::enter_farm::BaseEnterFarmModule @@ -180,16 +179,24 @@ pub trait Farm: fn merge_farm_tokens_endpoint( &self, opt_orig_caller: OptionalValue, - ) -> EsdtTokenPayment { + ) -> DoubleMultiPayment { let caller = self.blockchain().get_caller(); let orig_caller = self.get_orig_caller_from_opt(&caller, opt_orig_caller); - self.check_claim_progress_for_merge(&orig_caller); + self.migrate_old_farm_positions(&orig_caller); + let boosted_rewards = self.claim_only_boosted_payment(&orig_caller); let merged_farm_token = self.merge_farm_tokens::>(); + self.send_payment_non_zero(&caller, &merged_farm_token); + let locked_rewards_payment = self.send_to_lock_contract_non_zero( + self.reward_token_id().get(), + boosted_rewards, + caller.clone(), + orig_caller.clone(), + ); - merged_farm_token + (merged_farm_token, locked_rewards_payment).into() } #[endpoint(claimBoostedRewards)] diff --git a/dex/farm/src/lib.rs b/dex/farm/src/lib.rs index 7f019ed08..13f3a29d0 100644 --- a/dex/farm/src/lib.rs +++ b/dex/farm/src/lib.rs @@ -7,7 +7,6 @@ multiversx_sc::derive_imports!(); pub mod base_functions; pub mod exit_penalty; -pub mod progress_update; use base_functions::{ClaimRewardsResultType, DoubleMultiPayment, Wrapper}; use common_structs::FarmTokenAttributes; @@ -34,7 +33,6 @@ pub trait Farm: + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule + base_functions::BaseFunctionsModule + exit_penalty::ExitPenaltyModule - + progress_update::ProgressUpdateModule + farm_base_impl::base_farm_init::BaseFarmInitModule + farm_base_impl::base_farm_validation::BaseFarmValidationModule + farm_base_impl::enter_farm::BaseEnterFarmModule @@ -178,16 +176,23 @@ pub trait Farm: fn merge_farm_tokens_endpoint( &self, opt_orig_caller: OptionalValue, - ) -> EsdtTokenPayment { + ) -> DoubleMultiPayment { let caller = self.blockchain().get_caller(); let orig_caller = self.get_orig_caller_from_opt(&caller, opt_orig_caller); - self.check_claim_progress_for_merge(&orig_caller); self.migrate_old_farm_positions(&orig_caller); + let boosted_rewards = self.claim_only_boosted_payment(&orig_caller); + let boosted_rewards_payment = if boosted_rewards > 0 { + EsdtTokenPayment::new(self.reward_token_id().get(), 0, boosted_rewards) + } else { + EsdtTokenPayment::new(self.reward_token_id().get(), 0, BigUint::zero()) + }; + let merged_farm_token = self.merge_farm_tokens::>(); self.send_payment_non_zero(&caller, &merged_farm_token); + self.send_payment_non_zero(&caller, &boosted_rewards_payment); - merged_farm_token + (merged_farm_token, boosted_rewards_payment).into() } #[endpoint(claimBoostedRewards)] diff --git a/dex/farm/src/progress_update.rs b/dex/farm/src/progress_update.rs deleted file mode 100644 index 48e4b7644..000000000 --- a/dex/farm/src/progress_update.rs +++ /dev/null @@ -1,27 +0,0 @@ -multiversx_sc::imports!(); - -#[multiversx_sc::module] -pub trait ProgressUpdateModule: - week_timekeeping::WeekTimekeepingModule - + weekly_rewards_splitting::WeeklyRewardsSplittingModule - + weekly_rewards_splitting::events::WeeklyRewardsSplittingEventsModule - + weekly_rewards_splitting::global_info::WeeklyRewardsGlobalInfo - + weekly_rewards_splitting::locked_token_buckets::WeeklyRewardsLockedTokenBucketsModule - + weekly_rewards_splitting::update_claim_progress_energy::UpdateClaimProgressEnergyModule - + energy_query::EnergyQueryModule - + utils::UtilsModule -{ - fn check_claim_progress_for_merge(&self, caller: &ManagedAddress) { - let claim_progress_mapper = self.current_claim_progress(caller); - if claim_progress_mapper.is_empty() { - return; - } - - let current_week = self.get_current_week(); - let claim_progress = claim_progress_mapper.get(); - require!( - claim_progress.week == current_week, - "The user claim progress must be up to date." - ) - } -} diff --git a/dex/farm/tests/farm_setup/multi_user_farm_setup.rs b/dex/farm/tests/farm_setup/multi_user_farm_setup.rs index 819d87cfe..0168b2bf6 100644 --- a/dex/farm/tests/farm_setup/multi_user_farm_setup.rs +++ b/dex/farm/tests/farm_setup/multi_user_farm_setup.rs @@ -335,7 +335,9 @@ where self.b_mock .execute_esdt_multi_transfer(user, &self.farm_wrapper, &payments, |sc| { - let out_farm_token = sc.merge_farm_tokens_endpoint(OptionalValue::None); + let (out_farm_token, _boosted_rewards) = sc + .merge_farm_tokens_endpoint(OptionalValue::None) + .into_tuple(); assert_eq!( out_farm_token.token_identifier, managed_token_id!(FARM_TOKEN_ID) diff --git a/farm-staking/farm-staking/src/lib.rs b/farm-staking/farm-staking/src/lib.rs index c9941ced1..42820dd3f 100644 --- a/farm-staking/farm-staking/src/lib.rs +++ b/farm-staking/farm-staking/src/lib.rs @@ -7,6 +7,7 @@ multiversx_sc::derive_imports!(); use base_impl_wrapper::FarmStakingWrapper; use contexts::storage_cache::StorageCache; +use farm::base_functions::DoubleMultiPayment; use farm_base_impl::base_traits_impl::FarmContract; use fixed_supply_token::FixedSupplyToken; use token_attributes::StakingFarmTokenAttributes; @@ -42,7 +43,6 @@ pub trait FarmStaking: + farm_base_impl::claim_rewards::BaseClaimRewardsModule + farm_base_impl::compound_rewards::BaseCompoundRewardsModule + farm_base_impl::exit_farm::BaseExitFarmModule - + farm::progress_update::ProgressUpdateModule + utils::UtilsModule + farm_token_roles::FarmTokenRolesModule + stake_farm::StakeFarmModule @@ -92,11 +92,17 @@ pub trait FarmStaking: #[payable("*")] #[endpoint(mergeFarmTokens)] - fn merge_farm_tokens_endpoint(&self) -> EsdtTokenPayment { + fn merge_farm_tokens_endpoint(&self) -> DoubleMultiPayment { let caller = self.blockchain().get_caller(); - self.check_claim_progress_for_merge(&caller); self.migrate_old_farm_positions(&caller); + let boosted_rewards = self.claim_only_boosted_payment(&caller); + let boosted_rewards_payment = if boosted_rewards > 0 { + EsdtTokenPayment::new(self.reward_token_id().get(), 0, boosted_rewards) + } else { + EsdtTokenPayment::new(self.reward_token_id().get(), 0, BigUint::zero()) + }; + let payments = self.get_non_empty_payments(); let token_mapper = self.farm_token(); let output_attributes: StakingFarmTokenAttributes = @@ -105,8 +111,9 @@ pub trait FarmStaking: let merged_farm_token = token_mapper.nft_create(new_token_amount, &output_attributes); self.send_payment_non_zero(&caller, &merged_farm_token); + self.send_payment_non_zero(&caller, &boosted_rewards_payment); - merged_farm_token + (merged_farm_token, boosted_rewards_payment).into() } #[view(calculateRewardsForGivenPosition)] From 1e9ec9215fe337812c1d352d8bb006d5040382b2 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Wed, 20 Sep 2023 14:59:50 +0300 Subject: [PATCH 086/213] clippy and test fix --- dex/farm-with-locked-rewards/src/lib.rs | 4 ++-- dex/scenarios/merge_tokens.scen.json | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/dex/farm-with-locked-rewards/src/lib.rs b/dex/farm-with-locked-rewards/src/lib.rs index f998d6d1c..c7937d583 100644 --- a/dex/farm-with-locked-rewards/src/lib.rs +++ b/dex/farm-with-locked-rewards/src/lib.rs @@ -192,8 +192,8 @@ pub trait Farm: let locked_rewards_payment = self.send_to_lock_contract_non_zero( self.reward_token_id().get(), boosted_rewards, - caller.clone(), - orig_caller.clone(), + caller, + orig_caller, ); (merged_farm_token, locked_rewards_payment).into() diff --git a/dex/scenarios/merge_tokens.scen.json b/dex/scenarios/merge_tokens.scen.json index 1a0b187cb..ed059f31b 100644 --- a/dex/scenarios/merge_tokens.scen.json +++ b/dex/scenarios/merge_tokens.scen.json @@ -30,7 +30,8 @@ }, "expect": { "out": [ - "0x0000000b4641524d2d6162636465660000000000000003000000040bebc200" + "0x0000000b4641524d2d6162636465660000000000000003000000040bebc200", + "0x0000000c5745474c442d616263646566000000000000000000000000" ], "status": "0", "message": "", @@ -63,4 +64,4 @@ } } ] -} +} \ No newline at end of file From bbff63748cbd527a274dd857292af0f058347101 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Thu, 21 Sep 2023 01:25:00 +0300 Subject: [PATCH 087/213] audit fixes (2) --- common/modules/farm/config/src/config.rs | 22 ++++---- .../farm_base_impl/src/base_traits_impl.rs | 4 +- dex/farm-with-locked-rewards/src/lib.rs | 9 +++- dex/farm/src/base_functions.rs | 53 +++++++++++++++++-- dex/farm/src/lib.rs | 8 +-- .../src/claim_only_boosted_staking_rewards.rs | 27 ++++++++-- farm-staking/farm-staking/src/lib.rs | 28 ++++++++++ farm-staking/farm-staking/src/unstake_farm.rs | 4 +- 8 files changed, 123 insertions(+), 32 deletions(-) diff --git a/common/modules/farm/config/src/config.rs b/common/modules/farm/config/src/config.rs index a823a71c7..29bc8838c 100644 --- a/common/modules/farm/config/src/config.rs +++ b/common/modules/farm/config/src/config.rs @@ -54,21 +54,17 @@ pub trait ConfigModule: pausable::PausableModule + permissions_module::Permissio } fn is_old_farm_position(&self, token_nonce: Nonce) -> bool { - let farm_position_migration_block_nonce = self.farm_position_migration_block_nonce().get(); - token_nonce > 0 && token_nonce < farm_position_migration_block_nonce + let farm_position_migration_nonce = self.farm_position_migration_nonce().get(); + token_nonce > 0 && token_nonce < farm_position_migration_nonce } #[endpoint(allowExternalClaimBoostedRewards)] fn allow_external_claim_boosted_rewards(&self, allow_external_claim: bool) { let caller = self.blockchain().get_caller(); - let user_total_farm_position_mapper = self.user_total_farm_position(&caller); - require!( - !user_total_farm_position_mapper.is_empty(), - "User must have a farm position" - ); - user_total_farm_position_mapper.update(|user_total_farm_position| { - user_total_farm_position.allow_external_claim_boosted_rewards = allow_external_claim; - }); + let mut user_total_farm_position = self.get_user_total_farm_position(&caller); + user_total_farm_position.allow_external_claim_boosted_rewards = allow_external_claim; + self.user_total_farm_position(&caller) + .set(user_total_farm_position); } #[view(getFarmingTokenId)] @@ -101,7 +97,7 @@ pub trait ConfigModule: pausable::PausableModule + permissions_module::Permissio user: &ManagedAddress, ) -> SingleValueMapper>; - #[view(getFarmPositionMigrationBlockNonce)] - #[storage_mapper("farm_position_migration_block_nonce")] - fn farm_position_migration_block_nonce(&self) -> SingleValueMapper; + #[view(getFarmPositionMigrationNonce)] + #[storage_mapper("farm_position_migration_nonce")] + fn farm_position_migration_nonce(&self) -> SingleValueMapper; } diff --git a/common/modules/farm/farm_base_impl/src/base_traits_impl.rs b/common/modules/farm/farm_base_impl/src/base_traits_impl.rs index 8f44e8971..f2ccc293c 100644 --- a/common/modules/farm/farm_base_impl/src/base_traits_impl.rs +++ b/common/modules/farm/farm_base_impl/src/base_traits_impl.rs @@ -196,12 +196,12 @@ pub trait FarmContract { ) { let farm_token_mapper = sc.farm_token(); for farm_position in farm_positions { + farm_token_mapper.require_same_token(&farm_position.token_identifier); + if sc.is_old_farm_position(farm_position.token_nonce) { continue; } - farm_token_mapper.require_same_token(&farm_position.token_identifier); - let token_attributes: FarmTokenAttributes<::Api> = farm_token_mapper.get_token_attributes(farm_position.token_nonce); diff --git a/dex/farm-with-locked-rewards/src/lib.rs b/dex/farm-with-locked-rewards/src/lib.rs index c7937d583..9ac50d388 100644 --- a/dex/farm-with-locked-rewards/src/lib.rs +++ b/dex/farm-with-locked-rewards/src/lib.rs @@ -75,6 +75,9 @@ pub trait Farm: let current_epoch = self.blockchain().get_block_epoch(); self.first_week_start_epoch().set_if_empty(current_epoch); + + // Farm position migration code + self.try_set_farm_position_migration_nonce(); } #[payable("*")] @@ -155,11 +158,13 @@ pub trait Farm: let payment = self.call_value().single_esdt(); - self.migrate_old_farm_positions(&orig_caller); + let migrated_amount = self.migrate_old_farm_positions(&orig_caller); let exit_farm_result = self.exit_farm::>(orig_caller.clone(), payment); - let rewards = exit_farm_result.rewards; + self.decrease_old_farm_positions(migrated_amount, &orig_caller); + + let rewards = exit_farm_result.rewards; self.send_payment_non_zero(&caller, &exit_farm_result.farming_tokens); let locked_rewards_payment = self.send_to_lock_contract_non_zero( diff --git a/dex/farm/src/base_functions.rs b/dex/farm/src/base_functions.rs index b98a49d5f..ba576b5e5 100644 --- a/dex/farm/src/base_functions.rs +++ b/dex/farm/src/base_functions.rs @@ -204,20 +204,63 @@ pub trait BaseFunctionsModule: reward } - fn migrate_old_farm_positions(&self, caller: &ManagedAddress) { + fn migrate_old_farm_positions(&self, caller: &ManagedAddress) -> BigUint { let payments = self.get_non_empty_payments(); let farm_token_mapper = self.farm_token(); let farm_token_id = farm_token_mapper.get_token_id(); + let mut migrated_amount = BigUint::zero(); for farm_position in &payments { if farm_position.token_identifier == farm_token_id && self.is_old_farm_position(farm_position.token_nonce) { - let mut user_total_farm_position = self.get_user_total_farm_position(caller); - user_total_farm_position.total_farm_position += farm_position.amount; - self.user_total_farm_position(caller) - .set(user_total_farm_position); + migrated_amount += farm_position.amount; } } + + if migrated_amount > 0 { + let mut user_total_farm_position = self.get_user_total_farm_position(caller); + user_total_farm_position.total_farm_position += &migrated_amount; + self.user_total_farm_position(caller) + .set(user_total_farm_position); + } + + return migrated_amount; + } + + fn decrease_old_farm_positions(&self, migrated_amount: BigUint, caller: &ManagedAddress) { + if migrated_amount == BigUint::zero() { + return; + } + self.user_total_farm_position(caller) + .update(|user_total_farm_position| { + user_total_farm_position.total_farm_position -= migrated_amount; + }); + } + + fn try_set_farm_position_migration_nonce(&self) { + if !self.farm_position_migration_nonce().is_empty() { + return; + } + + let farm_token_mapper = self.farm_token(); + + let attributes = FarmTokenAttributes { + reward_per_share: BigUint::zero(), + entering_epoch: 0, + compounded_reward: BigUint::zero(), + current_farm_amount: BigUint::zero(), + original_owner: self.blockchain().get_sc_address(), + }; + + let migration_farm_token = farm_token_mapper.nft_create(BigUint::from(1u64), &attributes); + + self.farm_position_migration_nonce() + .set(migration_farm_token.token_nonce); + + farm_token_mapper.nft_burn( + migration_farm_token.token_nonce, + &migration_farm_token.amount, + ) } fn end_produce_rewards>(&self) { diff --git a/dex/farm/src/lib.rs b/dex/farm/src/lib.rs index 13f3a29d0..c7364b322 100644 --- a/dex/farm/src/lib.rs +++ b/dex/farm/src/lib.rs @@ -78,9 +78,7 @@ pub trait Farm: self.first_week_start_epoch().set_if_empty(current_epoch); // Farm position migration code - let block_nonce = self.blockchain().get_block_nonce(); - self.farm_position_migration_block_nonce() - .set_if_empty(block_nonce); + self.try_set_farm_position_migration_nonce(); } #[payable("*")] @@ -159,10 +157,12 @@ pub trait Farm: let payment = self.call_value().single_esdt(); - self.migrate_old_farm_positions(&orig_caller); + let migrated_amount = self.migrate_old_farm_positions(&orig_caller); let exit_farm_result = self.exit_farm::>(orig_caller.clone(), payment); + self.decrease_old_farm_positions(migrated_amount, &orig_caller); + self.send_payment_non_zero(&caller, &exit_farm_result.farming_tokens); self.send_payment_non_zero(&caller, &exit_farm_result.rewards); diff --git a/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs b/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs index 4e31662b2..fd1ac89e1 100644 --- a/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs +++ b/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs @@ -49,20 +49,37 @@ pub trait ClaimOnlyBoostedStakingRewardsModule: boosted_rewards_payment } - fn migrate_old_farm_positions(&self, caller: &ManagedAddress) { + fn migrate_old_farm_positions(&self, caller: &ManagedAddress) -> BigUint { let payments = self.call_value().all_esdt_transfers().clone_value(); let farm_token_mapper = self.farm_token(); let farm_token_id = farm_token_mapper.get_token_id(); + let mut migrated_amount = BigUint::zero(); for farm_position in &payments { if farm_position.token_identifier == farm_token_id && self.is_old_farm_position(farm_position.token_nonce) { - let mut user_total_farm_position = self.get_user_total_farm_position(caller); - user_total_farm_position.total_farm_position += farm_position.amount; - self.user_total_farm_position(caller) - .set(user_total_farm_position); + migrated_amount += farm_position.amount; } } + + if migrated_amount > 0 { + let mut user_total_farm_position = self.get_user_total_farm_position(caller); + user_total_farm_position.total_farm_position += &migrated_amount; + self.user_total_farm_position(caller) + .set(user_total_farm_position); + } + + return migrated_amount; + } + + fn decrease_old_farm_positions(&self, migrated_amount: BigUint, caller: &ManagedAddress) { + if migrated_amount == BigUint::zero() { + return; + } + self.user_total_farm_position(caller) + .update(|user_total_farm_position| { + user_total_farm_position.total_farm_position -= migrated_amount; + }); } // Cannot import the one from farm, as the Wrapper struct has different dependencies diff --git a/farm-staking/farm-staking/src/lib.rs b/farm-staking/farm-staking/src/lib.rs index 42820dd3f..d3a0cee74 100644 --- a/farm-staking/farm-staking/src/lib.rs +++ b/farm-staking/farm-staking/src/lib.rs @@ -88,6 +88,9 @@ pub trait FarmStaking: "Invalid min unbond epochs" ); self.min_unbond_epochs().set_if_empty(min_unbond_epochs); + + // Farm position migration code + self.try_set_farm_position_migration_nonce(); } #[payable("*")] @@ -144,4 +147,29 @@ pub trait FarmStaking: "May only call this function through VM query" ); } + + fn try_set_farm_position_migration_nonce(&self) { + if !self.farm_position_migration_nonce().is_empty() { + return; + } + + let farm_token_mapper = self.farm_token(); + + let attributes = StakingFarmTokenAttributes { + reward_per_share: BigUint::zero(), + compounded_reward: BigUint::zero(), + current_farm_amount: BigUint::zero(), + original_owner: self.blockchain().get_sc_address(), + }; + + let migration_farm_token = farm_token_mapper.nft_create(BigUint::from(1u64), &attributes); + + self.farm_position_migration_nonce() + .set(migration_farm_token.token_nonce); + + farm_token_mapper.nft_burn( + migration_farm_token.token_nonce, + &migration_farm_token.amount, + ) + } } diff --git a/farm-staking/farm-staking/src/unstake_farm.rs b/farm-staking/farm-staking/src/unstake_farm.rs index 6b529e0fb..e40642b4f 100644 --- a/farm-staking/farm-staking/src/unstake_farm.rs +++ b/farm-staking/farm-staking/src/unstake_farm.rs @@ -72,11 +72,13 @@ pub trait UnstakeFarmModule: payment: EsdtTokenPayment, opt_unbond_amount: Option, ) -> ExitFarmWithPartialPosResultType { - self.migrate_old_farm_positions(&original_caller); + let migrated_amount = self.migrate_old_farm_positions(&original_caller); let exit_result = self.exit_farm_base::>(original_caller.clone(), payment); + self.decrease_old_farm_positions(migrated_amount, &original_caller); + let unbond_token_amount = opt_unbond_amount.unwrap_or(exit_result.farming_token_payment.amount); let farm_token_id = exit_result.storage_cache.farm_token_id.clone(); From 4303c0c65f7e98fbceeec4259ac1604400accce6 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Thu, 21 Sep 2023 02:04:55 +0300 Subject: [PATCH 088/213] default migration nonce fix --- dex/farm-with-locked-rewards/wasm/src/lib.rs | 2 +- dex/farm/src/base_functions.rs | 23 ++++++++++++------- dex/farm/wasm/src/lib.rs | 2 +- .../src/claim_only_boosted_staking_rewards.rs | 2 +- farm-staking/farm-staking/src/lib.rs | 21 +++++++++++------ farm-staking/farm-staking/wasm/src/lib.rs | 2 +- 6 files changed, 33 insertions(+), 19 deletions(-) diff --git a/dex/farm-with-locked-rewards/wasm/src/lib.rs b/dex/farm-with-locked-rewards/wasm/src/lib.rs index ae9c8fced..64c73e3cc 100644 --- a/dex/farm-with-locked-rewards/wasm/src/lib.rs +++ b/dex/farm-with-locked-rewards/wasm/src/lib.rs @@ -40,7 +40,7 @@ multiversx_sc_wasm_adapter::endpoints! { getLastRewardBlockNonce => last_reward_block_nonce getDivisionSafetyConstant => division_safety_constant getUserTotalFarmPosition => user_total_farm_position - getFarmPositionMigrationBlockNonce => farm_position_migration_block_nonce + getFarmPositionMigrationNonce => farm_position_migration_nonce setLockingScAddress => set_locking_sc_address setLockEpochs => set_lock_epochs getLockingScAddress => locking_sc_address diff --git a/dex/farm/src/base_functions.rs b/dex/farm/src/base_functions.rs index ba576b5e5..fe95ce920 100644 --- a/dex/farm/src/base_functions.rs +++ b/dex/farm/src/base_functions.rs @@ -19,6 +19,8 @@ pub type DoubleMultiPayment = MultiValue2, EsdtTokenPayme pub type ClaimRewardsResultType = DoubleMultiPayment; pub type ExitFarmResultType = DoubleMultiPayment; +pub const DEFAULT_FARM_POSITION_MIGRATION_NONCE: u64 = 1; + pub struct ClaimRewardsResultWrapper { pub new_farm_token: EsdtTokenPayment, pub rewards: EsdtTokenPayment, @@ -224,7 +226,7 @@ pub trait BaseFunctionsModule: .set(user_total_farm_position); } - return migrated_amount; + migrated_amount } fn decrease_old_farm_positions(&self, migrated_amount: BigUint, caller: &ManagedAddress) { @@ -252,15 +254,20 @@ pub trait BaseFunctionsModule: original_owner: self.blockchain().get_sc_address(), }; - let migration_farm_token = farm_token_mapper.nft_create(BigUint::from(1u64), &attributes); + let migration_farm_token_nonce = if farm_token_mapper.get_token_state().is_set() { + let migration_farm_token = + farm_token_mapper.nft_create(BigUint::from(1u64), &attributes); + farm_token_mapper.nft_burn( + migration_farm_token.token_nonce, + &migration_farm_token.amount, + ); + migration_farm_token.token_nonce + } else { + DEFAULT_FARM_POSITION_MIGRATION_NONCE + }; self.farm_position_migration_nonce() - .set(migration_farm_token.token_nonce); - - farm_token_mapper.nft_burn( - migration_farm_token.token_nonce, - &migration_farm_token.amount, - ) + .set(migration_farm_token_nonce); } fn end_produce_rewards>(&self) { diff --git a/dex/farm/wasm/src/lib.rs b/dex/farm/wasm/src/lib.rs index 4acae57d7..78415bd2c 100644 --- a/dex/farm/wasm/src/lib.rs +++ b/dex/farm/wasm/src/lib.rs @@ -41,7 +41,7 @@ multiversx_sc_wasm_adapter::endpoints! { getLastRewardBlockNonce => last_reward_block_nonce getDivisionSafetyConstant => division_safety_constant getUserTotalFarmPosition => user_total_farm_position - getFarmPositionMigrationBlockNonce => farm_position_migration_block_nonce + getFarmPositionMigrationNonce => farm_position_migration_nonce registerFarmToken => register_farm_token getFarmTokenId => farm_token getFarmTokenSupply => farm_token_supply diff --git a/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs b/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs index fd1ac89e1..71e7ab9e3 100644 --- a/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs +++ b/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs @@ -69,7 +69,7 @@ pub trait ClaimOnlyBoostedStakingRewardsModule: .set(user_total_farm_position); } - return migrated_amount; + migrated_amount } fn decrease_old_farm_positions(&self, migrated_amount: BigUint, caller: &ManagedAddress) { diff --git a/farm-staking/farm-staking/src/lib.rs b/farm-staking/farm-staking/src/lib.rs index d3a0cee74..81c4d4d1b 100644 --- a/farm-staking/farm-staking/src/lib.rs +++ b/farm-staking/farm-staking/src/lib.rs @@ -25,6 +25,8 @@ pub mod token_attributes; pub mod unbond_farm; pub mod unstake_farm; +pub const DEFAULT_FARM_POSITION_MIGRATION_NONCE: u64 = 1; + #[multiversx_sc::contract] pub trait FarmStaking: custom_rewards::CustomRewardsModule @@ -162,14 +164,19 @@ pub trait FarmStaking: original_owner: self.blockchain().get_sc_address(), }; - let migration_farm_token = farm_token_mapper.nft_create(BigUint::from(1u64), &attributes); + let migration_farm_token_nonce = if farm_token_mapper.get_token_state().is_set() { + let migration_farm_token = + farm_token_mapper.nft_create(BigUint::from(1u64), &attributes); + farm_token_mapper.nft_burn( + migration_farm_token.token_nonce, + &migration_farm_token.amount, + ); + migration_farm_token.token_nonce + } else { + DEFAULT_FARM_POSITION_MIGRATION_NONCE + }; self.farm_position_migration_nonce() - .set(migration_farm_token.token_nonce); - - farm_token_mapper.nft_burn( - migration_farm_token.token_nonce, - &migration_farm_token.amount, - ) + .set(migration_farm_token_nonce); } } diff --git a/farm-staking/farm-staking/wasm/src/lib.rs b/farm-staking/farm-staking/wasm/src/lib.rs index 9dfb64c19..fedf1dba8 100644 --- a/farm-staking/farm-staking/wasm/src/lib.rs +++ b/farm-staking/farm-staking/wasm/src/lib.rs @@ -43,7 +43,7 @@ multiversx_sc_wasm_adapter::endpoints! { getLastRewardBlockNonce => last_reward_block_nonce getDivisionSafetyConstant => division_safety_constant getUserTotalFarmPosition => user_total_farm_position - getFarmPositionMigrationBlockNonce => farm_position_migration_block_nonce + getFarmPositionMigrationNonce => farm_position_migration_nonce registerFarmToken => register_farm_token getFarmTokenId => farm_token getFarmTokenSupply => farm_token_supply From 767f452b63295451a849f07bd8a3dba30fa41990 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Thu, 21 Sep 2023 11:32:51 +0300 Subject: [PATCH 089/213] use GetCurrentESDTNFTNonce VM endpoint --- dex/farm/src/base_functions.rs | 18 +++--------------- farm-staking/farm-staking/src/lib.rs | 17 +++-------------- 2 files changed, 6 insertions(+), 29 deletions(-) diff --git a/dex/farm/src/base_functions.rs b/dex/farm/src/base_functions.rs index fe95ce920..bbe12a49f 100644 --- a/dex/farm/src/base_functions.rs +++ b/dex/farm/src/base_functions.rs @@ -246,22 +246,10 @@ pub trait BaseFunctionsModule: let farm_token_mapper = self.farm_token(); - let attributes = FarmTokenAttributes { - reward_per_share: BigUint::zero(), - entering_epoch: 0, - compounded_reward: BigUint::zero(), - current_farm_amount: BigUint::zero(), - original_owner: self.blockchain().get_sc_address(), - }; - let migration_farm_token_nonce = if farm_token_mapper.get_token_state().is_set() { - let migration_farm_token = - farm_token_mapper.nft_create(BigUint::from(1u64), &attributes); - farm_token_mapper.nft_burn( - migration_farm_token.token_nonce, - &migration_farm_token.amount, - ); - migration_farm_token.token_nonce + let token_identifier = farm_token_mapper.get_token_id_ref(); + self.blockchain() + .get_current_esdt_nft_nonce(&self.blockchain().get_sc_address(), token_identifier) } else { DEFAULT_FARM_POSITION_MIGRATION_NONCE }; diff --git a/farm-staking/farm-staking/src/lib.rs b/farm-staking/farm-staking/src/lib.rs index 81c4d4d1b..26622a02b 100644 --- a/farm-staking/farm-staking/src/lib.rs +++ b/farm-staking/farm-staking/src/lib.rs @@ -157,21 +157,10 @@ pub trait FarmStaking: let farm_token_mapper = self.farm_token(); - let attributes = StakingFarmTokenAttributes { - reward_per_share: BigUint::zero(), - compounded_reward: BigUint::zero(), - current_farm_amount: BigUint::zero(), - original_owner: self.blockchain().get_sc_address(), - }; - let migration_farm_token_nonce = if farm_token_mapper.get_token_state().is_set() { - let migration_farm_token = - farm_token_mapper.nft_create(BigUint::from(1u64), &attributes); - farm_token_mapper.nft_burn( - migration_farm_token.token_nonce, - &migration_farm_token.amount, - ); - migration_farm_token.token_nonce + let token_identifier = farm_token_mapper.get_token_id_ref(); + self.blockchain() + .get_current_esdt_nft_nonce(&self.blockchain().get_sc_address(), token_identifier) } else { DEFAULT_FARM_POSITION_MIGRATION_NONCE }; From 8100d5732761e889a244ad4a5347ccfa7bdf422b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Thu, 21 Sep 2023 12:53:41 +0300 Subject: [PATCH 090/213] try_set_farm_position_migration_nonce: code dup Moved try_set_farm_position_migration_nonce to common modules to remove code duplication. --- common/modules/farm/config/src/config.rs | 34 +++++++++++++++++++----- dex/farm-with-locked-rewards/src/lib.rs | 3 ++- dex/farm/src/base_functions.rs | 19 ------------- dex/farm/src/lib.rs | 3 ++- farm-staking/farm-staking/src/lib.rs | 24 ++--------------- 5 files changed, 33 insertions(+), 50 deletions(-) diff --git a/common/modules/farm/config/src/config.rs b/common/modules/farm/config/src/config.rs index 29bc8838c..ea4d856e0 100644 --- a/common/modules/farm/config/src/config.rs +++ b/common/modules/farm/config/src/config.rs @@ -7,6 +7,7 @@ use common_structs::Nonce; use pausable::State; pub const DEFAULT_NFT_DEPOSIT_MAX_LEN: usize = 10; +pub const DEFAULT_FARM_POSITION_MIGRATION_NONCE: u64 = 1; #[derive( ManagedVecItem, @@ -35,6 +36,16 @@ impl Default for UserTotalFarmPosition { #[multiversx_sc::module] pub trait ConfigModule: pausable::PausableModule + permissions_module::PermissionsModule { + + #[endpoint(allowExternalClaimBoostedRewards)] + fn allow_external_claim_boosted_rewards(&self, allow_external_claim: bool) { + let caller = self.blockchain().get_caller(); + let mut user_total_farm_position = self.get_user_total_farm_position(&caller); + user_total_farm_position.allow_external_claim_boosted_rewards = allow_external_claim; + self.user_total_farm_position(&caller) + .set(user_total_farm_position); + } + #[inline] fn is_active(&self) -> bool { let state = self.state().get(); @@ -58,15 +69,24 @@ pub trait ConfigModule: pausable::PausableModule + permissions_module::Permissio token_nonce > 0 && token_nonce < farm_position_migration_nonce } - #[endpoint(allowExternalClaimBoostedRewards)] - fn allow_external_claim_boosted_rewards(&self, allow_external_claim: bool) { - let caller = self.blockchain().get_caller(); - let mut user_total_farm_position = self.get_user_total_farm_position(&caller); - user_total_farm_position.allow_external_claim_boosted_rewards = allow_external_claim; - self.user_total_farm_position(&caller) - .set(user_total_farm_position); + fn try_set_farm_position_migration_nonce(&self, farm_token_mapper: NonFungibleTokenMapper) { + if !self.farm_position_migration_nonce().is_empty() { + return; + } + + let migration_farm_token_nonce = if farm_token_mapper.get_token_state().is_set() { + let token_identifier = farm_token_mapper.get_token_id_ref(); + self.blockchain() + .get_current_esdt_nft_nonce(&self.blockchain().get_sc_address(), token_identifier) + } else { + DEFAULT_FARM_POSITION_MIGRATION_NONCE + }; + + self.farm_position_migration_nonce() + .set(migration_farm_token_nonce); } + #[view(getFarmingTokenId)] #[storage_mapper("farming_token_id")] fn farming_token_id(&self) -> SingleValueMapper; diff --git a/dex/farm-with-locked-rewards/src/lib.rs b/dex/farm-with-locked-rewards/src/lib.rs index 9ac50d388..27421ac16 100644 --- a/dex/farm-with-locked-rewards/src/lib.rs +++ b/dex/farm-with-locked-rewards/src/lib.rs @@ -77,7 +77,8 @@ pub trait Farm: self.first_week_start_epoch().set_if_empty(current_epoch); // Farm position migration code - self.try_set_farm_position_migration_nonce(); + let farm_token_mapper = self.farm_token(); + self.try_set_farm_position_migration_nonce(farm_token_mapper); } #[payable("*")] diff --git a/dex/farm/src/base_functions.rs b/dex/farm/src/base_functions.rs index bbe12a49f..968e3381d 100644 --- a/dex/farm/src/base_functions.rs +++ b/dex/farm/src/base_functions.rs @@ -239,25 +239,6 @@ pub trait BaseFunctionsModule: }); } - fn try_set_farm_position_migration_nonce(&self) { - if !self.farm_position_migration_nonce().is_empty() { - return; - } - - let farm_token_mapper = self.farm_token(); - - let migration_farm_token_nonce = if farm_token_mapper.get_token_state().is_set() { - let token_identifier = farm_token_mapper.get_token_id_ref(); - self.blockchain() - .get_current_esdt_nft_nonce(&self.blockchain().get_sc_address(), token_identifier) - } else { - DEFAULT_FARM_POSITION_MIGRATION_NONCE - }; - - self.farm_position_migration_nonce() - .set(migration_farm_token_nonce); - } - fn end_produce_rewards>(&self) { let mut storage = StorageCache::new(self); FC::generate_aggregated_rewards(self, &mut storage); diff --git a/dex/farm/src/lib.rs b/dex/farm/src/lib.rs index c7364b322..5a18d41e3 100644 --- a/dex/farm/src/lib.rs +++ b/dex/farm/src/lib.rs @@ -78,7 +78,8 @@ pub trait Farm: self.first_week_start_epoch().set_if_empty(current_epoch); // Farm position migration code - self.try_set_farm_position_migration_nonce(); + let farm_token_mapper = self.farm_token(); + self.try_set_farm_position_migration_nonce(farm_token_mapper); } #[payable("*")] diff --git a/farm-staking/farm-staking/src/lib.rs b/farm-staking/farm-staking/src/lib.rs index 26622a02b..5bd41cecf 100644 --- a/farm-staking/farm-staking/src/lib.rs +++ b/farm-staking/farm-staking/src/lib.rs @@ -25,8 +25,6 @@ pub mod token_attributes; pub mod unbond_farm; pub mod unstake_farm; -pub const DEFAULT_FARM_POSITION_MIGRATION_NONCE: u64 = 1; - #[multiversx_sc::contract] pub trait FarmStaking: custom_rewards::CustomRewardsModule @@ -92,7 +90,8 @@ pub trait FarmStaking: self.min_unbond_epochs().set_if_empty(min_unbond_epochs); // Farm position migration code - self.try_set_farm_position_migration_nonce(); + let farm_token_mapper = self.farm_token(); + self.try_set_farm_position_migration_nonce(farm_token_mapper); } #[payable("*")] @@ -149,23 +148,4 @@ pub trait FarmStaking: "May only call this function through VM query" ); } - - fn try_set_farm_position_migration_nonce(&self) { - if !self.farm_position_migration_nonce().is_empty() { - return; - } - - let farm_token_mapper = self.farm_token(); - - let migration_farm_token_nonce = if farm_token_mapper.get_token_state().is_set() { - let token_identifier = farm_token_mapper.get_token_id_ref(); - self.blockchain() - .get_current_esdt_nft_nonce(&self.blockchain().get_sc_address(), token_identifier) - } else { - DEFAULT_FARM_POSITION_MIGRATION_NONCE - }; - - self.farm_position_migration_nonce() - .set(migration_farm_token_nonce); - } } From aba2e4ec4b0517a57567ab85aa279e386e5e4a00 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Fri, 22 Sep 2023 11:23:05 +0300 Subject: [PATCH 091/213] fix farm_position_migration_nonce set function --- common/modules/farm/config/src/config.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/common/modules/farm/config/src/config.rs b/common/modules/farm/config/src/config.rs index ea4d856e0..e65056062 100644 --- a/common/modules/farm/config/src/config.rs +++ b/common/modules/farm/config/src/config.rs @@ -36,7 +36,6 @@ impl Default for UserTotalFarmPosition { #[multiversx_sc::module] pub trait ConfigModule: pausable::PausableModule + permissions_module::PermissionsModule { - #[endpoint(allowExternalClaimBoostedRewards)] fn allow_external_claim_boosted_rewards(&self, allow_external_claim: bool) { let caller = self.blockchain().get_caller(); @@ -69,15 +68,20 @@ pub trait ConfigModule: pausable::PausableModule + permissions_module::Permissio token_nonce > 0 && token_nonce < farm_position_migration_nonce } - fn try_set_farm_position_migration_nonce(&self, farm_token_mapper: NonFungibleTokenMapper) { + fn try_set_farm_position_migration_nonce( + &self, + farm_token_mapper: NonFungibleTokenMapper, + ) { if !self.farm_position_migration_nonce().is_empty() { return; } let migration_farm_token_nonce = if farm_token_mapper.get_token_state().is_set() { let token_identifier = farm_token_mapper.get_token_id_ref(); - self.blockchain() - .get_current_esdt_nft_nonce(&self.blockchain().get_sc_address(), token_identifier) + let current_nonce = self + .blockchain() + .get_current_esdt_nft_nonce(&self.blockchain().get_sc_address(), token_identifier); + current_nonce + DEFAULT_FARM_POSITION_MIGRATION_NONCE } else { DEFAULT_FARM_POSITION_MIGRATION_NONCE }; @@ -86,7 +90,6 @@ pub trait ConfigModule: pausable::PausableModule + permissions_module::Permissio .set(migration_farm_token_nonce); } - #[view(getFarmingTokenId)] #[storage_mapper("farming_token_id")] fn farming_token_id(&self) -> SingleValueMapper; From 494b301a09df5ad60d19a240123c8bf2f0b747a4 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Tue, 26 Sep 2023 14:04:32 +0300 Subject: [PATCH 092/213] farm position functionality tests --- .../tests/farm_with_locked_rewards_test.rs | 107 ++++ dex/farm/tests/farm_multi_user_test.rs | 96 --- .../tests/farm_setup/multi_user_farm_setup.rs | 58 +- dex/farm/tests/total_farm_position_test.rs | 546 ++++++++++++++++++ 4 files changed, 708 insertions(+), 99 deletions(-) create mode 100644 dex/farm/tests/total_farm_position_test.rs diff --git a/dex/farm-with-locked-rewards/tests/farm_with_locked_rewards_test.rs b/dex/farm-with-locked-rewards/tests/farm_with_locked_rewards_test.rs index 5d7bdf7be..8a9fb8793 100644 --- a/dex/farm-with-locked-rewards/tests/farm_with_locked_rewards_test.rs +++ b/dex/farm-with-locked-rewards/tests/farm_with_locked_rewards_test.rs @@ -228,3 +228,110 @@ fn farm_with_boosted_yields_no_proxy_test() { None, ); } + +#[test] +fn total_farm_position_claim_with_locked_rewards_test() { + DebugApi::dummy(); + let mut farm_setup = FarmSetup::new( + farm_with_locked_rewards::contract_obj, + energy_factory::contract_obj, + ); + + farm_setup.set_boosted_yields_rewards_percentage(BOOSTED_YIELDS_PERCENTAGE); + farm_setup.set_boosted_yields_factors(); + farm_setup.b_mock.set_block_epoch(2); + + let temp_user = farm_setup.third_user.clone(); + + // first user enter farm + let farm_in_amount = 50_000_000; + let first_user = farm_setup.first_user.clone(); + farm_setup.set_user_energy(&first_user, 1_000, 2, 1); + farm_setup.enter_farm(&first_user, farm_in_amount); + farm_setup.enter_farm(&first_user, farm_in_amount); + + farm_setup.b_mock.check_nft_balance( + &first_user, + FARM_TOKEN_ID, + 1, + &rust_biguint!(farm_in_amount), + Some(&FarmTokenAttributes:: { + reward_per_share: managed_biguint!(0), + compounded_reward: managed_biguint!(0), + entering_epoch: 2, + current_farm_amount: managed_biguint!(farm_in_amount), + original_owner: managed_address!(&first_user), + }), + ); + + farm_setup.b_mock.check_nft_balance( + &first_user, + FARM_TOKEN_ID, + 2, + &rust_biguint!(farm_in_amount), + Some(&FarmTokenAttributes:: { + reward_per_share: managed_biguint!(0), + compounded_reward: managed_biguint!(0), + entering_epoch: 2, + current_farm_amount: managed_biguint!(farm_in_amount), + original_owner: managed_address!(&first_user), + }), + ); + + // users claim rewards to get their energy registered + let _ = farm_setup.claim_rewards(&first_user, 1, farm_in_amount); + + // advance blocks - 10 blocks - 10 * 1_000 = 10_000 total rewards + // 7_500 base farm, 2_500 boosted yields + farm_setup.b_mock.set_block_nonce(10); + + // random tx on end of week 1, to cummulate rewards + farm_setup.b_mock.set_block_epoch(6); + farm_setup.set_user_energy(&first_user, 1_000, 6, 1); + farm_setup.set_user_energy(&temp_user, 1, 6, 1); + farm_setup.enter_farm(&temp_user, 1); + farm_setup.exit_farm(&temp_user, 4, 1); + + // advance 1 week + farm_setup.b_mock.set_block_epoch(10); + farm_setup.set_user_energy(&first_user, 1_000, 10, 1); + + let total_farm_tokens = farm_in_amount * 2; + + // first user claim with half total position + let first_base_farm_amt = farm_in_amount * 7_500 / total_farm_tokens; + + // Boosted yields rewards formula + // total_boosted_rewards * (energy_const * user_energy / total_energy + farm_const * user_farm / total_farm) / (energy_const + farm_const) + // (total_boosted_rewards * energy_const * user_energy / total_energy + total_boosted_rewards * farm_const * user_farm / total_farm) / (energy_const + farm_const) + // (2_500 * 3 * 1_000 / 1_000 + 2_500 * 2 * 100_000_000 / 100_000_000) / (3 + 2) + // (7_500 + 2_500) / (5) = 2_500 + let first_boosted_amt = 2_500; // 1000 energy & 100_000_000 farm tokens + let first_total_rewards = first_base_farm_amt + first_boosted_amt; + + let first_received_reward_amt = farm_setup.claim_rewards(&first_user, 3, farm_in_amount); + + // Should be equal to half base generated rewards + full boosted generated rewards + assert_eq!(first_received_reward_amt, first_total_rewards); + + farm_setup + .b_mock + .check_nft_balance::>( + &first_user, + FARM_TOKEN_ID, + 5, + &rust_biguint!(farm_in_amount), + None, + ); + + // Check user receive locked rewards + farm_setup + .b_mock + .check_nft_balance::>( + &first_user, + LOCKED_REWARD_TOKEN_ID, + 1, + &rust_biguint!(first_received_reward_amt), + None, + ); +} diff --git a/dex/farm/tests/farm_multi_user_test.rs b/dex/farm/tests/farm_multi_user_test.rs index 7fe7c53d3..03315b184 100644 --- a/dex/farm/tests/farm_multi_user_test.rs +++ b/dex/farm/tests/farm_multi_user_test.rs @@ -221,102 +221,6 @@ fn farm_with_boosted_yields_test() { ); } -#[test] -fn farm_claim_boosted_yields_for_other_user_test() { - DebugApi::dummy(); - let mut farm_setup = MultiUserFarmSetup::new( - farm::contract_obj, - energy_factory_mock::contract_obj, - energy_update::contract_obj, - ); - - farm_setup.set_boosted_yields_rewards_percentage(BOOSTED_YIELDS_PERCENTAGE); - farm_setup.set_boosted_yields_factors(); - farm_setup.b_mock.set_block_epoch(2); - - // first user enter farm - let first_farm_token_amount = 100_000_000; - let first_user = farm_setup.first_user.clone(); - let third_user = farm_setup.third_user.clone(); - - farm_setup.set_user_energy(&first_user, 1_000, 2, 1); - farm_setup.enter_farm(&first_user, first_farm_token_amount); - - // second user enter farm - let second_farm_token_amount = 50_000_000; - let second_user = farm_setup.second_user.clone(); - farm_setup.set_user_energy(&second_user, 4_000, 2, 1); - farm_setup.enter_farm(&second_user, second_farm_token_amount); - - // users claim rewards to get their energy registered - let _ = farm_setup.claim_rewards(&first_user, 1, first_farm_token_amount); - let _ = farm_setup.claim_rewards(&second_user, 2, second_farm_token_amount); - - // advance blocks - 10 blocks - 10 * 1_000 = 10_000 total rewards - // 7_500 base farm, 2_500 boosted yields - farm_setup.b_mock.set_block_nonce(10); - - // random tx on end of week 1, to cummulate rewards - farm_setup.b_mock.set_block_epoch(6); - farm_setup.set_user_energy(&first_user, 1_000, 6, 1); - farm_setup.set_user_energy(&second_user, 4_000, 6, 1); - farm_setup.set_user_energy(&third_user, 1, 6, 1); - farm_setup.enter_farm(&third_user, 1); - farm_setup.exit_farm(&third_user, 5, 1); - - // advance 1 week - farm_setup.b_mock.set_block_epoch(10); - farm_setup.set_user_energy(&first_user, 1_000, 10, 1); - farm_setup.set_user_energy(&second_user, 4_000, 10, 1); - - // Second user claims for himself - let total_farm_tokens = first_farm_token_amount + second_farm_token_amount; - let second_base_farm_amt = second_farm_token_amount * 7_500 / total_farm_tokens; - let second_boosted_amt = 1533; // 4000 energy & 50_000_000 farm tokens - let second_total = second_base_farm_amt + second_boosted_amt; - - let second_receveived_reward_amt = - farm_setup.claim_rewards(&second_user, 4, second_farm_token_amount); - assert_eq!(second_receveived_reward_amt, second_total); - - farm_setup - .b_mock - .check_nft_balance::>( - &second_user, - FARM_TOKEN_ID, - 6, - &rust_biguint!(second_farm_token_amount), - None, - ); - - farm_setup.b_mock.check_esdt_balance( - &second_user, - REWARD_TOKEN_ID, - &rust_biguint!(second_receveived_reward_amt), - ); - - // Boosted yields rewards formula - // total_boosted_rewards * (energy_const * user_energy / total_energy + farm_const * user_farm / total_farm) / (energy_const + farm_const) - // (total_boosted_rewards * energy_const * user_energy / total_energy + total_boosted_rewards * farm_const * user_farm / total_farm) / (energy_const + farm_const) - // (2500 * 3 * 1_000 / 5_000 + 2500 * 2 * 100_000_000 / 150_000_000) / (3 + 2) - // (1500 + 3333) / (5) = 966 - let first_boosted_amt = 966; // 1000 energy & 100_000_000 farm tokens - - // Second user claim boosted rewards for first user - farm_setup.allow_external_claim_rewards(&first_user); - - let first_receveived_boosted_amt = - farm_setup.claim_boosted_rewards_for_user(&first_user, &second_user); - assert_eq!(first_receveived_boosted_amt, first_boosted_amt); - - // First user should receive the boosted rewards - farm_setup.b_mock.check_esdt_balance( - &first_user, - REWARD_TOKEN_ID, - &rust_biguint!(first_receveived_boosted_amt), - ); -} - #[test] fn farm_change_boosted_yields_factors_test() { DebugApi::dummy(); diff --git a/dex/farm/tests/farm_setup/multi_user_farm_setup.rs b/dex/farm/tests/farm_setup/multi_user_farm_setup.rs index 0168b2bf6..fea83e1d3 100644 --- a/dex/farm/tests/farm_setup/multi_user_farm_setup.rs +++ b/dex/farm/tests/farm_setup/multi_user_farm_setup.rs @@ -2,7 +2,7 @@ #![allow(deprecated)] use common_structs::FarmTokenAttributes; -use config::ConfigModule; +use config::{ConfigModule, UserTotalFarmPosition}; use multiversx_sc::codec::multi_types::OptionalValue; use multiversx_sc::{ storage::mappers::StorageTokenWrapper, @@ -472,6 +472,18 @@ where result } + pub fn claim_boosted_rewards_for_user_expect_error( + &mut self, + owner: &Address, + broker: &Address, + ) { + self.b_mock + .execute_tx(broker, &self.farm_wrapper, &rust_biguint!(0), |sc| { + let _ = sc.claim_boosted_rewards(OptionalValue::Some(managed_address!(owner))); + }) + .assert_error(4, "Cannot claim rewards for this address"); + } + pub fn claim_rewards_known_proxy( &mut self, user: &Address, @@ -551,12 +563,13 @@ where .assert_ok(); } - pub fn allow_external_claim_rewards(&mut self, user: &Address) { + pub fn allow_external_claim_rewards(&mut self, user: &Address, allow_external_claim: bool) { self.b_mock .execute_tx(user, &self.farm_wrapper, &rust_biguint!(0), |sc| { sc.user_total_farm_position(&managed_address!(user)).update( |user_total_farm_position| { - user_total_farm_position.allow_external_claim_boosted_rewards = true; + user_total_farm_position.allow_external_claim_boosted_rewards = + allow_external_claim; }, ); }) @@ -637,4 +650,43 @@ where }) .assert_ok(); } + + pub fn check_farm_token_supply(&mut self, expected_farm_token_supply: u64) { + let b_mock = &mut self.b_mock; + b_mock + .execute_query(&self.farm_wrapper, |sc| { + let actual_farm_supply = sc.farm_token_supply().get(); + assert_eq!( + managed_biguint!(expected_farm_token_supply), + actual_farm_supply + ); + }) + .assert_ok(); + } + + pub fn set_user_total_farm_position(&mut self, user_addr: &Address, new_farm_position: u64) { + self.b_mock + .execute_tx(&self.owner, &self.farm_wrapper, &rust_biguint!(0), |sc| { + let mut user_farm_position = UserTotalFarmPosition::default(); + user_farm_position.total_farm_position = managed_biguint!(new_farm_position); + sc.user_total_farm_position(&managed_address!(&user_addr)) + .set(user_farm_position); + }) + .assert_ok(); + } + + pub fn check_user_total_farm_position(&mut self, user_addr: &Address, expected_amount: u64) { + self.b_mock + .execute_query(&self.farm_wrapper, |sc| { + let user_total_farm_position_mapper = + sc.user_total_farm_position(&managed_address!(&user_addr)); + if expected_amount > 0 && !user_total_farm_position_mapper.is_empty() { + assert_eq!( + managed_biguint!(expected_amount), + user_total_farm_position_mapper.get().total_farm_position + ); + } + }) + .assert_ok(); + } } diff --git a/dex/farm/tests/total_farm_position_test.rs b/dex/farm/tests/total_farm_position_test.rs new file mode 100644 index 000000000..55bc51903 --- /dev/null +++ b/dex/farm/tests/total_farm_position_test.rs @@ -0,0 +1,546 @@ +#![allow(deprecated)] + +mod farm_setup; + +use common_structs::FarmTokenAttributes; +use config::ConfigModule; +use farm_setup::multi_user_farm_setup::{MultiUserFarmSetup, BOOSTED_YIELDS_PERCENTAGE}; +use multiversx_sc_scenario::{managed_address, managed_biguint, rust_biguint, DebugApi}; + +use crate::farm_setup::multi_user_farm_setup::{FARM_TOKEN_ID, REWARD_TOKEN_ID}; + +#[test] +fn total_farm_position_claim_test() { + DebugApi::dummy(); + let mut farm_setup = MultiUserFarmSetup::new( + farm::contract_obj, + energy_factory_mock::contract_obj, + energy_update::contract_obj, + ); + + farm_setup.set_boosted_yields_rewards_percentage(BOOSTED_YIELDS_PERCENTAGE); + farm_setup.set_boosted_yields_factors(); + farm_setup.b_mock.set_block_epoch(2); + + let temp_user = farm_setup.third_user.clone(); + + // first user enter farm + let farm_in_amount = 50_000_000; + let first_user = farm_setup.first_user.clone(); + farm_setup.set_user_energy(&first_user, 1_000, 2, 1); + farm_setup.enter_farm(&first_user, farm_in_amount); + farm_setup.enter_farm(&first_user, farm_in_amount); + + farm_setup.b_mock.check_nft_balance( + &first_user, + FARM_TOKEN_ID, + 1, + &rust_biguint!(farm_in_amount), + Some(&FarmTokenAttributes:: { + reward_per_share: managed_biguint!(0), + compounded_reward: managed_biguint!(0), + entering_epoch: 2, + current_farm_amount: managed_biguint!(farm_in_amount), + original_owner: managed_address!(&first_user), + }), + ); + + farm_setup.b_mock.check_nft_balance( + &first_user, + FARM_TOKEN_ID, + 2, + &rust_biguint!(farm_in_amount), + Some(&FarmTokenAttributes:: { + reward_per_share: managed_biguint!(0), + compounded_reward: managed_biguint!(0), + entering_epoch: 2, + current_farm_amount: managed_biguint!(farm_in_amount), + original_owner: managed_address!(&first_user), + }), + ); + + farm_setup.check_farm_token_supply(farm_in_amount * 2); + + // users claim rewards to get their energy registered + let _ = farm_setup.claim_rewards(&first_user, 1, farm_in_amount); + + // advance blocks - 10 blocks - 10 * 1_000 = 10_000 total rewards + // 7_500 base farm, 2_500 boosted yields + farm_setup.b_mock.set_block_nonce(10); + + // random tx on end of week 1, to cummulate rewards + farm_setup.b_mock.set_block_epoch(6); + farm_setup.set_user_energy(&first_user, 1_000, 6, 1); + farm_setup.set_user_energy(&temp_user, 1, 6, 1); + farm_setup.enter_farm(&temp_user, 1); + farm_setup.exit_farm(&temp_user, 4, 1); + + // advance 1 week + farm_setup.b_mock.set_block_epoch(10); + farm_setup.set_user_energy(&first_user, 1_000, 10, 1); + + let total_farm_tokens = farm_in_amount * 2; + + // first user claim with half total position + let first_base_farm_amt = farm_in_amount * 7_500 / total_farm_tokens; + + // Boosted yields rewards formula + // total_boosted_rewards * (energy_const * user_energy / total_energy + farm_const * user_farm / total_farm) / (energy_const + farm_const) + // (total_boosted_rewards * energy_const * user_energy / total_energy + total_boosted_rewards * farm_const * user_farm / total_farm) / (energy_const + farm_const) + // (2_500 * 3 * 1_000 / 1_000 + 2_500 * 2 * 100_000_000 / 100_000_000) / (3 + 2) + // (7_500 + 2_500) / (5) = 2_500 + let first_boosted_amt = 2_500; // 1000 energy & 100_000_000 farm tokens + let first_total_rewards = first_base_farm_amt + first_boosted_amt; + + let first_received_reward_amt = farm_setup.claim_rewards(&first_user, 3, farm_in_amount); + + // Should be equal to half base generated rewards + full boosted generated rewards + assert_eq!(first_received_reward_amt, first_total_rewards); + + farm_setup + .b_mock + .check_nft_balance::>( + &first_user, + FARM_TOKEN_ID, + 5, + &rust_biguint!(farm_in_amount), + None, + ); + + farm_setup.b_mock.check_esdt_balance( + &first_user, + REWARD_TOKEN_ID, + &rust_biguint!(first_received_reward_amt), + ); +} + +#[test] +fn allow_external_claim_rewards_setting_test() { + DebugApi::dummy(); + let mut farm_setup = MultiUserFarmSetup::new( + farm::contract_obj, + energy_factory_mock::contract_obj, + energy_update::contract_obj, + ); + + farm_setup.set_boosted_yields_rewards_percentage(BOOSTED_YIELDS_PERCENTAGE); + farm_setup.set_boosted_yields_factors(); + farm_setup.b_mock.set_block_epoch(2); + + // first user enter farm + let first_farm_token_amount = 100_000_000; + let first_user = farm_setup.first_user.clone(); + let third_user = farm_setup.third_user.clone(); + + farm_setup.set_user_energy(&first_user, 1_000, 2, 1); + farm_setup.enter_farm(&first_user, first_farm_token_amount); + + // users claim rewards to get their energy registered + let _ = farm_setup.claim_rewards(&first_user, 1, first_farm_token_amount); + + // advance blocks - 10 blocks - 10 * 1_000 = 10_000 total rewards + // 7_500 base farm, 2_500 boosted yields + farm_setup.b_mock.set_block_nonce(10); + + // random tx on end of week 1, to cummulate rewards + farm_setup.b_mock.set_block_epoch(6); + farm_setup.set_user_energy(&first_user, 1_000, 6, 1); + farm_setup.set_user_energy(&third_user, 1, 6, 1); + farm_setup.enter_farm(&third_user, 1); + farm_setup.exit_farm(&third_user, 3, 1); + + // advance 1 week + farm_setup.b_mock.set_block_epoch(10); + farm_setup.set_user_energy(&first_user, 1_000, 10, 1); + + let first_boosted_amt = 2500; + + // Second user claim boosted rewards for first user + farm_setup.allow_external_claim_rewards(&first_user, true); + + let first_received_boosted_amt = + farm_setup.claim_boosted_rewards_for_user(&first_user, &third_user); + assert_eq!(first_received_boosted_amt, first_boosted_amt); + + // First user should receive the boosted rewards + farm_setup.b_mock.check_esdt_balance( + &first_user, + REWARD_TOKEN_ID, + &rust_biguint!(first_received_boosted_amt), + ); + + // Check allow external claim is set to false + farm_setup.allow_external_claim_rewards(&first_user, false); + + farm_setup.claim_boosted_rewards_for_user_expect_error(&first_user, &third_user); +} + +#[test] +fn test_total_farm_position_claim_for_other_test() { + DebugApi::dummy(); + let mut farm_setup = MultiUserFarmSetup::new( + farm::contract_obj, + energy_factory_mock::contract_obj, + energy_update::contract_obj, + ); + + farm_setup.set_boosted_yields_rewards_percentage(BOOSTED_YIELDS_PERCENTAGE); + farm_setup.set_boosted_yields_factors(); + farm_setup.b_mock.set_block_epoch(2); + + // first user enter farm + let first_farm_token_amount = 100_000_000; + let first_user = farm_setup.first_user.clone(); + let third_user = farm_setup.third_user.clone(); + + farm_setup.set_user_energy(&first_user, 1_000, 2, 1); + farm_setup.enter_farm(&first_user, first_farm_token_amount); + + // second user enter farm + let second_farm_token_amount = 50_000_000; + let second_user = farm_setup.second_user.clone(); + farm_setup.set_user_energy(&second_user, 4_000, 2, 1); + farm_setup.enter_farm(&second_user, second_farm_token_amount); + + // users claim rewards to get their energy registered + let _ = farm_setup.claim_rewards(&first_user, 1, first_farm_token_amount); + let _ = farm_setup.claim_rewards(&second_user, 2, second_farm_token_amount); + + // advance blocks - 10 blocks - 10 * 1_000 = 10_000 total rewards + // 7_500 base farm, 2_500 boosted yields + farm_setup.b_mock.set_block_nonce(10); + + // random tx on end of week 1, to cummulate rewards + farm_setup.b_mock.set_block_epoch(6); + farm_setup.set_user_energy(&first_user, 1_000, 6, 1); + farm_setup.set_user_energy(&second_user, 4_000, 6, 1); + farm_setup.set_user_energy(&third_user, 1, 6, 1); + farm_setup.enter_farm(&third_user, 1); + farm_setup.exit_farm(&third_user, 5, 1); + + // advance 1 week + farm_setup.b_mock.set_block_epoch(10); + farm_setup.set_user_energy(&first_user, 1_000, 10, 1); + farm_setup.set_user_energy(&second_user, 4_000, 10, 1); + + // Second user claims for himself + let total_farm_tokens = first_farm_token_amount + second_farm_token_amount; + let second_base_farm_amt = second_farm_token_amount * 7_500 / total_farm_tokens; + let second_boosted_amt = 1533; // 4000 energy & 50_000_000 farm tokens + let second_total = second_base_farm_amt + second_boosted_amt; + + let second_received_reward_amt = + farm_setup.claim_rewards(&second_user, 4, second_farm_token_amount); + assert_eq!(second_received_reward_amt, second_total); + + farm_setup + .b_mock + .check_nft_balance::>( + &second_user, + FARM_TOKEN_ID, + 6, + &rust_biguint!(second_farm_token_amount), + None, + ); + + farm_setup.b_mock.check_esdt_balance( + &second_user, + REWARD_TOKEN_ID, + &rust_biguint!(second_received_reward_amt), + ); + + // Boosted yields rewards formula + // total_boosted_rewards * (energy_const * user_energy / total_energy + farm_const * user_farm / total_farm) / (energy_const + farm_const) + // (total_boosted_rewards * energy_const * user_energy / total_energy + total_boosted_rewards * farm_const * user_farm / total_farm) / (energy_const + farm_const) + // (2500 * 3 * 1_000 / 5_000 + 2500 * 2 * 100_000_000 / 150_000_000) / (3 + 2) + // (1500 + 3333) / (5) = 966 + let first_boosted_amt = 966; // 1000 energy & 100_000_000 farm tokens + + // Second user claim boosted rewards for first user + farm_setup.allow_external_claim_rewards(&first_user, true); + + let first_received_boosted_amt = + farm_setup.claim_boosted_rewards_for_user(&first_user, &second_user); + assert_eq!(first_received_boosted_amt, first_boosted_amt); + + // First user should receive the boosted rewards + farm_setup.b_mock.check_esdt_balance( + &first_user, + REWARD_TOKEN_ID, + &rust_biguint!(first_received_boosted_amt), + ); +} + +#[test] +fn farm_total_position_migration_test() { + DebugApi::dummy(); + let mut farm_setup = MultiUserFarmSetup::new( + farm::contract_obj, + energy_factory_mock::contract_obj, + energy_update::contract_obj, + ); + + farm_setup.set_boosted_yields_rewards_percentage(BOOSTED_YIELDS_PERCENTAGE); + farm_setup.set_boosted_yields_factors(); + farm_setup.b_mock.set_block_epoch(2); + + let temp_user = farm_setup.third_user.clone(); + + // first user enter farm + let farm_in_amount = 50_000_000; + let first_user = farm_setup.first_user.clone(); + farm_setup.set_user_energy(&first_user, 1_000, 2, 1); + farm_setup.enter_farm(&first_user, farm_in_amount); + + // Remove current farm position from storage + farm_setup.set_user_total_farm_position(&first_user, 0); + farm_setup.check_user_total_farm_position(&first_user, 0); + + // User enters farm again + farm_setup.enter_farm(&first_user, farm_in_amount); + farm_setup.check_user_total_farm_position(&first_user, farm_in_amount); + + // Set farm position migration nonce + farm_setup + .b_mock + .execute_tx( + &farm_setup.owner, + &farm_setup.farm_wrapper, + &rust_biguint!(0), + |sc| { + sc.farm_position_migration_nonce().set(2); + }, + ) + .assert_ok(); + + farm_setup.check_farm_token_supply(farm_in_amount * 2); + + // users claim rewards to get their energy registered + let _ = farm_setup.claim_rewards(&first_user, 2, farm_in_amount); + + // advance blocks - 10 blocks - 10 * 1_000 = 10_000 total rewards + // 7_500 base farm, 2_500 boosted yields + farm_setup.b_mock.set_block_nonce(10); + + // random tx on end of week 1, to cummulate rewards + farm_setup.b_mock.set_block_epoch(6); + farm_setup.set_user_energy(&first_user, 1_000, 6, 1); + farm_setup.set_user_energy(&temp_user, 1, 6, 1); + farm_setup.enter_farm(&temp_user, 1); + farm_setup.exit_farm(&temp_user, 4, 1); + + // advance 1 week + farm_setup.b_mock.set_block_epoch(10); + farm_setup.set_user_energy(&first_user, 1_000, 10, 1); + + let total_farm_tokens = farm_in_amount * 2; + + // first user claim with half total position + let first_base_farm_amt = farm_in_amount * 7_500 / total_farm_tokens; + + let first_boosted_amt = 2_000; // claim boosted with only half total position - not full rewards + let first_total_rewards = first_base_farm_amt + first_boosted_amt; + + let first_received_reward_amt = farm_setup.claim_rewards(&first_user, 3, farm_in_amount); + + // Should be equal to half base generated rewards + partial boosted generated rewards + assert_eq!(first_received_reward_amt, first_total_rewards); + + farm_setup + .b_mock + .check_nft_balance::>( + &first_user, + FARM_TOKEN_ID, + 5, + &rust_biguint!(farm_in_amount), + None, + ); + + farm_setup.b_mock.check_esdt_balance( + &first_user, + REWARD_TOKEN_ID, + &rust_biguint!(first_received_reward_amt), + ); + + // advance 10 more blocks - 10_000 more total rewards + // 7_500 base farm, 2_500 boosted yields + farm_setup.b_mock.set_block_nonce(20); + + // random tx on end of week 2, to cummulate rewards + farm_setup.b_mock.set_block_epoch(13); + farm_setup.set_user_energy(&first_user, 1_000, 13, 1); + farm_setup.set_user_energy(&temp_user, 1, 13, 1); + farm_setup.enter_farm(&temp_user, 1); + farm_setup.exit_farm(&temp_user, 6, 1); + + // advance 1 week + farm_setup.b_mock.set_block_epoch(20); + farm_setup.set_user_energy(&first_user, 1_000, 20, 1); + + // user claims with old position - should migrate his entire position + let second_received_reward_amt = farm_setup.claim_rewards(&first_user, 1, farm_in_amount); + + let second_base_farm_amt = (farm_in_amount * 7_500 / total_farm_tokens) * 2; // user claims with initial position (2 weeks worth of rewards) + let second_boosted_amt = 2_500; // claim boosted with entire total position - receives full rewards + let second_total_rewards = second_base_farm_amt + second_boosted_amt; + assert_eq!(second_received_reward_amt, second_total_rewards); +} + +#[test] +fn farm_total_position_exit_migration_test() { + DebugApi::dummy(); + let mut farm_setup = MultiUserFarmSetup::new( + farm::contract_obj, + energy_factory_mock::contract_obj, + energy_update::contract_obj, + ); + + farm_setup.set_boosted_yields_rewards_percentage(BOOSTED_YIELDS_PERCENTAGE); + farm_setup.set_boosted_yields_factors(); + farm_setup.b_mock.set_block_epoch(2); + + let temp_user = farm_setup.third_user.clone(); + + // first user enter farm + let farm_in_amount = 50_000_000; + let first_user = farm_setup.first_user.clone(); + farm_setup.set_user_energy(&first_user, 1_000, 2, 1); + farm_setup.enter_farm(&first_user, farm_in_amount); + + // Remove current farm position from storage + farm_setup.set_user_total_farm_position(&first_user, 0); + farm_setup.check_user_total_farm_position(&first_user, 0); + + // User enters farm again + farm_setup.enter_farm(&first_user, farm_in_amount); + farm_setup.check_user_total_farm_position(&first_user, farm_in_amount); + + // Set farm position migration nonce + farm_setup + .b_mock + .execute_tx( + &farm_setup.owner, + &farm_setup.farm_wrapper, + &rust_biguint!(0), + |sc| { + sc.farm_position_migration_nonce().set(2); + }, + ) + .assert_ok(); + + farm_setup.check_farm_token_supply(farm_in_amount * 2); + + // users claim rewards to get their energy registered + let _ = farm_setup.claim_rewards(&first_user, 2, farm_in_amount); + + // advance blocks - 10 blocks - 10 * 1_000 = 10_000 total rewards + // 7_500 base farm, 2_500 boosted yields + farm_setup.b_mock.set_block_nonce(10); + + // random tx on end of week 1, to cummulate rewards + farm_setup.b_mock.set_block_epoch(6); + farm_setup.set_user_energy(&first_user, 1_000, 6, 1); + farm_setup.set_user_energy(&temp_user, 1, 6, 1); + farm_setup.enter_farm(&temp_user, 1); + farm_setup.exit_farm(&temp_user, 4, 1); + + // advance 1 week + farm_setup.b_mock.set_block_epoch(10); + farm_setup.set_user_energy(&first_user, 1_000, 10, 1); + + // first user exist farm with old position + farm_setup.exit_farm(&first_user, 1, farm_in_amount); + + // user farm position should be unchanged + farm_setup.check_user_total_farm_position(&first_user, farm_in_amount); + + // User should receive half base rewards and full boosted rewards + let total_farm_tokens = farm_in_amount * 2; + let first_base_farm_amt = farm_in_amount * 7_500 / total_farm_tokens; + let first_boosted_amt = 2_500; + let first_total_rewards = first_base_farm_amt + first_boosted_amt; + farm_setup.b_mock.check_esdt_balance( + &first_user, + REWARD_TOKEN_ID, + &rust_biguint!(first_total_rewards), + ); +} + +#[test] +fn no_boosted_rewards_penalty_for_exit_farm_test() { + DebugApi::dummy(); + DebugApi::dummy(); + let mut farm_setup = MultiUserFarmSetup::new( + farm::contract_obj, + energy_factory_mock::contract_obj, + energy_update::contract_obj, + ); + + farm_setup.set_boosted_yields_rewards_percentage(BOOSTED_YIELDS_PERCENTAGE); + farm_setup.set_boosted_yields_factors(); + farm_setup.b_mock.set_block_epoch(5); + + let temp_user = farm_setup.third_user.clone(); + + // first user enter farm + let farm_in_amount = 50_000_000; + let first_user = farm_setup.first_user.clone(); + farm_setup.set_user_energy(&first_user, 1_000, 5, 1); + farm_setup.enter_farm(&first_user, farm_in_amount); + farm_setup.enter_farm(&first_user, farm_in_amount); + + // users claim rewards to get their energy registered + let _ = farm_setup.claim_rewards(&first_user, 2, farm_in_amount); + + // advance to week 1 + + // advance blocks - 10 blocks - 10 * 1_000 = 10_000 total rewards + // 7_500 base farm, 2_500 boosted yields + farm_setup.b_mock.set_block_nonce(10); + + // random tx on end of the week, to cummulate rewards + farm_setup.b_mock.set_block_epoch(6); + farm_setup.set_user_energy(&first_user, 1_000, 6, 1); + farm_setup.set_user_energy(&temp_user, 1, 6, 1); + farm_setup.enter_farm(&temp_user, 1); + farm_setup.exit_farm(&temp_user, 4, 1); + + // advance to week 2 + farm_setup.b_mock.set_block_nonce(20); + + // random tx on end of the week, to cummulate rewards + farm_setup.b_mock.set_block_epoch(13); + farm_setup.set_user_energy(&temp_user, 1, 13, 1); + farm_setup.enter_farm(&temp_user, 1); + farm_setup.exit_farm(&temp_user, 5, 1); + + // advance to week 3 + farm_setup.b_mock.set_block_nonce(30); + + // random tx on end of the week, to cummulate rewards + farm_setup.b_mock.set_block_epoch(20); + farm_setup.set_user_energy(&temp_user, 1, 20, 1); + farm_setup.enter_farm(&temp_user, 1); + farm_setup.exit_farm(&temp_user, 6, 1); + + // advance to week 4 + farm_setup.b_mock.set_block_epoch(25); + farm_setup.set_user_energy(&first_user, 0, 25, 1); + + // first user claims 3 weeks worth of rewards (2-4) + let total_farm_tokens = farm_in_amount * 2; + let first_base_farm_amt = (farm_in_amount * 7_500 / total_farm_tokens) * 3; + let first_boosted_amt = 2_500 * 3; + let first_total_rewards = first_base_farm_amt + first_boosted_amt; + + let first_receveived_reward_amt = farm_setup.claim_rewards(&first_user, 1, farm_in_amount); + + // Should be equal to half base generated rewards + full boosted generated rewards + assert_eq!(first_receveived_reward_amt, first_total_rewards); + + farm_setup.b_mock.check_esdt_balance( + &first_user, + REWARD_TOKEN_ID, + &rust_biguint!(first_receveived_reward_amt), + ); +} From 772779a56f237b148a77539a303525c12fd6eaad Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Tue, 26 Sep 2023 14:16:21 +0300 Subject: [PATCH 093/213] allow_external_claim_rewards_setting extra check --- dex/farm/tests/farm_setup/multi_user_farm_setup.rs | 10 ++++++---- dex/farm/tests/total_farm_position_test.rs | 5 +++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/dex/farm/tests/farm_setup/multi_user_farm_setup.rs b/dex/farm/tests/farm_setup/multi_user_farm_setup.rs index fea83e1d3..2e74ab42c 100644 --- a/dex/farm/tests/farm_setup/multi_user_farm_setup.rs +++ b/dex/farm/tests/farm_setup/multi_user_farm_setup.rs @@ -667,9 +667,11 @@ where pub fn set_user_total_farm_position(&mut self, user_addr: &Address, new_farm_position: u64) { self.b_mock .execute_tx(&self.owner, &self.farm_wrapper, &rust_biguint!(0), |sc| { - let mut user_farm_position = UserTotalFarmPosition::default(); - user_farm_position.total_farm_position = managed_biguint!(new_farm_position); - sc.user_total_farm_position(&managed_address!(&user_addr)) + let user_farm_position = UserTotalFarmPosition { + total_farm_position: managed_biguint!(new_farm_position), + ..Default::default() + }; + sc.user_total_farm_position(&managed_address!(user_addr)) .set(user_farm_position); }) .assert_ok(); @@ -679,7 +681,7 @@ where self.b_mock .execute_query(&self.farm_wrapper, |sc| { let user_total_farm_position_mapper = - sc.user_total_farm_position(&managed_address!(&user_addr)); + sc.user_total_farm_position(&managed_address!(user_addr)); if expected_amount > 0 && !user_total_farm_position_mapper.is_empty() { assert_eq!( managed_biguint!(expected_amount), diff --git a/dex/farm/tests/total_farm_position_test.rs b/dex/farm/tests/total_farm_position_test.rs index 55bc51903..a15287e44 100644 --- a/dex/farm/tests/total_farm_position_test.rs +++ b/dex/farm/tests/total_farm_position_test.rs @@ -169,6 +169,11 @@ fn allow_external_claim_rewards_setting_test() { &rust_biguint!(first_received_boosted_amt), ); + // User who called the claim function should not receive anything + farm_setup + .b_mock + .check_esdt_balance(&third_user, REWARD_TOKEN_ID, &rust_biguint!(0)); + // Check allow external claim is set to false farm_setup.allow_external_claim_rewards(&first_user, false); From d790945bbd94b1515259963e77a8acd842524f2a Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Tue, 26 Sep 2023 14:24:47 +0300 Subject: [PATCH 094/213] total_farm_position_claim_for_other extra check --- dex/farm/tests/total_farm_position_test.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dex/farm/tests/total_farm_position_test.rs b/dex/farm/tests/total_farm_position_test.rs index a15287e44..1dbfc672b 100644 --- a/dex/farm/tests/total_farm_position_test.rs +++ b/dex/farm/tests/total_farm_position_test.rs @@ -181,7 +181,7 @@ fn allow_external_claim_rewards_setting_test() { } #[test] -fn test_total_farm_position_claim_for_other_test() { +fn total_farm_position_claim_for_other_test() { DebugApi::dummy(); let mut farm_setup = MultiUserFarmSetup::new( farm::contract_obj, @@ -274,6 +274,13 @@ fn test_total_farm_position_claim_for_other_test() { REWARD_TOKEN_ID, &rust_biguint!(first_received_boosted_amt), ); + + // Second user has the same amount of reward tokens + farm_setup.b_mock.check_esdt_balance( + &second_user, + REWARD_TOKEN_ID, + &rust_biguint!(second_received_reward_amt), + ); } #[test] From 0ee2b4271e8f8f1948bf0acd4fbf423fae962c69 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Tue, 26 Sep 2023 14:43:30 +0300 Subject: [PATCH 095/213] farm position tests updates --- dex/farm/tests/total_farm_position_test.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dex/farm/tests/total_farm_position_test.rs b/dex/farm/tests/total_farm_position_test.rs index 1dbfc672b..26756ebaa 100644 --- a/dex/farm/tests/total_farm_position_test.rs +++ b/dex/farm/tests/total_farm_position_test.rs @@ -392,6 +392,8 @@ fn farm_total_position_migration_test() { // user claims with old position - should migrate his entire position let second_received_reward_amt = farm_setup.claim_rewards(&first_user, 1, farm_in_amount); + farm_setup.check_user_total_farm_position(&first_user, farm_in_amount * 2); + let second_base_farm_amt = (farm_in_amount * 7_500 / total_farm_tokens) * 2; // user claims with initial position (2 weeks worth of rewards) let second_boosted_amt = 2_500; // claim boosted with entire total position - receives full rewards let second_total_rewards = second_base_farm_amt + second_boosted_amt; @@ -479,7 +481,7 @@ fn farm_total_position_exit_migration_test() { } #[test] -fn no_boosted_rewards_penalty_for_exit_farm_test() { +fn no_boosted_rewards_penalty_for_no_energy_test() { DebugApi::dummy(); DebugApi::dummy(); let mut farm_setup = MultiUserFarmSetup::new( @@ -519,9 +521,12 @@ fn no_boosted_rewards_penalty_for_exit_farm_test() { // advance to week 2 farm_setup.b_mock.set_block_nonce(20); + farm_setup.b_mock.set_block_epoch(13); + + // User unlocks XMEX and has no energy + farm_setup.set_user_energy(&first_user, 0, 13, 1); // random tx on end of the week, to cummulate rewards - farm_setup.b_mock.set_block_epoch(13); farm_setup.set_user_energy(&temp_user, 1, 13, 1); farm_setup.enter_farm(&temp_user, 1); farm_setup.exit_farm(&temp_user, 5, 1); @@ -537,7 +542,6 @@ fn no_boosted_rewards_penalty_for_exit_farm_test() { // advance to week 4 farm_setup.b_mock.set_block_epoch(25); - farm_setup.set_user_energy(&first_user, 0, 25, 1); // first user claims 3 weeks worth of rewards (2-4) let total_farm_tokens = farm_in_amount * 2; From 40410d3092a7e0e7106d482af59d256d315343ec Mon Sep 17 00:00:00 2001 From: Dorin Marian Iancu Date: Thu, 28 Sep 2023 11:45:14 +0300 Subject: [PATCH 096/213] proxy pair impl --- locked-asset/energy-factory/src/lib.rs | 39 ++++++++++++++- locked-asset/proxy_dex/src/energy_update.rs | 20 ++++++-- locked-asset/proxy_dex/src/proxy_pair.rs | 54 +++++++++++++++++++++ 3 files changed, 107 insertions(+), 6 deletions(-) diff --git a/locked-asset/energy-factory/src/lib.rs b/locked-asset/energy-factory/src/lib.rs index 0b79aa0d7..419527336 100644 --- a/locked-asset/energy-factory/src/lib.rs +++ b/locked-asset/energy-factory/src/lib.rs @@ -118,7 +118,6 @@ pub trait SimpleLockEnergy: let dest_address = self.dest_from_optional(opt_destination); let current_epoch = self.blockchain().get_block_epoch(); let unlock_epoch = self.unlock_epoch_to_start_of_month(current_epoch + lock_epochs); - require!( unlock_epoch > current_epoch, "Unlock epoch must be greater than the current epoch" @@ -184,4 +183,42 @@ pub trait SimpleLockEnergy: output_payment } + + /// Used internally by proxy-dex + #[payable("*")] + #[endpoint(extendLockPeriod)] + fn extend_lock_period(&self, lock_epochs: Epoch, user: ManagedAddress) -> EsdtTokenPayment { + self.require_not_paused(); + self.require_is_listed_lock_option(lock_epochs); + + let caller = self.blockchain().get_caller(); + require!( + self.token_transfer_whitelist().contains(&caller), + "May not call this endpoint. Use lockTokens instead" + ); + + let payment = self.call_value().single_esdt(); + self.locked_token() + .require_same_token(&payment.token_identifier); + + let current_epoch = self.blockchain().get_block_epoch(); + let unlock_epoch = self.unlock_epoch_to_start_of_month(current_epoch + lock_epochs); + require!( + unlock_epoch > current_epoch, + "Unlock epoch must be greater than the current epoch" + ); + + let output_tokens = self.update_energy(&user, |energy: &mut Energy| { + self.extend_new_token_period(payment, unlock_epoch, current_epoch, energy) + }); + + self.send().direct_esdt( + &caller, + &output_tokens.token_identifier, + output_tokens.token_nonce, + &output_tokens.amount, + ); + + output_tokens + } } diff --git a/locked-asset/proxy_dex/src/energy_update.rs b/locked-asset/proxy_dex/src/energy_update.rs index 4242350ca..9bc045b6d 100644 --- a/locked-asset/proxy_dex/src/energy_update.rs +++ b/locked-asset/proxy_dex/src/energy_update.rs @@ -1,7 +1,7 @@ multiversx_sc::imports!(); -use common_structs::Nonce; -use energy_factory::locked_token_transfer::ProxyTrait as _; +use common_structs::{Epoch, Nonce}; +use energy_factory::{locked_token_transfer::ProxyTrait as _, ProxyTrait as _}; use energy_query::Energy; use simple_lock::locked_token::LockedTokenAttributes; @@ -46,9 +46,6 @@ pub trait EnergyUpdateModule: .get_token_attributes(token_id, token_nonce); energy.update_after_unlock_any(token_amount, attributes.unlock_epoch, current_epoch); } else if token_id == &old_locked_token_id { - if self.blockchain().is_smart_contract(user) { - return; - } let attributes = self.decode_legacy_token(token_id, token_nonce); let epoch_amount_pairs = attributes.get_unlock_amounts_per_epoch(token_amount); for pair in epoch_amount_pairs.pairs { @@ -62,6 +59,19 @@ pub trait EnergyUpdateModule: self.set_energy_in_factory(user.clone(), energy, energy_factory_addr); } + fn call_increase_energy( + &self, + user: ManagedAddress, + old_tokens: EsdtTokenPayment, + lock_epochs: Epoch, + energy_factory_addr: ManagedAddress, + ) -> EsdtTokenPayment { + self.energy_factory_proxy(energy_factory_addr) + .extend_lock_period(lock_epochs, user) + .with_esdt_transfer(old_tokens) + .execute_on_dest_context() + } + fn set_energy_in_factory( &self, user: ManagedAddress, diff --git a/locked-asset/proxy_dex/src/proxy_pair.rs b/locked-asset/proxy_dex/src/proxy_pair.rs index 5045e0961..57708aa8e 100644 --- a/locked-asset/proxy_dex/src/proxy_pair.rs +++ b/locked-asset/proxy_dex/src/proxy_pair.rs @@ -6,6 +6,7 @@ multiversx_sc::imports!(); multiversx_sc::derive_imports!(); use crate::wrapped_lp_attributes::{WrappedLpToken, WrappedLpTokenAttributes}; +use common_structs::Epoch; use fixed_supply_token::FixedSupplyToken; #[multiversx_sc::module] @@ -221,6 +222,59 @@ pub trait ProxyPairModule: output_payments.into() } + #[payable("*")] + #[endpoint(increaseProxyPairTokenEnergy)] + fn increase_proxy_pair_token_energy_endpoint(&self, lock_epochs: Epoch) -> EsdtTokenPayment { + self.require_wrapped_lp_token_id_not_empty(); + + let payment = self.call_value().single_esdt(); + let wrapped_lp_mapper = self.wrapped_lp_token(); + wrapped_lp_mapper.require_same_token(&payment.token_identifier); + + let caller = self.blockchain().get_caller(); + let old_attributes: WrappedLpTokenAttributes = + self.get_attributes_as_part_of_fixed_supply(&payment, &wrapped_lp_mapper); + + let new_locked_tokens = self.increase_proxy_pair_token_energy( + caller.clone(), + payment.clone(), + lock_epochs, + &old_attributes, + ); + let new_token_attributes = WrappedLpTokenAttributes { + locked_tokens: new_locked_tokens, + lp_token_id: old_attributes.lp_token_id, + lp_token_amount: old_attributes.lp_token_amount, + }; + + self.send().esdt_local_burn( + &payment.token_identifier, + payment.token_nonce, + &payment.amount, + ); + + let new_token_amount = new_token_attributes.get_total_supply(); + + wrapped_lp_mapper.nft_create_and_send(&caller, new_token_amount, &new_token_attributes) + } + + fn increase_proxy_pair_token_energy( + &self, + user: ManagedAddress, + payment: EsdtTokenPayment, + lock_epochs: Epoch, + old_attributes: &WrappedLpTokenAttributes, + ) -> EsdtTokenPayment { + let new_locked_token_id = self.get_locked_token_id(); + require!( + old_attributes.locked_tokens.token_identifier == new_locked_token_id, + "Invalid payment" + ); + + let energy_factory_addr = self.energy_factory_address().get(); + self.call_increase_energy(user, payment, lock_epochs, energy_factory_addr) + } + fn require_wrapped_lp_token_id_not_empty(&self) { require!(!self.wrapped_lp_token().is_empty(), "Empty token id"); } From 4262fa1e8ba883b5f0e7e9438488fd5d2d580ddc Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Thu, 28 Sep 2023 19:36:45 +0300 Subject: [PATCH 097/213] farm staking full position claim test --- .../tests/farm_staking_energy_test.rs | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) diff --git a/farm-staking/farm-staking/tests/farm_staking_energy_test.rs b/farm-staking/farm-staking/tests/farm_staking_energy_test.rs index b2c3c5b3f..230d84747 100644 --- a/farm-staking/farm-staking/tests/farm_staking_energy_test.rs +++ b/farm-staking/farm-staking/tests/farm_staking_energy_test.rs @@ -245,3 +245,114 @@ fn farm_staking_claim_boosted_rewards_for_user_test() { ); fs_setup.check_farm_token_supply(farm_in_amount); } + +#[test] +fn farm_staking_full_position_boosted_rewards_test() { + DebugApi::dummy(); + let mut fs_setup = + FarmStakingSetup::new(farm_staking::contract_obj, energy_factory::contract_obj); + + fs_setup.set_boosted_yields_factors(); + fs_setup.set_boosted_yields_rewards_percentage(BOOSTED_YIELDS_PERCENTAGE); + + fs_setup.set_user_energy(&fs_setup.user_address.clone(), 10_000, 0, 10); + + let farm_in_amount = 50_000_000; + fs_setup.stake_farm(farm_in_amount, &[], 1, 0, 0); + fs_setup.stake_farm(farm_in_amount, &[], 2, 0, 0); + fs_setup.check_farm_token_supply(farm_in_amount * 2); + + // claim to get energy registered + fs_setup + .b_mock + .execute_esdt_transfer( + &fs_setup.user_address, + &fs_setup.farm_wrapper, + FARM_TOKEN_ID, + 1, + &rust_biguint!(farm_in_amount), + |sc| { + let _ = sc.claim_rewards(OptionalValue::None); + }, + ) + .assert_ok(); + + fs_setup.set_block_nonce(10); + + // random user tx to collect rewards + + let rand_user = fs_setup.b_mock.create_user_account(&rust_biguint!(0)); + fs_setup.b_mock.set_esdt_balance( + &rand_user, + FARMING_TOKEN_ID, + &rust_biguint!(USER_TOTAL_RIDE_TOKENS), + ); + + fs_setup.set_user_energy(&rand_user, 1, 5, 1); + fs_setup.set_block_epoch(5); + + fs_setup + .b_mock + .execute_esdt_transfer( + &rand_user, + &fs_setup.farm_wrapper, + FARMING_TOKEN_ID, + 0, + &rust_biguint!(10), + |sc| { + let _ = sc.stake_farm_endpoint(OptionalValue::None); + }, + ) + .assert_ok(); + + fs_setup + .b_mock + .execute_esdt_transfer( + &rand_user, + &fs_setup.farm_wrapper, + FARM_TOKEN_ID, + 4, + &rust_biguint!(10), + |sc| { + let _ = sc.unstake_farm(OptionalValue::None); + }, + ) + .assert_ok(); + + fs_setup.set_block_epoch(8); + + fs_setup.set_user_energy(&fs_setup.user_address.clone(), 10_000, 8, 10); + + let expected_base_rewards = 15; + let expected_boosted_rewards = 10; + let mut expected_farming_token_balance = rust_biguint!( + USER_TOTAL_RIDE_TOKENS - (farm_in_amount * 2) + + expected_base_rewards + + expected_boosted_rewards + ); + let expected_reward_per_share = 300_000; // from 400_000 -> 300_000 + + // Should receive half base rewards and full boosted rewards + fs_setup.claim_rewards( + farm_in_amount, + 2, + expected_base_rewards + expected_boosted_rewards, + &expected_farming_token_balance, + &expected_farming_token_balance, + 6, + expected_reward_per_share, + ); + + // Should receive half base rewards and no boosted rewards + expected_farming_token_balance += expected_base_rewards; + fs_setup.claim_rewards( + farm_in_amount, + 3, + expected_base_rewards, + &expected_farming_token_balance, + &expected_farming_token_balance, + 7, + expected_reward_per_share, + ); + fs_setup.check_farm_token_supply(farm_in_amount * 2); +} From 02105491d1204d19e24fcdb4d17fcdde90b26b4a Mon Sep 17 00:00:00 2001 From: Dorin Marian Iancu Date: Fri, 29 Sep 2023 09:35:33 +0300 Subject: [PATCH 098/213] wrapped lp test + fix --- locked-asset/proxy_dex/src/proxy_pair.rs | 16 +- locked-asset/proxy_dex/tests/proxy_lp_test.rs | 143 ++++++++++++++++++ 2 files changed, 151 insertions(+), 8 deletions(-) diff --git a/locked-asset/proxy_dex/src/proxy_pair.rs b/locked-asset/proxy_dex/src/proxy_pair.rs index 57708aa8e..e6a2f4d1b 100644 --- a/locked-asset/proxy_dex/src/proxy_pair.rs +++ b/locked-asset/proxy_dex/src/proxy_pair.rs @@ -235,12 +235,8 @@ pub trait ProxyPairModule: let old_attributes: WrappedLpTokenAttributes = self.get_attributes_as_part_of_fixed_supply(&payment, &wrapped_lp_mapper); - let new_locked_tokens = self.increase_proxy_pair_token_energy( - caller.clone(), - payment.clone(), - lock_epochs, - &old_attributes, - ); + let new_locked_tokens = + self.increase_proxy_pair_token_energy(caller.clone(), lock_epochs, &old_attributes); let new_token_attributes = WrappedLpTokenAttributes { locked_tokens: new_locked_tokens, lp_token_id: old_attributes.lp_token_id, @@ -261,7 +257,6 @@ pub trait ProxyPairModule: fn increase_proxy_pair_token_energy( &self, user: ManagedAddress, - payment: EsdtTokenPayment, lock_epochs: Epoch, old_attributes: &WrappedLpTokenAttributes, ) -> EsdtTokenPayment { @@ -272,7 +267,12 @@ pub trait ProxyPairModule: ); let energy_factory_addr = self.energy_factory_address().get(); - self.call_increase_energy(user, payment, lock_epochs, energy_factory_addr) + self.call_increase_energy( + user, + old_attributes.locked_tokens.clone(), + lock_epochs, + energy_factory_addr, + ) } fn require_wrapped_lp_token_id_not_empty(&self) { diff --git a/locked-asset/proxy_dex/tests/proxy_lp_test.rs b/locked-asset/proxy_dex/tests/proxy_lp_test.rs index 1f025ca67..9c3710bb7 100644 --- a/locked-asset/proxy_dex/tests/proxy_lp_test.rs +++ b/locked-asset/proxy_dex/tests/proxy_lp_test.rs @@ -798,3 +798,146 @@ fn wrapped_different_nonce_lp_token_merge_test() { }), ); } + +#[test] +fn increase_proxy_lp_token_energy() { + let mut setup = ProxySetup::new( + proxy_dex::contract_obj, + pair::contract_obj, + farm_with_locked_rewards::contract_obj, + energy_factory::contract_obj, + ); + let first_user = setup.first_user.clone(); + let full_balance = rust_biguint!(USER_BALANCE); + let locked_token_amount = rust_biguint!(1_000_000_000); + let other_token_amount = rust_biguint!(500_000_000); + let expected_lp_token_amount = rust_biguint!(499_999_000); + + // set the price to 1 EGLD = 2 MEX + let payments = vec![ + TxTokenTransfer { + token_identifier: LOCKED_TOKEN_ID.to_vec(), + nonce: 1, + value: locked_token_amount.clone(), + }, + TxTokenTransfer { + token_identifier: WEGLD_TOKEN_ID.to_vec(), + nonce: 0, + value: other_token_amount.clone(), + }, + ]; + + // add liquidity + let pair_addr = setup.pair_wrapper.address_ref().clone(); + setup + .b_mock + .execute_esdt_multi_transfer(&first_user, &setup.proxy_wrapper, &payments, |sc| { + sc.add_liquidity_proxy( + managed_address!(&pair_addr), + managed_biguint!(locked_token_amount.to_u64().unwrap()), + managed_biguint!(other_token_amount.to_u64().unwrap()), + ); + }) + .assert_ok(); + + // check user's balance + setup.b_mock.check_nft_balance::( + &first_user, + LOCKED_TOKEN_ID, + 1, + &(&full_balance - &locked_token_amount), + None, + ); + setup.b_mock.check_esdt_balance( + &first_user, + WEGLD_TOKEN_ID, + &(&full_balance - &other_token_amount), + ); + setup.b_mock.check_nft_balance( + &first_user, + WRAPPED_LP_TOKEN_ID, + 1, + &expected_lp_token_amount, + Some(&WrappedLpTokenAttributes:: { + locked_tokens: EsdtTokenPayment { + token_identifier: managed_token_id!(LOCKED_TOKEN_ID), + token_nonce: 1, + amount: managed_biguint!(locked_token_amount.to_u64().unwrap()), + }, + lp_token_id: managed_token_id!(LP_TOKEN_ID), + lp_token_amount: managed_biguint!(expected_lp_token_amount.to_u64().unwrap()), + }), + ); + + let block_epoch = 1; + let user_locked_tokens_in_lp = locked_token_amount.to_u64().unwrap(); + + // check user energy before + setup + .b_mock + .execute_query(&setup.simple_lock_wrapper, |sc| { + let lock_epochs = LOCK_OPTIONS[0] - block_epoch; + let expected_energy_amount = + BigInt::from((USER_BALANCE) as i64) * BigInt::from(lock_epochs as i64); + let expected_energy = Energy::new( + expected_energy_amount, + block_epoch, + managed_biguint!(USER_BALANCE), + ); + let actual_energy = sc.user_energy(&managed_address!(&first_user)).get(); + assert_eq!(expected_energy, actual_energy); + }) + .assert_ok(); + + // call increase energy + setup + .b_mock + .execute_esdt_transfer( + &setup.first_user, + &setup.proxy_wrapper, + WRAPPED_LP_TOKEN_ID, + 1, + &expected_lp_token_amount, + |sc| { + let _ = sc.increase_proxy_pair_token_energy_endpoint(LOCK_OPTIONS[1]); + }, + ) + .assert_ok(); + + // chceck new wrapped lp token + setup.b_mock.check_nft_balance( + &first_user, + WRAPPED_LP_TOKEN_ID, + 2, + &expected_lp_token_amount, + Some(&WrappedLpTokenAttributes:: { + locked_tokens: EsdtTokenPayment { + token_identifier: managed_token_id!(LOCKED_TOKEN_ID), + token_nonce: 2, + amount: managed_biguint!(locked_token_amount.to_u64().unwrap()), + }, + lp_token_id: managed_token_id!(LP_TOKEN_ID), + lp_token_amount: managed_biguint!(expected_lp_token_amount.to_u64().unwrap()), + }), + ); + + // check user energy after + setup + .b_mock + .execute_query(&setup.simple_lock_wrapper, |sc| { + let first_lock_epochs = LOCK_OPTIONS[1] - block_epoch; + let second_lock_epochs = LOCK_OPTIONS[0] - block_epoch; + let expected_energy_amount = BigInt::from((user_locked_tokens_in_lp) as i64) + * BigInt::from(first_lock_epochs as i64) + + BigInt::from((USER_BALANCE - user_locked_tokens_in_lp) as i64) + * BigInt::from(second_lock_epochs as i64); + let expected_energy = Energy::new( + expected_energy_amount, + block_epoch, + managed_biguint!(USER_BALANCE), + ); + let actual_energy = sc.user_energy(&managed_address!(&first_user)).get(); + assert_eq!(expected_energy, actual_energy); + }) + .assert_ok(); +} From eec1b067497c0b55c7995dc44651ef7ddf070eb1 Mon Sep 17 00:00:00 2001 From: Dorin Marian Iancu Date: Fri, 29 Sep 2023 09:39:00 +0300 Subject: [PATCH 099/213] burn old token --- locked-asset/energy-factory/src/lib.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/locked-asset/energy-factory/src/lib.rs b/locked-asset/energy-factory/src/lib.rs index 419527336..a39dcc117 100644 --- a/locked-asset/energy-factory/src/lib.rs +++ b/locked-asset/energy-factory/src/lib.rs @@ -209,9 +209,15 @@ pub trait SimpleLockEnergy: ); let output_tokens = self.update_energy(&user, |energy: &mut Energy| { - self.extend_new_token_period(payment, unlock_epoch, current_epoch, energy) + self.extend_new_token_period(payment.clone(), unlock_epoch, current_epoch, energy) }); + self.send().esdt_local_burn( + &payment.token_identifier, + payment.token_nonce, + &payment.amount, + ); + self.send().direct_esdt( &caller, &output_tokens.token_identifier, From 7b39b1e8fa3fdd94b3191e5bf023d762f1663593 Mon Sep 17 00:00:00 2001 From: Dorin Marian Iancu Date: Fri, 29 Sep 2023 09:58:36 +0300 Subject: [PATCH 100/213] increase farm energy impl --- locked-asset/proxy_dex/src/proxy_farm.rs | 63 ++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/locked-asset/proxy_dex/src/proxy_farm.rs b/locked-asset/proxy_dex/src/proxy_farm.rs index beb6cf425..96b56ea8b 100644 --- a/locked-asset/proxy_dex/src/proxy_farm.rs +++ b/locked-asset/proxy_dex/src/proxy_farm.rs @@ -3,6 +3,7 @@ multiversx_sc::imports!(); multiversx_sc::derive_imports!(); +use common_structs::Epoch; use fixed_supply_token::FixedSupplyToken; use crate::{ @@ -321,6 +322,68 @@ pub trait ProxyFarmModule: (new_wrapped_token, claim_result.rewards).into() } + #[payable("*")] + #[endpoint(increaseProxyFarmTokenEnergy)] + fn increase_proxy_farm_token_energy_endpoint(&self, lock_epochs: Epoch) -> EsdtTokenPayment { + self.require_wrapped_farm_token_id_not_empty(); + self.require_wrapped_lp_token_id_not_empty(); + + let wrapped_farm_token_mapper = self.wrapped_farm_token(); + let payment = self.call_value().single_esdt(); + wrapped_farm_token_mapper.require_same_token(&payment.token_identifier); + + let wrapped_farm_attributes: WrappedFarmTokenAttributes = + self.get_attributes_as_part_of_fixed_supply(&payment, &wrapped_farm_token_mapper); + + let caller = self.blockchain().get_caller(); + let new_locked_token_id = self.get_locked_token_id(); + let wrapped_lp_token_id = self.wrapped_lp_token().get_token_id(); + + let new_attributes = if wrapped_farm_attributes.proxy_farming_token.token_identifier + == new_locked_token_id + { + let energy_factory_addr = self.energy_factory_address().get(); + let new_locked_token = self.call_increase_energy( + caller.clone(), + wrapped_farm_attributes.proxy_farming_token, + lock_epochs, + energy_factory_addr, + ); + + WrappedFarmTokenAttributes { + farm_token: wrapped_farm_attributes.farm_token, + proxy_farming_token: new_locked_token, + } + } else if wrapped_farm_attributes.proxy_farming_token.token_identifier + == wrapped_lp_token_id + { + let wrapped_lp_attributes: WrappedLpTokenAttributes = + self.get_attributes_as_part_of_fixed_supply(&payment, &self.wrapped_lp_token()); + let new_wrapped_lp = self.increase_proxy_pair_token_energy( + caller.clone(), + lock_epochs, + &wrapped_lp_attributes, + ); + + WrappedFarmTokenAttributes { + farm_token: wrapped_farm_attributes.farm_token, + proxy_farming_token: new_wrapped_lp, + } + } else { + sc_panic!(INVALID_PAYMENTS_ERR_MSG) + }; + + self.send().esdt_local_burn( + &payment.token_identifier, + payment.token_nonce, + &payment.amount, + ); + + let new_token_amount = new_attributes.get_total_supply(); + + wrapped_farm_token_mapper.nft_create_and_send(&caller, new_token_amount, &new_attributes) + } + fn require_wrapped_farm_token_id_not_empty(&self) { require!(!self.wrapped_farm_token().is_empty(), "Empty token id"); } From 36be9634322a7cf8d4ce9e0fbadedcf47983e63e Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Fri, 29 Sep 2023 10:11:05 +0300 Subject: [PATCH 101/213] clippy fix --- farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs b/farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs index 920b96eb0..2faf021a3 100644 --- a/farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs +++ b/farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs @@ -49,7 +49,7 @@ pub trait ProxyUnstakeModule: orig_caller.clone(), remove_liq_result.staking_token_payment, exit_attributes.staking_farm_token_nonce, - exit_attributes.staking_farm_token_amount.clone(), + exit_attributes.staking_farm_token_amount, ); let caller = self.blockchain().get_caller(); From a7a8bea3f1dc75d00179d607b38749bb8643eb89 Mon Sep 17 00:00:00 2001 From: Dorin Marian Iancu Date: Fri, 29 Sep 2023 10:11:26 +0300 Subject: [PATCH 102/213] test for farm increase energy --- .../proxy_dex/tests/proxy_farm_test.rs | 237 ++++++++++++++++++ 1 file changed, 237 insertions(+) diff --git a/locked-asset/proxy_dex/tests/proxy_farm_test.rs b/locked-asset/proxy_dex/tests/proxy_farm_test.rs index bfa289fde..f0731d9d6 100644 --- a/locked-asset/proxy_dex/tests/proxy_farm_test.rs +++ b/locked-asset/proxy_dex/tests/proxy_farm_test.rs @@ -1180,3 +1180,240 @@ fn different_farm_locked_token_nonce_merging_test() { }), ); } + +#[test] +fn increase_proxy_farm_lkmex_energy() { + let mut setup = ProxySetup::new( + proxy_dex::contract_obj, + pair::contract_obj, + farm_with_locked_rewards::contract_obj, + energy_factory::contract_obj, + ); + let first_user = setup.first_user.clone(); + let farm_addr = setup.farm_locked_wrapper.address_ref().clone(); + + //////////////////////////////////////////// ENTER FARM ///////////////////////////////////// + + setup + .b_mock + .execute_esdt_transfer( + &first_user, + &setup.proxy_wrapper, + LOCKED_TOKEN_ID, + 1, + &rust_biguint!(USER_BALANCE), + |sc| { + sc.enter_farm_proxy_endpoint(managed_address!(&farm_addr)); + }, + ) + .assert_ok(); + + let block_epoch = 1; + + // check user energy before + setup + .b_mock + .execute_query(&setup.simple_lock_wrapper, |sc| { + let lock_epochs = LOCK_OPTIONS[0] - block_epoch; + let expected_energy_amount = + BigInt::from((USER_BALANCE) as i64) * BigInt::from(lock_epochs as i64); + let expected_energy = Energy::new( + expected_energy_amount, + block_epoch, + managed_biguint!(USER_BALANCE), + ); + let actual_energy = sc.user_energy(&managed_address!(&first_user)).get(); + assert_eq!(expected_energy, actual_energy); + }) + .assert_ok(); + + //////////////////////////////////////////// INCREASE ENERGY ///////////////////////////////////// + setup + .b_mock + .execute_esdt_transfer( + &first_user, + &setup.proxy_wrapper, + WRAPPED_FARM_TOKEN_ID, + 1, + &rust_biguint!(USER_BALANCE), + |sc| { + sc.increase_proxy_farm_token_energy_endpoint(LOCK_OPTIONS[1]); + }, + ) + .assert_ok(); + + // check user energy after + setup + .b_mock + .execute_query(&setup.simple_lock_wrapper, |sc| { + let lock_epochs = LOCK_OPTIONS[1] - block_epoch; + let expected_energy_amount = + BigInt::from((USER_BALANCE) as i64) * BigInt::from(lock_epochs as i64); + let expected_energy = Energy::new( + expected_energy_amount, + block_epoch, + managed_biguint!(USER_BALANCE), + ); + let actual_energy = sc.user_energy(&managed_address!(&first_user)).get(); + assert_eq!(expected_energy, actual_energy); + }) + .assert_ok(); +} + +#[test] +fn increase_proxy_farm_proxy_lp_energy() { + let mut setup = ProxySetup::new( + proxy_dex::contract_obj, + pair::contract_obj, + farm_with_locked_rewards::contract_obj, + energy_factory::contract_obj, + ); + + setup + .b_mock + .execute_tx( + &setup.owner, + &setup.farm_locked_wrapper, + &rust_biguint!(0), + |sc| { + sc.farming_token_id().set(&managed_token_id!(LP_TOKEN_ID)); + + // set produce rewards to false for easier calculation + sc.produce_rewards_enabled().set(false); + }, + ) + .assert_ok(); + + setup.b_mock.set_esdt_local_roles( + setup.farm_locked_wrapper.address_ref(), + LP_TOKEN_ID, + &[EsdtLocalRole::Burn], + ); + + let first_user = setup.first_user.clone(); + let locked_token_amount = rust_biguint!(1_000_000_000); + let other_token_amount = rust_biguint!(500_000_000); + let expected_lp_token_amount = rust_biguint!(499_999_000); + + // set the price to 1 EGLD = 2 MEX + let payments = vec![ + TxTokenTransfer { + token_identifier: LOCKED_TOKEN_ID.to_vec(), + nonce: 1, + value: locked_token_amount.clone(), + }, + TxTokenTransfer { + token_identifier: WEGLD_TOKEN_ID.to_vec(), + nonce: 0, + value: other_token_amount.clone(), + }, + ]; + + // add liquidity + let pair_addr = setup.pair_wrapper.address_ref().clone(); + setup + .b_mock + .execute_esdt_multi_transfer(&first_user, &setup.proxy_wrapper, &payments, |sc| { + sc.add_liquidity_proxy( + managed_address!(&pair_addr), + managed_biguint!(locked_token_amount.to_u64().unwrap()), + managed_biguint!(other_token_amount.to_u64().unwrap()), + ); + }) + .assert_ok(); + + let block_epoch = 1u64; + let user_balance = USER_BALANCE; + + // check energy before + setup + .b_mock + .execute_query(&setup.simple_lock_wrapper, |sc| { + let unlock_epoch = LOCK_OPTIONS[0]; + let lock_epochs = unlock_epoch - block_epoch; + let expected_energy_amount = + BigInt::from((user_balance) as i64) * BigInt::from(lock_epochs as i64); + let expected_energy = Energy::new( + expected_energy_amount, + block_epoch, + managed_biguint!(user_balance), + ); + let actual_energy = sc.user_energy(&managed_address!(&first_user)).get(); + assert_eq!(expected_energy, actual_energy); + }) + .assert_ok(); + + let farm_locked_addr = setup.farm_locked_wrapper.address_ref().clone(); + + //////////////////////////////////////////// ENTER FARM ///////////////////////////////////// + + setup + .b_mock + .execute_esdt_transfer( + &first_user, + &setup.proxy_wrapper, + WRAPPED_LP_TOKEN_ID, + 1, + &expected_lp_token_amount, + |sc| { + sc.enter_farm_proxy_endpoint(managed_address!(&farm_locked_addr)); + }, + ) + .assert_ok(); + + //////////////////////////////////////////// INCREASE ENERGY ///////////////////////////////////// + setup + .b_mock + .execute_esdt_transfer( + &first_user, + &setup.proxy_wrapper, + WRAPPED_FARM_TOKEN_ID, + 1, + &expected_lp_token_amount, + |sc| { + sc.increase_proxy_farm_token_energy_endpoint(LOCK_OPTIONS[1]); + }, + ) + .assert_ok(); + + // check energy after + let user_locked_tokens_in_lp = locked_token_amount.to_u64().unwrap(); + setup + .b_mock + .execute_query(&setup.simple_lock_wrapper, |sc| { + let first_lock_epochs = LOCK_OPTIONS[1] - block_epoch; + let second_lock_epochs = LOCK_OPTIONS[0] - block_epoch; + let expected_energy_amount = BigInt::from((user_locked_tokens_in_lp) as i64) + * BigInt::from(first_lock_epochs as i64) + + BigInt::from((USER_BALANCE - user_locked_tokens_in_lp) as i64) + * BigInt::from(second_lock_epochs as i64); + let expected_energy = Energy::new( + expected_energy_amount, + block_epoch, + managed_biguint!(USER_BALANCE), + ); + let actual_energy = sc.user_energy(&managed_address!(&first_user)).get(); + assert_eq!(expected_energy, actual_energy); + }) + .assert_ok(); + + // check user token after increase energy + setup.b_mock.check_nft_balance( + &first_user, + WRAPPED_FARM_TOKEN_ID, + 2, + &expected_lp_token_amount, + Some(&WrappedFarmTokenAttributes:: { + proxy_farming_token: EsdtTokenPayment { + token_identifier: managed_token_id!(WRAPPED_LP_TOKEN_ID), + token_nonce: 2, + amount: managed_biguint!(expected_lp_token_amount.to_u64().unwrap()), + }, + farm_token: EsdtTokenPayment { + token_identifier: managed_token_id!(FARM_LOCKED_TOKEN_ID), + token_nonce: 1, + amount: managed_biguint!(expected_lp_token_amount.to_u64().unwrap()), + }, + }), + ); +} From fbb1673168b37c9a7daf06887c2deb46886762f2 Mon Sep 17 00:00:00 2001 From: Dorin Marian Iancu Date: Fri, 29 Sep 2023 10:25:25 +0300 Subject: [PATCH 103/213] fix --- locked-asset/proxy_dex/src/proxy_farm.rs | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/locked-asset/proxy_dex/src/proxy_farm.rs b/locked-asset/proxy_dex/src/proxy_farm.rs index 96b56ea8b..1c1fdadc9 100644 --- a/locked-asset/proxy_dex/src/proxy_farm.rs +++ b/locked-asset/proxy_dex/src/proxy_farm.rs @@ -357,14 +357,34 @@ pub trait ProxyFarmModule: } else if wrapped_farm_attributes.proxy_farming_token.token_identifier == wrapped_lp_token_id { + let wrapped_lp_mapper = self.wrapped_lp_token(); let wrapped_lp_attributes: WrappedLpTokenAttributes = - self.get_attributes_as_part_of_fixed_supply(&payment, &self.wrapped_lp_token()); - let new_wrapped_lp = self.increase_proxy_pair_token_energy( + self.get_attributes_as_part_of_fixed_supply(&payment, &wrapped_lp_mapper); + let new_locked_tokens = self.increase_proxy_pair_token_energy( caller.clone(), lock_epochs, &wrapped_lp_attributes, ); + let new_wrapped_lp_attributes = WrappedLpTokenAttributes { + locked_tokens: new_locked_tokens, + lp_token_id: wrapped_lp_attributes.lp_token_id, + lp_token_amount: wrapped_lp_attributes.lp_token_amount, + }; + + let new_token_amount = new_wrapped_lp_attributes.get_total_supply(); + let new_wrapped_lp = wrapped_lp_mapper.nft_create_and_send( + &caller, + new_token_amount, + &new_wrapped_lp_attributes, + ); + + self.send().esdt_local_burn( + &wrapped_farm_attributes.proxy_farming_token.token_identifier, + wrapped_farm_attributes.proxy_farming_token.token_nonce, + &wrapped_farm_attributes.proxy_farming_token.amount, + ); + WrappedFarmTokenAttributes { farm_token: wrapped_farm_attributes.farm_token, proxy_farming_token: new_wrapped_lp, From 5acf5e4f35b53e218832f06fcba1cc55b8be55d4 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Fri, 29 Sep 2023 11:06:34 +0300 Subject: [PATCH 104/213] build & cargo lock --- dex/governance/wasm/Cargo.lock | 80 ++--------- dex/governance/wasm/src/lib.rs | 50 ++++--- dex/pair-mock/wasm/Cargo.lock | 80 ++--------- dex/pair-mock/wasm/src/lib.rs | 12 +- dex/pair/wasm-pair-full/Cargo.lock | 84 ++--------- dex/pair/wasm-pair-full/src/lib.rs | 134 +++++++++--------- dex/pair/wasm-safe-price-view/Cargo.lock | 84 ++--------- dex/pair/wasm-safe-price-view/src/lib.rs | 27 ++-- dex/pair/wasm/Cargo.lock | 84 ++--------- dex/pair/wasm/src/lib.rs | 116 +++++++-------- dex/price-discovery/wasm/Cargo.lock | 84 ++--------- dex/price-discovery/wasm/src/lib.rs | 63 ++++---- dex/proxy-deployer/wasm/Cargo.lock | 84 ++--------- dex/proxy-deployer/wasm/src/lib.rs | 16 ++- dex/router/wasm/Cargo.lock | 84 ++--------- dex/router/wasm/src/lib.rs | 74 +++++----- .../energy-factory-mock/wasm/Cargo.lock | 84 ++--------- .../energy-factory-mock/wasm/src/lib.rs | 16 ++- .../energy-update/wasm/Cargo.lock | 84 ++--------- .../energy-update/wasm/src/lib.rs | 10 +- .../governance-v2/wasm/Cargo.lock | 84 ++--------- .../governance-v2/wasm/src/lib.rs | 62 ++++---- .../metabonding-staking/wasm/Cargo.lock | 30 ++-- .../metabonding-staking/wasm/src/lib.rs | 28 ++-- locked-asset/distribution/wasm/Cargo.lock | 30 ++-- locked-asset/distribution/wasm/src/lib.rs | 38 ++--- locked-asset/energy-factory/wasm/Cargo.lock | 84 ++--------- locked-asset/energy-factory/wasm/src/lib.rs | 73 +++++----- locked-asset/factory/wasm/Cargo.lock | 30 ++-- locked-asset/factory/wasm/src/lib.rs | 57 ++++---- locked-asset/lkmex-transfer/wasm/Cargo.lock | 84 ++--------- locked-asset/lkmex-transfer/wasm/src/lib.rs | 30 ++-- .../locked-token-wrapper/wasm/Cargo.lock | 84 ++--------- .../locked-token-wrapper/wasm/src/lib.rs | 25 ++-- .../simple-lock-whitelist/wasm/Cargo.lock | 84 ++--------- .../simple-lock-whitelist/wasm/src/lib.rs | 57 ++++---- locked-asset/token-unstake/wasm/Cargo.lock | 84 ++--------- locked-asset/token-unstake/wasm/src/lib.rs | 28 ++-- pause-all/wasm/Cargo.lock | 84 ++--------- pause-all/wasm/src/lib.rs | 22 +-- 40 files changed, 806 insertions(+), 1642 deletions(-) diff --git a/dex/governance/wasm/Cargo.lock b/dex/governance/wasm/Cargo.lock index ebe14cc18..193e4531f 100644 --- a/dex/governance/wasm/Cargo.lock +++ b/dex/governance/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -85,23 +79,11 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "386c2727eba66bc5e502e470d7afa55fdd69aedff440c508bb9ba85aec36a52a" dependencies = [ "bitflags", "hashbrown", @@ -113,20 +95,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -136,9 +117,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "050510b6b9836b24b4a73bb7878c58c268d56bde1c6eb0f9a88dce9a6518507b" dependencies = [ "hex", "proc-macro2", @@ -149,12 +130,11 @@ dependencies = [ [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "b059f22dfc3eb45aa015f6f20f28ed34dc42a65b42d282f8ac9b799b12e2942c" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -183,9 +163,9 @@ checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] @@ -237,37 +217,3 @@ name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/dex/governance/wasm/src/lib.rs b/dex/governance/wasm/src/lib.rs index bfedec764..3e106b05e 100644 --- a/dex/governance/wasm/src/lib.rs +++ b/dex/governance/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 23 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,28 +21,29 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { governance ( - propose - upvote - downvote - execute - redeem - changeQuorum - changeMinTokenBalanceForProposing - changeVotingDelayInBlocks - changeVotingPeriodInBlocks - changeGovernanceTokenIds - changePriceProviders - getGovernanceTokenId - getQuorum - getMinWeightForProposal - getVotingDelayInBlocks - getVotingPeriodInBlocks - getProposal - getProposalIdCounter - getVoteNFTId - getMexTokenId - getProposalStatus + init => init + propose => propose + upvote => upvote + downvote => downvote + execute => execute + redeem => redeem + changeQuorum => change_quorum + changeMinTokenBalanceForProposing => change_min_weight_for_proposal + changeVotingDelayInBlocks => change_voting_delay_in_blocks + changeVotingPeriodInBlocks => change_voting_period_in_blocks + changeGovernanceTokenIds => change_governance_token_ids + changePriceProviders => change_price_providers + getGovernanceTokenId => governance_token_ids + getQuorum => quorum + getMinWeightForProposal => min_weight_for_proposal + getVotingDelayInBlocks => voting_delay_in_blocks + getVotingPeriodInBlocks => voting_period_in_blocks + getProposal => proposal + getProposalIdCounter => proposal_id_counter + getVoteNFTId => vote_nft_id + getMexTokenId => mex_token_id + getProposalStatus => get_proposal_status_view ) } -multiversx_sc_wasm_adapter::empty_callback! {} +multiversx_sc_wasm_adapter::async_callback_empty! {} diff --git a/dex/pair-mock/wasm/Cargo.lock b/dex/pair-mock/wasm/Cargo.lock index fdfb68d12..0fbb17cd7 100644 --- a/dex/pair-mock/wasm/Cargo.lock +++ b/dex/pair-mock/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -92,23 +86,11 @@ dependencies = [ "either", ] -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "386c2727eba66bc5e502e470d7afa55fdd69aedff440c508bb9ba85aec36a52a" dependencies = [ "bitflags", "hashbrown", @@ -120,20 +102,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -143,9 +124,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "050510b6b9836b24b4a73bb7878c58c268d56bde1c6eb0f9a88dce9a6518507b" dependencies = [ "hex", "proc-macro2", @@ -156,12 +137,11 @@ dependencies = [ [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "b059f22dfc3eb45aa015f6f20f28ed34dc42a65b42d282f8ac9b799b12e2942c" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -207,9 +187,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] @@ -261,37 +241,3 @@ name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/dex/pair-mock/wasm/src/lib.rs b/dex/pair-mock/wasm/src/lib.rs index 54b9b427e..77325383a 100644 --- a/dex/pair-mock/wasm/src/lib.rs +++ b/dex/pair-mock/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 4 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,9 +21,10 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { pair_mock ( - addInitialLiquidity - getTokensForGivenPositionWithSafePrice + init => init + addInitialLiquidity => add_initial_liquidity + getTokensForGivenPositionWithSafePrice => get_tokens_for_given_position_with_safe_price ) } -multiversx_sc_wasm_adapter::empty_callback! {} +multiversx_sc_wasm_adapter::async_callback_empty! {} diff --git a/dex/pair/wasm-pair-full/Cargo.lock b/dex/pair/wasm-pair-full/Cargo.lock index 9077209cd..b337ee608 100644 --- a/dex/pair/wasm-pair-full/Cargo.lock +++ b/dex/pair/wasm-pair-full/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -168,12 +162,6 @@ dependencies = [ "utils", ] -[[package]] -name = "libc" -version = "0.2.144" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" - [[package]] name = "locking_module" version = "0.0.0" @@ -190,12 +178,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -205,9 +187,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "386c2727eba66bc5e502e470d7afa55fdd69aedff440c508bb9ba85aec36a52a" dependencies = [ "bitflags", "hashbrown", @@ -219,20 +201,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -242,9 +223,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "050510b6b9836b24b4a73bb7878c58c268d56bde1c6eb0f9a88dce9a6518507b" dependencies = [ "hex", "proc-macro2", @@ -255,21 +236,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "3b55fe3585cbc745bd7b9793be4bcb3aa7f1869ced7a0981f3d47e6a832c6311" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "b059f22dfc3eb45aa015f6f20f28ed34dc42a65b42d282f8ac9b799b12e2942c" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -338,9 +318,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.56" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] @@ -436,18 +416,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -467,25 +435,3 @@ dependencies = [ "unwrappable", "week-timekeeping", ] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/dex/pair/wasm-pair-full/src/lib.rs b/dex/pair/wasm-pair-full/src/lib.rs index 30efb71cb..9c6650e16 100644 --- a/dex/pair/wasm-pair-full/src/lib.rs +++ b/dex/pair/wasm-pair-full/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 65 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,70 +21,71 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { pair ( - addInitialLiquidity - addLiquidity - removeLiquidity - removeLiquidityAndBuyBackAndBurnToken - swapNoFeeAndForward - swapTokensFixedInput - swapTokensFixedOutput - setLpTokenIdentifier - getTokensForGivenPosition - getReservesAndTotalSupply - getAmountOut - getAmountIn - getEquivalent - getFeeState - whitelist - removeWhitelist - addTrustedSwapPair - removeTrustedSwapPair - setupFeesCollector - setFeeOn - getFeeDestinations - getTrustedSwapPairs - getWhitelistedManagedAddresses - getFeesCollectorAddress - getFeesCollectorCutPercentage - setStateActiveNoSwaps - setFeePercents - getLpTokenIdentifier - getTotalFeePercent - getSpecialFee - getRouterManagedAddress - getFirstTokenId - getSecondTokenId - getTotalSupply - getInitialLiquidtyAdder - getReserve - getSafePriceCurrentIndex - updateAndGetTokensForGivenPositionWithSafePrice - updateAndGetSafePrice - setLockingDeadlineEpoch - setLockingScAddress - setUnlockEpoch - getLockingScAddress - getUnlockEpoch - getLockingDeadlineEpoch - addAdmin - removeAdmin - updateOwnerOrAdmin - getPermissions - addToPauseWhitelist - removeFromPauseWhitelist - pause - resume - getState - getLpTokensSafePriceByDefaultOffset - getLpTokensSafePriceByRoundOffset - getLpTokensSafePriceByTimestampOffset - getLpTokensSafePrice - getSafePriceByDefaultOffset - getSafePriceByRoundOffset - getSafePriceByTimestampOffset - getSafePrice - getPriceObservation + init => init + addInitialLiquidity => add_initial_liquidity + addLiquidity => add_liquidity + removeLiquidity => remove_liquidity + removeLiquidityAndBuyBackAndBurnToken => remove_liquidity_and_burn_token + swapNoFeeAndForward => swap_no_fee + swapTokensFixedInput => swap_tokens_fixed_input + swapTokensFixedOutput => swap_tokens_fixed_output + setLpTokenIdentifier => set_lp_token_identifier + getTokensForGivenPosition => get_tokens_for_given_position + getReservesAndTotalSupply => get_reserves_and_total_supply + getAmountOut => get_amount_out_view + getAmountIn => get_amount_in_view + getEquivalent => get_equivalent + getFeeState => is_fee_enabled + whitelist => whitelist_endpoint + removeWhitelist => remove_whitelist + addTrustedSwapPair => add_trusted_swap_pair + removeTrustedSwapPair => remove_trusted_swap_pair + setupFeesCollector => setup_fees_collector + setFeeOn => set_fee_on + getFeeDestinations => get_fee_destinations + getTrustedSwapPairs => get_trusted_swap_pairs + getWhitelistedManagedAddresses => get_whitelisted_managed_addresses + getFeesCollectorAddress => fees_collector_address + getFeesCollectorCutPercentage => fees_collector_cut_percentage + setStateActiveNoSwaps => set_state_active_no_swaps + setFeePercents => set_fee_percent + getLpTokenIdentifier => get_lp_token_identifier + getTotalFeePercent => total_fee_percent + getSpecialFee => special_fee_percent + getRouterManagedAddress => router_address + getFirstTokenId => first_token_id + getSecondTokenId => second_token_id + getTotalSupply => lp_token_supply + getInitialLiquidtyAdder => initial_liquidity_adder + getReserve => pair_reserve + getSafePriceCurrentIndex => safe_price_current_index + updateAndGetTokensForGivenPositionWithSafePrice => update_and_get_tokens_for_given_position_with_safe_price + updateAndGetSafePrice => update_and_get_safe_price + setLockingDeadlineEpoch => set_locking_deadline_epoch + setLockingScAddress => set_locking_sc_address + setUnlockEpoch => set_unlock_epoch + getLockingScAddress => locking_sc_address + getUnlockEpoch => unlock_epoch + getLockingDeadlineEpoch => locking_deadline_epoch + addAdmin => add_admin_endpoint + removeAdmin => remove_admin_endpoint + updateOwnerOrAdmin => update_owner_or_admin_endpoint + getPermissions => permissions + addToPauseWhitelist => add_to_pause_whitelist + removeFromPauseWhitelist => remove_from_pause_whitelist + pause => pause + resume => resume + getState => state + getLpTokensSafePriceByDefaultOffset => get_lp_tokens_safe_price_by_default_offset + getLpTokensSafePriceByRoundOffset => get_lp_tokens_safe_price_by_round_offset + getLpTokensSafePriceByTimestampOffset => get_lp_tokens_safe_price_by_timestamp_offset + getLpTokensSafePrice => get_lp_tokens_safe_price + getSafePriceByDefaultOffset => get_safe_price_by_default_offset + getSafePriceByRoundOffset => get_safe_price_by_round_offset + getSafePriceByTimestampOffset => get_safe_price_by_timestamp_offset + getSafePrice => get_safe_price + getPriceObservation => get_price_observation_view ) } -multiversx_sc_wasm_adapter::empty_callback! {} +multiversx_sc_wasm_adapter::async_callback_empty! {} diff --git a/dex/pair/wasm-safe-price-view/Cargo.lock b/dex/pair/wasm-safe-price-view/Cargo.lock index c8995accb..805ded42d 100644 --- a/dex/pair/wasm-safe-price-view/Cargo.lock +++ b/dex/pair/wasm-safe-price-view/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -168,12 +162,6 @@ dependencies = [ "utils", ] -[[package]] -name = "libc" -version = "0.2.144" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" - [[package]] name = "locking_module" version = "0.0.0" @@ -190,12 +178,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -205,9 +187,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "386c2727eba66bc5e502e470d7afa55fdd69aedff440c508bb9ba85aec36a52a" dependencies = [ "bitflags", "hashbrown", @@ -219,20 +201,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -242,9 +223,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "050510b6b9836b24b4a73bb7878c58c268d56bde1c6eb0f9a88dce9a6518507b" dependencies = [ "hex", "proc-macro2", @@ -255,21 +236,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "3b55fe3585cbc745bd7b9793be4bcb3aa7f1869ced7a0981f3d47e6a832c6311" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "b059f22dfc3eb45aa015f6f20f28ed34dc42a65b42d282f8ac9b799b12e2942c" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -330,9 +310,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.56" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] @@ -436,18 +416,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -467,25 +435,3 @@ dependencies = [ "unwrappable", "week-timekeeping", ] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/dex/pair/wasm-safe-price-view/src/lib.rs b/dex/pair/wasm-safe-price-view/src/lib.rs index a41f72fd1..c5f78382f 100644 --- a/dex/pair/wasm-safe-price-view/src/lib.rs +++ b/dex/pair/wasm-safe-price-view/src/lib.rs @@ -10,24 +10,29 @@ // Total number of exported functions: 11 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); +multiversx_sc_wasm_adapter::external_view_init! {} + multiversx_sc_wasm_adapter::external_view_endpoints! { pair ( - getLpTokensSafePriceByDefaultOffset - getLpTokensSafePriceByRoundOffset - getLpTokensSafePriceByTimestampOffset - getLpTokensSafePrice - getSafePriceByDefaultOffset - getSafePriceByRoundOffset - getSafePriceByTimestampOffset - getSafePrice - getPriceObservation + getLpTokensSafePriceByDefaultOffset => get_lp_tokens_safe_price_by_default_offset + getLpTokensSafePriceByRoundOffset => get_lp_tokens_safe_price_by_round_offset + getLpTokensSafePriceByTimestampOffset => get_lp_tokens_safe_price_by_timestamp_offset + getLpTokensSafePrice => get_lp_tokens_safe_price + getSafePriceByDefaultOffset => get_safe_price_by_default_offset + getSafePriceByRoundOffset => get_safe_price_by_round_offset + getSafePriceByTimestampOffset => get_safe_price_by_timestamp_offset + getSafePrice => get_safe_price + getPriceObservation => get_price_observation_view ) } -multiversx_sc_wasm_adapter::empty_callback! {} +multiversx_sc_wasm_adapter::async_callback_empty! {} diff --git a/dex/pair/wasm/Cargo.lock b/dex/pair/wasm/Cargo.lock index a2f6f1a44..e53ad1a13 100644 --- a/dex/pair/wasm/Cargo.lock +++ b/dex/pair/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -168,12 +162,6 @@ dependencies = [ "utils", ] -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - [[package]] name = "locking_module" version = "0.0.0" @@ -190,12 +178,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -205,9 +187,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "386c2727eba66bc5e502e470d7afa55fdd69aedff440c508bb9ba85aec36a52a" dependencies = [ "bitflags", "hashbrown", @@ -219,20 +201,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -242,9 +223,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "050510b6b9836b24b4a73bb7878c58c268d56bde1c6eb0f9a88dce9a6518507b" dependencies = [ "hex", "proc-macro2", @@ -255,21 +236,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "3b55fe3585cbc745bd7b9793be4bcb3aa7f1869ced7a0981f3d47e6a832c6311" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "b059f22dfc3eb45aa015f6f20f28ed34dc42a65b42d282f8ac9b799b12e2942c" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -338,9 +318,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] @@ -436,18 +416,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -467,25 +435,3 @@ dependencies = [ "unwrappable", "week-timekeeping", ] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/dex/pair/wasm/src/lib.rs b/dex/pair/wasm/src/lib.rs index d692b1d2b..9f65c8a35 100644 --- a/dex/pair/wasm/src/lib.rs +++ b/dex/pair/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 56 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,61 +21,62 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { pair ( - addInitialLiquidity - addLiquidity - removeLiquidity - removeLiquidityAndBuyBackAndBurnToken - swapNoFeeAndForward - swapTokensFixedInput - swapTokensFixedOutput - setLpTokenIdentifier - getTokensForGivenPosition - getReservesAndTotalSupply - getAmountOut - getAmountIn - getEquivalent - getFeeState - whitelist - removeWhitelist - addTrustedSwapPair - removeTrustedSwapPair - setupFeesCollector - setFeeOn - getFeeDestinations - getTrustedSwapPairs - getWhitelistedManagedAddresses - getFeesCollectorAddress - getFeesCollectorCutPercentage - setStateActiveNoSwaps - setFeePercents - getLpTokenIdentifier - getTotalFeePercent - getSpecialFee - getRouterManagedAddress - getFirstTokenId - getSecondTokenId - getTotalSupply - getInitialLiquidtyAdder - getReserve - getSafePriceCurrentIndex - updateAndGetTokensForGivenPositionWithSafePrice - updateAndGetSafePrice - setLockingDeadlineEpoch - setLockingScAddress - setUnlockEpoch - getLockingScAddress - getUnlockEpoch - getLockingDeadlineEpoch - addAdmin - removeAdmin - updateOwnerOrAdmin - getPermissions - addToPauseWhitelist - removeFromPauseWhitelist - pause - resume - getState + init => init + addInitialLiquidity => add_initial_liquidity + addLiquidity => add_liquidity + removeLiquidity => remove_liquidity + removeLiquidityAndBuyBackAndBurnToken => remove_liquidity_and_burn_token + swapNoFeeAndForward => swap_no_fee + swapTokensFixedInput => swap_tokens_fixed_input + swapTokensFixedOutput => swap_tokens_fixed_output + setLpTokenIdentifier => set_lp_token_identifier + getTokensForGivenPosition => get_tokens_for_given_position + getReservesAndTotalSupply => get_reserves_and_total_supply + getAmountOut => get_amount_out_view + getAmountIn => get_amount_in_view + getEquivalent => get_equivalent + getFeeState => is_fee_enabled + whitelist => whitelist_endpoint + removeWhitelist => remove_whitelist + addTrustedSwapPair => add_trusted_swap_pair + removeTrustedSwapPair => remove_trusted_swap_pair + setupFeesCollector => setup_fees_collector + setFeeOn => set_fee_on + getFeeDestinations => get_fee_destinations + getTrustedSwapPairs => get_trusted_swap_pairs + getWhitelistedManagedAddresses => get_whitelisted_managed_addresses + getFeesCollectorAddress => fees_collector_address + getFeesCollectorCutPercentage => fees_collector_cut_percentage + setStateActiveNoSwaps => set_state_active_no_swaps + setFeePercents => set_fee_percent + getLpTokenIdentifier => get_lp_token_identifier + getTotalFeePercent => total_fee_percent + getSpecialFee => special_fee_percent + getRouterManagedAddress => router_address + getFirstTokenId => first_token_id + getSecondTokenId => second_token_id + getTotalSupply => lp_token_supply + getInitialLiquidtyAdder => initial_liquidity_adder + getReserve => pair_reserve + getSafePriceCurrentIndex => safe_price_current_index + updateAndGetTokensForGivenPositionWithSafePrice => update_and_get_tokens_for_given_position_with_safe_price + updateAndGetSafePrice => update_and_get_safe_price + setLockingDeadlineEpoch => set_locking_deadline_epoch + setLockingScAddress => set_locking_sc_address + setUnlockEpoch => set_unlock_epoch + getLockingScAddress => locking_sc_address + getUnlockEpoch => unlock_epoch + getLockingDeadlineEpoch => locking_deadline_epoch + addAdmin => add_admin_endpoint + removeAdmin => remove_admin_endpoint + updateOwnerOrAdmin => update_owner_or_admin_endpoint + getPermissions => permissions + addToPauseWhitelist => add_to_pause_whitelist + removeFromPauseWhitelist => remove_from_pause_whitelist + pause => pause + resume => resume + getState => state ) } -multiversx_sc_wasm_adapter::empty_callback! {} +multiversx_sc_wasm_adapter::async_callback_empty! {} diff --git a/dex/price-discovery/wasm/Cargo.lock b/dex/price-discovery/wasm/Cargo.lock index 7e6dc4c5b..58f80eb2d 100644 --- a/dex/price-discovery/wasm/Cargo.lock +++ b/dex/price-discovery/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -120,12 +114,6 @@ dependencies = [ "utils", ] -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - [[package]] name = "locking_module" version = "0.0.0" @@ -142,12 +130,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -157,9 +139,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "386c2727eba66bc5e502e470d7afa55fdd69aedff440c508bb9ba85aec36a52a" dependencies = [ "bitflags", "hashbrown", @@ -171,20 +153,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -194,9 +175,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "050510b6b9836b24b4a73bb7878c58c268d56bde1c6eb0f9a88dce9a6518507b" dependencies = [ "hex", "proc-macro2", @@ -207,21 +188,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "3b55fe3585cbc745bd7b9793be4bcb3aa7f1869ced7a0981f3d47e6a832c6311" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "b059f22dfc3eb45aa015f6f20f28ed34dc42a65b42d282f8ac9b799b12e2942c" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -268,9 +248,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] @@ -356,37 +336,3 @@ name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/dex/price-discovery/wasm/src/lib.rs b/dex/price-discovery/wasm/src/lib.rs index 7c227533c..0a3ed110d 100644 --- a/dex/price-discovery/wasm/src/lib.rs +++ b/dex/price-discovery/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 29 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,33 +21,35 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { price_discovery ( - deposit - withdraw - redeem - getCurrentPrice - getMinLaunchedTokenPrice - getPricePrecision - getLaunchedTokenId - getAcceptedTokenId - getLaunchedTokenBalance - getAcceptedTokenBalance - getStartBlock - getEndBlock - setLockingScAddress - setUnlockEpoch - getLockingScAddress - getUnlockEpoch - getCurrentPhase - getNoLimitPhaseDurationBlocks - getLinearPenaltyPhaseDurationBlocks - getFixedPenaltyPhaseDurationBlocks - getPenaltyMinPercentage - getPenaltyMaxPercentage - getFixedPenaltyPercentage - issueRedeemToken - createInitialRedeemTokens - getRedeemTokenId - getRedeemTokenTotalCirculatingSupply - callBack + init => init + deposit => deposit + withdraw => withdraw + redeem => redeem + getCurrentPrice => calculate_price + getMinLaunchedTokenPrice => min_launched_token_price + getPricePrecision => price_precision + getLaunchedTokenId => launched_token_id + getAcceptedTokenId => accepted_token_id + getLaunchedTokenBalance => launched_token_balance + getAcceptedTokenBalance => accepted_token_balance + getStartBlock => start_block + getEndBlock => end_block + setLockingScAddress => set_locking_sc_address + setUnlockEpoch => set_unlock_epoch + getLockingScAddress => locking_sc_address + getUnlockEpoch => unlock_epoch + getCurrentPhase => get_current_phase + getNoLimitPhaseDurationBlocks => no_limit_phase_duration_blocks + getLinearPenaltyPhaseDurationBlocks => linear_penalty_phase_duration_blocks + getFixedPenaltyPhaseDurationBlocks => fixed_penalty_phase_duration_blocks + getPenaltyMinPercentage => penalty_min_percentage + getPenaltyMaxPercentage => penalty_max_percentage + getFixedPenaltyPercentage => fixed_penalty_percentage + issueRedeemToken => issue_redeem_token + createInitialRedeemTokens => create_initial_redeem_tokens + getRedeemTokenId => redeem_token + getRedeemTokenTotalCirculatingSupply => redeem_token_total_circulating_supply ) } + +multiversx_sc_wasm_adapter::async_callback! { price_discovery } diff --git a/dex/proxy-deployer/wasm/Cargo.lock b/dex/proxy-deployer/wasm/Cargo.lock index 3d762a9be..f632f6425 100644 --- a/dex/proxy-deployer/wasm/Cargo.lock +++ b/dex/proxy-deployer/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -284,12 +278,6 @@ dependencies = [ "utils", ] -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - [[package]] name = "locking_module" version = "0.0.0" @@ -306,12 +294,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -321,9 +303,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "386c2727eba66bc5e502e470d7afa55fdd69aedff440c508bb9ba85aec36a52a" dependencies = [ "bitflags", "hashbrown", @@ -335,20 +317,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -358,9 +339,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "050510b6b9836b24b4a73bb7878c58c268d56bde1c6eb0f9a88dce9a6518507b" dependencies = [ "hex", "proc-macro2", @@ -371,21 +352,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "3b55fe3585cbc745bd7b9793be4bcb3aa7f1869ced7a0981f3d47e6a832c6311" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "b059f22dfc3eb45aa015f6f20f28ed34dc42a65b42d282f8ac9b799b12e2942c" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -446,9 +426,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] @@ -586,18 +566,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -617,25 +585,3 @@ dependencies = [ "unwrappable", "week-timekeeping", ] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/dex/proxy-deployer/wasm/src/lib.rs b/dex/proxy-deployer/wasm/src/lib.rs index bdf618263..b8d5311f2 100644 --- a/dex/proxy-deployer/wasm/src/lib.rs +++ b/dex/proxy-deployer/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 6 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,11 +21,12 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { proxy_deployer ( - deployFarm - callFarmEndpoint - getAllDeployedFarms - getDeployerFarmAddresses + init => init + deployFarm => deploy_farm + callFarmEndpoint => call_farm_endpoint + getAllDeployedFarms => get_all_deployed_farms + getDeployerFarmAddresses => deployer_farm_addresses ) } -multiversx_sc_wasm_adapter::empty_callback! {} +multiversx_sc_wasm_adapter::async_callback_empty! {} diff --git a/dex/router/wasm/Cargo.lock b/dex/router/wasm/Cargo.lock index 6746dd43d..610c44b89 100644 --- a/dex/router/wasm/Cargo.lock +++ b/dex/router/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -168,12 +162,6 @@ dependencies = [ "utils", ] -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - [[package]] name = "locking_module" version = "0.0.0" @@ -190,12 +178,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -205,9 +187,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "386c2727eba66bc5e502e470d7afa55fdd69aedff440c508bb9ba85aec36a52a" dependencies = [ "bitflags", "hashbrown", @@ -219,20 +201,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -242,9 +223,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "050510b6b9836b24b4a73bb7878c58c268d56bde1c6eb0f9a88dce9a6518507b" dependencies = [ "hex", "proc-macro2", @@ -255,21 +236,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "3b55fe3585cbc745bd7b9793be4bcb3aa7f1869ced7a0981f3d47e6a832c6311" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "b059f22dfc3eb45aa015f6f20f28ed34dc42a65b42d282f8ac9b799b12e2942c" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -330,9 +310,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] @@ -448,18 +428,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -479,25 +447,3 @@ dependencies = [ "unwrappable", "week-timekeeping", ] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/dex/router/wasm/src/lib.rs b/dex/router/wasm/src/lib.rs index 28609e0ab..a33c1a146 100644 --- a/dex/router/wasm/src/lib.rs +++ b/dex/router/wasm/src/lib.rs @@ -5,12 +5,15 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 30 +// Endpoints: 31 // Async Callback: 1 -// Total number of exported functions: 32 +// Total number of exported functions: 33 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,36 +21,39 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { router ( - pause - resume - createPair - upgradePair - issueLpToken - setLocalRoles - setLocalRolesOwner - removePair - setFeeOn - setFeeOff - setPairCreationEnabled - getPairCreationEnabled - getState - getOwner - getAllPairsManagedAddresses - getAllPairTokens - getAllPairContractMetadata - getPair - clearPairTemporaryOwnerStorage - setTemporaryOwnerPeriod - setPairTemplateAddress - getPairTemplateAddress - getTemporaryOwnerPeriod - multiPairSwap - configEnableByUserParameters - addCommonTokensForUserPairs - removeCommonTokensForUserPairs - setSwapEnabledByUser - getEnableSwapByUserConfig - getCommonTokensForUserPairs - callBack + init => init + pause => pause + resume => resume + createPair => create_pair_endpoint + upgradePair => upgrade_pair_endpoint + issueLpToken => issue_lp_token + setLocalRoles => set_local_roles + setLocalRolesOwner => set_local_roles_owner + removePair => remove_pair + setFeeOn => set_fee_on + setFeeOff => set_fee_off + setPairCreationEnabled => set_pair_creation_enabled + migratePairMap => migrate_pair_map + getPairCreationEnabled => pair_creation_enabled + getState => state + getOwner => owner + getAllPairsManagedAddresses => get_all_pairs_addresses + getAllPairTokens => get_all_token_pairs + getAllPairContractMetadata => get_all_pair_contract_metadata + getPair => get_pair + clearPairTemporaryOwnerStorage => clear_pair_temporary_owner_storage + setTemporaryOwnerPeriod => set_temporary_owner_period + setPairTemplateAddress => set_pair_template_address + getPairTemplateAddress => pair_template_address + getTemporaryOwnerPeriod => temporary_owner_period + multiPairSwap => multi_pair_swap + configEnableByUserParameters => config_enable_by_user_parameters + addCommonTokensForUserPairs => add_common_tokens_for_user_pairs + removeCommonTokensForUserPairs => remove_common_tokens_for_user_pairs + setSwapEnabledByUser => set_swap_enabled_by_user + getEnableSwapByUserConfig => try_get_config + getCommonTokensForUserPairs => common_tokens_for_user_pairs ) } + +multiversx_sc_wasm_adapter::async_callback! { router } diff --git a/energy-integration/energy-factory-mock/wasm/Cargo.lock b/energy-integration/energy-factory-mock/wasm/Cargo.lock index 1b1924b82..1c8ed2d30 100644 --- a/energy-integration/energy-factory-mock/wasm/Cargo.lock +++ b/energy-integration/energy-factory-mock/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -144,12 +138,6 @@ dependencies = [ "utils", ] -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - [[package]] name = "math" version = "0.0.0" @@ -157,12 +145,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -172,9 +154,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "386c2727eba66bc5e502e470d7afa55fdd69aedff440c508bb9ba85aec36a52a" dependencies = [ "bitflags", "hashbrown", @@ -186,20 +168,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -209,9 +190,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "050510b6b9836b24b4a73bb7878c58c268d56bde1c6eb0f9a88dce9a6518507b" dependencies = [ "hex", "proc-macro2", @@ -222,21 +203,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "3b55fe3585cbc745bd7b9793be4bcb3aa7f1869ced7a0981f3d47e6a832c6311" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "b059f22dfc3eb45aa015f6f20f28ed34dc42a65b42d282f8ac9b799b12e2942c" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -265,9 +245,9 @@ checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] @@ -353,37 +333,3 @@ name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/energy-integration/energy-factory-mock/wasm/src/lib.rs b/energy-integration/energy-factory-mock/wasm/src/lib.rs index bfa562d58..89a4cb257 100644 --- a/energy-integration/energy-factory-mock/wasm/src/lib.rs +++ b/energy-integration/energy-factory-mock/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 6 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,11 +21,12 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { energy_factory_mock ( - setUserEnergy - getEnergyAmountForUser - getEnergyEntryForUser - setUserEnergyAfterLockedTokenTransfer + init => init + setUserEnergy => set_user_energy + getEnergyAmountForUser => get_energy_amount_for_user + getEnergyEntryForUser => get_energy_entry_for_user + setUserEnergyAfterLockedTokenTransfer => set_user_energy_after_locked_token_transfer ) } -multiversx_sc_wasm_adapter::empty_callback! {} +multiversx_sc_wasm_adapter::async_callback_empty! {} diff --git a/energy-integration/energy-update/wasm/Cargo.lock b/energy-integration/energy-update/wasm/Cargo.lock index 5173db1ce..d178e0eef 100644 --- a/energy-integration/energy-update/wasm/Cargo.lock +++ b/energy-integration/energy-update/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -302,12 +296,6 @@ dependencies = [ "utils", ] -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - [[package]] name = "locking_module" version = "0.0.0" @@ -324,12 +312,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -339,9 +321,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "386c2727eba66bc5e502e470d7afa55fdd69aedff440c508bb9ba85aec36a52a" dependencies = [ "bitflags", "hashbrown", @@ -353,20 +335,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -376,9 +357,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "050510b6b9836b24b4a73bb7878c58c268d56bde1c6eb0f9a88dce9a6518507b" dependencies = [ "hex", "proc-macro2", @@ -389,21 +370,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "3b55fe3585cbc745bd7b9793be4bcb3aa7f1869ced7a0981f3d47e6a832c6311" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "b059f22dfc3eb45aa015f6f20f28ed34dc42a65b42d282f8ac9b799b12e2942c" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -464,9 +444,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] @@ -585,18 +565,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -616,25 +584,3 @@ dependencies = [ "unwrappable", "week-timekeeping", ] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/energy-integration/energy-update/wasm/src/lib.rs b/energy-integration/energy-update/wasm/src/lib.rs index 9ddd60e4c..18eb3df45 100644 --- a/energy-integration/energy-update/wasm/src/lib.rs +++ b/energy-integration/energy-update/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 3 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,8 +21,9 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { energy_update ( - updateFarmsEnergyForUser + init => init + updateFarmsEnergyForUser => update_farms_energy_for_user ) } -multiversx_sc_wasm_adapter::empty_callback! {} +multiversx_sc_wasm_adapter::async_callback_empty! {} diff --git a/energy-integration/governance-v2/wasm/Cargo.lock b/energy-integration/governance-v2/wasm/Cargo.lock index 40bcf7baa..7c57cce9a 100644 --- a/energy-integration/governance-v2/wasm/Cargo.lock +++ b/energy-integration/governance-v2/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -172,12 +166,6 @@ dependencies = [ "utils", ] -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - [[package]] name = "locking_module" version = "0.0.0" @@ -194,12 +182,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -209,9 +191,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "386c2727eba66bc5e502e470d7afa55fdd69aedff440c508bb9ba85aec36a52a" dependencies = [ "bitflags", "hashbrown", @@ -223,20 +205,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -246,9 +227,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "050510b6b9836b24b4a73bb7878c58c268d56bde1c6eb0f9a88dce9a6518507b" dependencies = [ "hex", "proc-macro2", @@ -259,21 +240,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "3b55fe3585cbc745bd7b9793be4bcb3aa7f1869ced7a0981f3d47e6a832c6311" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "b059f22dfc3eb45aa015f6f20f28ed34dc42a65b42d282f8ac9b799b12e2942c" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -311,9 +291,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] @@ -400,18 +380,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -431,25 +399,3 @@ dependencies = [ "unwrappable", "week-timekeeping", ] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/energy-integration/governance-v2/wasm/src/lib.rs b/energy-integration/governance-v2/wasm/src/lib.rs index 6c2f6e7e2..bcf9529fb 100644 --- a/energy-integration/governance-v2/wasm/src/lib.rs +++ b/energy-integration/governance-v2/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 29 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,34 +21,35 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { governance_v2 ( - propose - vote - cancel - withdrawDeposit - changeMinEnergyForProposal - changeMinFeeForProposal - changeQuorumPercentage - changeVotingDelayInBlocks - changeVotingPeriodInBlocks - getMinEnergyForPropose - getMinFeeForPropose - getQuorum - getVotingDelayInBlocks - getVotingPeriodInBlocks - getFeeTokenId - getWithdrawPercentageDefeated - getProposals - getUserVotedProposals - getProposalVotes - getProposalStatus - getFeesCollectorAddress - setEnergyFactoryAddress - getEnergyFactoryAddress - addAdmin - removeAdmin - updateOwnerOrAdmin - getPermissions + init => init + propose => propose + vote => vote + cancel => cancel + withdrawDeposit => withdraw_deposit + changeMinEnergyForProposal => change_min_energy_for_propose + changeMinFeeForProposal => change_min_fee_for_propose + changeQuorumPercentage => change_quorum_percentage + changeVotingDelayInBlocks => change_voting_delay_in_blocks + changeVotingPeriodInBlocks => change_voting_period_in_blocks + getMinEnergyForPropose => min_energy_for_propose + getMinFeeForPropose => min_fee_for_propose + getQuorum => quorum_percentage + getVotingDelayInBlocks => voting_delay_in_blocks + getVotingPeriodInBlocks => voting_period_in_blocks + getFeeTokenId => fee_token_id + getWithdrawPercentageDefeated => withdraw_percentage_defeated + getProposals => proposals + getUserVotedProposals => user_voted_proposals + getProposalVotes => proposal_votes + getProposalStatus => get_proposal_status + getFeesCollectorAddress => fees_collector_address + setEnergyFactoryAddress => set_energy_factory_address + getEnergyFactoryAddress => energy_factory_address + addAdmin => add_admin_endpoint + removeAdmin => remove_admin_endpoint + updateOwnerOrAdmin => update_owner_or_admin_endpoint + getPermissions => permissions ) } -multiversx_sc_wasm_adapter::empty_callback! {} +multiversx_sc_wasm_adapter::async_callback_empty! {} diff --git a/farm-staking/metabonding-staking/wasm/Cargo.lock b/farm-staking/metabonding-staking/wasm/Cargo.lock index dbb5e6cc5..9661f1ca4 100644 --- a/farm-staking/metabonding-staking/wasm/Cargo.lock +++ b/farm-staking/metabonding-staking/wasm/Cargo.lock @@ -196,9 +196,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "386c2727eba66bc5e502e470d7afa55fdd69aedff440c508bb9ba85aec36a52a" dependencies = [ "bitflags", "hashbrown", @@ -210,20 +210,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -233,9 +232,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "050510b6b9836b24b4a73bb7878c58c268d56bde1c6eb0f9a88dce9a6518507b" dependencies = [ "hex", "proc-macro2", @@ -246,21 +245,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "3b55fe3585cbc745bd7b9793be4bcb3aa7f1869ced7a0981f3d47e6a832c6311" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "b059f22dfc3eb45aa015f6f20f28ed34dc42a65b42d282f8ac9b799b12e2942c" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -289,9 +287,9 @@ checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] diff --git a/farm-staking/metabonding-staking/wasm/src/lib.rs b/farm-staking/metabonding-staking/wasm/src/lib.rs index 337c0ea4b..ce110b30f 100644 --- a/farm-staking/metabonding-staking/wasm/src/lib.rs +++ b/farm-staking/metabonding-staking/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 12 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,17 +21,18 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { metabonding_staking ( - stakeLockedAsset - unstake - unbond - getStakedAmountForUser - getUserEntry - getSnapshot - getLockedAssetTokenId - getLockedAssetFactoryAddress - getTotalLockedAssetSupply - getUserList + init => init + stakeLockedAsset => stake_locked_asset + unstake => unstake + unbond => unbond + getStakedAmountForUser => get_staked_amount_for_user + getUserEntry => get_user_entry + getSnapshot => get_snapshot + getLockedAssetTokenId => locked_asset_token_id + getLockedAssetFactoryAddress => locked_asset_factory_address + getTotalLockedAssetSupply => total_locked_asset_supply + getUserList => user_list ) } -multiversx_sc_wasm_adapter::empty_callback! {} +multiversx_sc_wasm_adapter::async_callback_empty! {} diff --git a/locked-asset/distribution/wasm/Cargo.lock b/locked-asset/distribution/wasm/Cargo.lock index e1cc0fc9e..1575c3ab3 100644 --- a/locked-asset/distribution/wasm/Cargo.lock +++ b/locked-asset/distribution/wasm/Cargo.lock @@ -196,9 +196,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "386c2727eba66bc5e502e470d7afa55fdd69aedff440c508bb9ba85aec36a52a" dependencies = [ "bitflags", "hashbrown", @@ -210,20 +210,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -233,9 +232,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "050510b6b9836b24b4a73bb7878c58c268d56bde1c6eb0f9a88dce9a6518507b" dependencies = [ "hex", "proc-macro2", @@ -246,21 +245,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "3b55fe3585cbc745bd7b9793be4bcb3aa7f1869ced7a0981f3d47e6a832c6311" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "b059f22dfc3eb45aa015f6f20f28ed34dc42a65b42d282f8ac9b799b12e2942c" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -289,9 +287,9 @@ checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] diff --git a/locked-asset/distribution/wasm/src/lib.rs b/locked-asset/distribution/wasm/src/lib.rs index 829e87945..7713b182b 100644 --- a/locked-asset/distribution/wasm/src/lib.rs +++ b/locked-asset/distribution/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 17 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,22 +21,23 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { distribution ( - setCommunityDistribution - setPerUserDistributedLockedAssets - claimLockedAssets - clearUnclaimableAssets - undoLastCommunityDistribution - undoUserDistributedAssetsBetweenEpochs - setUnlockPeriod - calculateLockedAssets - deleteUserDistributedLockedAssets - getUsersDistributedLockedAssetsLength - getUnlockPeriod - getCommunityDistributionList - getAssetTokenId - startGlobalOperation - endGlobalOperation + init => init + setCommunityDistribution => set_community_distribution + setPerUserDistributedLockedAssets => set_per_user_distributed_locked_assets + claimLockedAssets => claim_locked_assets + clearUnclaimableAssets => clear_unclaimable_assets + undoLastCommunityDistribution => undo_last_community_distrib + undoUserDistributedAssetsBetweenEpochs => undo_user_assets_between_epochs + setUnlockPeriod => set_unlock_period + calculateLockedAssets => calculate_locked_assets_view + deleteUserDistributedLockedAssets => delete_user_distributed_locked_assets + getUsersDistributedLockedAssetsLength => get_users_distributed_locked_assets_length + getUnlockPeriod => unlock_period + getCommunityDistributionList => community_distribution_list + getAssetTokenId => asset_token_id + startGlobalOperation => global_op_start + endGlobalOperation => global_op_stop ) } -multiversx_sc_wasm_adapter::empty_callback! {} +multiversx_sc_wasm_adapter::async_callback_empty! {} diff --git a/locked-asset/energy-factory/wasm/Cargo.lock b/locked-asset/energy-factory/wasm/Cargo.lock index 4ce7c14d7..6f19aab26 100644 --- a/locked-asset/energy-factory/wasm/Cargo.lock +++ b/locked-asset/energy-factory/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -128,12 +122,6 @@ dependencies = [ "utils", ] -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - [[package]] name = "math" version = "0.0.0" @@ -141,12 +129,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -156,9 +138,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "386c2727eba66bc5e502e470d7afa55fdd69aedff440c508bb9ba85aec36a52a" dependencies = [ "bitflags", "hashbrown", @@ -170,20 +152,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -193,9 +174,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "050510b6b9836b24b4a73bb7878c58c268d56bde1c6eb0f9a88dce9a6518507b" dependencies = [ "hex", "proc-macro2", @@ -206,21 +187,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "3b55fe3585cbc745bd7b9793be4bcb3aa7f1869ced7a0981f3d47e6a832c6311" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "b059f22dfc3eb45aa015f6f20f28ed34dc42a65b42d282f8ac9b799b12e2942c" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -249,9 +229,9 @@ checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] @@ -337,37 +317,3 @@ name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/locked-asset/energy-factory/wasm/src/lib.rs b/locked-asset/energy-factory/wasm/src/lib.rs index d496bd0d2..213c94146 100644 --- a/locked-asset/energy-factory/wasm/src/lib.rs +++ b/locked-asset/energy-factory/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 34 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,38 +21,40 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { energy_factory ( - lockTokens - unlockTokens - issueLockedToken - getLockedTokenId - getBaseAssetTokenId - getLegacyLockedTokenId - getEnergyEntryForUser - getEnergyAmountForUser - addLockOptions - getLockOptions - unlockEarly - reduceLockPeriod - getPenaltyAmount - setTokenUnstakeAddress - revertUnstake - getTokenUnstakeScAddress - setEnergyForOldTokens - updateEnergyAfterOldTokenUnlock - migrateOldTokens - pause - unpause - isPaused - setTransferRoleLockedToken - setBurnRoleLockedToken - mergeTokens - lockVirtual - addSCAddressToWhitelist - removeSCAddressFromWhitelist - isSCAddressWhitelisted - addToTokenTransferWhitelist - removeFromTokenTransferWhitelist - setUserEnergyAfterLockedTokenTransfer - callBack + init => init + lockTokens => lock_tokens_endpoint + unlockTokens => unlock_tokens_endpoint + issueLockedToken => issue_locked_token + getLockedTokenId => locked_token + getBaseAssetTokenId => base_asset_token_id + getLegacyLockedTokenId => legacy_locked_token_id + getEnergyEntryForUser => get_updated_energy_entry_for_user + getEnergyAmountForUser => get_energy_amount_for_user + addLockOptions => add_lock_options + getLockOptions => get_lock_options_view + unlockEarly => unlock_early + reduceLockPeriod => reduce_lock_period + getPenaltyAmount => calculate_penalty_amount + setTokenUnstakeAddress => set_token_unstake_address + revertUnstake => revert_unstake + getTokenUnstakeScAddress => token_unstake_sc_address + setEnergyForOldTokens => set_energy_for_old_tokens + updateEnergyAfterOldTokenUnlock => update_energy_after_old_token_unlock + migrateOldTokens => migrate_old_tokens + pause => pause_endpoint + unpause => unpause_endpoint + isPaused => paused_status + setTransferRoleLockedToken => set_transfer_role + setBurnRoleLockedToken => set_burn_role + mergeTokens => merge_tokens_endpoint + lockVirtual => lock_virtual + addSCAddressToWhitelist => add_sc_address_to_whitelist + removeSCAddressFromWhitelist => remove_sc_address_from_whitelist + isSCAddressWhitelisted => is_sc_address_whitelisted + addToTokenTransferWhitelist => add_to_token_transfer_whitelist + removeFromTokenTransferWhitelist => remove_from_token_transfer_whitelist + setUserEnergyAfterLockedTokenTransfer => set_user_energy_after_locked_token_transfer ) } + +multiversx_sc_wasm_adapter::async_callback! { energy_factory } diff --git a/locked-asset/factory/wasm/Cargo.lock b/locked-asset/factory/wasm/Cargo.lock index ca5df67df..2e3b4d55a 100644 --- a/locked-asset/factory/wasm/Cargo.lock +++ b/locked-asset/factory/wasm/Cargo.lock @@ -187,9 +187,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "386c2727eba66bc5e502e470d7afa55fdd69aedff440c508bb9ba85aec36a52a" dependencies = [ "bitflags", "hashbrown", @@ -201,20 +201,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -224,9 +223,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "050510b6b9836b24b4a73bb7878c58c268d56bde1c6eb0f9a88dce9a6518507b" dependencies = [ "hex", "proc-macro2", @@ -237,21 +236,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "3b55fe3585cbc745bd7b9793be4bcb3aa7f1869ced7a0981f3d47e6a832c6311" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "b059f22dfc3eb45aa015f6f20f28ed34dc42a65b42d282f8ac9b799b12e2942c" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -280,9 +278,9 @@ checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] diff --git a/locked-asset/factory/wasm/src/lib.rs b/locked-asset/factory/wasm/src/lib.rs index e5250b664..3593ccb49 100644 --- a/locked-asset/factory/wasm/src/lib.rs +++ b/locked-asset/factory/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 26 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,30 +21,32 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { factory ( - whitelist - removeWhitelist - createAndForwardCustomPeriod - createAndForward - unlockAssets - lockAssets - setUnlockPeriod - registerLockedAssetToken - setInitEpoch - getInitEpoch - getWhitelistedContracts - getDefaultUnlockPeriod - getLockedAssetTokenId - getAssetTokenId - getUnlockScheduleForSFTNonce - getCacheSize - mergeTokens - getExtendedAttributesActivationNonce - setLockedTokenBurnRoleForAddress - setTransferRoleOldLockedToken - setNewFactoryAddress - pause - unpause - isPaused - callBack + init => init + whitelist => whitelist + removeWhitelist => remove_whitelist + createAndForwardCustomPeriod => create_and_forward_custom_period + createAndForward => create_and_forward + unlockAssets => unlock_assets + lockAssets => lock_assets + setUnlockPeriod => set_unlock_period + registerLockedAssetToken => register_locked_asset_token + setInitEpoch => set_init_epoch + getInitEpoch => init_epoch + getWhitelistedContracts => whitelisted_contracts + getDefaultUnlockPeriod => default_unlock_period + getLockedAssetTokenId => locked_asset_token + getAssetTokenId => asset_token_id + getUnlockScheduleForSFTNonce => get_unlock_schedule_for_sft_nonce + getCacheSize => get_cache_size + mergeTokens => merge_tokens + getExtendedAttributesActivationNonce => extended_attributes_activation_nonce + setLockedTokenBurnRoleForAddress => set_locked_token_burn_role_for_address + setTransferRoleOldLockedToken => set_transfer_role_old_locked_token + setNewFactoryAddress => set_new_factory_address + pause => pause_endpoint + unpause => unpause_endpoint + isPaused => paused_status ) } + +multiversx_sc_wasm_adapter::async_callback! { factory } diff --git a/locked-asset/lkmex-transfer/wasm/Cargo.lock b/locked-asset/lkmex-transfer/wasm/Cargo.lock index 0956bbfca..817559577 100644 --- a/locked-asset/lkmex-transfer/wasm/Cargo.lock +++ b/locked-asset/lkmex-transfer/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -128,12 +122,6 @@ dependencies = [ "utils", ] -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - [[package]] name = "lkmex-transfer" version = "0.0.0" @@ -163,12 +151,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -178,9 +160,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "386c2727eba66bc5e502e470d7afa55fdd69aedff440c508bb9ba85aec36a52a" dependencies = [ "bitflags", "hashbrown", @@ -192,20 +174,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -215,9 +196,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "050510b6b9836b24b4a73bb7878c58c268d56bde1c6eb0f9a88dce9a6518507b" dependencies = [ "hex", "proc-macro2", @@ -228,21 +209,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "3b55fe3585cbc745bd7b9793be4bcb3aa7f1869ced7a0981f3d47e6a832c6311" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "b059f22dfc3eb45aa015f6f20f28ed34dc42a65b42d282f8ac9b799b12e2942c" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -280,9 +260,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] @@ -368,37 +348,3 @@ name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/locked-asset/lkmex-transfer/wasm/src/lib.rs b/locked-asset/lkmex-transfer/wasm/src/lib.rs index 5b48ab16b..88d45c5f9 100644 --- a/locked-asset/lkmex-transfer/wasm/src/lib.rs +++ b/locked-asset/lkmex-transfer/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 13 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,18 +21,19 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { lkmex_transfer ( - withdraw - cancelTransfer - lockFunds - getScheduledTransfers - getAllSenders - setEnergyFactoryAddress - getEnergyFactoryAddress - addAdmin - removeAdmin - updateOwnerOrAdmin - getPermissions + init => init + withdraw => withdraw + cancelTransfer => cancel_transfer + lockFunds => lock_funds + getScheduledTransfers => get_scheduled_transfers + getAllSenders => all_senders + setEnergyFactoryAddress => set_energy_factory_address + getEnergyFactoryAddress => energy_factory_address + addAdmin => add_admin_endpoint + removeAdmin => remove_admin_endpoint + updateOwnerOrAdmin => update_owner_or_admin_endpoint + getPermissions => permissions ) } -multiversx_sc_wasm_adapter::empty_callback! {} +multiversx_sc_wasm_adapter::async_callback_empty! {} diff --git a/locked-asset/locked-token-wrapper/wasm/Cargo.lock b/locked-asset/locked-token-wrapper/wasm/Cargo.lock index 389a26cc8..37781138a 100644 --- a/locked-asset/locked-token-wrapper/wasm/Cargo.lock +++ b/locked-asset/locked-token-wrapper/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -136,12 +130,6 @@ dependencies = [ "utils", ] -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - [[package]] name = "lkmex-transfer" version = "0.0.0" @@ -187,12 +175,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -202,9 +184,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "386c2727eba66bc5e502e470d7afa55fdd69aedff440c508bb9ba85aec36a52a" dependencies = [ "bitflags", "hashbrown", @@ -216,20 +198,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -239,9 +220,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "050510b6b9836b24b4a73bb7878c58c268d56bde1c6eb0f9a88dce9a6518507b" dependencies = [ "hex", "proc-macro2", @@ -252,21 +233,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "3b55fe3585cbc745bd7b9793be4bcb3aa7f1869ced7a0981f3d47e6a832c6311" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "b059f22dfc3eb45aa015f6f20f28ed34dc42a65b42d282f8ac9b799b12e2942c" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -304,9 +284,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] @@ -392,37 +372,3 @@ name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/locked-asset/locked-token-wrapper/wasm/src/lib.rs b/locked-asset/locked-token-wrapper/wasm/src/lib.rs index efae1ed5e..dd7c8fd96 100644 --- a/locked-asset/locked-token-wrapper/wasm/src/lib.rs +++ b/locked-asset/locked-token-wrapper/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 10 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,14 +21,16 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { locked_token_wrapper ( - wrapLockedToken - unwrapLockedToken - issueWrappedToken - setTransferRoleWrappedToken - unsetTransferRoleWrappedToken - getWrappedTokenId - setEnergyFactoryAddress - getEnergyFactoryAddress - callBack + init => init + wrapLockedToken => wrap_locked_token_endpoint + unwrapLockedToken => unwrap_locked_token_endpoint + issueWrappedToken => issue_wrapped_token + setTransferRoleWrappedToken => set_transfer_role + unsetTransferRoleWrappedToken => unset_transfer_role + getWrappedTokenId => wrapped_token + setEnergyFactoryAddress => set_energy_factory_address + getEnergyFactoryAddress => energy_factory_address ) } + +multiversx_sc_wasm_adapter::async_callback! { locked_token_wrapper } diff --git a/locked-asset/simple-lock-whitelist/wasm/Cargo.lock b/locked-asset/simple-lock-whitelist/wasm/Cargo.lock index 678cb0db6..fcf6f4e9a 100644 --- a/locked-asset/simple-lock-whitelist/wasm/Cargo.lock +++ b/locked-asset/simple-lock-whitelist/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -88,12 +82,6 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - [[package]] name = "math" version = "0.0.0" @@ -101,12 +89,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -116,9 +98,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "386c2727eba66bc5e502e470d7afa55fdd69aedff440c508bb9ba85aec36a52a" dependencies = [ "bitflags", "hashbrown", @@ -130,20 +112,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -153,9 +134,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "050510b6b9836b24b4a73bb7878c58c268d56bde1c6eb0f9a88dce9a6518507b" dependencies = [ "hex", "proc-macro2", @@ -166,21 +147,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "3b55fe3585cbc745bd7b9793be4bcb3aa7f1869ced7a0981f3d47e6a832c6311" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "b059f22dfc3eb45aa015f6f20f28ed34dc42a65b42d282f8ac9b799b12e2942c" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -209,9 +189,9 @@ checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] @@ -307,37 +287,3 @@ name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/locked-asset/simple-lock-whitelist/wasm/src/lib.rs b/locked-asset/simple-lock-whitelist/wasm/src/lib.rs index 2d42f0f2c..8d60bed84 100644 --- a/locked-asset/simple-lock-whitelist/wasm/src/lib.rs +++ b/locked-asset/simple-lock-whitelist/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 26 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,30 +21,32 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { simple_lock_whitelist ( - setTransferRoleLockedToken - setTransferRoleProxyLpToken - setTransferRoleProxyFarmToken - setLockedToken - lockTokens - unlockTokens - getTokenWhitelist - issueLockedToken - getLockedTokenId - issueLpProxyToken - addLpToWhitelist - removeLpFromWhitelist - addLiquidityLockedToken - removeLiquidityLockedToken - getKnownLiquidityPools - getLpProxyTokenId - issueFarmProxyToken - addFarmToWhitelist - removeFarmFromWhitelist - enterFarmLockedToken - exitFarmLockedToken - farmClaimRewardsLockedToken - getKnownFarms - getFarmProxyTokenId - callBack + init => init + setTransferRoleLockedToken => set_transfer_role + setTransferRoleProxyLpToken => set_transfer_role_proxy_lp + setTransferRoleProxyFarmToken => set_transfer_role_proxy_farm + setLockedToken => set_locked_token + lockTokens => lock_tokens_endpoint + unlockTokens => unlock_tokens_endpoint + getTokenWhitelist => token_whitelist + issueLockedToken => issue_locked_token + getLockedTokenId => locked_token + issueLpProxyToken => issue_lp_proxy_token + addLpToWhitelist => add_lp_to_whitelist + removeLpFromWhitelist => remove_lp_from_whitelist + addLiquidityLockedToken => add_liquidity_locked_token + removeLiquidityLockedToken => remove_liquidity_locked_token + getKnownLiquidityPools => known_liquidity_pools + getLpProxyTokenId => lp_proxy_token + issueFarmProxyToken => issue_farm_proxy_token + addFarmToWhitelist => add_farm_to_whitelist + removeFarmFromWhitelist => remove_farm_from_whitelist + enterFarmLockedToken => enter_farm_locked_token + exitFarmLockedToken => exit_farm_locked_token + farmClaimRewardsLockedToken => farm_claim_rewards_locked_token + getKnownFarms => known_farms + getFarmProxyTokenId => farm_proxy_token ) } + +multiversx_sc_wasm_adapter::async_callback! { simple_lock_whitelist } diff --git a/locked-asset/token-unstake/wasm/Cargo.lock b/locked-asset/token-unstake/wasm/Cargo.lock index 4a78e1d16..45ca8458f 100644 --- a/locked-asset/token-unstake/wasm/Cargo.lock +++ b/locked-asset/token-unstake/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -135,12 +129,6 @@ dependencies = [ "utils", ] -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - [[package]] name = "math" version = "0.0.0" @@ -148,12 +136,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "mergeable" version = "0.0.0" @@ -163,9 +145,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "386c2727eba66bc5e502e470d7afa55fdd69aedff440c508bb9ba85aec36a52a" dependencies = [ "bitflags", "hashbrown", @@ -177,20 +159,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -200,9 +181,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "050510b6b9836b24b4a73bb7878c58c268d56bde1c6eb0f9a88dce9a6518507b" dependencies = [ "hex", "proc-macro2", @@ -213,21 +194,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "3b55fe3585cbc745bd7b9793be4bcb3aa7f1869ced7a0981f3d47e6a832c6311" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "b059f22dfc3eb45aa015f6f20f28ed34dc42a65b42d282f8ac9b799b12e2942c" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -256,9 +236,9 @@ checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] @@ -367,18 +347,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -386,25 +354,3 @@ dependencies = [ "common-types", "multiversx-sc", ] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/locked-asset/token-unstake/wasm/src/lib.rs b/locked-asset/token-unstake/wasm/src/lib.rs index e0ac873af..f2f371c21 100644 --- a/locked-asset/token-unstake/wasm/src/lib.rs +++ b/locked-asset/token-unstake/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 12 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,17 +21,18 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { token_unstake ( - getUnbondEpochs - getUnlockedTokensForUser - claimUnlockedTokens - cancelUnbond - depositUserTokens - depositFees - getFeesBurnPercentage - getFeesCollectorAddress - setEnergyFactoryAddress - getEnergyFactoryAddress + init => init + getUnbondEpochs => unbond_epochs + getUnlockedTokensForUser => unlocked_tokens_for_user + claimUnlockedTokens => claim_unlocked_tokens + cancelUnbond => cancel_unbond + depositUserTokens => deposit_user_tokens + depositFees => deposit_fees + getFeesBurnPercentage => fees_burn_percentage + getFeesCollectorAddress => fees_collector_address + setEnergyFactoryAddress => set_energy_factory_address + getEnergyFactoryAddress => energy_factory_address ) } -multiversx_sc_wasm_adapter::empty_callback! {} +multiversx_sc_wasm_adapter::async_callback_empty! {} diff --git a/pause-all/wasm/Cargo.lock b/pause-all/wasm/Cargo.lock index 8dfdb7105..af898789c 100644 --- a/pause-all/wasm/Cargo.lock +++ b/pause-all/wasm/Cargo.lock @@ -8,7 +8,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", "version_check", ] @@ -31,12 +31,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -77,23 +71,11 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "multiversx-sc" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecfb3e03ac6e08114963a54e15a3c78c28e57cc0e31836e870450b35085bdf8d" +checksum = "386c2727eba66bc5e502e470d7afa55fdd69aedff440c508bb9ba85aec36a52a" dependencies = [ "bitflags", "hashbrown", @@ -105,20 +87,19 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7638cb46a0e99c636fd55443ac534ff0a5fad0bd772e1037fbac9a75e04c3c9" +checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", - "wee_alloc", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.17.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e976002d51367f16140929c10ee695f95dd8d34c150a45db60d3fcd1328a267a" +checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" dependencies = [ "hex", "proc-macro2", @@ -128,9 +109,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eb54a7d452eb09f5de159ee9b4d1fb9ec79cf49f1602ebd3efc8532015a4ea" +checksum = "050510b6b9836b24b4a73bb7878c58c268d56bde1c6eb0f9a88dce9a6518507b" dependencies = [ "hex", "proc-macro2", @@ -141,21 +122,20 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12284a3e31c0852b6ca0ce8306d3f404c3712b996a05ed78e97e765c98461f3" +checksum = "3b55fe3585cbc745bd7b9793be4bcb3aa7f1869ced7a0981f3d47e6a832c6311" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.39.4" +version = "0.43.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee69fa831cdd5a7ea1aedbb6356a55792b821396f48360a6194f4131eddd1045" +checksum = "b059f22dfc3eb45aa015f6f20f28ed34dc42a65b42d282f8ac9b799b12e2942c" dependencies = [ "multiversx-sc", - "wee_alloc", ] [[package]] @@ -218,9 +198,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] @@ -272,37 +252,3 @@ name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/pause-all/wasm/src/lib.rs b/pause-all/wasm/src/lib.rs index 6177d8585..d92fcfc45 100644 --- a/pause-all/wasm/src/lib.rs +++ b/pause-all/wasm/src/lib.rs @@ -10,7 +10,10 @@ // Total number of exported functions: 9 #![no_std] -#![feature(alloc_error_handler, lang_items)] + +// Configuration that works with rustc < 1.73.0. +// TODO: Recommended rustc version: 1.73.0 or newer. +#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); @@ -18,14 +21,15 @@ multiversx_sc_wasm_adapter::panic_handler!(); multiversx_sc_wasm_adapter::endpoints! { pause_all ( - addPausableContracts - removePausableContracts - pauseSelected - pauseAll - resumeSelected - resumeAll - getPausableContracts + init => init + addPausableContracts => add_pausable_contracts + removePausableContracts => remove_pausable_contracts + pauseSelected => pause_selected + pauseAll => pause_all + resumeSelected => resume_selected + resumeAll => resume_all + getPausableContracts => pausable_contracts ) } -multiversx_sc_wasm_adapter::empty_callback! {} +multiversx_sc_wasm_adapter::async_callback_empty! {} From d1a9e72347da846125e3ec3517a8f4a1fe0044a5 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Fri, 29 Sep 2023 11:08:38 +0300 Subject: [PATCH 105/213] github actions update --- .github/workflows/actions.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index f6acbaa50..c5fdba201 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -4,6 +4,7 @@ on: push: branches: [ main, feat/* ] pull_request: + branches: [ main, feat/* ] workflow_dispatch: permissions: From a7ca9e642557e294090bc668f8220f8a88633ec5 Mon Sep 17 00:00:00 2001 From: Dorin Marian Iancu Date: Fri, 29 Sep 2023 11:27:02 +0300 Subject: [PATCH 106/213] clippy --- locked-asset/proxy_dex/tests/proxy_dex_test_setup/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locked-asset/proxy_dex/tests/proxy_dex_test_setup/mod.rs b/locked-asset/proxy_dex/tests/proxy_dex_test_setup/mod.rs index 413ddb980..c93cfc924 100644 --- a/locked-asset/proxy_dex/tests/proxy_dex_test_setup/mod.rs +++ b/locked-asset/proxy_dex/tests/proxy_dex_test_setup/mod.rs @@ -87,7 +87,7 @@ where farm_locked_builder: FarmLockedObjBuilder, simple_lock_builder: SimpleLockObjBuilder, ) -> Self { - let _ = DebugApi::dummy(); + DebugApi::dummy(); let rust_zero = rust_biguint!(0); let mut b_mock = BlockchainStateWrapper::new(); From 2e3652481ff6ddda269bcf22c7bcfda3361a84be Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Fri, 29 Sep 2023 12:26:25 +0300 Subject: [PATCH 107/213] clippy fix --- dex/farm/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dex/farm/src/lib.rs b/dex/farm/src/lib.rs index 5a18d41e3..74456ad5c 100644 --- a/dex/farm/src/lib.rs +++ b/dex/farm/src/lib.rs @@ -119,7 +119,7 @@ pub trait Farm: self.migrate_old_farm_positions(&orig_caller); - let claim_rewards_result = self.claim_rewards::>(orig_caller.clone()); + let claim_rewards_result = self.claim_rewards::>(orig_caller); self.send_payment_non_zero(&caller, &claim_rewards_result.new_farm_token); self.send_payment_non_zero(&caller, &claim_rewards_result.rewards); From 67a7d4277d5a6d25534f3a2882b7d88593a2554e Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Fri, 29 Sep 2023 12:39:15 +0300 Subject: [PATCH 108/213] cargo lock fix --- dex/farm-with-locked-rewards/wasm/Cargo.lock | 1 - 1 file changed, 1 deletion(-) diff --git a/dex/farm-with-locked-rewards/wasm/Cargo.lock b/dex/farm-with-locked-rewards/wasm/Cargo.lock index ac4fd1333..17a37e607 100644 --- a/dex/farm-with-locked-rewards/wasm/Cargo.lock +++ b/dex/farm-with-locked-rewards/wasm/Cargo.lock @@ -392,7 +392,6 @@ dependencies = [ name = "multiversx-sc-modules" version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b55fe3585cbc745bd7b9793be4bcb3aa7f1869ced7a0981f3d47e6a832c6311" checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" dependencies = [ "multiversx-sc", From 4dc02033c33d2ed89ab0ccc4b7529b976467979e Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Fri, 29 Sep 2023 12:56:08 +0300 Subject: [PATCH 109/213] farm with lock rewards cargo lock fix --- dex/farm-with-locked-rewards/wasm/Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dex/farm-with-locked-rewards/wasm/Cargo.lock b/dex/farm-with-locked-rewards/wasm/Cargo.lock index 17a37e607..102fabc1d 100644 --- a/dex/farm-with-locked-rewards/wasm/Cargo.lock +++ b/dex/farm-with-locked-rewards/wasm/Cargo.lock @@ -379,7 +379,7 @@ dependencies = [ name = "multiversx-sc-derive" version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "050510b6b9836b24b4a73bb7878c58c268d56bde1c6eb0f9a88dce9a6518507b" +checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" dependencies = [ "hex", "proc-macro2", @@ -401,7 +401,7 @@ dependencies = [ name = "multiversx-sc-wasm-adapter" version = "0.43.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b059f22dfc3eb45aa015f6f20f28ed34dc42a65b42d282f8ac9b799b12e2942c" +checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" dependencies = [ "multiversx-sc", ] From b8a2a3f851e51c203b66cee507127c8573c65de5 Mon Sep 17 00:00:00 2001 From: Dorin Marian Iancu Date: Tue, 3 Oct 2023 14:05:46 +0300 Subject: [PATCH 110/213] revert energy update change --- locked-asset/proxy_dex/src/energy_update.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/locked-asset/proxy_dex/src/energy_update.rs b/locked-asset/proxy_dex/src/energy_update.rs index 9bc045b6d..0c62e34f7 100644 --- a/locked-asset/proxy_dex/src/energy_update.rs +++ b/locked-asset/proxy_dex/src/energy_update.rs @@ -46,6 +46,10 @@ pub trait EnergyUpdateModule: .get_token_attributes(token_id, token_nonce); energy.update_after_unlock_any(token_amount, attributes.unlock_epoch, current_epoch); } else if token_id == &old_locked_token_id { + if self.blockchain().is_smart_contract(user) { + return; + } + let attributes = self.decode_legacy_token(token_id, token_nonce); let epoch_amount_pairs = attributes.get_unlock_amounts_per_epoch(token_amount); for pair in epoch_amount_pairs.pairs { From 13d4b5dea9283e7e35e2aa4e81902c8e105b215a Mon Sep 17 00:00:00 2001 From: Dorin Marian Iancu Date: Thu, 5 Oct 2023 10:47:52 +0300 Subject: [PATCH 111/213] upgradeable contracts --- dex/farm-staking-proxy/wasm/Cargo.lock | 457 ------------------ dex/farm-staking/wasm/Cargo.lock | 389 --------------- dex/farm-with-locked-rewards/src/lib.rs | 3 + dex/farm/src/lib.rs | 3 + dex/farm_v1_2_mock/wasm/Cargo.lock | 276 ----------- dex/farm_with_lock/wasm/Cargo.lock | 428 ---------------- dex/governance/src/lib.rs | 3 + dex/pair/src/lib.rs | 3 + dex/price-discovery/src/lib.rs | 3 + dex/proxy-deployer/src/lib.rs | 3 + dex/router/src/contract.rs | 3 + energy-integration/energy-update/src/lib.rs | 3 + energy-integration/fees-collector/src/lib.rs | 3 + energy-integration/governance-v2/src/lib.rs | 3 + farm-staking/farm-staking-proxy/src/lib.rs | 3 + farm-staking/farm-staking/src/lib.rs | 3 + farm-staking/metabonding-staking/src/lib.rs | 3 + locked-asset/distribution/src/lib.rs | 3 + locked-asset/energy-factory/src/lib.rs | 3 + locked-asset/factory/src/lib.rs | 3 + locked-asset/lkmex-transfer/src/lib.rs | 3 + locked-asset/locked-token-wrapper/src/lib.rs | 3 + locked-asset/proxy_dex/src/lib.rs | 3 + locked-asset/simple-lock-whitelist/src/lib.rs | 3 + locked-asset/simple-lock/src/lib.rs | 3 + locked-asset/token-unstake/src/lib.rs | 3 + pair-mock/wasm/Cargo.lock | 300 ------------ pause-all/src/lib.rs | 3 + price-discovery/wasm/Cargo.lock | 336 ------------- 29 files changed, 69 insertions(+), 2186 deletions(-) delete mode 100644 dex/farm-staking-proxy/wasm/Cargo.lock delete mode 100644 dex/farm-staking/wasm/Cargo.lock delete mode 100644 dex/farm_v1_2_mock/wasm/Cargo.lock delete mode 100644 dex/farm_with_lock/wasm/Cargo.lock delete mode 100644 pair-mock/wasm/Cargo.lock delete mode 100644 price-discovery/wasm/Cargo.lock diff --git a/dex/farm-staking-proxy/wasm/Cargo.lock b/dex/farm-staking-proxy/wasm/Cargo.lock deleted file mode 100644 index 8f5238cd6..000000000 --- a/dex/farm-staking-proxy/wasm/Cargo.lock +++ /dev/null @@ -1,457 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" -dependencies = [ - "getrandom", - "once_cell", - "version_check", -] - -[[package]] -name = "arrayvec" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "config" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", - "token_send", -] - -[[package]] -name = "contexts" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "multiversx-sc", - "farm_token", - "rewards", - "token_merge", - "token_send", -] - -[[package]] -name = "either" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" - -[[package]] -name = "elrond-codec" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6d85f2b7c969a12da26157a989f759f59d1df2b0e2f4ae7b2ebb011334a63c1" -dependencies = [ - "arrayvec", - "elrond-codec-derive", - "wee_alloc", -] - -[[package]] -name = "elrond-codec-derive" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae84b062b57562daf6b90d12c6568a6df21ef355625f6dd21a3106d774456a51" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "multiversx-sc" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c99bd13acbd995a1b048fcc791a8acd8d2d4ab1085738c9077607d218fb2a42f" -dependencies = [ - "bitflags", - "elrond-codec", - "multiversx-sc-derive", - "hashbrown", - "hex-literal", - "wee_alloc", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a3e0e238435b3e1ac971e15ac345bf4f75efc88c8ee0032e286cf67dbff9681" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn", -] - -[[package]] -name = "multiversx-sc-node" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad55a0495ab1760ab532766529bc4b1cda04c918e44cfb2d84e1ac066d574397" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-output" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a1b54eef1004bb8b622b7f8cbe0100c715dfd58699bb7b0c5a50d23c3a87f38" -dependencies = [ - "multiversx-sc-node", - "wee_alloc", -] - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "events" -version = "0.0.0" -dependencies = [ - "common_structs", - "contexts", - "multiversx-sc", -] - -[[package]] -name = "factory" -version = "0.0.0" -dependencies = [ - "arrayvec", - "common_errors", - "common_structs", - "multiversx-sc", - "itertools", - "token_merge", - "token_send", - "wee_alloc", -] - -[[package]] -name = "farm" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "contexts", - "multiversx-sc", - "events", - "factory", - "farm_token", - "migration_from_v1_2", - "pair", - "rewards", - "token_merge", - "token_send", -] - -[[package]] -name = "farm-staking" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "multiversx-sc", - "factory", - "farm_token", - "pair", - "rewards", - "token_merge", - "token_send", -] - -[[package]] -name = "farm-staking-proxy" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "farm", - "farm-staking", - "hex-literal", - "pair", - "token_merge", -] - -[[package]] -name = "farm-staking-proxy-wasm" -version = "0.0.0" -dependencies = [ - "multiversx-sc-node", - "multiversx-sc-output", - "farm-staking-proxy", -] - -[[package]] -name = "farm_token" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "multiversx-sc", - "token_send", -] - -[[package]] -name = "getrandom" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d39cd93900197114fa1fcb7ae84ca742095eed9442088988ae74fa744e930e77" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "wasi", -] - -[[package]] -name = "hashbrown" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" -dependencies = [ - "ahash", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" - -[[package]] -name = "itertools" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" -dependencies = [ - "either", -] - -[[package]] -name = "libc" -version = "0.2.119" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bf2e165bb3457c8e098ea76f3e3bc9db55f87aa90d52d0e6be741470916aaa4" - -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - -[[package]] -name = "migration_from_v1_2" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "multiversx-sc", - "farm_token", - "rewards", - "token_send", -] - -[[package]] -name = "nibble_vec" -version = "0.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8d77f3db4bce033f4d04db08079b2ef1c3d02b44e86f25d08886fafa7756ffa" - -[[package]] -name = "once_cell" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" - -[[package]] -name = "pair" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "itertools", - "token_send", -] - -[[package]] -name = "proc-macro2" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" -dependencies = [ - "unicode-xid", -] - -[[package]] -name = "quote" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d3681b28cd95acfb0560ea9441f82d6a4504fa3b15b97bd7b6e952131820e95" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "rewards" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "multiversx-sc", - "farm_token", - "token_send", -] - -[[package]] -name = "syn" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] - -[[package]] -name = "token_merge" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", -] - -[[package]] -name = "token_send" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", -] - -[[package]] -name = "unicode-xid" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" - -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/dex/farm-staking/wasm/Cargo.lock b/dex/farm-staking/wasm/Cargo.lock deleted file mode 100644 index c4db9fb9a..000000000 --- a/dex/farm-staking/wasm/Cargo.lock +++ /dev/null @@ -1,389 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" -dependencies = [ - "getrandom", - "once_cell", - "version_check", -] - -[[package]] -name = "arrayvec" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "config" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", - "token_send", -] - -[[package]] -name = "either" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" - -[[package]] -name = "elrond-codec" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6d85f2b7c969a12da26157a989f759f59d1df2b0e2f4ae7b2ebb011334a63c1" -dependencies = [ - "arrayvec", - "elrond-codec-derive", - "wee_alloc", -] - -[[package]] -name = "elrond-codec-derive" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae84b062b57562daf6b90d12c6568a6df21ef355625f6dd21a3106d774456a51" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "multiversx-sc" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c99bd13acbd995a1b048fcc791a8acd8d2d4ab1085738c9077607d218fb2a42f" -dependencies = [ - "bitflags", - "elrond-codec", - "multiversx-sc-derive", - "hashbrown", - "hex-literal", - "wee_alloc", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a3e0e238435b3e1ac971e15ac345bf4f75efc88c8ee0032e286cf67dbff9681" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn", -] - -[[package]] -name = "multiversx-sc-node" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad55a0495ab1760ab532766529bc4b1cda04c918e44cfb2d84e1ac066d574397" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-output" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a1b54eef1004bb8b622b7f8cbe0100c715dfd58699bb7b0c5a50d23c3a87f38" -dependencies = [ - "multiversx-sc-node", - "wee_alloc", -] - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "factory" -version = "0.0.0" -dependencies = [ - "arrayvec", - "common_errors", - "common_structs", - "multiversx-sc", - "itertools", - "token_merge", - "token_send", - "wee_alloc", -] - -[[package]] -name = "farm-staking" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "multiversx-sc", - "factory", - "farm_token", - "pair", - "rewards", - "token_merge", - "token_send", -] - -[[package]] -name = "farm-staking-wasm" -version = "0.0.0" -dependencies = [ - "multiversx-sc-node", - "multiversx-sc-output", - "farm-staking", -] - -[[package]] -name = "farm_token" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "multiversx-sc", - "token_send", -] - -[[package]] -name = "getrandom" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "wasi", -] - -[[package]] -name = "hashbrown" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" -dependencies = [ - "ahash", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" - -[[package]] -name = "itertools" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" -dependencies = [ - "either", -] - -[[package]] -name = "libc" -version = "0.2.115" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a8d982fa7a96a000f6ec4cfe966de9703eccde29750df2bb8949da91b0e818d" - -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - -[[package]] -name = "nibble_vec" -version = "0.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8d77f3db4bce033f4d04db08079b2ef1c3d02b44e86f25d08886fafa7756ffa" - -[[package]] -name = "once_cell" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" - -[[package]] -name = "pair" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "itertools", - "token_send", -] - -[[package]] -name = "proc-macro2" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" -dependencies = [ - "unicode-xid", -] - -[[package]] -name = "quote" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d3681b28cd95acfb0560ea9441f82d6a4504fa3b15b97bd7b6e952131820e95" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "rewards" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "multiversx-sc", - "farm_token", - "token_send", -] - -[[package]] -name = "syn" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] - -[[package]] -name = "token_merge" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", -] - -[[package]] -name = "token_send" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", -] - -[[package]] -name = "unicode-xid" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" - -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/dex/farm-with-locked-rewards/src/lib.rs b/dex/farm-with-locked-rewards/src/lib.rs index 27421ac16..6a13bc7ef 100644 --- a/dex/farm-with-locked-rewards/src/lib.rs +++ b/dex/farm-with-locked-rewards/src/lib.rs @@ -81,6 +81,9 @@ pub trait Farm: self.try_set_farm_position_migration_nonce(farm_token_mapper); } + #[endpoint] + fn upgrade(&self) {} + #[payable("*")] #[endpoint(enterFarm)] fn enter_farm_endpoint( diff --git a/dex/farm/src/lib.rs b/dex/farm/src/lib.rs index 74456ad5c..97b280546 100644 --- a/dex/farm/src/lib.rs +++ b/dex/farm/src/lib.rs @@ -82,6 +82,9 @@ pub trait Farm: self.try_set_farm_position_migration_nonce(farm_token_mapper); } + #[endpoint] + fn upgrade(&self) {} + #[payable("*")] #[endpoint(enterFarm)] fn enter_farm_endpoint( diff --git a/dex/farm_v1_2_mock/wasm/Cargo.lock b/dex/farm_v1_2_mock/wasm/Cargo.lock deleted file mode 100644 index ac237c601..000000000 --- a/dex/farm_v1_2_mock/wasm/Cargo.lock +++ /dev/null @@ -1,276 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" -dependencies = [ - "getrandom", - "once_cell", - "version_check", -] - -[[package]] -name = "arrayvec" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "elrond-codec" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6d85f2b7c969a12da26157a989f759f59d1df2b0e2f4ae7b2ebb011334a63c1" -dependencies = [ - "arrayvec", - "elrond-codec-derive", - "wee_alloc", -] - -[[package]] -name = "elrond-codec-derive" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae84b062b57562daf6b90d12c6568a6df21ef355625f6dd21a3106d774456a51" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "multiversx-sc" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c99bd13acbd995a1b048fcc791a8acd8d2d4ab1085738c9077607d218fb2a42f" -dependencies = [ - "bitflags", - "elrond-codec", - "multiversx-sc-derive", - "hashbrown", - "hex-literal", - "wee_alloc", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a3e0e238435b3e1ac971e15ac345bf4f75efc88c8ee0032e286cf67dbff9681" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn", -] - -[[package]] -name = "multiversx-sc-node" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad55a0495ab1760ab532766529bc4b1cda04c918e44cfb2d84e1ac066d574397" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-output" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a1b54eef1004bb8b622b7f8cbe0100c715dfd58699bb7b0c5a50d23c3a87f38" -dependencies = [ - "multiversx-sc-node", - "wee_alloc", -] - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "farm_v1_2_mock" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "farm_v1_2_mock-wasm" -version = "0.0.0" -dependencies = [ - "multiversx-sc-node", - "multiversx-sc-output", - "farm_v1_2_mock", -] - -[[package]] -name = "getrandom" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d39cd93900197114fa1fcb7ae84ca742095eed9442088988ae74fa744e930e77" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "wasi", -] - -[[package]] -name = "hashbrown" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" -dependencies = [ - "ahash", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" - -[[package]] -name = "libc" -version = "0.2.119" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bf2e165bb3457c8e098ea76f3e3bc9db55f87aa90d52d0e6be741470916aaa4" - -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - -[[package]] -name = "nibble_vec" -version = "0.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8d77f3db4bce033f4d04db08079b2ef1c3d02b44e86f25d08886fafa7756ffa" - -[[package]] -name = "once_cell" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" - -[[package]] -name = "proc-macro2" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" -dependencies = [ - "unicode-xid", -] - -[[package]] -name = "quote" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d3681b28cd95acfb0560ea9441f82d6a4504fa3b15b97bd7b6e952131820e95" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "syn" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] - -[[package]] -name = "unicode-xid" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" - -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/dex/farm_with_lock/wasm/Cargo.lock b/dex/farm_with_lock/wasm/Cargo.lock deleted file mode 100644 index a286127a2..000000000 --- a/dex/farm_with_lock/wasm/Cargo.lock +++ /dev/null @@ -1,428 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" -dependencies = [ - "getrandom", - "once_cell", - "version_check", -] - -[[package]] -name = "arrayvec" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "config" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", - "token_send", -] - -[[package]] -name = "contexts" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "multiversx-sc", - "farm_token", - "rewards", - "token_merge", - "token_send", -] - -[[package]] -name = "either" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" - -[[package]] -name = "elrond-codec" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6d85f2b7c969a12da26157a989f759f59d1df2b0e2f4ae7b2ebb011334a63c1" -dependencies = [ - "arrayvec", - "elrond-codec-derive", - "wee_alloc", -] - -[[package]] -name = "elrond-codec-derive" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae84b062b57562daf6b90d12c6568a6df21ef355625f6dd21a3106d774456a51" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "multiversx-sc" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c99bd13acbd995a1b048fcc791a8acd8d2d4ab1085738c9077607d218fb2a42f" -dependencies = [ - "bitflags", - "elrond-codec", - "multiversx-sc-derive", - "hashbrown", - "hex-literal", - "wee_alloc", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a3e0e238435b3e1ac971e15ac345bf4f75efc88c8ee0032e286cf67dbff9681" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn", -] - -[[package]] -name = "multiversx-sc-node" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad55a0495ab1760ab532766529bc4b1cda04c918e44cfb2d84e1ac066d574397" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-output" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a1b54eef1004bb8b622b7f8cbe0100c715dfd58699bb7b0c5a50d23c3a87f38" -dependencies = [ - "multiversx-sc-node", - "wee_alloc", -] - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "events" -version = "0.0.0" -dependencies = [ - "common_structs", - "contexts", - "multiversx-sc", -] - -[[package]] -name = "factory" -version = "0.0.0" -dependencies = [ - "arrayvec", - "common_errors", - "common_structs", - "multiversx-sc", - "itertools", - "token_merge", - "token_send", - "wee_alloc", -] - -[[package]] -name = "farm_token" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "multiversx-sc", - "token_send", -] - -[[package]] -name = "farm_with_lock" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "contexts", - "multiversx-sc", - "events", - "factory", - "farm_token", - "migration_from_v1_2", - "pair", - "rewards", - "token_merge", - "token_send", -] - -[[package]] -name = "farm_with_lock-wasm" -version = "0.0.0" -dependencies = [ - "multiversx-sc-node", - "multiversx-sc-output", - "farm_with_lock", -] - -[[package]] -name = "getrandom" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "wasi", -] - -[[package]] -name = "hashbrown" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" -dependencies = [ - "ahash", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" - -[[package]] -name = "itertools" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" -dependencies = [ - "either", -] - -[[package]] -name = "libc" -version = "0.2.115" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a8d982fa7a96a000f6ec4cfe966de9703eccde29750df2bb8949da91b0e818d" - -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - -[[package]] -name = "migration_from_v1_2" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "multiversx-sc", - "farm_token", - "rewards", - "token_send", -] - -[[package]] -name = "nibble_vec" -version = "0.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8d77f3db4bce033f4d04db08079b2ef1c3d02b44e86f25d08886fafa7756ffa" - -[[package]] -name = "once_cell" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" - -[[package]] -name = "pair" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "itertools", - "token_send", -] - -[[package]] -name = "proc-macro2" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" -dependencies = [ - "unicode-xid", -] - -[[package]] -name = "quote" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d3681b28cd95acfb0560ea9441f82d6a4504fa3b15b97bd7b6e952131820e95" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "rewards" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "multiversx-sc", - "farm_token", - "token_send", -] - -[[package]] -name = "syn" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] - -[[package]] -name = "token_merge" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", -] - -[[package]] -name = "token_send" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", -] - -[[package]] -name = "unicode-xid" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" - -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/dex/governance/src/lib.rs b/dex/governance/src/lib.rs index 605ba4ba0..e9d4147d3 100644 --- a/dex/governance/src/lib.rs +++ b/dex/governance/src/lib.rs @@ -49,6 +49,9 @@ pub trait Governance: self.try_change_price_providers(price_providers); } + #[endpoint] + fn upgrade(&self) {} + #[payable("*")] #[endpoint] fn propose(&self, args: ProposalCreationArgs) -> u64 { diff --git a/dex/pair/src/lib.rs b/dex/pair/src/lib.rs index 425b7acc1..7bc69c42b 100644 --- a/dex/pair/src/lib.rs +++ b/dex/pair/src/lib.rs @@ -102,6 +102,9 @@ pub trait Pair: }; } + #[endpoint] + fn upgrade(&self) {} + #[payable("*")] #[endpoint(addInitialLiquidity)] fn add_initial_liquidity(&self) -> AddLiquidityResultType { diff --git a/dex/price-discovery/src/lib.rs b/dex/price-discovery/src/lib.rs index 30799231a..32a07acf0 100644 --- a/dex/price-discovery/src/lib.rs +++ b/dex/price-discovery/src/lib.rs @@ -113,6 +113,9 @@ pub trait PriceDiscovery: self.set_locking_sc_address(locking_sc_address); } + #[endpoint] + fn upgrade(&self) {} + /// Users can deposit either launched_token or accepted_token. /// They will receive an SFT that can be used to withdraw said tokens #[payable("*")] diff --git a/dex/proxy-deployer/src/lib.rs b/dex/proxy-deployer/src/lib.rs index 38c3b546b..a05bab7b0 100644 --- a/dex/proxy-deployer/src/lib.rs +++ b/dex/proxy-deployer/src/lib.rs @@ -15,4 +15,7 @@ pub trait ProxyDeployer: farm_deploy::FarmDeployModule { self.farm_template_address().set(&farm_template_address); } + + #[endpoint] + fn upgrade(&self) {} } diff --git a/dex/router/src/contract.rs b/dex/router/src/contract.rs index 56e9cba45..e5db4235f 100644 --- a/dex/router/src/contract.rs +++ b/dex/router/src/contract.rs @@ -39,6 +39,9 @@ pub trait Router: self.owner().set(&self.blockchain().get_caller()); } + #[endpoint] + fn upgrade(&self) {} + #[only_owner] #[endpoint] fn pause(&self, address: ManagedAddress) { diff --git a/energy-integration/energy-update/src/lib.rs b/energy-integration/energy-update/src/lib.rs index 730dd8f70..a8e10213f 100644 --- a/energy-integration/energy-update/src/lib.rs +++ b/energy-integration/energy-update/src/lib.rs @@ -9,6 +9,9 @@ pub trait EnergyUpdate { #[init] fn init(&self) {} + #[endpoint] + fn upgrade(&self) {} + #[endpoint(updateFarmsEnergyForUser)] fn update_farms_energy_for_user( &self, diff --git a/energy-integration/fees-collector/src/lib.rs b/energy-integration/fees-collector/src/lib.rs index f2aef7a34..cf1d8b6c8 100644 --- a/energy-integration/fees-collector/src/lib.rs +++ b/energy-integration/fees-collector/src/lib.rs @@ -44,6 +44,9 @@ pub trait FeesCollector: self.energy_factory_address().set(&energy_factory_address); } + #[endpoint] + fn upgrade(&self) {} + #[endpoint(claimRewards)] fn claim_rewards( &self, diff --git a/energy-integration/governance-v2/src/lib.rs b/energy-integration/governance-v2/src/lib.rs index bdeba1326..9c9de7613 100644 --- a/energy-integration/governance-v2/src/lib.rs +++ b/energy-integration/governance-v2/src/lib.rs @@ -61,6 +61,9 @@ pub trait GovernanceV2: self.try_change_fee_token_id(fee_token); } + #[endpoint] + fn upgrade(&self) {} + /// Propose a list of actions. /// A maximum of MAX_GOVERNANCE_PROPOSAL_ACTIONS can be proposed at a time. /// diff --git a/farm-staking/farm-staking-proxy/src/lib.rs b/farm-staking/farm-staking-proxy/src/lib.rs index f9c5d5e2f..24bd0d78d 100644 --- a/farm-staking/farm-staking-proxy/src/lib.rs +++ b/farm-staking/farm-staking-proxy/src/lib.rs @@ -52,4 +52,7 @@ pub trait FarmStakingProxy: .set_if_empty(&staking_farm_token_id); self.lp_token_id().set_if_empty(&lp_token_id); } + + #[endpoint] + fn upgrade(&self) {} } diff --git a/farm-staking/farm-staking/src/lib.rs b/farm-staking/farm-staking/src/lib.rs index 5bd41cecf..e44b3b3df 100644 --- a/farm-staking/farm-staking/src/lib.rs +++ b/farm-staking/farm-staking/src/lib.rs @@ -94,6 +94,9 @@ pub trait FarmStaking: self.try_set_farm_position_migration_nonce(farm_token_mapper); } + #[endpoint] + fn upgrade(&self) {} + #[payable("*")] #[endpoint(mergeFarmTokens)] fn merge_farm_tokens_endpoint(&self) -> DoubleMultiPayment { diff --git a/farm-staking/metabonding-staking/src/lib.rs b/farm-staking/metabonding-staking/src/lib.rs index c4927d3de..94be22193 100644 --- a/farm-staking/metabonding-staking/src/lib.rs +++ b/farm-staking/metabonding-staking/src/lib.rs @@ -26,6 +26,9 @@ pub trait MetabondingStaking: .set_if_empty(&locked_asset_factory_address); } + #[endpoint] + fn upgrade(&self) {} + #[payable("*")] #[endpoint(stakeLockedAsset)] fn stake_locked_asset(&self) { diff --git a/locked-asset/distribution/src/lib.rs b/locked-asset/distribution/src/lib.rs index 1ae78b009..93187154e 100644 --- a/locked-asset/distribution/src/lib.rs +++ b/locked-asset/distribution/src/lib.rs @@ -47,6 +47,9 @@ pub trait Distribution: global_op::GlobalOperationModule { .set_if_empty(&locked_asset_factory_address); } + #[endpoint] + fn upgrade(&self) {} + #[only_owner] #[endpoint(setCommunityDistribution)] fn set_community_distribution(&self, total_amount: BigUint, spread_epoch: u64) { diff --git a/locked-asset/energy-factory/src/lib.rs b/locked-asset/energy-factory/src/lib.rs index a39dcc117..d146566d6 100644 --- a/locked-asset/energy-factory/src/lib.rs +++ b/locked-asset/energy-factory/src/lib.rs @@ -91,6 +91,9 @@ pub trait SimpleLockEnergy: self.set_paused(true); } + #[endpoint] + fn upgrade(&self) {} + /// Locks a whitelisted token until `unlock_epoch` and receive meta ESDT LOCKED tokens /// on a 1:1 ratio. Accepted input tokens: /// - base asset token diff --git a/locked-asset/factory/src/lib.rs b/locked-asset/factory/src/lib.rs index 21084b2f1..d8de993b4 100644 --- a/locked-asset/factory/src/lib.rs +++ b/locked-asset/factory/src/lib.rs @@ -63,6 +63,9 @@ pub trait LockedAssetFactory: self.set_paused(true); } + #[endpoint] + fn upgrade(&self) {} + fn set_extended_attributes_activation_nonce(&self, is_sc_upgrade: bool) { if !self.extended_attributes_activation_nonce().is_empty() { return; diff --git a/locked-asset/lkmex-transfer/src/lib.rs b/locked-asset/lkmex-transfer/src/lib.rs index f716b55a3..7c187882e 100644 --- a/locked-asset/lkmex-transfer/src/lib.rs +++ b/locked-asset/lkmex-transfer/src/lib.rs @@ -56,6 +56,9 @@ pub trait LkmexTransfer: self.add_permissions(caller, Permissions::OWNER); } + #[endpoint] + fn upgrade(&self) {} + #[endpoint] fn withdraw(&self, sender: ManagedAddress) { let receiver = self.blockchain().get_caller(); diff --git a/locked-asset/locked-token-wrapper/src/lib.rs b/locked-asset/locked-token-wrapper/src/lib.rs index 0998f92f5..980736f63 100644 --- a/locked-asset/locked-token-wrapper/src/lib.rs +++ b/locked-asset/locked-token-wrapper/src/lib.rs @@ -20,6 +20,9 @@ pub trait LockedTokenWrapper: self.energy_factory_address().set(&energy_factory_address); } + #[endpoint] + fn upgrade(&self) {} + #[payable("*")] #[endpoint(wrapLockedToken)] fn wrap_locked_token_endpoint(&self) -> EsdtTokenPayment { diff --git a/locked-asset/proxy_dex/src/lib.rs b/locked-asset/proxy_dex/src/lib.rs index e8ff52eec..757f7d505 100644 --- a/locked-asset/proxy_dex/src/lib.rs +++ b/locked-asset/proxy_dex/src/lib.rs @@ -57,6 +57,9 @@ pub trait ProxyDexImpl: .set_if_empty(&energy_factory_address); } + #[endpoint] + fn upgrade(&self) {} + #[only_owner] #[payable("EGLD")] #[endpoint(registerProxyPair)] diff --git a/locked-asset/simple-lock-whitelist/src/lib.rs b/locked-asset/simple-lock-whitelist/src/lib.rs index 80043ec08..48192fb15 100644 --- a/locked-asset/simple-lock-whitelist/src/lib.rs +++ b/locked-asset/simple-lock-whitelist/src/lib.rs @@ -28,6 +28,9 @@ pub trait SimpleLockWhitelist: } } + #[endpoint] + fn upgrade(&self) {} + /// Sets the transfer role for the given address. Defaults to own address. #[only_owner] #[endpoint(setTransferRoleLockedToken)] diff --git a/locked-asset/simple-lock/src/lib.rs b/locked-asset/simple-lock/src/lib.rs index f21f1721f..5db24f38e 100644 --- a/locked-asset/simple-lock/src/lib.rs +++ b/locked-asset/simple-lock/src/lib.rs @@ -25,6 +25,9 @@ pub trait SimpleLock: #[init] fn init(&self) {} + #[endpoint] + fn upgrade(&self) {} + /// Locks any token (including EGLD) until `unlock_epoch` and receive meta ESDT LOCKED tokens. /// on a 1:1 ratio. If unlock epoch has already passed, the original tokens are sent instead. /// diff --git a/locked-asset/token-unstake/src/lib.rs b/locked-asset/token-unstake/src/lib.rs index d160fce58..6295d46a2 100644 --- a/locked-asset/token-unstake/src/lib.rs +++ b/locked-asset/token-unstake/src/lib.rs @@ -41,4 +41,7 @@ pub trait TokenUnstakeModule: self.fees_collector_address().set(&fees_collector_address); self.fees_burn_percentage().set(fees_burn_percentage); } + + #[endpoint] + fn upgrade(&self) {} } diff --git a/pair-mock/wasm/Cargo.lock b/pair-mock/wasm/Cargo.lock deleted file mode 100644 index bcd19a52a..000000000 --- a/pair-mock/wasm/Cargo.lock +++ /dev/null @@ -1,300 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" -dependencies = [ - "getrandom", - "once_cell", - "version_check", -] - -[[package]] -name = "arrayvec" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "either" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" - -[[package]] -name = "elrond-codec" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6d85f2b7c969a12da26157a989f759f59d1df2b0e2f4ae7b2ebb011334a63c1" -dependencies = [ - "arrayvec", - "elrond-codec-derive", - "wee_alloc", -] - -[[package]] -name = "elrond-codec-derive" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae84b062b57562daf6b90d12c6568a6df21ef355625f6dd21a3106d774456a51" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "multiversx-sc" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c99bd13acbd995a1b048fcc791a8acd8d2d4ab1085738c9077607d218fb2a42f" -dependencies = [ - "bitflags", - "elrond-codec", - "multiversx-sc-derive", - "hashbrown", - "hex-literal", - "wee_alloc", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a3e0e238435b3e1ac971e15ac345bf4f75efc88c8ee0032e286cf67dbff9681" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn", -] - -[[package]] -name = "multiversx-sc-node" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad55a0495ab1760ab532766529bc4b1cda04c918e44cfb2d84e1ac066d574397" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-output" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a1b54eef1004bb8b622b7f8cbe0100c715dfd58699bb7b0c5a50d23c3a87f38" -dependencies = [ - "multiversx-sc-node", - "wee_alloc", -] - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "getrandom" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "wasi", -] - -[[package]] -name = "hashbrown" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" -dependencies = [ - "ahash", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" - -[[package]] -name = "itertools" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" -dependencies = [ - "either", -] - -[[package]] -name = "libc" -version = "0.2.115" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a8d982fa7a96a000f6ec4cfe966de9703eccde29750df2bb8949da91b0e818d" - -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - -[[package]] -name = "nibble_vec" -version = "0.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8d77f3db4bce033f4d04db08079b2ef1c3d02b44e86f25d08886fafa7756ffa" - -[[package]] -name = "once_cell" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" - -[[package]] -name = "pair-mock" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", - "itertools", -] - -[[package]] -name = "pair-mock-wasm" -version = "0.0.0" -dependencies = [ - "multiversx-sc-node", - "multiversx-sc-output", - "pair-mock", -] - -[[package]] -name = "proc-macro2" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" -dependencies = [ - "unicode-xid", -] - -[[package]] -name = "quote" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d3681b28cd95acfb0560ea9441f82d6a4504fa3b15b97bd7b6e952131820e95" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "syn" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] - -[[package]] -name = "unicode-xid" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" - -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/pause-all/src/lib.rs b/pause-all/src/lib.rs index 732e16678..6e9bcd823 100644 --- a/pause-all/src/lib.rs +++ b/pause-all/src/lib.rs @@ -28,6 +28,9 @@ pub trait PauseAll: #[init] fn init(&self) {} + #[endpoint] + fn upgrade(&self) {} + #[only_owner] #[endpoint(addPausableContracts)] fn add_pausable_contracts(&self, pausable_sc_addr: MultiValueEncoded) { diff --git a/price-discovery/wasm/Cargo.lock b/price-discovery/wasm/Cargo.lock deleted file mode 100644 index 9f0b1af16..000000000 --- a/price-discovery/wasm/Cargo.lock +++ /dev/null @@ -1,336 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" -dependencies = [ - "getrandom", - "once_cell", - "version_check", -] - -[[package]] -name = "arrayvec" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "either" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" - -[[package]] -name = "elrond-codec" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6d85f2b7c969a12da26157a989f759f59d1df2b0e2f4ae7b2ebb011334a63c1" -dependencies = [ - "arrayvec", - "elrond-codec-derive", - "wee_alloc", -] - -[[package]] -name = "elrond-codec-derive" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae84b062b57562daf6b90d12c6568a6df21ef355625f6dd21a3106d774456a51" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "multiversx-sc" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c99bd13acbd995a1b048fcc791a8acd8d2d4ab1085738c9077607d218fb2a42f" -dependencies = [ - "bitflags", - "elrond-codec", - "multiversx-sc-derive", - "hashbrown", - "hex-literal", - "wee_alloc", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a3e0e238435b3e1ac971e15ac345bf4f75efc88c8ee0032e286cf67dbff9681" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn", -] - -[[package]] -name = "multiversx-sc-node" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad55a0495ab1760ab532766529bc4b1cda04c918e44cfb2d84e1ac066d574397" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-output" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a1b54eef1004bb8b622b7f8cbe0100c715dfd58699bb7b0c5a50d23c3a87f38" -dependencies = [ - "multiversx-sc-node", - "wee_alloc", -] - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "getrandom" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "wasi", -] - -[[package]] -name = "hashbrown" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" -dependencies = [ - "ahash", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" - -[[package]] -name = "itertools" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" -dependencies = [ - "either", -] - -[[package]] -name = "libc" -version = "0.2.115" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a8d982fa7a96a000f6ec4cfe966de9703eccde29750df2bb8949da91b0e818d" - -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - -[[package]] -name = "nibble_vec" -version = "0.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8d77f3db4bce033f4d04db08079b2ef1c3d02b44e86f25d08886fafa7756ffa" - -[[package]] -name = "once_cell" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" - -[[package]] -name = "pair" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "itertools", - "token_send", -] - -[[package]] -name = "price-discovery" -version = "0.0.0" -dependencies = [ - "multiversx-sc", - "hex-literal", - "pair", - "token_merge", -] - -[[package]] -name = "price-discovery-wasm" -version = "0.0.0" -dependencies = [ - "multiversx-sc-node", - "multiversx-sc-output", - "price-discovery", -] - -[[package]] -name = "proc-macro2" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" -dependencies = [ - "unicode-xid", -] - -[[package]] -name = "quote" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d3681b28cd95acfb0560ea9441f82d6a4504fa3b15b97bd7b6e952131820e95" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "syn" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] - -[[package]] -name = "token_merge" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", -] - -[[package]] -name = "token_send" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", -] - -[[package]] -name = "unicode-xid" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" - -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" From c74132aa4c941b8b40294716e6d249380aa325c6 Mon Sep 17 00:00:00 2001 From: Dorin Marian Iancu Date: Mon, 9 Oct 2023 13:39:40 +0300 Subject: [PATCH 112/213] opt caller arg --- locked-asset/proxy_dex/Cargo.toml | 6 +- .../proxy_dex/src/farm_interactions.rs | 12 +-- locked-asset/proxy_dex/src/lib.rs | 5 +- ...{sc_whitelist.rs => other_sc_whitelist.rs} | 2 +- locked-asset/proxy_dex/src/proxy_farm.rs | 80 ++++++++++++++----- locked-asset/proxy_dex/src/proxy_pair.rs | 4 +- .../proxy_dex/src/wrapped_farm_token_merge.rs | 2 +- .../tests/proxy_dex_test_setup/mod.rs | 2 +- .../proxy_dex/tests/proxy_farm_test.rs | 47 +++++++---- 9 files changed, 106 insertions(+), 54 deletions(-) rename locked-asset/proxy_dex/src/{sc_whitelist.rs => other_sc_whitelist.rs} (97%) diff --git a/locked-asset/proxy_dex/Cargo.toml b/locked-asset/proxy_dex/Cargo.toml index 2bbeec0d2..bec88ca06 100644 --- a/locked-asset/proxy_dex/Cargo.toml +++ b/locked-asset/proxy_dex/Cargo.toml @@ -59,6 +59,9 @@ path = "../../energy-integration/common-modules/energy-query" [dependencies.simple-lock] path = "../simple-lock" +[dependencies.sc_whitelist_module] +path = "../../common/modules/sc_whitelist_module" + [dev-dependencies] num-bigint = "0.4.2" num-traits = "0.2" @@ -82,8 +85,5 @@ path = "../../common/modules/farm/farm_token" [dev-dependencies.rewards] path = "../../common/modules/farm/rewards" -[dev-dependencies.sc_whitelist_module] -path = "../../common/modules/sc_whitelist_module" - [dev-dependencies.farm-boosted-yields] path = "../../energy-integration/farm-boosted-yields" diff --git a/locked-asset/proxy_dex/src/farm_interactions.rs b/locked-asset/proxy_dex/src/farm_interactions.rs index 0ccabdb33..e1620f1d4 100644 --- a/locked-asset/proxy_dex/src/farm_interactions.rs +++ b/locked-asset/proxy_dex/src/farm_interactions.rs @@ -19,14 +19,14 @@ pub struct ExitFarmResultWrapper { pub trait FarmInteractionsModule { fn call_enter_farm( &self, + user: ManagedAddress, farm_address: ManagedAddress, farming_token_id: TokenIdentifier, farming_token_amount: BigUint, ) -> EnterFarmResultWrapper { - let original_caller = self.blockchain().get_caller(); let enter_farm_result: EnterFarmResultType = self .farm_contract_proxy(farm_address) - .enter_farm_endpoint(original_caller) + .enter_farm_endpoint(user) .with_esdt_transfer((farming_token_id, 0, farming_token_amount)) .execute_on_dest_context(); @@ -40,13 +40,13 @@ pub trait FarmInteractionsModule { fn call_exit_farm( &self, + user: ManagedAddress, farm_address: ManagedAddress, farm_token: EsdtTokenPayment, ) -> ExitFarmResultWrapper { - let original_caller = self.blockchain().get_caller(); let raw_result: ExitFarmWithPartialPosResultType = self .farm_contract_proxy(farm_address) - .exit_farm_endpoint(original_caller) + .exit_farm_endpoint(user) .with_esdt_transfer(farm_token) .execute_on_dest_context(); let (farming_tokens, reward_tokens) = raw_result.into_tuple(); @@ -59,13 +59,13 @@ pub trait FarmInteractionsModule { fn call_claim_rewards_farm( &self, + user: ManagedAddress, farm_address: ManagedAddress, farm_token: EsdtTokenPayment, ) -> ClaimRewardsResultWrapper { - let original_caller = self.blockchain().get_caller(); let raw_result: ClaimRewardsResultType = self .farm_contract_proxy(farm_address) - .claim_rewards_endpoint(original_caller) + .claim_rewards_endpoint(user) .with_esdt_transfer(farm_token) .execute_on_dest_context(); let (new_farm_token, rewards) = raw_result.into_tuple(); diff --git a/locked-asset/proxy_dex/src/lib.rs b/locked-asset/proxy_dex/src/lib.rs index 757f7d505..d81055288 100644 --- a/locked-asset/proxy_dex/src/lib.rs +++ b/locked-asset/proxy_dex/src/lib.rs @@ -13,7 +13,7 @@ pub mod pair_interactions; pub mod proxy_common; pub mod proxy_farm; pub mod proxy_pair; -pub mod sc_whitelist; +pub mod other_sc_whitelist; pub mod wrapped_farm_attributes; pub mod wrapped_farm_token_merge; pub mod wrapped_lp_attributes; @@ -22,7 +22,7 @@ pub mod wrapped_lp_token_merge; #[multiversx_sc::contract] pub trait ProxyDexImpl: proxy_common::ProxyCommonModule - + sc_whitelist::ScWhitelistModule + + crate::other_sc_whitelist::OtherScWhitelistModule + proxy_pair::ProxyPairModule + pair_interactions::PairInteractionsModule + proxy_farm::ProxyFarmModule @@ -37,6 +37,7 @@ pub trait ProxyDexImpl: + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule + utils::UtilsModule + legacy_token_decode_module::LegacyTokenDecodeModule + + sc_whitelist_module::SCWhitelistModule { #[init] fn init( diff --git a/locked-asset/proxy_dex/src/sc_whitelist.rs b/locked-asset/proxy_dex/src/other_sc_whitelist.rs similarity index 97% rename from locked-asset/proxy_dex/src/sc_whitelist.rs rename to locked-asset/proxy_dex/src/other_sc_whitelist.rs index d89b767f8..5fe43bffd 100644 --- a/locked-asset/proxy_dex/src/sc_whitelist.rs +++ b/locked-asset/proxy_dex/src/other_sc_whitelist.rs @@ -1,7 +1,7 @@ multiversx_sc::imports!(); #[multiversx_sc::module] -pub trait ScWhitelistModule { +pub trait OtherScWhitelistModule { #[only_owner] #[endpoint(addPairToIntermediate)] fn add_pair_to_intermediate(&self, pair_address: ManagedAddress) { diff --git a/locked-asset/proxy_dex/src/proxy_farm.rs b/locked-asset/proxy_dex/src/proxy_farm.rs index d77e6d212..e21d4b0b4 100644 --- a/locked-asset/proxy_dex/src/proxy_farm.rs +++ b/locked-asset/proxy_dex/src/proxy_farm.rs @@ -12,18 +12,20 @@ use crate::{ wrapped_lp_attributes::WrappedLpTokenAttributes, }; -pub struct FarmingFarmTokenPair { +pub struct EnterFarmResult { pub farming_token: EsdtTokenPayment, pub farm_token: EsdtTokenPayment, + pub rewards: EsdtTokenPayment, } +pub type EnterFarmProxyResultType = MultiValue2, EsdtTokenPayment>; pub type ExitFarmProxyResultType = MultiValue2, EsdtTokenPayment>; pub type ClaimRewardsFarmProxyResultType = MultiValue2, EsdtTokenPayment>; #[multiversx_sc::module] pub trait ProxyFarmModule: crate::proxy_common::ProxyCommonModule - + crate::sc_whitelist::ScWhitelistModule + + crate::other_sc_whitelist::OtherScWhitelistModule + crate::proxy_pair::ProxyPairModule + crate::pair_interactions::PairInteractionsModule + crate::farm_interactions::FarmInteractionsModule @@ -36,30 +38,44 @@ pub trait ProxyFarmModule: + crate::events::EventsModule + utils::UtilsModule + legacy_token_decode_module::LegacyTokenDecodeModule + + sc_whitelist_module::SCWhitelistModule { #[payable("*")] #[endpoint(enterFarmProxy)] - fn enter_farm_proxy_endpoint(&self, farm_address: ManagedAddress) -> EsdtTokenPayment { + fn enter_farm_proxy_endpoint( + &self, + farm_address: ManagedAddress, + opt_original_caller: OptionalValue, + ) -> EnterFarmProxyResultType { self.require_is_intermediated_farm(&farm_address); self.require_wrapped_farm_token_id_not_empty(); self.require_wrapped_lp_token_id_not_empty(); let caller = self.blockchain().get_caller(); + let original_caller = self.get_orig_caller_from_opt(&caller, opt_original_caller); + let mut payments = self.get_non_empty_payments(); let proxy_farming_token = self.pop_first_payment(&mut payments); let wrapped_lp_token_id = self.wrapped_lp_token().get_token_id(); - let farm_farming_token_pair = if self.is_locked_token(&proxy_farming_token.token_identifier) - { - self.enter_farm_locked_token(farm_address.clone(), proxy_farming_token.clone()) + let enter_result = if self.is_locked_token(&proxy_farming_token.token_identifier) { + self.enter_farm_locked_token( + original_caller.clone(), + farm_address.clone(), + proxy_farming_token.clone(), + ) } else if proxy_farming_token.token_identifier == wrapped_lp_token_id { - self.enter_farm_wrapped_lp(farm_address.clone(), proxy_farming_token.clone()) + self.enter_farm_wrapped_lp( + original_caller.clone(), + farm_address.clone(), + proxy_farming_token.clone(), + ) } else { sc_panic!(INVALID_PAYMENTS_ERR_MSG) }; let new_token_attributes = WrappedFarmTokenAttributes { - farm_token: farm_farming_token_pair.farm_token, + farm_token: enter_result.farm_token, proxy_farming_token, }; @@ -72,7 +88,7 @@ pub trait ProxyFarmModule: self.send().esdt_local_burn_multi(&payments); self.merge_wrapped_farm_tokens_with_virtual_pos( - &caller, + &original_caller, farm_address.clone(), wrapped_lp_tokens, new_token_attributes, @@ -89,46 +105,51 @@ pub trait ProxyFarmModule: }; self.send_payment_non_zero(&caller, &new_wrapped_farm_token.payment); + self.send_payment_non_zero(&caller, &enter_result.rewards); self.emit_enter_farm_proxy_event( - &caller, + &original_caller, &farm_address, - farm_farming_token_pair.farming_token, + enter_result.farming_token, new_wrapped_farm_token.payment.clone(), new_wrapped_farm_token.attributes, token_merge_requested, ); - new_wrapped_farm_token.payment + (new_wrapped_farm_token.payment, enter_result.rewards).into() } fn enter_farm_locked_token( &self, + user: ManagedAddress, farm_address: ManagedAddress, locked_token: EsdtTokenPayment, - ) -> FarmingFarmTokenPair { + ) -> EnterFarmResult { let asset_token_id = self.get_base_token_id(); self.send() .esdt_local_mint(&asset_token_id, 0, &locked_token.amount); let minted_asset_tokens = EsdtTokenPayment::new(asset_token_id, 0, locked_token.amount); let enter_result = self.call_enter_farm( + user, farm_address, minted_asset_tokens.token_identifier.clone(), minted_asset_tokens.amount.clone(), ); - FarmingFarmTokenPair { + EnterFarmResult { farming_token: minted_asset_tokens, farm_token: enter_result.farm_token, + rewards: enter_result.reward_token, } } fn enter_farm_wrapped_lp( &self, + user: ManagedAddress, farm_address: ManagedAddress, wrapped_lp_token: EsdtTokenPayment, - ) -> FarmingFarmTokenPair { + ) -> EnterFarmResult { let wrapped_lp_token_mapper = self.wrapped_lp_token(); let wrapped_lp_attributes: WrappedLpTokenAttributes = self .get_attributes_as_part_of_fixed_supply(&wrapped_lp_token, &wrapped_lp_token_mapper); @@ -139,20 +160,26 @@ pub trait ProxyFarmModule: wrapped_lp_attributes.lp_token_amount, ); let enter_result = self.call_enter_farm( + user, farm_address, farming_token.token_identifier.clone(), farming_token.amount.clone(), ); - FarmingFarmTokenPair { + EnterFarmResult { farming_token, farm_token: enter_result.farm_token, + rewards: enter_result.reward_token, } } #[payable("*")] #[endpoint(exitFarmProxy)] - fn exit_farm_proxy(&self, farm_address: ManagedAddress) -> ExitFarmProxyResultType { + fn exit_farm_proxy( + &self, + farm_address: ManagedAddress, + opt_original_caller: OptionalValue, + ) -> ExitFarmProxyResultType { self.require_is_intermediated_farm(&farm_address); self.require_wrapped_farm_token_id_not_empty(); self.require_wrapped_lp_token_id_not_empty(); @@ -169,7 +196,12 @@ pub trait ProxyFarmModule: full_wrapped_farm_attributes .clone() .into_part(&payment.amount); + + let caller = self.blockchain().get_caller(); + let original_caller = self.get_orig_caller_from_opt(&caller, opt_original_caller); + let exit_result = self.call_exit_farm( + original_caller.clone(), farm_address.clone(), wrapped_farm_attributes_for_exit.farm_token.clone(), ); @@ -181,10 +213,9 @@ pub trait ProxyFarmModule: attributes: wrapped_farm_attributes_for_exit.clone(), }; - let caller = self.blockchain().get_caller(); let initial_proxy_farming_tokens = self .handle_farm_penalty_and_get_output_proxy_farming_token( - &caller, + &original_caller, wrapped_farm_tokens_for_initial_tokens, exit_result.farming_tokens.amount, ); @@ -195,7 +226,7 @@ pub trait ProxyFarmModule: wrapped_farm_token_mapper.nft_burn(payment.token_nonce, &payment.amount); self.emit_exit_farm_proxy_event( - &caller, + &original_caller, &farm_address, payment, wrapped_farm_attributes_for_exit, @@ -262,6 +293,7 @@ pub trait ProxyFarmModule: fn claim_rewards_proxy( &self, farm_address: ManagedAddress, + opt_original_caller: OptionalValue, ) -> ClaimRewardsFarmProxyResultType { self.require_is_intermediated_farm(&farm_address); self.require_wrapped_farm_token_id_not_empty(); @@ -273,7 +305,12 @@ pub trait ProxyFarmModule: let wrapped_farm_attributes: WrappedFarmTokenAttributes = self.get_attributes_as_part_of_fixed_supply(&payment, &wrapped_farm_token_mapper); + + let caller = self.blockchain().get_caller(); + let original_caller = self.get_orig_caller_from_opt(&caller, opt_original_caller); + let claim_result = self.call_claim_rewards_farm( + original_caller.clone(), farm_address.clone(), wrapped_farm_attributes.farm_token.clone(), ); @@ -286,12 +323,11 @@ pub trait ProxyFarmModule: let new_wrapped_token = wrapped_farm_token_mapper.nft_create(new_token_amount, &new_wrapped_farm_attributes); - let caller = self.blockchain().get_caller(); self.send_payment_non_zero(&caller, &new_wrapped_token); self.send_payment_non_zero(&caller, &claim_result.rewards); self.emit_claim_rewards_farm_proxy_event( - &caller, + &original_caller, &farm_address, payment, wrapped_farm_attributes, diff --git a/locked-asset/proxy_dex/src/proxy_pair.rs b/locked-asset/proxy_dex/src/proxy_pair.rs index e6a2f4d1b..1536f41cb 100644 --- a/locked-asset/proxy_dex/src/proxy_pair.rs +++ b/locked-asset/proxy_dex/src/proxy_pair.rs @@ -12,14 +12,14 @@ use fixed_supply_token::FixedSupplyToken; #[multiversx_sc::module] pub trait ProxyPairModule: crate::proxy_common::ProxyCommonModule - + crate::sc_whitelist::ScWhitelistModule + + crate::other_sc_whitelist::OtherScWhitelistModule + crate::pair_interactions::PairInteractionsModule + crate::wrapped_lp_token_merge::WrappedLpTokenMerge + crate::energy_update::EnergyUpdateModule + + crate::events::EventsModule + energy_query::EnergyQueryModule + token_merge_helper::TokenMergeHelperModule + token_send::TokenSendModule - + crate::events::EventsModule + utils::UtilsModule + legacy_token_decode_module::LegacyTokenDecodeModule { diff --git a/locked-asset/proxy_dex/src/wrapped_farm_token_merge.rs b/locked-asset/proxy_dex/src/wrapped_farm_token_merge.rs index f4052f337..5b071a2f1 100644 --- a/locked-asset/proxy_dex/src/wrapped_farm_token_merge.rs +++ b/locked-asset/proxy_dex/src/wrapped_farm_token_merge.rs @@ -13,7 +13,7 @@ use fixed_supply_token::FixedSupplyToken; pub trait WrappedFarmTokenMerge: token_merge_helper::TokenMergeHelperModule + token_send::TokenSendModule - + crate::sc_whitelist::ScWhitelistModule + + crate::other_sc_whitelist::OtherScWhitelistModule + crate::proxy_common::ProxyCommonModule + crate::wrapped_lp_token_merge::WrappedLpTokenMerge + utils::UtilsModule diff --git a/locked-asset/proxy_dex/tests/proxy_dex_test_setup/mod.rs b/locked-asset/proxy_dex/tests/proxy_dex_test_setup/mod.rs index c93cfc924..59da1640a 100644 --- a/locked-asset/proxy_dex/tests/proxy_dex_test_setup/mod.rs +++ b/locked-asset/proxy_dex/tests/proxy_dex_test_setup/mod.rs @@ -21,7 +21,7 @@ use multiversx_sc_scenario::{ }; use pair::{config::ConfigModule as OtherConfigModule, Pair}; use pausable::{PausableModule, State}; -use proxy_dex::{proxy_common::ProxyCommonModule, sc_whitelist::ScWhitelistModule, ProxyDexImpl}; +use proxy_dex::{proxy_common::ProxyCommonModule, other_sc_whitelist::OtherScWhitelistModule, ProxyDexImpl}; use sc_whitelist_module::SCWhitelistModule; use simple_lock::locked_token::{LockedTokenAttributes, LockedTokenModule}; diff --git a/locked-asset/proxy_dex/tests/proxy_farm_test.rs b/locked-asset/proxy_dex/tests/proxy_farm_test.rs index 9ea589340..4dc879dba 100644 --- a/locked-asset/proxy_dex/tests/proxy_farm_test.rs +++ b/locked-asset/proxy_dex/tests/proxy_farm_test.rs @@ -57,7 +57,7 @@ fn farm_proxy_actions_test() { 1, &rust_biguint!(USER_BALANCE), |sc| { - sc.enter_farm_proxy_endpoint(managed_address!(&farm_addr)); + sc.enter_farm_proxy_endpoint(managed_address!(&farm_addr), OptionalValue::None); }, ) .assert_ok(); @@ -122,7 +122,7 @@ fn farm_proxy_actions_test() { 1, &rust_biguint!(USER_BALANCE / 2), |sc| { - sc.claim_rewards_proxy(managed_address!(&farm_addr)); + sc.claim_rewards_proxy(managed_address!(&farm_addr), OptionalValue::None); }, ) .assert_ok(); @@ -240,7 +240,7 @@ fn farm_proxy_actions_test() { 3, &rust_biguint!(USER_BALANCE), |sc| { - let output = sc.exit_farm_proxy(managed_address!(&farm_addr)); + let output = sc.exit_farm_proxy(managed_address!(&farm_addr), OptionalValue::None); let output_lp_token = output.0 .0; assert_eq!(output_lp_token.token_nonce, 1); assert_eq!(output_lp_token.amount, USER_BALANCE); @@ -375,7 +375,10 @@ fn farm_with_wrapped_lp_test() { 1, &expected_lp_token_amount, |sc| { - sc.enter_farm_proxy_endpoint(managed_address!(&farm_locked_addr)); + sc.enter_farm_proxy_endpoint( + managed_address!(&farm_locked_addr), + OptionalValue::None, + ); }, ) .assert_ok(); @@ -443,7 +446,7 @@ fn farm_with_wrapped_lp_test() { 1, &(expected_lp_token_amount.clone() / rust_biguint!(2)), |sc| { - sc.exit_farm_proxy(managed_address!(&farm_locked_addr)); + sc.exit_farm_proxy(managed_address!(&farm_locked_addr), OptionalValue::None); }, ) .assert_ok(); @@ -545,7 +548,10 @@ fn farm_proxy_claim_energy_test() { 1, &rust_biguint!(USER_BALANCE), |sc| { - sc.enter_farm_proxy_endpoint(managed_address!(&farm_locked_addr)); + sc.enter_farm_proxy_endpoint( + managed_address!(&farm_locked_addr), + OptionalValue::None, + ); }, ) .assert_ok(); @@ -619,7 +625,7 @@ fn farm_proxy_claim_energy_test() { 1, &rust_biguint!(USER_BALANCE), |sc| { - sc.claim_rewards_proxy(managed_address!(&farm_locked_addr)); + sc.claim_rewards_proxy(managed_address!(&farm_locked_addr), OptionalValue::None); }, ) .assert_ok(); @@ -680,7 +686,10 @@ fn farm_proxy_partial_exit_test() { 1, &rust_biguint!(USER_BALANCE), |sc| { - sc.enter_farm_proxy_endpoint(managed_address!(&farm_locked_addr)); + sc.enter_farm_proxy_endpoint( + managed_address!(&farm_locked_addr), + OptionalValue::None, + ); }, ) .assert_ok(); @@ -756,7 +765,7 @@ fn farm_proxy_partial_exit_test() { 1, &rust_biguint!(USER_BALANCE / 2), |sc| { - sc.exit_farm_proxy(managed_address!(&farm_locked_addr)); + sc.exit_farm_proxy(managed_address!(&farm_locked_addr), OptionalValue::None); }, ) .assert_ok(); @@ -855,7 +864,10 @@ fn farm_proxy_partial_exit_with_penalty_test() { 1, &rust_biguint!(USER_BALANCE), |sc| { - sc.enter_farm_proxy_endpoint(managed_address!(&farm_locked_addr)); + sc.enter_farm_proxy_endpoint( + managed_address!(&farm_locked_addr), + OptionalValue::None, + ); }, ) .assert_ok(); @@ -931,7 +943,7 @@ fn farm_proxy_partial_exit_with_penalty_test() { 1, &rust_biguint!(USER_BALANCE / 2), |sc| { - sc.exit_farm_proxy(managed_address!(&farm_locked_addr)); + sc.exit_farm_proxy(managed_address!(&farm_locked_addr), OptionalValue::None); }, ) .assert_ok(); @@ -1042,7 +1054,7 @@ fn different_farm_locked_token_nonce_merging_test() { 1, &rust_biguint!(USER_BALANCE), |sc| { - sc.enter_farm_proxy_endpoint(managed_address!(&farm_addr)); + sc.enter_farm_proxy_endpoint(managed_address!(&farm_addr), OptionalValue::None); }, ) .assert_ok(); @@ -1056,7 +1068,7 @@ fn different_farm_locked_token_nonce_merging_test() { 2, &rust_biguint!(USER_BALANCE), |sc| { - sc.enter_farm_proxy_endpoint(managed_address!(&farm_addr)); + sc.enter_farm_proxy_endpoint(managed_address!(&farm_addr), OptionalValue::None); }, ) .assert_ok(); @@ -1149,7 +1161,7 @@ fn different_farm_locked_token_nonce_merging_test() { 3, &rust_biguint!(USER_BALANCE * 2), |sc| { - sc.exit_farm_proxy(managed_address!(&farm_addr)); + sc.exit_farm_proxy(managed_address!(&farm_addr), OptionalValue::None); }, ) .assert_ok(); @@ -1190,7 +1202,7 @@ fn increase_proxy_farm_lkmex_energy() { 1, &rust_biguint!(USER_BALANCE), |sc| { - sc.enter_farm_proxy_endpoint(managed_address!(&farm_addr)); + sc.enter_farm_proxy_endpoint(managed_address!(&farm_addr), OptionalValue::None); }, ) .assert_ok(); @@ -1343,7 +1355,10 @@ fn increase_proxy_farm_proxy_lp_energy() { 1, &expected_lp_token_amount, |sc| { - sc.enter_farm_proxy_endpoint(managed_address!(&farm_locked_addr)); + sc.enter_farm_proxy_endpoint( + managed_address!(&farm_locked_addr), + OptionalValue::None, + ); }, ) .assert_ok(); From cd4d21b6e4cfc86292b6e1f5db0379cb2b5be3f7 Mon Sep 17 00:00:00 2001 From: Dorin Marian Iancu Date: Mon, 9 Oct 2023 13:42:05 +0300 Subject: [PATCH 113/213] clippy --- locked-asset/proxy_dex/src/proxy_farm.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/locked-asset/proxy_dex/src/proxy_farm.rs b/locked-asset/proxy_dex/src/proxy_farm.rs index e21d4b0b4..1d15c7528 100644 --- a/locked-asset/proxy_dex/src/proxy_farm.rs +++ b/locked-asset/proxy_dex/src/proxy_farm.rs @@ -193,9 +193,7 @@ pub trait ProxyFarmModule: .get_token_attributes(&payment.token_identifier, payment.token_nonce); let wrapped_farm_attributes_for_exit: WrappedFarmTokenAttributes = - full_wrapped_farm_attributes - .clone() - .into_part(&payment.amount); + full_wrapped_farm_attributes.into_part(&payment.amount); let caller = self.blockchain().get_caller(); let original_caller = self.get_orig_caller_from_opt(&caller, opt_original_caller); From da8986847f3459091f6c37063df7a183e9643757 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Thu, 12 Oct 2023 13:45:10 +0300 Subject: [PATCH 114/213] farm with locked rewards references cleanup --- dex/farm-with-locked-rewards/src/lib.rs | 16 ++++++---------- dex/farm/src/lib.rs | 14 ++++---------- farm-staking/farm-staking/Cargo.toml | 1 + farm-staking/farm-staking/src/lib.rs | 7 ++----- farm-staking/farm-staking/src/stake_farm.rs | 7 ++----- farm-staking/farm-staking/wasm/src/lib.rs | 5 +++-- locked-asset/proxy_dex/src/farm_interactions.rs | 6 ++++-- locked-asset/proxy_dex/wasm/Cargo.lock | 1 + locked-asset/proxy_dex/wasm/src/lib.rs | 10 ++++++++-- 9 files changed, 31 insertions(+), 36 deletions(-) diff --git a/dex/farm-with-locked-rewards/src/lib.rs b/dex/farm-with-locked-rewards/src/lib.rs index 6a13bc7ef..01ce11880 100644 --- a/dex/farm-with-locked-rewards/src/lib.rs +++ b/dex/farm-with-locked-rewards/src/lib.rs @@ -95,16 +95,12 @@ pub trait Farm: self.migrate_old_farm_positions(&orig_caller); let boosted_rewards = self.claim_only_boosted_payment(&orig_caller); - let boosted_rewards_payment = if boosted_rewards > 0 { - self.send_to_lock_contract_non_zero( - self.reward_token_id().get(), - boosted_rewards, - caller.clone(), - orig_caller.clone(), - ) - } else { - EsdtTokenPayment::new(self.reward_token_id().get(), 0, BigUint::zero()) - }; + let boosted_rewards_payment = self.send_to_lock_contract_non_zero( + self.reward_token_id().get(), + boosted_rewards, + caller.clone(), + orig_caller.clone(), + ); let new_farm_token = self.enter_farm::>(orig_caller.clone()); self.send_payment_non_zero(&caller, &new_farm_token); diff --git a/dex/farm/src/lib.rs b/dex/farm/src/lib.rs index 97b280546..b29d7c8a5 100644 --- a/dex/farm/src/lib.rs +++ b/dex/farm/src/lib.rs @@ -96,11 +96,8 @@ pub trait Farm: self.migrate_old_farm_positions(&orig_caller); let boosted_rewards = self.claim_only_boosted_payment(&orig_caller); - let boosted_rewards_payment = if boosted_rewards > 0 { - EsdtTokenPayment::new(self.reward_token_id().get(), 0, boosted_rewards) - } else { - EsdtTokenPayment::new(self.reward_token_id().get(), 0, BigUint::zero()) - }; + let boosted_rewards_payment = + EsdtTokenPayment::new(self.reward_token_id().get(), 0, boosted_rewards); let new_farm_token = self.enter_farm::>(orig_caller.clone()); self.send_payment_non_zero(&caller, &new_farm_token); @@ -186,11 +183,8 @@ pub trait Farm: self.migrate_old_farm_positions(&orig_caller); let boosted_rewards = self.claim_only_boosted_payment(&orig_caller); - let boosted_rewards_payment = if boosted_rewards > 0 { - EsdtTokenPayment::new(self.reward_token_id().get(), 0, boosted_rewards) - } else { - EsdtTokenPayment::new(self.reward_token_id().get(), 0, BigUint::zero()) - }; + let boosted_rewards_payment = + EsdtTokenPayment::new(self.reward_token_id().get(), 0, boosted_rewards); let merged_farm_token = self.merge_farm_tokens::>(); self.send_payment_non_zero(&caller, &merged_farm_token); diff --git a/farm-staking/farm-staking/Cargo.toml b/farm-staking/farm-staking/Cargo.toml index 9884e34ce..a8dc189e4 100644 --- a/farm-staking/farm-staking/Cargo.toml +++ b/farm-staking/farm-staking/Cargo.toml @@ -7,6 +7,7 @@ publish = false [lib] path = "src/lib.rs" + [dependencies.farm] path = "../../dex/farm" diff --git a/farm-staking/farm-staking/src/lib.rs b/farm-staking/farm-staking/src/lib.rs index e44b3b3df..32cbec0e1 100644 --- a/farm-staking/farm-staking/src/lib.rs +++ b/farm-staking/farm-staking/src/lib.rs @@ -104,11 +104,8 @@ pub trait FarmStaking: self.migrate_old_farm_positions(&caller); let boosted_rewards = self.claim_only_boosted_payment(&caller); - let boosted_rewards_payment = if boosted_rewards > 0 { - EsdtTokenPayment::new(self.reward_token_id().get(), 0, boosted_rewards) - } else { - EsdtTokenPayment::new(self.reward_token_id().get(), 0, BigUint::zero()) - }; + let boosted_rewards_payment = + EsdtTokenPayment::new(self.reward_token_id().get(), 0, boosted_rewards); let payments = self.get_non_empty_payments(); let token_mapper = self.farm_token(); diff --git a/farm-staking/farm-staking/src/stake_farm.rs b/farm-staking/farm-staking/src/stake_farm.rs index bd5f6481a..7ab3dea1c 100644 --- a/farm-staking/farm-staking/src/stake_farm.rs +++ b/farm-staking/farm-staking/src/stake_farm.rs @@ -74,11 +74,8 @@ pub trait StakeFarmModule: let caller = self.blockchain().get_caller(); self.migrate_old_farm_positions(&original_caller); let boosted_rewards = self.claim_only_boosted_payment(&original_caller); - let boosted_rewards_payment = if boosted_rewards > 0 { - EsdtTokenPayment::new(self.reward_token_id().get(), 0, boosted_rewards) - } else { - EsdtTokenPayment::new(self.reward_token_id().get(), 0, BigUint::zero()) - }; + let boosted_rewards_payment = + EsdtTokenPayment::new(self.reward_token_id().get(), 0, boosted_rewards); let enter_result = self.enter_farm_base::>(original_caller.clone(), payments); diff --git a/farm-staking/farm-staking/wasm/src/lib.rs b/farm-staking/farm-staking/wasm/src/lib.rs index fedf1dba8..3c3946ede 100644 --- a/farm-staking/farm-staking/wasm/src/lib.rs +++ b/farm-staking/farm-staking/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 68 +// Endpoints: 69 // Async Callback: 1 -// Total number of exported functions: 70 +// Total number of exported functions: 71 #![no_std] @@ -22,6 +22,7 @@ multiversx_sc_wasm_adapter::endpoints! { farm_staking ( init => init + upgrade => upgrade mergeFarmTokens => merge_farm_tokens_endpoint calculateRewardsForGivenPosition => calculate_rewards_for_given_position topUpRewards => top_up_rewards diff --git a/locked-asset/proxy_dex/src/farm_interactions.rs b/locked-asset/proxy_dex/src/farm_interactions.rs index e1620f1d4..dab9a7825 100644 --- a/locked-asset/proxy_dex/src/farm_interactions.rs +++ b/locked-asset/proxy_dex/src/farm_interactions.rs @@ -2,8 +2,9 @@ multiversx_sc::imports!(); use farm::{ base_functions::{ClaimRewardsResultType, ClaimRewardsResultWrapper}, - EnterFarmResultType, ExitFarmWithPartialPosResultType, ProxyTrait as _, + EnterFarmResultType, ExitFarmWithPartialPosResultType, }; +use farm_with_locked_rewards::ProxyTrait as _; pub struct EnterFarmResultWrapper { pub farm_token: EsdtTokenPayment, @@ -77,5 +78,6 @@ pub trait FarmInteractionsModule { } #[proxy] - fn farm_contract_proxy(&self, to: ManagedAddress) -> farm::Proxy; + fn farm_contract_proxy(&self, to: ManagedAddress) + -> farm_with_locked_rewards::Proxy; } diff --git a/locked-asset/proxy_dex/wasm/Cargo.lock b/locked-asset/proxy_dex/wasm/Cargo.lock index b40656523..4af1937e2 100644 --- a/locked-asset/proxy_dex/wasm/Cargo.lock +++ b/locked-asset/proxy_dex/wasm/Cargo.lock @@ -480,6 +480,7 @@ dependencies = [ "multiversx-sc", "multiversx-sc-modules", "pair", + "sc_whitelist_module", "simple-lock", "token_merge_helper", "token_send", diff --git a/locked-asset/proxy_dex/wasm/src/lib.rs b/locked-asset/proxy_dex/wasm/src/lib.rs index 096dff097..5ffdc8d79 100644 --- a/locked-asset/proxy_dex/wasm/src/lib.rs +++ b/locked-asset/proxy_dex/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 25 +// Endpoints: 31 // Async Callback: 1 -// Total number of exported functions: 27 +// Total number of exported functions: 33 #![no_std] @@ -22,6 +22,7 @@ multiversx_sc_wasm_adapter::endpoints! { proxy_dex ( init => init + upgrade => upgrade registerProxyPair => register_proxy_pair setTransferRoleWrappedLpToken => set_transfer_role_wrapped_lp_token registerProxyFarm => register_proxy_farm @@ -40,13 +41,18 @@ multiversx_sc_wasm_adapter::endpoints! { getIntermediatedFarms => intermediated_farms addLiquidityProxy => add_liquidity_proxy removeLiquidityProxy => remove_liquidity_proxy + increaseProxyPairTokenEnergy => increase_proxy_pair_token_energy_endpoint enterFarmProxy => enter_farm_proxy_endpoint exitFarmProxy => exit_farm_proxy claimRewardsProxy => claim_rewards_proxy + increaseProxyFarmTokenEnergy => increase_proxy_farm_token_energy_endpoint mergeWrappedFarmTokens => merge_wrapped_farm_tokens_endpoint mergeWrappedLpTokens => merge_wrapped_lp_tokens_endpoint setEnergyFactoryAddress => set_energy_factory_address getEnergyFactoryAddress => energy_factory_address + addSCAddressToWhitelist => add_sc_address_to_whitelist + removeSCAddressFromWhitelist => remove_sc_address_from_whitelist + isSCAddressWhitelisted => is_sc_address_whitelisted ) } From 00b25dc2e1b3d0bd17ac7ca3282bf601c79d2ed9 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Thu, 12 Oct 2023 13:46:50 +0300 Subject: [PATCH 115/213] farm staking proxy lp tokens merge fix --- farm-staking/farm-staking-proxy/Cargo.toml | 3 ++ .../src/external_contracts_interactions.rs | 16 +++++++--- .../src/proxy_actions/stake.rs | 15 +++++---- .../farm-staking-proxy/src/result_types.rs | 6 ++-- .../farm-staking-proxy/wasm/Cargo.lock | 31 +++++++++++++++++++ .../farm-staking-proxy/wasm/src/lib.rs | 5 +-- 6 files changed, 61 insertions(+), 15 deletions(-) diff --git a/farm-staking/farm-staking-proxy/Cargo.toml b/farm-staking/farm-staking-proxy/Cargo.toml index 088edab13..95cc91c4a 100644 --- a/farm-staking/farm-staking-proxy/Cargo.toml +++ b/farm-staking/farm-staking-proxy/Cargo.toml @@ -21,6 +21,9 @@ version = "=0.43.3" [dependencies.farm] path = "../../dex/farm" +[dependencies.farm-with-locked-rewards] +path = "../../dex/farm-with-locked-rewards" + [dependencies.farm-staking] path = "../farm-staking" diff --git a/farm-staking/farm-staking-proxy/src/external_contracts_interactions.rs b/farm-staking/farm-staking-proxy/src/external_contracts_interactions.rs index 17d32d056..4e24d0597 100644 --- a/farm-staking/farm-staking-proxy/src/external_contracts_interactions.rs +++ b/farm-staking/farm-staking-proxy/src/external_contracts_interactions.rs @@ -1,13 +1,14 @@ multiversx_sc::imports!(); use farm::{ - base_functions::ClaimRewardsResultType, EnterFarmResultType, ExitFarmWithPartialPosResultType, - ProxyTrait as _, + base_functions::{ClaimRewardsResultType, DoubleMultiPayment}, + EnterFarmResultType, ExitFarmWithPartialPosResultType, }; use farm_staking::{ claim_stake_farm_rewards::ProxyTrait as _, stake_farm::ProxyTrait as _, unstake_farm::ProxyTrait as _, }; +use farm_with_locked_rewards::ProxyTrait as _; use pair::safe_price_view::ProxyTrait as _; use crate::result_types::*; @@ -68,9 +69,11 @@ pub trait ExternalContractsInteractionsModule: orig_caller: ManagedAddress, base_lp_token: EsdtTokenPayment, mut additional_lp_tokens: PaymentsVec, - ) -> EsdtTokenPayment { + ) -> DoubleMultiPayment { if additional_lp_tokens.is_empty() { - return base_lp_token; + let rewards_payment = + EsdtTokenPayment::new(base_lp_token.token_identifier.clone(), 0, BigUint::zero()); + return (base_lp_token, rewards_payment).into(); } additional_lp_tokens.push(base_lp_token); @@ -216,7 +219,10 @@ pub trait ExternalContractsInteractionsModule: fn staking_farm_proxy_obj(&self, sc_address: ManagedAddress) -> farm_staking::Proxy; #[proxy] - fn lp_farm_proxy_obj(&self, sc_address: ManagedAddress) -> farm::Proxy; + fn lp_farm_proxy_obj( + &self, + sc_address: ManagedAddress, + ) -> farm_with_locked_rewards::Proxy; #[proxy] fn pair_proxy_obj(&self, sc_address: ManagedAddress) -> pair::Proxy; diff --git a/farm-staking/farm-staking-proxy/src/proxy_actions/stake.rs b/farm-staking/farm-staking-proxy/src/proxy_actions/stake.rs index d39dd7f2c..a4cc65206 100644 --- a/farm-staking/farm-staking-proxy/src/proxy_actions/stake.rs +++ b/farm-staking/farm-staking-proxy/src/proxy_actions/stake.rs @@ -67,11 +67,13 @@ pub trait ProxyStakeModule: ); let received_staking_farm_token = staking_farm_enter_result.received_staking_farm_token; - let merged_lp_farm_tokens = self.merge_lp_farm_tokens( - orig_caller, - lp_farm_token_payment, - additional_lp_farm_tokens, - ); + let (merged_lp_farm_tokens, lp_farm_boosted_rewards) = self + .merge_lp_farm_tokens( + orig_caller, + lp_farm_token_payment, + additional_lp_farm_tokens, + ) + .into_tuple(); let new_attributes = DualYieldTokenAttributes { lp_farm_token_nonce: merged_lp_farm_tokens.token_nonce, @@ -83,7 +85,8 @@ pub trait ProxyStakeModule: self.create_dual_yield_tokens(&dual_yield_token_mapper, &new_attributes); let output_payments = StakeProxyResult { dual_yield_tokens: new_dual_yield_tokens, - boosted_rewards: staking_farm_enter_result.boosted_rewards, + staking_boosted_rewards: staking_farm_enter_result.boosted_rewards, + lp_farm_boosted_rewards, }; output_payments.send_and_return(self, &caller) diff --git a/farm-staking/farm-staking-proxy/src/result_types.rs b/farm-staking/farm-staking-proxy/src/result_types.rs index 65e0cf238..2130fd696 100644 --- a/farm-staking/farm-staking-proxy/src/result_types.rs +++ b/farm-staking/farm-staking-proxy/src/result_types.rs @@ -44,7 +44,8 @@ pub struct PairRemoveLiquidityResult { #[derive(TypeAbi, TopEncode, TopDecode)] pub struct StakeProxyResult { pub dual_yield_tokens: EsdtTokenPayment, - pub boosted_rewards: EsdtTokenPayment, + pub staking_boosted_rewards: EsdtTokenPayment, + pub lp_farm_boosted_rewards: EsdtTokenPayment, } impl StakeProxyResult { @@ -54,7 +55,8 @@ impl StakeProxyResult { to: &ManagedAddress, ) -> Self { sc.send_payment_non_zero(to, &self.dual_yield_tokens); - sc.send_payment_non_zero(to, &self.boosted_rewards); + sc.send_payment_non_zero(to, &self.staking_boosted_rewards); + sc.send_payment_non_zero(to, &self.lp_farm_boosted_rewards); self } diff --git a/farm-staking/farm-staking-proxy/wasm/Cargo.lock b/farm-staking/farm-staking-proxy/wasm/Cargo.lock index b39a7d277..a84b712c8 100644 --- a/farm-staking/farm-staking-proxy/wasm/Cargo.lock +++ b/farm-staking/farm-staking-proxy/wasm/Cargo.lock @@ -217,6 +217,7 @@ dependencies = [ "config", "farm", "farm-staking", + "farm-with-locked-rewards", "fixed-supply-token", "hex-literal", "mergeable", @@ -239,6 +240,36 @@ dependencies = [ "multiversx-sc-wasm-adapter", ] +[[package]] +name = "farm-with-locked-rewards" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "energy-factory", + "energy-query", + "events", + "farm", + "farm-boosted-yields", + "farm_base_impl", + "farm_token", + "fixed-supply-token", + "locking_module", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "rewards", + "sc_whitelist_module", + "token_send", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + [[package]] name = "farm_base_impl" version = "0.0.0" diff --git a/farm-staking/farm-staking-proxy/wasm/src/lib.rs b/farm-staking/farm-staking-proxy/wasm/src/lib.rs index 4223b260d..b5ff89409 100644 --- a/farm-staking/farm-staking-proxy/wasm/src/lib.rs +++ b/farm-staking/farm-staking-proxy/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 15 +// Endpoints: 16 // Async Callback: 1 -// Total number of exported functions: 17 +// Total number of exported functions: 18 #![no_std] @@ -22,6 +22,7 @@ multiversx_sc_wasm_adapter::endpoints! { farm_staking_proxy ( init => init + upgrade => upgrade registerDualYieldToken => register_dual_yield_token getDualYieldTokenId => dual_yield_token getLpFarmAddress => lp_farm_address From 49fea1a9815873826cd89b706066e6e02dbb1fd1 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Fri, 13 Oct 2023 14:28:40 +0300 Subject: [PATCH 116/213] small optimizations --- dex/farm-with-locked-rewards/src/lib.rs | 3 ++- dex/farm-with-locked-rewards/wasm/src/lib.rs | 5 +++-- farm-staking/farm-staking-proxy/Cargo.toml | 3 +++ .../src/external_contracts_interactions.rs | 18 +++++++++--------- farm-staking/farm-staking-proxy/src/lib.rs | 5 +++++ .../src/proxy_actions/claim.rs | 1 + .../src/proxy_actions/stake.rs | 1 + .../src/proxy_actions/unstake.rs | 1 + .../mod.rs | 1 + .../farm-staking-proxy/wasm/Cargo.lock | 1 + .../farm-staking-proxy/wasm/src/lib.rs | 6 ++++-- locked-asset/energy-factory/elrond.json | 3 --- locked-asset/energy-factory/wasm/src/lib.rs | 6 ++++-- 13 files changed, 35 insertions(+), 19 deletions(-) delete mode 100644 locked-asset/energy-factory/elrond.json diff --git a/dex/farm-with-locked-rewards/src/lib.rs b/dex/farm-with-locked-rewards/src/lib.rs index 01ce11880..2a6b299a3 100644 --- a/dex/farm-with-locked-rewards/src/lib.rs +++ b/dex/farm-with-locked-rewards/src/lib.rs @@ -278,7 +278,8 @@ pub trait Farm: energy_address: ManagedAddress, ) -> EsdtTokenPayment { if amount == 0 { - return EsdtTokenPayment::new(token_id, 0, amount); + let locked_token_id = self.get_locked_token_id(); + return EsdtTokenPayment::new(locked_token_id, 0, amount); } self.lock_virtual(token_id, amount, destination_address, energy_address) diff --git a/dex/farm-with-locked-rewards/wasm/src/lib.rs b/dex/farm-with-locked-rewards/wasm/src/lib.rs index 64c73e3cc..9e0b6c29e 100644 --- a/dex/farm-with-locked-rewards/wasm/src/lib.rs +++ b/dex/farm-with-locked-rewards/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 66 +// Endpoints: 67 // Async Callback: 1 -// Total number of exported functions: 68 +// Total number of exported functions: 69 #![no_std] @@ -22,6 +22,7 @@ multiversx_sc_wasm_adapter::endpoints! { farm_with_locked_rewards ( init => init + upgrade => upgrade enterFarm => enter_farm_endpoint claimRewards => claim_rewards_endpoint exitFarm => exit_farm_endpoint diff --git a/farm-staking/farm-staking-proxy/Cargo.toml b/farm-staking/farm-staking-proxy/Cargo.toml index 95cc91c4a..b9f7989f8 100644 --- a/farm-staking/farm-staking-proxy/Cargo.toml +++ b/farm-staking/farm-staking-proxy/Cargo.toml @@ -60,6 +60,9 @@ path = "../../common/traits/unwrappable" [dependencies.sc_whitelist_module] path = "../../common/modules/sc_whitelist_module" +[dependencies.energy-query] +path = "../../energy-integration/common-modules/energy-query" + [dev-dependencies] num-bigint = "0.4.2" diff --git a/farm-staking/farm-staking-proxy/src/external_contracts_interactions.rs b/farm-staking/farm-staking-proxy/src/external_contracts_interactions.rs index 4e24d0597..163ebb922 100644 --- a/farm-staking/farm-staking-proxy/src/external_contracts_interactions.rs +++ b/farm-staking/farm-staking-proxy/src/external_contracts_interactions.rs @@ -18,7 +18,7 @@ pub type SafePriceResult = MultiValue2, EsdtTokenPaym #[multiversx_sc::module] pub trait ExternalContractsInteractionsModule: - crate::lp_farm_token::LpFarmTokenModule + utils::UtilsModule + crate::lp_farm_token::LpFarmTokenModule + utils::UtilsModule + energy_query::EnergyQueryModule { // lp farm @@ -67,21 +67,21 @@ pub trait ExternalContractsInteractionsModule: fn merge_lp_farm_tokens( &self, orig_caller: ManagedAddress, - base_lp_token: EsdtTokenPayment, - mut additional_lp_tokens: PaymentsVec, + base_lp_farm_token: EsdtTokenPayment, + mut additional_lp_farm_tokens: PaymentsVec, ) -> DoubleMultiPayment { - if additional_lp_tokens.is_empty() { - let rewards_payment = - EsdtTokenPayment::new(base_lp_token.token_identifier.clone(), 0, BigUint::zero()); - return (base_lp_token, rewards_payment).into(); + if additional_lp_farm_tokens.is_empty() { + let locked_token_id = self.get_locked_token_id(); + let rewards_payment = EsdtTokenPayment::new(locked_token_id, 0, BigUint::zero()); + return (base_lp_farm_token, rewards_payment).into(); } - additional_lp_tokens.push(base_lp_token); + additional_lp_farm_tokens.push(base_lp_farm_token); let lp_farm_address = self.lp_farm_address().get(); self.lp_farm_proxy_obj(lp_farm_address) .merge_farm_tokens_endpoint(orig_caller) - .with_multi_token_transfer(additional_lp_tokens) + .with_multi_token_transfer(additional_lp_farm_tokens) .execute_on_dest_context() } diff --git a/farm-staking/farm-staking-proxy/src/lib.rs b/farm-staking/farm-staking-proxy/src/lib.rs index 24bd0d78d..bd8ef7013 100644 --- a/farm-staking/farm-staking-proxy/src/lib.rs +++ b/farm-staking/farm-staking-proxy/src/lib.rs @@ -16,6 +16,7 @@ pub trait FarmStakingProxy: + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule + utils::UtilsModule + token_send::TokenSendModule + + energy_query::EnergyQueryModule + sc_whitelist_module::SCWhitelistModule + proxy_actions::stake::ProxyStakeModule + proxy_actions::claim::ProxyClaimModule @@ -24,6 +25,7 @@ pub trait FarmStakingProxy: #[init] fn init( &self, + energy_factory_address: ManagedAddress, lp_farm_address: ManagedAddress, staking_farm_address: ManagedAddress, pair_address: ManagedAddress, @@ -32,6 +34,7 @@ pub trait FarmStakingProxy: staking_farm_token_id: TokenIdentifier, lp_token_id: TokenIdentifier, ) { + self.require_sc_address(&energy_factory_address); self.require_sc_address(&lp_farm_address); self.require_sc_address(&staking_farm_address); self.require_sc_address(&pair_address); @@ -41,6 +44,8 @@ pub trait FarmStakingProxy: self.require_valid_token_id(&staking_farm_token_id); self.require_valid_token_id(&lp_token_id); + self.energy_factory_address() + .set_if_empty(&energy_factory_address); self.lp_farm_address().set_if_empty(&lp_farm_address); self.staking_farm_address() .set_if_empty(&staking_farm_address); diff --git a/farm-staking/farm-staking-proxy/src/proxy_actions/claim.rs b/farm-staking/farm-staking-proxy/src/proxy_actions/claim.rs index fe84fa65d..01df77c36 100644 --- a/farm-staking/farm-staking-proxy/src/proxy_actions/claim.rs +++ b/farm-staking/farm-staking-proxy/src/proxy_actions/claim.rs @@ -16,6 +16,7 @@ pub trait ProxyClaimModule: + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule + utils::UtilsModule + token_send::TokenSendModule + + energy_query::EnergyQueryModule + sc_whitelist_module::SCWhitelistModule { #[payable("*")] diff --git a/farm-staking/farm-staking-proxy/src/proxy_actions/stake.rs b/farm-staking/farm-staking-proxy/src/proxy_actions/stake.rs index a4cc65206..b32f62b76 100644 --- a/farm-staking/farm-staking-proxy/src/proxy_actions/stake.rs +++ b/farm-staking/farm-staking-proxy/src/proxy_actions/stake.rs @@ -10,6 +10,7 @@ pub trait ProxyStakeModule: + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule + utils::UtilsModule + token_send::TokenSendModule + + energy_query::EnergyQueryModule + sc_whitelist_module::SCWhitelistModule { #[payable("*")] diff --git a/farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs b/farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs index 2faf021a3..3c46ffd3e 100644 --- a/farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs +++ b/farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs @@ -12,6 +12,7 @@ pub trait ProxyUnstakeModule: + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule + utils::UtilsModule + token_send::TokenSendModule + + energy_query::EnergyQueryModule + sc_whitelist_module::SCWhitelistModule { #[payable("*")] diff --git a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_setup/mod.rs b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_setup/mod.rs index e5d848e5d..2c67d2714 100644 --- a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_setup/mod.rs +++ b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_setup/mod.rs @@ -119,6 +119,7 @@ where b_mock .execute_tx(owner_addr, &proxy_wrapper, &rust_zero, |sc| { sc.init( + managed_address!(staking_farm_address), // TODO - replace with energy factory address when needed managed_address!(lp_farm_address), managed_address!(staking_farm_address), managed_address!(pair_address), diff --git a/farm-staking/farm-staking-proxy/wasm/Cargo.lock b/farm-staking/farm-staking-proxy/wasm/Cargo.lock index a84b712c8..381d25474 100644 --- a/farm-staking/farm-staking-proxy/wasm/Cargo.lock +++ b/farm-staking/farm-staking-proxy/wasm/Cargo.lock @@ -215,6 +215,7 @@ version = "0.0.0" dependencies = [ "common_structs", "config", + "energy-query", "farm", "farm-staking", "farm-with-locked-rewards", diff --git a/farm-staking/farm-staking-proxy/wasm/src/lib.rs b/farm-staking/farm-staking-proxy/wasm/src/lib.rs index b5ff89409..c233a2125 100644 --- a/farm-staking/farm-staking-proxy/wasm/src/lib.rs +++ b/farm-staking/farm-staking-proxy/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 16 +// Endpoints: 18 // Async Callback: 1 -// Total number of exported functions: 18 +// Total number of exported functions: 20 #![no_std] @@ -35,6 +35,8 @@ multiversx_sc_wasm_adapter::endpoints! { addSCAddressToWhitelist => add_sc_address_to_whitelist removeSCAddressFromWhitelist => remove_sc_address_from_whitelist isSCAddressWhitelisted => is_sc_address_whitelisted + setEnergyFactoryAddress => set_energy_factory_address + getEnergyFactoryAddress => energy_factory_address stakeFarmTokens => stake_farm_tokens claimDualYield => claim_dual_yield_endpoint unstakeFarmTokens => unstake_farm_tokens diff --git a/locked-asset/energy-factory/elrond.json b/locked-asset/energy-factory/elrond.json deleted file mode 100644 index 736553962..000000000 --- a/locked-asset/energy-factory/elrond.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "language": "rust" -} \ No newline at end of file diff --git a/locked-asset/energy-factory/wasm/src/lib.rs b/locked-asset/energy-factory/wasm/src/lib.rs index 213c94146..a116e6ce7 100644 --- a/locked-asset/energy-factory/wasm/src/lib.rs +++ b/locked-asset/energy-factory/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 32 +// Endpoints: 34 // Async Callback: 1 -// Total number of exported functions: 34 +// Total number of exported functions: 36 #![no_std] @@ -22,8 +22,10 @@ multiversx_sc_wasm_adapter::endpoints! { energy_factory ( init => init + upgrade => upgrade lockTokens => lock_tokens_endpoint unlockTokens => unlock_tokens_endpoint + extendLockPeriod => extend_lock_period issueLockedToken => issue_locked_token getLockedTokenId => locked_token getBaseAssetTokenId => base_asset_token_id From 69a57e33c149e4f57e61adf9677d4dd9d1bf9d77 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Fri, 13 Oct 2023 14:36:50 +0300 Subject: [PATCH 117/213] tests fixes --- .../tests/farm_with_locked_rewards_setup/mod.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/dex/farm-with-locked-rewards/tests/farm_with_locked_rewards_setup/mod.rs b/dex/farm-with-locked-rewards/tests/farm_with_locked_rewards_setup/mod.rs index f8858aaf8..f92abc5c7 100644 --- a/dex/farm-with-locked-rewards/tests/farm_with_locked_rewards_setup/mod.rs +++ b/dex/farm-with-locked-rewards/tests/farm_with_locked_rewards_setup/mod.rs @@ -391,17 +391,13 @@ where assert_eq!(out_farm_token.token_nonce, expected_farm_token_nonce); assert_eq!(out_farm_token.amount, managed_biguint!(farm_token_amount)); + assert_eq!( + out_reward_token.token_identifier, + managed_token_id!(LOCKED_REWARD_TOKEN_ID) + ); if out_reward_token.amount > 0 { - assert_eq!( - out_reward_token.token_identifier, - managed_token_id!(LOCKED_REWARD_TOKEN_ID) - ); assert_eq!(out_reward_token.token_nonce, 1); } else { - assert_eq!( - out_reward_token.token_identifier, - managed_token_id!(REWARD_TOKEN_ID) - ); assert_eq!(out_reward_token.token_nonce, 0); } From c05ec53e0037bfd59fb46be73830a6eaf8a0b1d4 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Mon, 16 Oct 2023 01:38:32 +0300 Subject: [PATCH 118/213] farm staking proxy test setup updates --- farm-staking/farm-staking-proxy/Cargo.toml | 9 ++ .../farm-staking-proxy/tests/constants/mod.rs | 9 ++ .../tests/staking_farm_with_lp.rs | 40 ++++++--- .../mod.rs | 90 +++++++++++++++++-- .../mod.rs | 33 +++++-- .../tests/proxy_dex_test_setup/mod.rs | 6 +- 6 files changed, 162 insertions(+), 25 deletions(-) diff --git a/farm-staking/farm-staking-proxy/Cargo.toml b/farm-staking/farm-staking-proxy/Cargo.toml index b9f7989f8..64c132f8c 100644 --- a/farm-staking/farm-staking-proxy/Cargo.toml +++ b/farm-staking/farm-staking-proxy/Cargo.toml @@ -74,3 +74,12 @@ path = "../../common/modules/farm/farm_token" [dev-dependencies.farm-boosted-yields] path = "../../energy-integration/farm-boosted-yields" + +[dev-dependencies.energy-factory] +path = "../../locked-asset/energy-factory" + +[dev-dependencies.simple-lock] +path = "../../locked-asset/simple-lock" + +[dev-dependencies.locking_module] +path = "../../common/modules/locking_module" diff --git a/farm-staking/farm-staking-proxy/tests/constants/mod.rs b/farm-staking/farm-staking-proxy/tests/constants/mod.rs index 6e9bb9fd9..4ccf1ba79 100644 --- a/farm-staking/farm-staking-proxy/tests/constants/mod.rs +++ b/farm-staking/farm-staking-proxy/tests/constants/mod.rs @@ -44,3 +44,12 @@ pub const MIN_FARM_AMOUNT_FOR_BOOSTED_YIELDS: u64 = 1; pub static PROXY_WASM_PATH: &str = "farm-staking-proxy/output/farm-staking-proxy"; pub static DUAL_YIELD_TOKEN_ID: &[u8] = b"DYIELD-abcdef"; + +// Energy factory constants + +pub const EPOCHS_IN_YEAR: u64 = 360; +pub static MEX_TOKEN_ID: &[u8] = b"MEX-123456"; +pub static LOCKED_TOKEN_ID: &[u8] = b"LOCKED-123456"; +pub static LEGACY_LOCKED_TOKEN_ID: &[u8] = b"LEGACY-123456"; +pub static LOCK_OPTIONS: &[u64] = &[EPOCHS_IN_YEAR, 5 * EPOCHS_IN_YEAR, 10 * EPOCHS_IN_YEAR]; // 1, 5 or 10 years +pub static PENALTY_PERCENTAGES: &[u64] = &[4_000, 6_000, 8_000]; diff --git a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp.rs b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp.rs index c81d579ab..2589e1d2b 100644 --- a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp.rs +++ b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp.rs @@ -20,7 +20,8 @@ use staking_farm_with_lp_staking_contract_interactions::*; fn test_all_setup() { let _ = FarmStakingSetup::new( pair::contract_obj, - farm::contract_obj, + farm_with_locked_rewards::contract_obj, + energy_factory::contract_obj, farm_staking::contract_obj, farm_staking_proxy::contract_obj, ); @@ -30,7 +31,8 @@ fn test_all_setup() { fn test_stake_farm_proxy() { let mut setup = FarmStakingSetup::new( pair::contract_obj, - farm::contract_obj, + farm_with_locked_rewards::contract_obj, + energy_factory::contract_obj, farm_staking::contract_obj, farm_staking_proxy::contract_obj, ); @@ -44,7 +46,8 @@ fn test_stake_farm_proxy() { fn test_claim_rewards_farm_proxy_full() { let mut setup = FarmStakingSetup::new( pair::contract_obj, - farm::contract_obj, + farm_with_locked_rewards::contract_obj, + energy_factory::contract_obj, farm_staking::contract_obj, farm_staking_proxy::contract_obj, ); @@ -71,7 +74,8 @@ fn test_claim_rewards_farm_proxy_full() { fn test_claim_rewards_farm_proxy_half() { let mut setup = FarmStakingSetup::new( pair::contract_obj, - farm::contract_obj, + farm_with_locked_rewards::contract_obj, + energy_factory::contract_obj, farm_staking::contract_obj, farm_staking_proxy::contract_obj, ); @@ -98,7 +102,8 @@ fn test_claim_rewards_farm_proxy_half() { fn test_claim_rewards_farm_proxy_twice() { let mut setup = FarmStakingSetup::new( pair::contract_obj, - farm::contract_obj, + farm_with_locked_rewards::contract_obj, + energy_factory::contract_obj, farm_staking::contract_obj, farm_staking_proxy::contract_obj, ); @@ -140,7 +145,8 @@ fn test_claim_rewards_farm_proxy_twice() { fn test_unstake_through_proxy_no_claim() { let mut setup = FarmStakingSetup::new( pair::contract_obj, - farm::contract_obj, + farm_with_locked_rewards::contract_obj, + energy_factory::contract_obj, farm_staking::contract_obj, farm_staking_proxy::contract_obj, ); @@ -170,7 +176,8 @@ fn test_unstake_through_proxy_no_claim() { fn unstake_through_proxy_after_claim() { let mut setup = FarmStakingSetup::new( pair::contract_obj, - farm::contract_obj, + farm_with_locked_rewards::contract_obj, + energy_factory::contract_obj, farm_staking::contract_obj, farm_staking_proxy::contract_obj, ); @@ -210,7 +217,8 @@ fn unstake_partial_position_test() { DebugApi::dummy(); let mut setup = FarmStakingSetup::new( pair::contract_obj, - farm::contract_obj, + farm_with_locked_rewards::contract_obj, + energy_factory::contract_obj, farm_staking::contract_obj, farm_staking_proxy::contract_obj, ); @@ -252,7 +260,7 @@ fn unstake_partial_position_test() { let lp_farm_rewards = results.lp_farm_rewards; assert_eq!( lp_farm_rewards.token_identifier, - managed_token_id!(RIDE_TOKEN_ID) + managed_token_id!(LOCKED_TOKEN_ID) ); assert_eq!(lp_farm_rewards.amount, 99_999 / 2); @@ -299,7 +307,7 @@ fn unstake_partial_position_test() { let lp_farm_rewards = results.lp_farm_rewards; assert_eq!( lp_farm_rewards.token_identifier, - managed_token_id!(RIDE_TOKEN_ID) + managed_token_id!(LOCKED_TOKEN_ID) ); assert_eq!(lp_farm_rewards.amount, 99_999 / 2); @@ -325,7 +333,8 @@ fn unstake_partial_position_test() { fn unbond_test() { let mut setup = FarmStakingSetup::new( pair::contract_obj, - farm::contract_obj, + farm_with_locked_rewards::contract_obj, + energy_factory::contract_obj, farm_staking::contract_obj, farm_staking_proxy::contract_obj, ); @@ -369,7 +378,8 @@ fn unbond_test() { fn farm_staking_compound_rewards_and_unstake_test() { let mut setup = FarmStakingSetup::new( pair::contract_obj, - farm::contract_obj, + farm_with_locked_rewards::contract_obj, + energy_factory::contract_obj, farm_staking::contract_obj, farm_staking_proxy::contract_obj, ); @@ -399,7 +409,8 @@ fn farm_staking_compound_rewards_and_unstake_test() { fn test_stake_farm_through_proxy_with_merging() { let mut setup = FarmStakingSetup::new( pair::contract_obj, - farm::contract_obj, + farm_with_locked_rewards::contract_obj, + energy_factory::contract_obj, farm_staking::contract_obj, farm_staking_proxy::contract_obj, ); @@ -469,3 +480,6 @@ fn test_stake_farm_through_proxy_with_merging() { ) }); } + +#[test] +fn test_farm_stake_proxy_merging_boosted_rewards() {} diff --git a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_external_contracts/mod.rs b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_external_contracts/mod.rs index 4381f061b..95c734663 100644 --- a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_external_contracts/mod.rs +++ b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_external_contracts/mod.rs @@ -1,12 +1,18 @@ #![allow(deprecated)] +use energy_factory::token_whitelist::TokenWhitelistModule; +use energy_factory::SimpleLockEnergy; +use energy_query::EnergyQueryModule; +use locking_module::lock_with_energy_module::LockWithEnergyModule; use multiversx_sc::codec::multi_types::{MultiValue3, OptionalValue}; use multiversx_sc::storage::mappers::StorageTokenWrapper; use multiversx_sc::types::{Address, EsdtLocalRole, ManagedAddress, MultiValueEncoded}; +use multiversx_sc_modules::pause::PauseModule; use multiversx_sc_scenario::whitebox_legacy::TxTokenTransfer; use multiversx_sc_scenario::{ managed_address, managed_biguint, managed_token_id, rust_biguint, whitebox_legacy::*, DebugApi, }; +use simple_lock::locked_token::LockedTokenModule; use farm::exit_penalty::ExitPenaltyModule; use pair::config as pair_config; @@ -16,10 +22,10 @@ use pair_config::ConfigModule as _; use pausable::{PausableModule, State}; use ::config as farm_config; -use farm::*; use farm_boosted_yields::boosted_yields_factors::BoostedYieldsFactorsModule; use farm_config::ConfigModule as _; use farm_token::FarmTokenModule; +use farm_with_locked_rewards::*; use crate::constants::*; @@ -241,12 +247,13 @@ fn remove_liquidity( pub fn setup_lp_farm( owner_addr: &Address, user_addr: &Address, + energy_factory_address: &Address, b_mock: &mut BlockchainStateWrapper, farm_builder: FarmObjBuilder, user_farm_in_amount: u64, -) -> ContractObjWrapper, FarmObjBuilder> +) -> ContractObjWrapper, FarmObjBuilder> where - FarmObjBuilder: 'static + Copy + Fn() -> farm::ContractObj, + FarmObjBuilder: 'static + Copy + Fn() -> farm_with_locked_rewards::ContractObj, { let rust_zero = rust_biguint!(0u64); let farm_wrapper = @@ -256,7 +263,7 @@ where b_mock .execute_tx(owner_addr, &farm_wrapper, &rust_zero, |sc| { - let reward_token_id = managed_token_id!(RIDE_TOKEN_ID); + let reward_token_id = managed_token_id!(MEX_TOKEN_ID); let farming_token_id = managed_token_id!(LP_TOKEN_ID); let division_safety_constant = managed_biguint!(DIVISION_SAFETY_CONSTANT); let pair_address = managed_address!(&Address::zero()); @@ -282,6 +289,11 @@ where .set(&managed_biguint!(LP_FARM_PER_BLOCK_REWARD_AMOUNT)); sc.last_reward_block_nonce() .set(BLOCK_NONCE_AFTER_PAIR_SETUP); + sc.lock_epochs().set(LOCK_OPTIONS[2]); + sc.locking_sc_address() + .set(managed_address!(energy_factory_address)); + sc.energy_factory_address() + .set(managed_address!(energy_factory_address)); }) .assert_ok(); @@ -327,14 +339,80 @@ where farm_wrapper } +pub fn setup_energy_factory( + owner_addr: &Address, + b_mock: &mut BlockchainStateWrapper, + energy_factory_builder: EnergyFactoryObjBuilder, +) -> ContractObjWrapper, EnergyFactoryObjBuilder> +where + EnergyFactoryObjBuilder: 'static + Copy + Fn() -> energy_factory::ContractObj, +{ + let rust_zero = rust_biguint!(0u64); + let energy_factory_wrapper = b_mock.create_sc_account( + &rust_zero, + Some(owner_addr), + energy_factory_builder, + "energy factory", + ); + + b_mock + .execute_tx(owner_addr, &energy_factory_wrapper, &rust_zero, |sc| { + let mut lock_options = MultiValueEncoded::new(); + for (option, penalty) in LOCK_OPTIONS.iter().zip(PENALTY_PERCENTAGES.iter()) { + lock_options.push((*option, *penalty).into()); + } + + sc.init( + managed_token_id!(LOCKED_TOKEN_ID), + managed_token_id!(LEGACY_LOCKED_TOKEN_ID), + managed_address!(energy_factory_wrapper.address_ref()), + 0, + lock_options, + ); + + sc.base_asset_token_id() + .set(managed_token_id!(MEX_TOKEN_ID)); + sc.locked_token() + .set_token_id(managed_token_id!(LOCKED_TOKEN_ID)); + sc.set_paused(false); + }) + .assert_ok(); + + b_mock.set_esdt_local_roles( + energy_factory_wrapper.address_ref(), + MEX_TOKEN_ID, + &[EsdtLocalRole::Mint, EsdtLocalRole::Burn], + ); + b_mock.set_esdt_local_roles( + energy_factory_wrapper.address_ref(), + LOCKED_TOKEN_ID, + &[ + EsdtLocalRole::NftCreate, + EsdtLocalRole::NftAddQuantity, + EsdtLocalRole::NftBurn, + EsdtLocalRole::Transfer, + ], + ); + b_mock.set_esdt_local_roles( + energy_factory_wrapper.address_ref(), + LEGACY_LOCKED_TOKEN_ID, + &[EsdtLocalRole::NftBurn], + ); + + energy_factory_wrapper +} + fn enter_farm( user_address: &Address, b_mock: &mut BlockchainStateWrapper, - farm_wrapper: &ContractObjWrapper, FarmObjBuilder>, + farm_wrapper: &ContractObjWrapper< + farm_with_locked_rewards::ContractObj, + FarmObjBuilder, + >, farm_in_amount: u64, additional_farm_tokens: &[TxTokenTransfer], ) where - FarmObjBuilder: 'static + Copy + Fn() -> farm::ContractObj, + FarmObjBuilder: 'static + Copy + Fn() -> farm_with_locked_rewards::ContractObj, { let mut payments = Vec::with_capacity(1 + additional_farm_tokens.len()); payments.push(TxTokenTransfer { diff --git a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_interactions/mod.rs b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_interactions/mod.rs index 00b2e2e0f..6a272f207 100644 --- a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_interactions/mod.rs +++ b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_interactions/mod.rs @@ -23,7 +23,7 @@ use sc_whitelist_module::SCWhitelistModule; use crate::{ constants::*, - staking_farm_with_lp_external_contracts::{setup_lp_farm, setup_pair}, + staking_farm_with_lp_external_contracts::{setup_energy_factory, setup_lp_farm, setup_pair}, staking_farm_with_lp_staking_contract_setup::{ add_proxy_to_whitelist, setup_proxy, setup_staking_farm, }, @@ -37,11 +37,13 @@ pub struct NonceAmountPair { pub struct FarmStakingSetup< PairObjBuilder, FarmObjBuilder, + EnergyFactoryBuilder, StakingContractObjBuilder, ProxyContractObjBuilder, > where PairObjBuilder: 'static + Copy + Fn() -> pair::ContractObj, - FarmObjBuilder: 'static + Copy + Fn() -> farm::ContractObj, + FarmObjBuilder: 'static + Copy + Fn() -> farm_with_locked_rewards::ContractObj, + EnergyFactoryBuilder: 'static + Copy + Fn() -> energy_factory::ContractObj, StakingContractObjBuilder: 'static + Copy + Fn() -> farm_staking::ContractObj, ProxyContractObjBuilder: 'static + Copy + Fn() -> farm_staking_proxy::ContractObj, { @@ -49,29 +51,41 @@ pub struct FarmStakingSetup< pub user_addr: Address, pub b_mock: BlockchainStateWrapper, pub pair_wrapper: ContractObjWrapper, PairObjBuilder>, - pub lp_farm_wrapper: ContractObjWrapper, FarmObjBuilder>, + pub lp_farm_wrapper: + ContractObjWrapper, FarmObjBuilder>, + pub energy_factory_wrapper: + ContractObjWrapper, EnergyFactoryBuilder>, pub staking_farm_wrapper: ContractObjWrapper, StakingContractObjBuilder>, pub proxy_wrapper: ContractObjWrapper, ProxyContractObjBuilder>, } -impl +impl< + PairObjBuilder, + FarmObjBuilder, + EnergyFactoryBuilder, + StakingContractObjBuilder, + ProxyContractObjBuilder, + > FarmStakingSetup< PairObjBuilder, FarmObjBuilder, + EnergyFactoryBuilder, StakingContractObjBuilder, ProxyContractObjBuilder, > where PairObjBuilder: 'static + Copy + Fn() -> pair::ContractObj, - FarmObjBuilder: 'static + Copy + Fn() -> farm::ContractObj, + FarmObjBuilder: 'static + Copy + Fn() -> farm_with_locked_rewards::ContractObj, + EnergyFactoryBuilder: 'static + Copy + Fn() -> energy_factory::ContractObj, StakingContractObjBuilder: 'static + Copy + Fn() -> farm_staking::ContractObj, ProxyContractObjBuilder: 'static + Copy + Fn() -> farm_staking_proxy::ContractObj, { pub fn new( pair_builder: PairObjBuilder, lp_farm_builder: FarmObjBuilder, + energy_factory_builder: EnergyFactoryBuilder, staking_farm_builder: StakingContractObjBuilder, proxy_builder: ProxyContractObjBuilder, ) -> Self { @@ -80,10 +94,13 @@ where let owner_addr = b_mock.create_user_account(&rust_zero); let user_addr = b_mock.create_user_account(&rust_biguint!(100_000_000)); + let energy_factory_wrapper = + setup_energy_factory(&owner_addr, &mut b_mock, energy_factory_builder); let pair_wrapper = setup_pair(&owner_addr, &user_addr, &mut b_mock, pair_builder); let lp_farm_wrapper = setup_lp_farm( &owner_addr, &user_addr, + energy_factory_wrapper.address_ref(), &mut b_mock, lp_farm_builder, USER_TOTAL_LP_TOKENS, @@ -111,6 +128,11 @@ where sc.add_sc_address_to_whitelist(managed_address!(proxy_wrapper.address_ref())); }) .assert_ok(); + b_mock + .execute_tx(&owner_addr, &energy_factory_wrapper, &rust_zero, |sc| { + sc.add_sc_address_to_whitelist(managed_address!(lp_farm_wrapper.address_ref())); + }) + .assert_ok(); FarmStakingSetup { owner_addr, @@ -118,6 +140,7 @@ where b_mock, pair_wrapper, lp_farm_wrapper, + energy_factory_wrapper, staking_farm_wrapper, proxy_wrapper, } diff --git a/locked-asset/proxy_dex/tests/proxy_dex_test_setup/mod.rs b/locked-asset/proxy_dex/tests/proxy_dex_test_setup/mod.rs index 59da1640a..2ab0326d4 100644 --- a/locked-asset/proxy_dex/tests/proxy_dex_test_setup/mod.rs +++ b/locked-asset/proxy_dex/tests/proxy_dex_test_setup/mod.rs @@ -21,7 +21,9 @@ use multiversx_sc_scenario::{ }; use pair::{config::ConfigModule as OtherConfigModule, Pair}; use pausable::{PausableModule, State}; -use proxy_dex::{proxy_common::ProxyCommonModule, other_sc_whitelist::OtherScWhitelistModule, ProxyDexImpl}; +use proxy_dex::{ + other_sc_whitelist::OtherScWhitelistModule, proxy_common::ProxyCommonModule, ProxyDexImpl, +}; use sc_whitelist_module::SCWhitelistModule; use simple_lock::locked_token::{LockedTokenAttributes, LockedTokenModule}; @@ -315,6 +317,8 @@ where ); sc.set_locking_sc_address(managed_address!(simple_lock_addr)); sc.set_lock_epochs(EPOCHS_IN_YEAR); + sc.energy_factory_address() + .set(managed_address!(simple_lock_addr)); }) .assert_ok(); From 1b70768f231dc0ea77f7b2dfd78b08070d9e4df5 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Mon, 16 Oct 2023 14:12:42 +0300 Subject: [PATCH 119/213] metastaking test with lp farm token merge --- .../farm-staking-proxy/tests/constants/mod.rs | 1 + .../tests/staking_farm_with_lp.rs | 144 +++++++++++++++++- .../mod.rs | 119 ++++++++++++++- 3 files changed, 261 insertions(+), 3 deletions(-) diff --git a/farm-staking/farm-staking-proxy/tests/constants/mod.rs b/farm-staking/farm-staking-proxy/tests/constants/mod.rs index 4ccf1ba79..706bc12a2 100644 --- a/farm-staking/farm-staking-proxy/tests/constants/mod.rs +++ b/farm-staking/farm-staking-proxy/tests/constants/mod.rs @@ -39,6 +39,7 @@ pub const USER_REWARDS_ENERGY_CONST: u64 = 3; pub const USER_REWARDS_FARM_CONST: u64 = 2; pub const MIN_ENERGY_AMOUNT_FOR_BOOSTED_YIELDS: u64 = 1; pub const MIN_FARM_AMOUNT_FOR_BOOSTED_YIELDS: u64 = 1; +pub const BOOSTED_YIELDS_PERCENTAGE: u64 = 2_500; // 25% // Proxy constants diff --git a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp.rs b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp.rs index 2589e1d2b..d7ee78e8d 100644 --- a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp.rs +++ b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp.rs @@ -482,4 +482,146 @@ fn test_stake_farm_through_proxy_with_merging() { } #[test] -fn test_farm_stake_proxy_merging_boosted_rewards() {} +fn test_farm_stake_proxy_merging_boosted_rewards() { + let mut setup = FarmStakingSetup::new( + pair::contract_obj, + farm_with_locked_rewards::contract_obj, + energy_factory::contract_obj, + farm_staking::contract_obj, + farm_staking_proxy::contract_obj, + ); + + // Boosted rewards setup + setup.set_lp_farm_boosted_yields_rewards_percentage(BOOSTED_YIELDS_PERCENTAGE); + let farm_amount = 50_000_000u64; + let user_address = setup.user_addr.clone(); + let temp_user = setup + .b_mock + .create_user_account(&rust_biguint!(100_000_000)); + setup.exit_lp_farm(&user_address, 1, USER_TOTAL_LP_TOKENS); + setup.b_mock.set_esdt_balance( + &setup.user_addr, + LP_TOKEN_ID, + &rust_biguint!(farm_amount * 2), + ); + setup + .b_mock + .set_esdt_balance(&temp_user, LP_TOKEN_ID, &rust_biguint!(1)); + + setup.b_mock.set_block_epoch(2); + + setup.set_user_energy(&user_address, 1_000, 2, 1); + let mut farm_token_nonce = setup.enter_lp_farm(&user_address, farm_amount); + let second_farm_token_nonce = setup.enter_lp_farm(&user_address, farm_amount); // will enter Metastaking next week + + // User claims rewards to get his energy registered + farm_token_nonce = setup.claim_lp_farm(&user_address, farm_token_nonce, farm_amount, 0); + + // User enters Metastaking + let first_dual_yield_token_nonce = + setup.stake_farm_lp_proxy(farm_token_nonce, farm_amount, 1, farm_amount); + setup.b_mock.execute_in_managed_environment(|| { + setup.b_mock.check_nft_balance( + &setup.user_addr, + DUAL_YIELD_TOKEN_ID, + first_dual_yield_token_nonce, + &rust_biguint!(farm_amount), + Some(&DualYieldTokenAttributes:: { + lp_farm_token_nonce: farm_token_nonce, + lp_farm_token_amount: managed_biguint!(farm_amount), + staking_farm_token_nonce: 1, + staking_farm_token_amount: managed_biguint!(farm_amount), + }), + ) + }); + + // advance blocks - 10 blocks - 10 * 5_000 = 50_000 total rewards + // 37_500 base farm, 12_500 boosted yields + let boosted_rewards = 12_500u64; + setup.b_mock.set_block_nonce(110); + + // random tx on end of week 1, to cummulate rewards + setup.b_mock.set_block_epoch(6); + setup.set_user_energy(&user_address, 1_000, 6, 1); + setup.set_user_energy(&temp_user, 1, 6, 1); + let temp_user_farm_token_nonce = setup.enter_lp_farm(&temp_user, 1); + setup.exit_lp_farm(&temp_user, temp_user_farm_token_nonce, 1); + + // advance 1 week + setup.b_mock.set_block_epoch(10); + setup.set_user_energy(&user_address, 1_000, 10, 1); + + // check locked tokens rewards before staking farm tokens with merge + setup.b_mock.execute_in_managed_environment(|| { + setup.b_mock.check_nft_balance::( + &user_address, + LOCKED_TOKEN_ID, + 1, + &rust_biguint!(0), + None, + ) + }); + + // user enters Metastaking with second position, which should merge with the first one + let dual_yield_token_payments = vec![NonceAmountPair { + nonce: first_dual_yield_token_nonce, + amount: farm_amount, + }]; + let new_dual_yield_token_nonce = setup.stake_farm_lp_proxy_multiple( + second_farm_token_nonce, + farm_amount, + dual_yield_token_payments, + ); + + // check user staking farm tokens + setup.b_mock.check_nft_balance::( + &setup.user_addr, + DUAL_YIELD_TOKEN_ID, + first_dual_yield_token_nonce, + &rust_biguint!(0), + None, + ); + setup.b_mock.execute_in_managed_environment(|| { + setup.b_mock.check_nft_balance( + &setup.user_addr, + DUAL_YIELD_TOKEN_ID, + new_dual_yield_token_nonce, + &rust_biguint!(farm_amount * 2), + Some(&DualYieldTokenAttributes:: { + lp_farm_token_nonce: 6, + lp_farm_token_amount: managed_biguint!(farm_amount * 2), + staking_farm_token_nonce: 2, + staking_farm_token_amount: managed_biguint!(farm_amount * 2), + }), + ) + }); + + // check farm staking SC tokens + setup.b_mock.check_esdt_balance( + setup.staking_farm_wrapper.address_ref(), + RIDE_TOKEN_ID, + &rust_biguint!(1_000_000_000_000), + ); + + // check proxy SC tokens + setup.b_mock.execute_in_managed_environment(|| { + setup.b_mock.check_nft_balance::( + setup.proxy_wrapper.address_ref(), + LP_FARM_TOKEN_ID, + 6, // farm token nonce after merge + &rust_biguint!(farm_amount * 2), + None, //current attributes + ) + }); + + // check boosted rewards + setup.b_mock.execute_in_managed_environment(|| { + setup.b_mock.check_nft_balance::( + &user_address, + LOCKED_TOKEN_ID, + 1, + &rust_biguint!(boosted_rewards), + None, + ) + }); +} diff --git a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_interactions/mod.rs b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_interactions/mod.rs index 6a272f207..8860a604e 100644 --- a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_interactions/mod.rs +++ b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_interactions/mod.rs @@ -1,8 +1,15 @@ #![allow(deprecated)] -use multiversx_sc::{codec::multi_types::OptionalValue, types::Address}; +use energy_factory::energy::EnergyModule; +use energy_query::Energy; +use farm_boosted_yields::FarmBoostedYieldsModule; +use farm_with_locked_rewards::Farm; +use multiversx_sc::{ + codec::multi_types::OptionalValue, + types::{Address, BigInt}, +}; use multiversx_sc_scenario::{ - managed_address, managed_biguint, rust_biguint, + managed_address, managed_biguint, managed_token_id, rust_biguint, whitebox_legacy::TxTokenTransfer, whitebox_legacy::{BlockchainStateWrapper, ContractObjWrapper}, DebugApi, @@ -442,4 +449,112 @@ where unbond_token_nonce } + + pub fn enter_lp_farm(&mut self, user: &Address, farm_token_amount: u64) -> u64 { + let mut farm_token_nonce = 0; + self.b_mock + .execute_esdt_transfer( + user, + &self.lp_farm_wrapper, + LP_TOKEN_ID, + 0, + &rust_biguint!(farm_token_amount), + |sc| { + let (new_farm_token, _boosted_rewards_payment) = + sc.enter_farm_endpoint(OptionalValue::None).into_tuple(); + assert_eq!( + new_farm_token.token_identifier, + managed_token_id!(LP_FARM_TOKEN_ID) + ); + assert_eq!(new_farm_token.amount, farm_token_amount); + farm_token_nonce = new_farm_token.token_nonce; + }, + ) + .assert_ok(); + + farm_token_nonce + } + + pub fn exit_lp_farm(&mut self, user: &Address, farm_token_nonce: u64, farm_token_amount: u64) { + self.b_mock + .execute_esdt_transfer( + user, + &self.lp_farm_wrapper, + LP_FARM_TOKEN_ID, + farm_token_nonce, + &rust_biguint!(farm_token_amount), + |sc| { + let (_lp_tokens, _boosted_rewards_payment) = + sc.exit_farm_endpoint(OptionalValue::None).into_tuple(); + }, + ) + .assert_ok(); + } + + pub fn claim_lp_farm( + &mut self, + user: &Address, + farm_token_nonce: u64, + farm_token_amount: u64, + expected_lp_farm_rewards: u64, + ) -> u64 { + let mut new_farm_token_nonce = 0; + self.b_mock + .execute_esdt_transfer( + user, + &self.lp_farm_wrapper, + LP_FARM_TOKEN_ID, + farm_token_nonce, + &rust_biguint!(farm_token_amount), + |sc| { + let (output_farm_token, boosted_rewards_payment) = + sc.claim_rewards_endpoint(OptionalValue::None).into_tuple(); + assert_eq!(output_farm_token.amount, farm_token_amount); + assert_eq!(boosted_rewards_payment.amount, expected_lp_farm_rewards); + new_farm_token_nonce = output_farm_token.token_nonce; + }, + ) + .assert_ok(); + + new_farm_token_nonce + } + + pub fn set_user_energy( + &mut self, + user: &Address, + energy: u64, + last_update_epoch: u64, + locked_tokens: u64, + ) { + self.b_mock + .execute_tx( + &self.owner_addr, + &self.energy_factory_wrapper, + &rust_biguint!(0), + |sc| { + sc.user_energy(&managed_address!(user)).set(&Energy::new( + BigInt::from(managed_biguint!(energy)), + last_update_epoch, + managed_biguint!(locked_tokens), + )); + }, + ) + .assert_ok(); + } + + pub fn set_lp_farm_boosted_yields_rewards_percentage( + &mut self, + boosted_yields_rewards_percentage: u64, + ) { + self.b_mock + .execute_tx( + &self.owner_addr, + &self.lp_farm_wrapper, + &rust_biguint!(0), + |sc| { + sc.set_boosted_yields_rewards_percentage(boosted_yields_rewards_percentage); + }, + ) + .assert_ok(); + } } From de67c974b8d6d5762be944cebe24fdcee0eaa7c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Mon, 16 Oct 2023 19:24:35 +0300 Subject: [PATCH 120/213] router: multi_pair_swap return payments --- dex/router/src/multi_pair_swap.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dex/router/src/multi_pair_swap.rs b/dex/router/src/multi_pair_swap.rs index e537beed9..c7151965e 100644 --- a/dex/router/src/multi_pair_swap.rs +++ b/dex/router/src/multi_pair_swap.rs @@ -15,7 +15,7 @@ pub const SWAP_TOKENS_FIXED_OUTPUT_FUNC_NAME: &[u8] = b"swapTokensFixedOutput"; pub trait MultiPairSwap: factory::FactoryModule + token_send::TokenSendModule { #[payable("*")] #[endpoint(multiPairSwap)] - fn multi_pair_swap(&self, swap_operations: MultiValueEncoded>) { + fn multi_pair_swap(&self, swap_operations: MultiValueEncoded>) -> ManagedVec { let (token_id, nonce, amount) = self.call_value().single_esdt().into_tuple(); require!(nonce == 0, "Invalid nonce. Should be zero"); require!(amount > 0u64, "Invalid amount. Should not be zero"); @@ -61,6 +61,8 @@ pub trait MultiPairSwap: factory::FactoryModule + token_send::TokenSendModule { payments.push(last_payment); self.send().direct_multi(&caller, &payments); + + payments } fn actual_swap_fixed_input( From 06ffdabb5e3f9b2e6a32f874a608ec16417110c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Mon, 16 Oct 2023 19:24:52 +0300 Subject: [PATCH 121/213] farm-staking: Fix clippy --- farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs b/farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs index 2faf021a3..b598e3a06 100644 --- a/farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs +++ b/farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs @@ -46,7 +46,7 @@ pub trait ProxyUnstakeModule: ); let staking_farm_exit_result = self.staking_farm_unstake( - orig_caller.clone(), + orig_caller, remove_liq_result.staking_token_payment, exit_attributes.staking_farm_token_nonce, exit_attributes.staking_farm_token_amount, From d500ab69abdecdb1f106759368bef6cca0f12d8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Fri, 27 Oct 2023 07:20:09 +0300 Subject: [PATCH 122/213] Governance-v2: Fix GovernanceProposal default --- energy-integration/governance-v2/src/proposal.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/energy-integration/governance-v2/src/proposal.rs b/energy-integration/governance-v2/src/proposal.rs index 8c60bc280..9ba50798c 100644 --- a/energy-integration/governance-v2/src/proposal.rs +++ b/energy-integration/governance-v2/src/proposal.rs @@ -65,3 +65,18 @@ pub struct GovernanceProposal { pub proposal_start_block: u64, pub fee_withdrawn: bool, } + + +impl Default for GovernanceProposal { + fn default() -> Self { + Self::new() + } +} + +impl GovernanceProposal { + pub fn new() -> Self { + GovernanceProposal { + ..Default::default() + } + } +} From b9361ef7c0c5140f10806b7ef21d1874e93468da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Mon, 30 Oct 2023 12:05:16 +0200 Subject: [PATCH 123/213] Governance-v2: Fix default GovernanceProposal --- .../governance-v2/src/proposal.rs | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/energy-integration/governance-v2/src/proposal.rs b/energy-integration/governance-v2/src/proposal.rs index 9ba50798c..3c988b067 100644 --- a/energy-integration/governance-v2/src/proposal.rs +++ b/energy-integration/governance-v2/src/proposal.rs @@ -50,7 +50,7 @@ impl From> for GovernanceAction } } -#[derive(TypeAbi, TopEncode, TopDecode, PartialEq, Debug)] +#[derive(TypeAbi, TopEncode, TopDecode, NestedEncode, NestedDecode, PartialEq, Debug)] pub struct GovernanceProposal { pub proposal_id: usize, pub proposer: ManagedAddress, @@ -66,7 +66,6 @@ pub struct GovernanceProposal { pub fee_withdrawn: bool, } - impl Default for GovernanceProposal { fn default() -> Self { Self::new() @@ -76,7 +75,22 @@ impl Default for GovernanceProposal { impl GovernanceProposal { pub fn new() -> Self { GovernanceProposal { - ..Default::default() + proposal_id: 0, + proposer: ManagedAddress::default(), + actions: ArrayVec::default(), + description: ManagedBuffer::default(), + fee_payment: EsdtTokenPayment { + token_identifier: TokenIdentifier::from(""), + token_nonce: 0, + amount: BigUint::zero(), + }, + minimum_quorum: BigUint::default(), + voting_delay_in_blocks: 0, + voting_period_in_blocks: 0, + withdraw_percentage_defeated: 0, + total_quorum: BigUint::default(), + proposal_start_block: 0, + fee_withdrawn: false, } } } From 4c73589342600c770ed30264e816569a75c8b24b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Mon, 30 Oct 2023 14:05:44 +0200 Subject: [PATCH 124/213] Governance-v2: Update proposal_id consistency --- energy-integration/governance-v2/tests/gov_rust_test.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/energy-integration/governance-v2/tests/gov_rust_test.rs b/energy-integration/governance-v2/tests/gov_rust_test.rs index 929e36945..871060d4a 100644 --- a/energy-integration/governance-v2/tests/gov_rust_test.rs +++ b/energy-integration/governance-v2/tests/gov_rust_test.rs @@ -730,6 +730,11 @@ fn gov_propose_cancel_proposal_id_test() { &min_fee, None, ); + assert_eq!(proposal_id, 3); + gov_setup + .check_proposal_id_consistency(&first_user_addr, proposal_id) + .assert_ok(); + // Proposal ID = 4 let (result, proposal_id) = gov_setup.propose( From 77c159b7c9d10110dcd6c9ce957503fe2fdde750 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Mon, 30 Oct 2023 15:24:33 +0200 Subject: [PATCH 125/213] Governance-v2: Retrieve cancelled proposal --- energy-integration/governance-v2/tests/gov_rust_test.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/energy-integration/governance-v2/tests/gov_rust_test.rs b/energy-integration/governance-v2/tests/gov_rust_test.rs index 871060d4a..3ec147d73 100644 --- a/energy-integration/governance-v2/tests/gov_rust_test.rs +++ b/energy-integration/governance-v2/tests/gov_rust_test.rs @@ -722,6 +722,11 @@ fn gov_propose_cancel_proposal_id_test() { gov_setup.cancel_proposal(&first_user_addr, 2).assert_ok(); + // Try to retrieve the cancelled proposal + gov_setup.b_mock.execute_tx(&gov_setup.first_user.clone(), &gov_setup.gov_wrapper, &rust_biguint!(0), |sc| { + sc.proposals().get(2); + }).assert_ok(); + // Check proposer balance (fee should be refunded) gov_setup.b_mock.check_nft_balance::( &first_user_addr, From 6d87cf574510d900a7dd329875fac99ae350f88f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Mon, 30 Oct 2023 15:32:11 +0200 Subject: [PATCH 126/213] Governance-v2: Fix GovernanceProposal default --- .../governance-v2/src/proposal.rs | 12 ++++++-- .../governance-v2/tests/gov_rust_test.rs | 29 ++++++++++++++++--- 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/energy-integration/governance-v2/src/proposal.rs b/energy-integration/governance-v2/src/proposal.rs index 3c988b067..8237331cd 100644 --- a/energy-integration/governance-v2/src/proposal.rs +++ b/energy-integration/governance-v2/src/proposal.rs @@ -1,3 +1,5 @@ +use multiversx_sc::codec::{EncodeDefault, DecodeDefault}; + multiversx_sc::imports!(); multiversx_sc::derive_imports!(); @@ -50,7 +52,7 @@ impl From> for GovernanceAction } } -#[derive(TypeAbi, TopEncode, TopDecode, NestedEncode, NestedDecode, PartialEq, Debug)] +#[derive(TypeAbi, NestedEncode, NestedDecode, PartialEq, Debug, TopEncodeOrDefault, TopDecodeOrDefault)] pub struct GovernanceProposal { pub proposal_id: usize, pub proposer: ManagedAddress, @@ -66,7 +68,13 @@ pub struct GovernanceProposal { pub fee_withdrawn: bool, } -impl Default for GovernanceProposal { +impl EncodeDefault for GovernanceProposal { + fn is_default(&self) -> bool { + self.proposal_id == 0 + } +} + +impl DecodeDefault for GovernanceProposal { fn default() -> Self { Self::new() } diff --git a/energy-integration/governance-v2/tests/gov_rust_test.rs b/energy-integration/governance-v2/tests/gov_rust_test.rs index 3ec147d73..24b3ed517 100644 --- a/energy-integration/governance-v2/tests/gov_rust_test.rs +++ b/energy-integration/governance-v2/tests/gov_rust_test.rs @@ -723,9 +723,17 @@ fn gov_propose_cancel_proposal_id_test() { gov_setup.cancel_proposal(&first_user_addr, 2).assert_ok(); // Try to retrieve the cancelled proposal - gov_setup.b_mock.execute_tx(&gov_setup.first_user.clone(), &gov_setup.gov_wrapper, &rust_biguint!(0), |sc| { - sc.proposals().get(2); - }).assert_ok(); + gov_setup + .b_mock + .execute_tx( + &gov_setup.first_user.clone(), + &gov_setup.gov_wrapper, + &rust_biguint!(0), + |sc| { + sc.proposals().get(2); + }, + ) + .assert_ok(); // Check proposer balance (fee should be refunded) gov_setup.b_mock.check_nft_balance::( @@ -740,7 +748,6 @@ fn gov_propose_cancel_proposal_id_test() { .check_proposal_id_consistency(&first_user_addr, proposal_id) .assert_ok(); - // Proposal ID = 4 let (result, proposal_id) = gov_setup.propose( &first_user_addr, @@ -757,6 +764,20 @@ fn gov_propose_cancel_proposal_id_test() { gov_setup.cancel_proposal(&first_user_addr, 4).assert_ok(); + // Try to retrieve the cancelled proposal + gov_setup + .b_mock + .execute_tx( + &gov_setup.first_user.clone(), + &gov_setup.gov_wrapper, + &rust_biguint!(0), + |sc| { + sc.proposals().get(4); + }, + ) + .assert_ok(); + + // Proposal ID = 5 let (result, proposal_id) = gov_setup.propose( &first_user_addr, From 75ec9051666fa570e5ab9fe358dbcb43fcdd04cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Tue, 31 Oct 2023 08:56:15 +0200 Subject: [PATCH 127/213] Governance-v2: Clippy fix + format --- energy-integration/governance-v2/src/proposal.rs | 12 ++++++++++-- .../governance-v2/tests/gov_rust_test.rs | 5 ++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/energy-integration/governance-v2/src/proposal.rs b/energy-integration/governance-v2/src/proposal.rs index 8237331cd..94c66a131 100644 --- a/energy-integration/governance-v2/src/proposal.rs +++ b/energy-integration/governance-v2/src/proposal.rs @@ -1,4 +1,4 @@ -use multiversx_sc::codec::{EncodeDefault, DecodeDefault}; +use multiversx_sc::codec::{DecodeDefault, EncodeDefault}; multiversx_sc::imports!(); multiversx_sc::derive_imports!(); @@ -52,7 +52,9 @@ impl From> for GovernanceAction } } -#[derive(TypeAbi, NestedEncode, NestedDecode, PartialEq, Debug, TopEncodeOrDefault, TopDecodeOrDefault)] +#[derive( + TypeAbi, NestedEncode, NestedDecode, PartialEq, Debug, TopEncodeOrDefault, TopDecodeOrDefault, +)] pub struct GovernanceProposal { pub proposal_id: usize, pub proposer: ManagedAddress, @@ -80,6 +82,12 @@ impl DecodeDefault for GovernanceProposal { } } +impl Default for GovernanceProposal { + fn default() -> Self { + Self::new() + } +} + impl GovernanceProposal { pub fn new() -> Self { GovernanceProposal { diff --git a/energy-integration/governance-v2/tests/gov_rust_test.rs b/energy-integration/governance-v2/tests/gov_rust_test.rs index 24b3ed517..573278722 100644 --- a/energy-integration/governance-v2/tests/gov_rust_test.rs +++ b/energy-integration/governance-v2/tests/gov_rust_test.rs @@ -764,8 +764,8 @@ fn gov_propose_cancel_proposal_id_test() { gov_setup.cancel_proposal(&first_user_addr, 4).assert_ok(); - // Try to retrieve the cancelled proposal - gov_setup + // Try to retrieve the cancelled proposal + gov_setup .b_mock .execute_tx( &gov_setup.first_user.clone(), @@ -777,7 +777,6 @@ fn gov_propose_cancel_proposal_id_test() { ) .assert_ok(); - // Proposal ID = 5 let (result, proposal_id) = gov_setup.propose( &first_user_addr, From 6a47c2275ffa8fd716ee1da13b2cb3d99738e715 Mon Sep 17 00:00:00 2001 From: Andrei Marinica Date: Fri, 10 Nov 2023 10:49:29 +0200 Subject: [PATCH 128/213] framework upgrade 0.44.0 --- common/common_errors/Cargo.toml | 2 +- common/common_structs/Cargo.toml | 2 +- common/modules/farm/config/Cargo.toml | 2 +- common/modules/farm/contexts/Cargo.toml | 4 ++-- common/modules/farm/events/Cargo.toml | 2 +- common/modules/farm/farm_base_impl/Cargo.toml | 6 +++--- common/modules/farm/farm_token/Cargo.toml | 4 ++-- common/modules/farm/farm_token_merge/Cargo.toml | 4 ++-- common/modules/farm/rewards/Cargo.toml | 4 ++-- common/modules/legacy_token_decode_module/Cargo.toml | 2 +- common/modules/locking_module/Cargo.toml | 2 +- common/modules/math/Cargo.toml | 2 +- common/modules/pausable/Cargo.toml | 2 +- common/modules/permissions_module/Cargo.toml | 2 +- common/modules/sc_whitelist_module/Cargo.toml | 2 +- common/modules/token_merge_helper/Cargo.toml | 2 +- common/modules/token_send/Cargo.toml | 2 +- common/modules/utils/Cargo.toml | 2 +- common/traits/fixed-supply-token/Cargo.toml | 2 +- common/traits/mergeable/Cargo.toml | 2 +- common/traits/unwrappable/Cargo.toml | 2 +- dex/Cargo.toml | 6 +++--- dex/farm-with-locked-rewards/Cargo.toml | 6 +++--- dex/farm-with-locked-rewards/meta/Cargo.toml | 2 +- dex/farm-with-locked-rewards/wasm/Cargo.toml | 2 +- dex/farm/Cargo.toml | 6 +++--- dex/farm/meta/Cargo.toml | 2 +- dex/farm/wasm/Cargo.toml | 2 +- dex/fuzz/Cargo.toml | 4 ++-- dex/governance/Cargo.toml | 4 ++-- dex/governance/meta/Cargo.toml | 2 +- dex/governance/wasm/Cargo.toml | 2 +- dex/pair-mock/Cargo.toml | 4 ++-- dex/pair-mock/meta/Cargo.toml | 2 +- dex/pair-mock/wasm/Cargo.toml | 2 +- dex/pair/Cargo.toml | 4 ++-- dex/pair/meta/Cargo.toml | 2 +- dex/pair/wasm-pair-full/Cargo.toml | 2 +- dex/pair/wasm-safe-price-view/Cargo.toml | 2 +- dex/pair/wasm/Cargo.toml | 2 +- dex/price-discovery/Cargo.toml | 6 +++--- dex/price-discovery/meta/Cargo.toml | 2 +- dex/price-discovery/wasm/Cargo.toml | 2 +- dex/proxy-deployer/Cargo.toml | 4 ++-- dex/proxy-deployer/meta/Cargo.toml | 2 +- dex/proxy-deployer/wasm/Cargo.toml | 2 +- dex/router/Cargo.toml | 4 ++-- dex/router/meta/Cargo.toml | 2 +- dex/router/wasm/Cargo.toml | 2 +- energy-integration/common-modules/energy-query/Cargo.toml | 2 +- .../common-modules/week-timekeeping/Cargo.toml | 2 +- .../common-modules/weekly-rewards-splitting/Cargo.toml | 2 +- energy-integration/common-types/Cargo.toml | 2 +- energy-integration/energy-factory-mock/Cargo.toml | 4 ++-- energy-integration/energy-factory-mock/meta/Cargo.toml | 2 +- energy-integration/energy-factory-mock/wasm/Cargo.toml | 2 +- energy-integration/energy-update/Cargo.toml | 6 +++--- energy-integration/energy-update/meta/Cargo.toml | 2 +- energy-integration/energy-update/wasm/Cargo.toml | 2 +- energy-integration/farm-boosted-yields/Cargo.toml | 2 +- energy-integration/fees-collector/Cargo.toml | 6 +++--- energy-integration/fees-collector/meta/Cargo.toml | 2 +- energy-integration/fees-collector/wasm/Cargo.toml | 2 +- energy-integration/governance-v2/Cargo.toml | 4 ++-- energy-integration/governance-v2/meta/Cargo.toml | 2 +- energy-integration/governance-v2/wasm/Cargo.toml | 2 +- farm-staking/farm-staking-proxy/Cargo.toml | 6 +++--- farm-staking/farm-staking-proxy/meta/Cargo.toml | 2 +- farm-staking/farm-staking-proxy/wasm/Cargo.toml | 2 +- farm-staking/farm-staking/Cargo.toml | 7 +++---- farm-staking/farm-staking/meta/Cargo.toml | 2 +- farm-staking/farm-staking/wasm/Cargo.toml | 2 +- farm-staking/metabonding-staking/Cargo.toml | 6 +++--- farm-staking/metabonding-staking/meta/Cargo.toml | 2 +- farm-staking/metabonding-staking/wasm/Cargo.toml | 2 +- locked-asset/Cargo.toml | 6 +++--- locked-asset/distribution/Cargo.toml | 4 ++-- locked-asset/distribution/meta/Cargo.toml | 2 +- locked-asset/distribution/wasm/Cargo.toml | 2 +- locked-asset/energy-factory/Cargo.toml | 6 +++--- locked-asset/energy-factory/meta/Cargo.toml | 2 +- locked-asset/energy-factory/wasm/Cargo.toml | 2 +- locked-asset/factory/Cargo.toml | 6 +++--- locked-asset/factory/meta/Cargo.toml | 2 +- locked-asset/factory/wasm/Cargo.toml | 2 +- locked-asset/lkmex-transfer/Cargo.toml | 6 +++--- locked-asset/lkmex-transfer/meta/Cargo.toml | 2 +- locked-asset/lkmex-transfer/wasm/Cargo.toml | 2 +- locked-asset/locked-token-wrapper/Cargo.toml | 6 +++--- locked-asset/locked-token-wrapper/meta/Cargo.toml | 2 +- locked-asset/locked-token-wrapper/wasm/Cargo.toml | 2 +- locked-asset/proxy_dex/Cargo.toml | 6 +++--- locked-asset/proxy_dex/meta/Cargo.toml | 2 +- locked-asset/proxy_dex/wasm/Cargo.toml | 2 +- locked-asset/simple-lock-whitelist/Cargo.toml | 6 +++--- locked-asset/simple-lock-whitelist/meta/Cargo.toml | 2 +- locked-asset/simple-lock-whitelist/wasm/Cargo.toml | 2 +- locked-asset/simple-lock/Cargo.toml | 6 +++--- locked-asset/simple-lock/meta/Cargo.toml | 2 +- locked-asset/simple-lock/wasm/Cargo.toml | 2 +- locked-asset/token-unstake/Cargo.toml | 6 +++--- locked-asset/token-unstake/meta/Cargo.toml | 2 +- locked-asset/token-unstake/wasm/Cargo.toml | 2 +- pause-all/Cargo.toml | 6 +++--- pause-all/meta/Cargo.toml | 2 +- pause-all/wasm/Cargo.toml | 2 +- 106 files changed, 159 insertions(+), 160 deletions(-) diff --git a/common/common_errors/Cargo.toml b/common/common_errors/Cargo.toml index cee6021cb..5ef0030f2 100644 --- a/common/common_errors/Cargo.toml +++ b/common/common_errors/Cargo.toml @@ -7,5 +7,5 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/common_structs/Cargo.toml b/common/common_structs/Cargo.toml index 967fb2174..e0c4ea791 100644 --- a/common/common_structs/Cargo.toml +++ b/common/common_structs/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.mergeable] diff --git a/common/modules/farm/config/Cargo.toml b/common/modules/farm/config/Cargo.toml index c1382c3a2..b1cc79243 100644 --- a/common/modules/farm/config/Cargo.toml +++ b/common/modules/farm/config/Cargo.toml @@ -22,5 +22,5 @@ path = "../../pausable" path = "../../permissions_module" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/farm/contexts/Cargo.toml b/common/modules/farm/contexts/Cargo.toml index 61326685e..82cd4e451 100644 --- a/common/modules/farm/contexts/Cargo.toml +++ b/common/modules/farm/contexts/Cargo.toml @@ -34,8 +34,8 @@ path = "../../pausable" path = "../../permissions_module" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.43.3" +version = "=0.44.0" diff --git a/common/modules/farm/events/Cargo.toml b/common/modules/farm/events/Cargo.toml index 14f710818..984cff301 100644 --- a/common/modules/farm/events/Cargo.toml +++ b/common/modules/farm/events/Cargo.toml @@ -13,5 +13,5 @@ path = "../../../common_structs" path = "../contexts" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/farm/farm_base_impl/Cargo.toml b/common/modules/farm/farm_base_impl/Cargo.toml index e303dc21f..9305cfd08 100644 --- a/common/modules/farm/farm_base_impl/Cargo.toml +++ b/common/modules/farm/farm_base_impl/Cargo.toml @@ -49,10 +49,10 @@ path = "../../../traits/mergeable" path = "../../../traits/fixed-supply-token" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.43.3" +version = "=0.44.0" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.3" +version = "=0.44.0" diff --git a/common/modules/farm/farm_token/Cargo.toml b/common/modules/farm/farm_token/Cargo.toml index abcf49db3..dd52a3e41 100644 --- a/common/modules/farm/farm_token/Cargo.toml +++ b/common/modules/farm/farm_token/Cargo.toml @@ -25,8 +25,8 @@ path = "../../pausable" path = "../../permissions_module" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.43.3" +version = "=0.44.0" diff --git a/common/modules/farm/farm_token_merge/Cargo.toml b/common/modules/farm/farm_token_merge/Cargo.toml index a73eef274..6976c0402 100644 --- a/common/modules/farm/farm_token_merge/Cargo.toml +++ b/common/modules/farm/farm_token_merge/Cargo.toml @@ -22,8 +22,8 @@ path = "../../token_merge_helper" path = "../farm_token" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.43.3" +version = "=0.44.0" diff --git a/common/modules/farm/rewards/Cargo.toml b/common/modules/farm/rewards/Cargo.toml index 0e3361f30..4ae605524 100644 --- a/common/modules/farm/rewards/Cargo.toml +++ b/common/modules/farm/rewards/Cargo.toml @@ -28,8 +28,8 @@ path = "../../pausable" path = "../../permissions_module" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.43.3" +version = "=0.44.0" diff --git a/common/modules/legacy_token_decode_module/Cargo.toml b/common/modules/legacy_token_decode_module/Cargo.toml index 7742f8d70..2b0b0152c 100644 --- a/common/modules/legacy_token_decode_module/Cargo.toml +++ b/common/modules/legacy_token_decode_module/Cargo.toml @@ -7,7 +7,7 @@ edition = "2018" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.common_structs] diff --git a/common/modules/locking_module/Cargo.toml b/common/modules/locking_module/Cargo.toml index 2627818d2..9ee2e08b5 100644 --- a/common/modules/locking_module/Cargo.toml +++ b/common/modules/locking_module/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.simple-lock] diff --git a/common/modules/math/Cargo.toml b/common/modules/math/Cargo.toml index 212fbea3e..621d25bd4 100644 --- a/common/modules/math/Cargo.toml +++ b/common/modules/math/Cargo.toml @@ -7,5 +7,5 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/pausable/Cargo.toml b/common/modules/pausable/Cargo.toml index 91c293650..1d93a6a20 100644 --- a/common/modules/pausable/Cargo.toml +++ b/common/modules/pausable/Cargo.toml @@ -10,5 +10,5 @@ path = "src/pausable.rs" path = "../permissions_module" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/permissions_module/Cargo.toml b/common/modules/permissions_module/Cargo.toml index 3c016d8ce..cd6cd9424 100644 --- a/common/modules/permissions_module/Cargo.toml +++ b/common/modules/permissions_module/Cargo.toml @@ -14,5 +14,5 @@ bitflags = "1.3.2" path = "../../common_errors" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/sc_whitelist_module/Cargo.toml b/common/modules/sc_whitelist_module/Cargo.toml index 35dd61be5..87b9d6874 100644 --- a/common/modules/sc_whitelist_module/Cargo.toml +++ b/common/modules/sc_whitelist_module/Cargo.toml @@ -10,5 +10,5 @@ path = "src/sc_whitelist_module.rs" path = "../../common_errors" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/token_merge_helper/Cargo.toml b/common/modules/token_merge_helper/Cargo.toml index 80d3bcb6e..a11e5d61b 100644 --- a/common/modules/token_merge_helper/Cargo.toml +++ b/common/modules/token_merge_helper/Cargo.toml @@ -10,5 +10,5 @@ path = "src/lib.rs" path = "../../common_errors" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/token_send/Cargo.toml b/common/modules/token_send/Cargo.toml index 5e155af70..2961d8287 100644 --- a/common/modules/token_send/Cargo.toml +++ b/common/modules/token_send/Cargo.toml @@ -13,5 +13,5 @@ path = "../../common_structs" path = "../../common_errors" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/utils/Cargo.toml b/common/modules/utils/Cargo.toml index 406bce549..a4f77ac25 100644 --- a/common/modules/utils/Cargo.toml +++ b/common/modules/utils/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.common_structs] diff --git a/common/traits/fixed-supply-token/Cargo.toml b/common/traits/fixed-supply-token/Cargo.toml index 7922633a1..6b8d4c8f2 100644 --- a/common/traits/fixed-supply-token/Cargo.toml +++ b/common/traits/fixed-supply-token/Cargo.toml @@ -7,4 +7,4 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" diff --git a/common/traits/mergeable/Cargo.toml b/common/traits/mergeable/Cargo.toml index d8e76fa93..582354504 100644 --- a/common/traits/mergeable/Cargo.toml +++ b/common/traits/mergeable/Cargo.toml @@ -7,5 +7,5 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/traits/unwrappable/Cargo.toml b/common/traits/unwrappable/Cargo.toml index 01cf23ef0..f4cdc6ad3 100644 --- a/common/traits/unwrappable/Cargo.toml +++ b/common/traits/unwrappable/Cargo.toml @@ -7,5 +7,5 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/dex/Cargo.toml b/dex/Cargo.toml index b62358245..e79055dd1 100644 --- a/dex/Cargo.toml +++ b/dex/Cargo.toml @@ -4,17 +4,17 @@ version = "0.0.0" edition = "2021" publish = false [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-modules] -version = "=0.43.3" +version = "=0.44.0" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.3" +version = "=0.44.0" [dev-dependencies.config] path = "../common/modules/farm/config" diff --git a/dex/farm-with-locked-rewards/Cargo.toml b/dex/farm-with-locked-rewards/Cargo.toml index b250d12ad..6409db6ac 100644 --- a/dex/farm-with-locked-rewards/Cargo.toml +++ b/dex/farm-with-locked-rewards/Cargo.toml @@ -74,17 +74,17 @@ path = "../../locked-asset/energy-factory" path = "../../energy-integration/common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.43.3" +version = "=0.44.0" [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.3" +version = "=0.44.0" [dev-dependencies.simple-lock] path = "../../locked-asset/simple-lock" diff --git a/dex/farm-with-locked-rewards/meta/Cargo.toml b/dex/farm-with-locked-rewards/meta/Cargo.toml index 4db13ec1d..0fc20f13c 100644 --- a/dex/farm-with-locked-rewards/meta/Cargo.toml +++ b/dex/farm-with-locked-rewards/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.43.2" +version = "0.44.0" diff --git a/dex/farm-with-locked-rewards/wasm/Cargo.toml b/dex/farm-with-locked-rewards/wasm/Cargo.toml index 6abffb966..db4ffa5d8 100644 --- a/dex/farm-with-locked-rewards/wasm/Cargo.toml +++ b/dex/farm-with-locked-rewards/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.3" +version = "=0.44.0" diff --git a/dex/farm/Cargo.toml b/dex/farm/Cargo.toml index b3df661f7..87adca99e 100644 --- a/dex/farm/Cargo.toml +++ b/dex/farm/Cargo.toml @@ -68,11 +68,11 @@ path = "../../energy-integration/common-modules/weekly-rewards-splitting" path = "../../energy-integration/common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.43.3" +version = "=0.44.0" [dev-dependencies] num-bigint = "0.4.2" @@ -81,7 +81,7 @@ num-bigint = "0.4.2" path = "../../energy-integration/energy-update" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.3" +version = "=0.44.0" [dev-dependencies.energy-factory-mock] path = "../../energy-integration/energy-factory-mock" diff --git a/dex/farm/meta/Cargo.toml b/dex/farm/meta/Cargo.toml index 777764d67..bcd565cdd 100644 --- a/dex/farm/meta/Cargo.toml +++ b/dex/farm/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.43.2" +version = "0.44.0" diff --git a/dex/farm/wasm/Cargo.toml b/dex/farm/wasm/Cargo.toml index 1e0b0a134..c48ebba22 100644 --- a/dex/farm/wasm/Cargo.toml +++ b/dex/farm/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.3" +version = "=0.44.0" diff --git a/dex/fuzz/Cargo.toml b/dex/fuzz/Cargo.toml index 34bbfa809..6d1dd0eb5 100644 --- a/dex/fuzz/Cargo.toml +++ b/dex/fuzz/Cargo.toml @@ -12,11 +12,11 @@ num-bigint = "0.4.2" rand = "0.8.4" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-scenario] -version = "=0.43.3" +version = "=0.44.0" [dependencies.pausable] path = "../../common/modules/pausable" diff --git a/dex/governance/Cargo.toml b/dex/governance/Cargo.toml index b38e75cf9..d6cf219f6 100644 --- a/dex/governance/Cargo.toml +++ b/dex/governance/Cargo.toml @@ -8,14 +8,14 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.3" +version = "=0.44.0" [dev-dependencies.pair-mock] path = "../pair-mock" diff --git a/dex/governance/meta/Cargo.toml b/dex/governance/meta/Cargo.toml index 0a183b8d9..8aa3f3d5d 100644 --- a/dex/governance/meta/Cargo.toml +++ b/dex/governance/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.43.2" +version = "0.44.0" diff --git a/dex/governance/wasm/Cargo.toml b/dex/governance/wasm/Cargo.toml index 8abd3ad55..61518848f 100644 --- a/dex/governance/wasm/Cargo.toml +++ b/dex/governance/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.3" +version = "=0.44.0" diff --git a/dex/pair-mock/Cargo.toml b/dex/pair-mock/Cargo.toml index d7c805e2f..fce707f0e 100644 --- a/dex/pair-mock/Cargo.toml +++ b/dex/pair-mock/Cargo.toml @@ -11,11 +11,11 @@ path = "src/pair.rs" path = "../../common/common_errors" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.itertools] version = "0.10.1" default-features = false [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.3" +version = "=0.44.0" diff --git a/dex/pair-mock/meta/Cargo.toml b/dex/pair-mock/meta/Cargo.toml index f6dc3932d..66128bd6b 100644 --- a/dex/pair-mock/meta/Cargo.toml +++ b/dex/pair-mock/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.43.2" +version = "0.44.0" diff --git a/dex/pair-mock/wasm/Cargo.toml b/dex/pair-mock/wasm/Cargo.toml index d3c6f1947..af68e935b 100644 --- a/dex/pair-mock/wasm/Cargo.toml +++ b/dex/pair-mock/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.3" +version = "=0.44.0" diff --git a/dex/pair/Cargo.toml b/dex/pair/Cargo.toml index e3e80088c..201661ef3 100644 --- a/dex/pair/Cargo.toml +++ b/dex/pair/Cargo.toml @@ -33,11 +33,11 @@ version = "0.10.1" default-features = false [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.3" +version = "=0.44.0" diff --git a/dex/pair/meta/Cargo.toml b/dex/pair/meta/Cargo.toml index 26d231c9f..1510d7bce 100644 --- a/dex/pair/meta/Cargo.toml +++ b/dex/pair/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.43.2" +version = "0.44.0" diff --git a/dex/pair/wasm-pair-full/Cargo.toml b/dex/pair/wasm-pair-full/Cargo.toml index 5d2901b79..82cd43527 100644 --- a/dex/pair/wasm-pair-full/Cargo.toml +++ b/dex/pair/wasm-pair-full/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.3" +version = "=0.44.0" diff --git a/dex/pair/wasm-safe-price-view/Cargo.toml b/dex/pair/wasm-safe-price-view/Cargo.toml index 2c2f6556d..94a49cc47 100644 --- a/dex/pair/wasm-safe-price-view/Cargo.toml +++ b/dex/pair/wasm-safe-price-view/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.3" +version = "=0.44.0" diff --git a/dex/pair/wasm/Cargo.toml b/dex/pair/wasm/Cargo.toml index b94221364..897320ec0 100644 --- a/dex/pair/wasm/Cargo.toml +++ b/dex/pair/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.3" +version = "=0.44.0" diff --git a/dex/price-discovery/Cargo.toml b/dex/price-discovery/Cargo.toml index 043f18403..c611e792e 100644 --- a/dex/price-discovery/Cargo.toml +++ b/dex/price-discovery/Cargo.toml @@ -12,11 +12,11 @@ path = "src/lib.rs" hex-literal = "0.3.1" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.43.3" +version = "=0.44.0" [dependencies.locking_module] path = "../../common/modules/locking_module" @@ -30,4 +30,4 @@ hex = "0.4" path = "../../locked-asset/simple-lock" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.3" +version = "=0.44.0" diff --git a/dex/price-discovery/meta/Cargo.toml b/dex/price-discovery/meta/Cargo.toml index e611b98a7..02766c25e 100644 --- a/dex/price-discovery/meta/Cargo.toml +++ b/dex/price-discovery/meta/Cargo.toml @@ -8,4 +8,4 @@ authors = ["Dorin Iancu "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.43.2" +version = "0.44.0" diff --git a/dex/price-discovery/wasm/Cargo.toml b/dex/price-discovery/wasm/Cargo.toml index 70b97b365..ffa2b5a9d 100644 --- a/dex/price-discovery/wasm/Cargo.toml +++ b/dex/price-discovery/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.3" +version = "=0.44.0" diff --git a/dex/proxy-deployer/Cargo.toml b/dex/proxy-deployer/Cargo.toml index b9ed729a9..c78c8021a 100644 --- a/dex/proxy-deployer/Cargo.toml +++ b/dex/proxy-deployer/Cargo.toml @@ -20,11 +20,11 @@ path = "../../common/modules/farm/config" path = "../../common/modules/farm/farm_token" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.3" +version = "=0.44.0" diff --git a/dex/proxy-deployer/meta/Cargo.toml b/dex/proxy-deployer/meta/Cargo.toml index 728822284..c5ad5aae9 100644 --- a/dex/proxy-deployer/meta/Cargo.toml +++ b/dex/proxy-deployer/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.43.2" +version = "0.44.0" diff --git a/dex/proxy-deployer/wasm/Cargo.toml b/dex/proxy-deployer/wasm/Cargo.toml index 76774d56a..042bf990e 100644 --- a/dex/proxy-deployer/wasm/Cargo.toml +++ b/dex/proxy-deployer/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.3" +version = "=0.44.0" diff --git a/dex/router/Cargo.toml b/dex/router/Cargo.toml index bf147cedd..ec3bead6c 100644 --- a/dex/router/Cargo.toml +++ b/dex/router/Cargo.toml @@ -14,7 +14,7 @@ path = "../../common/modules/token_send" path = "../../common/modules/pausable" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.pair] @@ -26,4 +26,4 @@ path = "../../common/modules/locking_module" [dependencies.simple-lock] path = "../../locked-asset/simple-lock" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.3" +version = "=0.44.0" diff --git a/dex/router/meta/Cargo.toml b/dex/router/meta/Cargo.toml index 1952e09af..d0513a5b8 100644 --- a/dex/router/meta/Cargo.toml +++ b/dex/router/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.43.2" +version = "0.44.0" diff --git a/dex/router/wasm/Cargo.toml b/dex/router/wasm/Cargo.toml index 02a08c8a8..527d41c2a 100644 --- a/dex/router/wasm/Cargo.toml +++ b/dex/router/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.3" +version = "=0.44.0" diff --git a/energy-integration/common-modules/energy-query/Cargo.toml b/energy-integration/common-modules/energy-query/Cargo.toml index 1a87d9b18..5817c0e0d 100644 --- a/energy-integration/common-modules/energy-query/Cargo.toml +++ b/energy-integration/common-modules/energy-query/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.energy-factory] diff --git a/energy-integration/common-modules/week-timekeeping/Cargo.toml b/energy-integration/common-modules/week-timekeeping/Cargo.toml index 7ee59bf06..425e82770 100644 --- a/energy-integration/common-modules/week-timekeeping/Cargo.toml +++ b/energy-integration/common-modules/week-timekeeping/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.common-types] diff --git a/energy-integration/common-modules/weekly-rewards-splitting/Cargo.toml b/energy-integration/common-modules/weekly-rewards-splitting/Cargo.toml index f2bf32dfb..0d4392996 100644 --- a/energy-integration/common-modules/weekly-rewards-splitting/Cargo.toml +++ b/energy-integration/common-modules/weekly-rewards-splitting/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.energy-query] diff --git a/energy-integration/common-types/Cargo.toml b/energy-integration/common-types/Cargo.toml index abaa00aa4..a9330d1ab 100644 --- a/energy-integration/common-types/Cargo.toml +++ b/energy-integration/common-types/Cargo.toml @@ -7,5 +7,5 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/energy-integration/energy-factory-mock/Cargo.toml b/energy-integration/energy-factory-mock/Cargo.toml index 1333cfccf..1a56fbd10 100644 --- a/energy-integration/energy-factory-mock/Cargo.toml +++ b/energy-integration/energy-factory-mock/Cargo.toml @@ -11,7 +11,7 @@ path = "src/lib.rs" path = "../common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.3" +version = "=0.44.0" diff --git a/energy-integration/energy-factory-mock/meta/Cargo.toml b/energy-integration/energy-factory-mock/meta/Cargo.toml index 0a0449eda..206f5ad1f 100644 --- a/energy-integration/energy-factory-mock/meta/Cargo.toml +++ b/energy-integration/energy-factory-mock/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.43.2" +version = "0.44.0" diff --git a/energy-integration/energy-factory-mock/wasm/Cargo.toml b/energy-integration/energy-factory-mock/wasm/Cargo.toml index 14191c202..c477bfcea 100644 --- a/energy-integration/energy-factory-mock/wasm/Cargo.toml +++ b/energy-integration/energy-factory-mock/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.3" +version = "=0.44.0" diff --git a/energy-integration/energy-update/Cargo.toml b/energy-integration/energy-update/Cargo.toml index 994ea2f20..53d8179a0 100644 --- a/energy-integration/energy-update/Cargo.toml +++ b/energy-integration/energy-update/Cargo.toml @@ -8,11 +8,11 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.43.3" +version = "=0.44.0" [dependencies.farm] path = "../../dex/farm" @@ -24,4 +24,4 @@ path = "../common-modules/weekly-rewards-splitting" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.3" +version = "=0.44.0" diff --git a/energy-integration/energy-update/meta/Cargo.toml b/energy-integration/energy-update/meta/Cargo.toml index 9b28309d9..4775ffc90 100644 --- a/energy-integration/energy-update/meta/Cargo.toml +++ b/energy-integration/energy-update/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.43.2" +version = "0.44.0" diff --git a/energy-integration/energy-update/wasm/Cargo.toml b/energy-integration/energy-update/wasm/Cargo.toml index a9ee6ddde..710ad77d1 100644 --- a/energy-integration/energy-update/wasm/Cargo.toml +++ b/energy-integration/energy-update/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.3" +version = "=0.44.0" diff --git a/energy-integration/farm-boosted-yields/Cargo.toml b/energy-integration/farm-boosted-yields/Cargo.toml index c8ee30757..6e574c3e9 100644 --- a/energy-integration/farm-boosted-yields/Cargo.toml +++ b/energy-integration/farm-boosted-yields/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.config] diff --git a/energy-integration/fees-collector/Cargo.toml b/energy-integration/fees-collector/Cargo.toml index adde4d6a5..be3fd2f4f 100644 --- a/energy-integration/fees-collector/Cargo.toml +++ b/energy-integration/fees-collector/Cargo.toml @@ -8,11 +8,11 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.43.3" +version = "=0.44.0" [dependencies.energy-query] path = "../common-modules/energy-query" @@ -48,7 +48,7 @@ path = "../../common/common_errors" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.3" +version = "=0.44.0" [dev-dependencies.sc_whitelist_module] path = "../../common/modules/sc_whitelist_module" diff --git a/energy-integration/fees-collector/meta/Cargo.toml b/energy-integration/fees-collector/meta/Cargo.toml index 64c545255..ca6b8aa0e 100644 --- a/energy-integration/fees-collector/meta/Cargo.toml +++ b/energy-integration/fees-collector/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.43.2" +version = "0.44.0" diff --git a/energy-integration/fees-collector/wasm/Cargo.toml b/energy-integration/fees-collector/wasm/Cargo.toml index 5acfe555f..4fb89d1cf 100644 --- a/energy-integration/fees-collector/wasm/Cargo.toml +++ b/energy-integration/fees-collector/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.3" +version = "=0.44.0" diff --git a/energy-integration/governance-v2/Cargo.toml b/energy-integration/governance-v2/Cargo.toml index 063b9dab9..6c75811b9 100644 --- a/energy-integration/governance-v2/Cargo.toml +++ b/energy-integration/governance-v2/Cargo.toml @@ -11,7 +11,7 @@ path = "src/lib.rs" path = "../common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.permissions_module] @@ -27,7 +27,7 @@ path = "../common-modules/weekly-rewards-splitting" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.3" +version = "=0.44.0" [dev-dependencies.energy-factory-mock] path = "../energy-factory-mock" diff --git a/energy-integration/governance-v2/meta/Cargo.toml b/energy-integration/governance-v2/meta/Cargo.toml index f79ca0ab9..e7e4e174c 100644 --- a/energy-integration/governance-v2/meta/Cargo.toml +++ b/energy-integration/governance-v2/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.43.2" +version = "0.44.0" diff --git a/energy-integration/governance-v2/wasm/Cargo.toml b/energy-integration/governance-v2/wasm/Cargo.toml index 194776b0a..f14805733 100644 --- a/energy-integration/governance-v2/wasm/Cargo.toml +++ b/energy-integration/governance-v2/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.3" +version = "=0.44.0" diff --git a/farm-staking/farm-staking-proxy/Cargo.toml b/farm-staking/farm-staking-proxy/Cargo.toml index 64c132f8c..a6c3ce176 100644 --- a/farm-staking/farm-staking-proxy/Cargo.toml +++ b/farm-staking/farm-staking-proxy/Cargo.toml @@ -12,11 +12,11 @@ path = "src/lib.rs" hex-literal = "0.3.1" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.43.3" +version = "=0.44.0" [dependencies.farm] path = "../../dex/farm" @@ -67,7 +67,7 @@ path = "../../energy-integration/common-modules/energy-query" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.3" +version = "=0.44.0" [dev-dependencies.farm_token] path = "../../common/modules/farm/farm_token" diff --git a/farm-staking/farm-staking-proxy/meta/Cargo.toml b/farm-staking/farm-staking-proxy/meta/Cargo.toml index 7461b0f5b..bfa27096f 100644 --- a/farm-staking/farm-staking-proxy/meta/Cargo.toml +++ b/farm-staking/farm-staking-proxy/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.43.2" +version = "0.44.0" diff --git a/farm-staking/farm-staking-proxy/wasm/Cargo.toml b/farm-staking/farm-staking-proxy/wasm/Cargo.toml index cf5c28357..080d8441f 100644 --- a/farm-staking/farm-staking-proxy/wasm/Cargo.toml +++ b/farm-staking/farm-staking-proxy/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.3" +version = "=0.44.0" diff --git a/farm-staking/farm-staking/Cargo.toml b/farm-staking/farm-staking/Cargo.toml index a8dc189e4..40d1367fd 100644 --- a/farm-staking/farm-staking/Cargo.toml +++ b/farm-staking/farm-staking/Cargo.toml @@ -7,7 +7,6 @@ publish = false [lib] path = "src/lib.rs" - [dependencies.farm] path = "../../dex/farm" @@ -78,14 +77,14 @@ path = "../../common/common_structs" path = "../../common/common_errors" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.43.3" +version = "=0.44.0" [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.3" +version = "=0.44.0" diff --git a/farm-staking/farm-staking/meta/Cargo.toml b/farm-staking/farm-staking/meta/Cargo.toml index 0f03d3b72..d6cd46c5e 100644 --- a/farm-staking/farm-staking/meta/Cargo.toml +++ b/farm-staking/farm-staking/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.43.2" +version = "0.44.0" diff --git a/farm-staking/farm-staking/wasm/Cargo.toml b/farm-staking/farm-staking/wasm/Cargo.toml index 946b86b9b..2a49b495a 100644 --- a/farm-staking/farm-staking/wasm/Cargo.toml +++ b/farm-staking/farm-staking/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.3" +version = "=0.44.0" diff --git a/farm-staking/metabonding-staking/Cargo.toml b/farm-staking/metabonding-staking/Cargo.toml index 76fe4492e..789fa82e3 100644 --- a/farm-staking/metabonding-staking/Cargo.toml +++ b/farm-staking/metabonding-staking/Cargo.toml @@ -8,11 +8,11 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.43.3" +version = "=0.44.0" [dependencies.factory] path = "../../locked-asset/factory" @@ -21,7 +21,7 @@ path = "../../locked-asset/factory" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.3" +version = "=0.44.0" [dev-dependencies.common_structs] path = "../../common/common_structs" diff --git a/farm-staking/metabonding-staking/meta/Cargo.toml b/farm-staking/metabonding-staking/meta/Cargo.toml index f944c4fce..847b77d09 100644 --- a/farm-staking/metabonding-staking/meta/Cargo.toml +++ b/farm-staking/metabonding-staking/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.43.2" +version = "0.44.0" diff --git a/farm-staking/metabonding-staking/wasm/Cargo.toml b/farm-staking/metabonding-staking/wasm/Cargo.toml index 3765823a6..655c190d8 100644 --- a/farm-staking/metabonding-staking/wasm/Cargo.toml +++ b/farm-staking/metabonding-staking/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.3" +version = "=0.44.0" diff --git a/locked-asset/Cargo.toml b/locked-asset/Cargo.toml index c54180a85..d2e856bb7 100644 --- a/locked-asset/Cargo.toml +++ b/locked-asset/Cargo.toml @@ -4,7 +4,7 @@ version = "0.0.0" edition = "2021" publish = false [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.farm] @@ -49,7 +49,7 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-modules] -version = "=0.43.3" +version = "=0.44.0" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.3" +version = "=0.44.0" diff --git a/locked-asset/distribution/Cargo.toml b/locked-asset/distribution/Cargo.toml index 56cc20ec2..a15f30ce0 100644 --- a/locked-asset/distribution/Cargo.toml +++ b/locked-asset/distribution/Cargo.toml @@ -13,7 +13,7 @@ path = "../../common/common_structs" path = "../factory" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.3" +version = "=0.44.0" diff --git a/locked-asset/distribution/meta/Cargo.toml b/locked-asset/distribution/meta/Cargo.toml index eef847e32..30ef56d2d 100644 --- a/locked-asset/distribution/meta/Cargo.toml +++ b/locked-asset/distribution/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.43.2" +version = "0.44.0" diff --git a/locked-asset/distribution/wasm/Cargo.toml b/locked-asset/distribution/wasm/Cargo.toml index 9be455a14..71b117c75 100644 --- a/locked-asset/distribution/wasm/Cargo.toml +++ b/locked-asset/distribution/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.3" +version = "=0.44.0" diff --git a/locked-asset/energy-factory/Cargo.toml b/locked-asset/energy-factory/Cargo.toml index 0fa92855a..6ac8f5e33 100644 --- a/locked-asset/energy-factory/Cargo.toml +++ b/locked-asset/energy-factory/Cargo.toml @@ -32,11 +32,11 @@ path = "../../common/traits/unwrappable" path = "../../common/modules/legacy_token_decode_module" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.43.3" +version = "=0.44.0" [dev-dependencies] num-bigint = "0.4.2" @@ -44,4 +44,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.3" +version = "=0.44.0" diff --git a/locked-asset/energy-factory/meta/Cargo.toml b/locked-asset/energy-factory/meta/Cargo.toml index 0bab3bc4d..dd63568c2 100644 --- a/locked-asset/energy-factory/meta/Cargo.toml +++ b/locked-asset/energy-factory/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.43.2" +version = "0.44.0" diff --git a/locked-asset/energy-factory/wasm/Cargo.toml b/locked-asset/energy-factory/wasm/Cargo.toml index 1ffbf327b..fcb22bfb0 100644 --- a/locked-asset/energy-factory/wasm/Cargo.toml +++ b/locked-asset/energy-factory/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.3" +version = "=0.44.0" diff --git a/locked-asset/factory/Cargo.toml b/locked-asset/factory/Cargo.toml index b0771ada1..f513c5e57 100644 --- a/locked-asset/factory/Cargo.toml +++ b/locked-asset/factory/Cargo.toml @@ -26,11 +26,11 @@ path = "../../common/modules/token_merge_helper" path = "../energy-factory" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.43.3" +version = "=0.44.0" [dependencies.arrayvec] version = "0.7.1" @@ -49,4 +49,4 @@ hex = "0.4" path = "../simple-lock" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.3" +version = "=0.44.0" diff --git a/locked-asset/factory/meta/Cargo.toml b/locked-asset/factory/meta/Cargo.toml index 4dac5cc03..ae59970a1 100644 --- a/locked-asset/factory/meta/Cargo.toml +++ b/locked-asset/factory/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.43.2" +version = "0.44.0" diff --git a/locked-asset/factory/wasm/Cargo.toml b/locked-asset/factory/wasm/Cargo.toml index 591bb319a..3c22e1cb5 100644 --- a/locked-asset/factory/wasm/Cargo.toml +++ b/locked-asset/factory/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.3" +version = "=0.44.0" diff --git a/locked-asset/lkmex-transfer/Cargo.toml b/locked-asset/lkmex-transfer/Cargo.toml index b7b076233..abb39fa97 100644 --- a/locked-asset/lkmex-transfer/Cargo.toml +++ b/locked-asset/lkmex-transfer/Cargo.toml @@ -29,14 +29,14 @@ path = "../energy-factory" path = "../../energy-integration/common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.3" +version = "=0.44.0" [dev-dependencies.multiversx-sc-modules] -version = "=0.43.3" +version = "=0.44.0" diff --git a/locked-asset/lkmex-transfer/meta/Cargo.toml b/locked-asset/lkmex-transfer/meta/Cargo.toml index 08a7e03f5..52865b0ee 100644 --- a/locked-asset/lkmex-transfer/meta/Cargo.toml +++ b/locked-asset/lkmex-transfer/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.43.2" +version = "0.44.0" diff --git a/locked-asset/lkmex-transfer/wasm/Cargo.toml b/locked-asset/lkmex-transfer/wasm/Cargo.toml index 7ca9c97ef..824aef74a 100644 --- a/locked-asset/lkmex-transfer/wasm/Cargo.toml +++ b/locked-asset/lkmex-transfer/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.3" +version = "=0.44.0" diff --git a/locked-asset/locked-token-wrapper/Cargo.toml b/locked-asset/locked-token-wrapper/Cargo.toml index 576375026..6e6b793a5 100644 --- a/locked-asset/locked-token-wrapper/Cargo.toml +++ b/locked-asset/locked-token-wrapper/Cargo.toml @@ -8,10 +8,10 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" [dependencies.multiversx-sc-modules] -version = "=0.43.3" +version = "=0.44.0" [dependencies.utils] path = "../../common/modules/utils" @@ -43,4 +43,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.3" +version = "=0.44.0" diff --git a/locked-asset/locked-token-wrapper/meta/Cargo.toml b/locked-asset/locked-token-wrapper/meta/Cargo.toml index 1b5daca09..757968c19 100644 --- a/locked-asset/locked-token-wrapper/meta/Cargo.toml +++ b/locked-asset/locked-token-wrapper/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.43.2" +version = "0.44.0" diff --git a/locked-asset/locked-token-wrapper/wasm/Cargo.toml b/locked-asset/locked-token-wrapper/wasm/Cargo.toml index 31488c7c5..627c55b94 100644 --- a/locked-asset/locked-token-wrapper/wasm/Cargo.toml +++ b/locked-asset/locked-token-wrapper/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.3" +version = "=0.44.0" diff --git a/locked-asset/proxy_dex/Cargo.toml b/locked-asset/proxy_dex/Cargo.toml index bec88ca06..1ffbd2439 100644 --- a/locked-asset/proxy_dex/Cargo.toml +++ b/locked-asset/proxy_dex/Cargo.toml @@ -44,11 +44,11 @@ path = "../../common/traits/mergeable" path = "../../common/traits/fixed-supply-token" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.43.3" +version = "=0.44.0" [dependencies.energy-factory] path = "../energy-factory" @@ -68,7 +68,7 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.3" +version = "=0.44.0" [dev-dependencies.pausable] path = "../../common/modules/pausable" diff --git a/locked-asset/proxy_dex/meta/Cargo.toml b/locked-asset/proxy_dex/meta/Cargo.toml index 062ab5aaf..2d3ef8dea 100644 --- a/locked-asset/proxy_dex/meta/Cargo.toml +++ b/locked-asset/proxy_dex/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.43.2" +version = "0.44.0" diff --git a/locked-asset/proxy_dex/wasm/Cargo.toml b/locked-asset/proxy_dex/wasm/Cargo.toml index 3ca1df49d..8da106653 100644 --- a/locked-asset/proxy_dex/wasm/Cargo.toml +++ b/locked-asset/proxy_dex/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.3" +version = "=0.44.0" diff --git a/locked-asset/simple-lock-whitelist/Cargo.toml b/locked-asset/simple-lock-whitelist/Cargo.toml index 08671b883..66f7bcc4b 100644 --- a/locked-asset/simple-lock-whitelist/Cargo.toml +++ b/locked-asset/simple-lock-whitelist/Cargo.toml @@ -14,11 +14,11 @@ path = "../simple-lock" path = "../../common/modules/utils" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.43.3" +version = "=0.44.0" [dev-dependencies] num-bigint = "0.4.2" @@ -26,4 +26,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.3" +version = "=0.44.0" diff --git a/locked-asset/simple-lock-whitelist/meta/Cargo.toml b/locked-asset/simple-lock-whitelist/meta/Cargo.toml index 9707df924..45465ec56 100644 --- a/locked-asset/simple-lock-whitelist/meta/Cargo.toml +++ b/locked-asset/simple-lock-whitelist/meta/Cargo.toml @@ -8,4 +8,4 @@ authors = ["Dorin Iancu "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.43.2" +version = "0.44.0" diff --git a/locked-asset/simple-lock-whitelist/wasm/Cargo.toml b/locked-asset/simple-lock-whitelist/wasm/Cargo.toml index d89132156..acc47027b 100644 --- a/locked-asset/simple-lock-whitelist/wasm/Cargo.toml +++ b/locked-asset/simple-lock-whitelist/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.3" +version = "=0.44.0" diff --git a/locked-asset/simple-lock/Cargo.toml b/locked-asset/simple-lock/Cargo.toml index 771d60639..0e95b6dfc 100644 --- a/locked-asset/simple-lock/Cargo.toml +++ b/locked-asset/simple-lock/Cargo.toml @@ -8,11 +8,11 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.43.3" +version = "=0.44.0" [dependencies.common_structs] path = "../../common/common_structs" @@ -23,4 +23,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.3" +version = "=0.44.0" diff --git a/locked-asset/simple-lock/meta/Cargo.toml b/locked-asset/simple-lock/meta/Cargo.toml index b51468b2b..fe846129c 100644 --- a/locked-asset/simple-lock/meta/Cargo.toml +++ b/locked-asset/simple-lock/meta/Cargo.toml @@ -8,4 +8,4 @@ authors = ["Dorin Iancu "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.43.2" +version = "0.44.0" diff --git a/locked-asset/simple-lock/wasm/Cargo.toml b/locked-asset/simple-lock/wasm/Cargo.toml index 12f9cf76d..49ab66c07 100644 --- a/locked-asset/simple-lock/wasm/Cargo.toml +++ b/locked-asset/simple-lock/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.3" +version = "=0.44.0" diff --git a/locked-asset/token-unstake/Cargo.toml b/locked-asset/token-unstake/Cargo.toml index 95966aea4..4741e1602 100644 --- a/locked-asset/token-unstake/Cargo.toml +++ b/locked-asset/token-unstake/Cargo.toml @@ -8,7 +8,7 @@ publish = false [lib] path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.mergeable] @@ -38,7 +38,7 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.3" +version = "=0.44.0" [dev-dependencies.multiversx-sc-modules] -version = "=0.43.3" +version = "=0.44.0" diff --git a/locked-asset/token-unstake/meta/Cargo.toml b/locked-asset/token-unstake/meta/Cargo.toml index be6b1b488..bcb227c50 100644 --- a/locked-asset/token-unstake/meta/Cargo.toml +++ b/locked-asset/token-unstake/meta/Cargo.toml @@ -8,4 +8,4 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.43.2" +version = "0.44.0" diff --git a/locked-asset/token-unstake/wasm/Cargo.toml b/locked-asset/token-unstake/wasm/Cargo.toml index 494c44b70..8411d3ccb 100644 --- a/locked-asset/token-unstake/wasm/Cargo.toml +++ b/locked-asset/token-unstake/wasm/Cargo.toml @@ -23,4 +23,4 @@ default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.3" +version = "=0.44.0" diff --git a/pause-all/Cargo.toml b/pause-all/Cargo.toml index 538678894..193baee17 100644 --- a/pause-all/Cargo.toml +++ b/pause-all/Cargo.toml @@ -11,13 +11,13 @@ path = "src/lib.rs" path = "../common/modules/pausable" [dependencies.multiversx-sc] -version = "=0.43.3" +version = "=0.44.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.43.3" +version = "=0.44.0" [dev-dependencies.multiversx-sc-scenario] -version = "=0.43.3" +version = "=0.44.0" [dev-dependencies.farm] path = "../dex/farm" diff --git a/pause-all/meta/Cargo.toml b/pause-all/meta/Cargo.toml index a9e79beef..b03137124 100644 --- a/pause-all/meta/Cargo.toml +++ b/pause-all/meta/Cargo.toml @@ -10,4 +10,4 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.43.2" +version = "0.44.0" diff --git a/pause-all/wasm/Cargo.toml b/pause-all/wasm/Cargo.toml index 0b22beec3..a82c6c8d1 100644 --- a/pause-all/wasm/Cargo.toml +++ b/pause-all/wasm/Cargo.toml @@ -22,4 +22,4 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.43.3" +version = "=0.44.0" From f09a116e7c73dc46835d7501cbfd3d291abc6c5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Fri, 10 Nov 2023 14:24:33 +0200 Subject: [PATCH 129/213] Fix compilation issues --- dex/farm-with-locked-rewards/wasm/Cargo.lock | 16 ++-- dex/farm/wasm/Cargo.lock | 16 ++-- dex/farm/wasm/src/lib.rs | 5 +- dex/governance/wasm/Cargo.lock | 12 +-- dex/governance/wasm/src/lib.rs | 5 +- dex/pair-mock/src/pair.rs | 1 + dex/pair-mock/wasm/Cargo.lock | 12 +-- .../{multicontract.toml => sc-config.toml} | 1 + dex/pair/wasm-pair-full/Cargo.lock | 84 ++++++++++++------ dex/pair/wasm-pair-full/src/lib.rs | 5 +- dex/pair/wasm-safe-price-view/Cargo.lock | 84 ++++++++++++------ dex/pair/wasm/Cargo.lock | 88 +++++++++++++------ dex/pair/wasm/src/lib.rs | 5 +- dex/price-discovery/wasm/Cargo.lock | 16 ++-- dex/price-discovery/wasm/src/lib.rs | 5 +- dex/proxy-deployer/wasm/Cargo.lock | 16 ++-- dex/proxy-deployer/wasm/src/lib.rs | 5 +- dex/router/src/contract.rs | 1 + dex/router/wasm/Cargo.lock | 16 ++-- dex/router/wasm/src/lib.rs | 5 +- .../energy-factory-mock/wasm/Cargo.lock | 16 ++-- .../energy-update/wasm/Cargo.lock | 16 ++-- .../energy-update/wasm/src/lib.rs | 5 +- .../fees-collector/wasm/Cargo.lock | 16 ++-- .../fees-collector/wasm/src/lib.rs | 5 +- .../governance-v2/wasm/Cargo.lock | 16 ++-- .../governance-v2/wasm/src/lib.rs | 5 +- .../farm-staking-proxy/wasm/Cargo.lock | 16 ++-- .../farm-staking-proxy/wasm/src/lib.rs | 4 +- farm-staking/farm-staking/wasm/Cargo.lock | 16 ++-- .../metabonding-staking/wasm/Cargo.lock | 16 ++-- .../metabonding-staking/wasm/src/lib.rs | 5 +- locked-asset/distribution/wasm/Cargo.lock | 16 ++-- locked-asset/distribution/wasm/src/lib.rs | 5 +- locked-asset/energy-factory/wasm/Cargo.lock | 16 ++-- locked-asset/factory/wasm/Cargo.lock | 16 ++-- locked-asset/factory/wasm/src/lib.rs | 5 +- locked-asset/lkmex-transfer/wasm/Cargo.lock | 16 ++-- locked-asset/lkmex-transfer/wasm/src/lib.rs | 5 +- .../locked-token-wrapper/wasm/Cargo.lock | 16 ++-- .../locked-token-wrapper/wasm/src/lib.rs | 5 +- locked-asset/proxy_dex/wasm/Cargo.lock | 16 ++-- .../simple-lock-whitelist/wasm/Cargo.lock | 16 ++-- .../simple-lock-whitelist/wasm/src/lib.rs | 5 +- locked-asset/simple-lock/wasm/Cargo.lock | 16 ++-- locked-asset/simple-lock/wasm/src/lib.rs | 5 +- locked-asset/token-unstake/wasm/Cargo.lock | 16 ++-- locked-asset/token-unstake/wasm/src/lib.rs | 5 +- pause-all/wasm/Cargo.lock | 16 ++-- pause-all/wasm/src/lib.rs | 5 +- 50 files changed, 426 insertions(+), 308 deletions(-) rename dex/pair/{multicontract.toml => sc-config.toml} (92%) diff --git a/dex/farm-with-locked-rewards/wasm/Cargo.lock b/dex/farm-with-locked-rewards/wasm/Cargo.lock index 102fabc1d..7ba8571cc 100644 --- a/dex/farm-with-locked-rewards/wasm/Cargo.lock +++ b/dex/farm-with-locked-rewards/wasm/Cargo.lock @@ -341,9 +341,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" +checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" dependencies = [ "bitflags", "hashbrown", @@ -377,9 +377,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" +checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" dependencies = [ "hex", "proc-macro2", @@ -390,18 +390,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" +checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" +checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" dependencies = [ "multiversx-sc", ] diff --git a/dex/farm/wasm/Cargo.lock b/dex/farm/wasm/Cargo.lock index 7e9a4a925..0152a5383 100644 --- a/dex/farm/wasm/Cargo.lock +++ b/dex/farm/wasm/Cargo.lock @@ -311,9 +311,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" +checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" dependencies = [ "bitflags", "hashbrown", @@ -347,9 +347,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" +checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" dependencies = [ "hex", "proc-macro2", @@ -360,18 +360,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" +checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" +checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" dependencies = [ "multiversx-sc", ] diff --git a/dex/farm/wasm/src/lib.rs b/dex/farm/wasm/src/lib.rs index 78415bd2c..7a14847a9 100644 --- a/dex/farm/wasm/src/lib.rs +++ b/dex/farm/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 63 +// Endpoints: 64 // Async Callback: 1 -// Total number of exported functions: 65 +// Total number of exported functions: 66 #![no_std] @@ -22,6 +22,7 @@ multiversx_sc_wasm_adapter::endpoints! { farm ( init => init + upgrade => upgrade enterFarm => enter_farm_endpoint claimRewards => claim_rewards_endpoint compoundRewards => compound_rewards_endpoint diff --git a/dex/governance/wasm/Cargo.lock b/dex/governance/wasm/Cargo.lock index 93781b4e0..bc69789e8 100644 --- a/dex/governance/wasm/Cargo.lock +++ b/dex/governance/wasm/Cargo.lock @@ -81,9 +81,9 @@ checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" [[package]] name = "multiversx-sc" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" +checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" dependencies = [ "bitflags", "hashbrown", @@ -117,9 +117,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" +checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" dependencies = [ "hex", "proc-macro2", @@ -130,9 +130,9 @@ dependencies = [ [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" +checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" dependencies = [ "multiversx-sc", ] diff --git a/dex/governance/wasm/src/lib.rs b/dex/governance/wasm/src/lib.rs index 3e106b05e..c4a7c87ff 100644 --- a/dex/governance/wasm/src/lib.rs +++ b/dex/governance/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 21 +// Endpoints: 22 // Async Callback (empty): 1 -// Total number of exported functions: 23 +// Total number of exported functions: 24 #![no_std] @@ -22,6 +22,7 @@ multiversx_sc_wasm_adapter::endpoints! { governance ( init => init + upgrade => upgrade propose => propose upvote => upvote downvote => downvote diff --git a/dex/pair-mock/src/pair.rs b/dex/pair-mock/src/pair.rs index 751ea8d2c..1f073c215 100644 --- a/dex/pair-mock/src/pair.rs +++ b/dex/pair-mock/src/pair.rs @@ -16,6 +16,7 @@ pub const DEFAULT_SKIP_MINTING_LP_TOKENS: bool = true; #[multiversx_sc::derive::contract] pub trait PairMock { + #[allow_multiple_var_args] #[init] fn init( &self, diff --git a/dex/pair-mock/wasm/Cargo.lock b/dex/pair-mock/wasm/Cargo.lock index e813b5155..40e00a6f8 100644 --- a/dex/pair-mock/wasm/Cargo.lock +++ b/dex/pair-mock/wasm/Cargo.lock @@ -88,9 +88,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" +checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" dependencies = [ "bitflags", "hashbrown", @@ -124,9 +124,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" +checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" dependencies = [ "hex", "proc-macro2", @@ -137,9 +137,9 @@ dependencies = [ [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" +checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" dependencies = [ "multiversx-sc", ] diff --git a/dex/pair/multicontract.toml b/dex/pair/sc-config.toml similarity index 92% rename from dex/pair/multicontract.toml rename to dex/pair/sc-config.toml index ed3a54026..738e43967 100644 --- a/dex/pair/multicontract.toml +++ b/dex/pair/sc-config.toml @@ -8,6 +8,7 @@ add-unlabelled = true [contracts.safe-price-view] name = "safe-price-view" external-view = true +add-unlabelled = false add-labels = ["safe-price-view"] [contracts.full] diff --git a/dex/pair/wasm-pair-full/Cargo.lock b/dex/pair/wasm-pair-full/Cargo.lock index 9006a8f9d..ce6792399 100644 --- a/dex/pair/wasm-pair-full/Cargo.lock +++ b/dex/pair/wasm-pair-full/Cargo.lock @@ -4,20 +4,21 @@ version = 3 [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if", "once_cell", "version_check", + "zerocopy", ] [[package]] name = "arrayvec" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "autocfg" @@ -64,9 +65,9 @@ dependencies = [ [[package]] name = "either" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "endian-type" @@ -187,9 +188,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" +checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" dependencies = [ "bitflags", "hashbrown", @@ -218,36 +219,36 @@ dependencies = [ "hex", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "multiversx-sc-derive" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" +checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" dependencies = [ "hex", "proc-macro2", "quote", "radix_trie", - "syn", + "syn 1.0.109", ] [[package]] name = "multiversx-sc-modules" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" +checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" +checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" dependencies = [ "multiversx-sc", ] @@ -263,18 +264,18 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", ] [[package]] name = "once_cell" -version = "1.17.1" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "pair" @@ -318,9 +319,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.67" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] @@ -363,9 +364,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.10.0" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" [[package]] name = "syn" @@ -378,6 +379,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "token_send" version = "0.0.0" @@ -389,9 +401,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.8" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unwrappable" @@ -435,3 +447,23 @@ dependencies = [ "unwrappable", "week-timekeeping", ] + +[[package]] +name = "zerocopy" +version = "0.7.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cd369a67c0edfef15010f980c3cbe45d7f651deac2cd67ce097cd801de16557" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2f140bda219a26ccc0cdb03dba58af72590c53b22642577d88a927bc5c87d6b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] diff --git a/dex/pair/wasm-pair-full/src/lib.rs b/dex/pair/wasm-pair-full/src/lib.rs index 9c6650e16..020b428db 100644 --- a/dex/pair/wasm-pair-full/src/lib.rs +++ b/dex/pair/wasm-pair-full/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 63 +// Endpoints: 64 // Async Callback (empty): 1 -// Total number of exported functions: 65 +// Total number of exported functions: 66 #![no_std] @@ -22,6 +22,7 @@ multiversx_sc_wasm_adapter::endpoints! { pair ( init => init + upgrade => upgrade addInitialLiquidity => add_initial_liquidity addLiquidity => add_liquidity removeLiquidity => remove_liquidity diff --git a/dex/pair/wasm-safe-price-view/Cargo.lock b/dex/pair/wasm-safe-price-view/Cargo.lock index b2afa0021..7bb41b36c 100644 --- a/dex/pair/wasm-safe-price-view/Cargo.lock +++ b/dex/pair/wasm-safe-price-view/Cargo.lock @@ -4,20 +4,21 @@ version = 3 [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if", "once_cell", "version_check", + "zerocopy", ] [[package]] name = "arrayvec" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "autocfg" @@ -64,9 +65,9 @@ dependencies = [ [[package]] name = "either" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "endian-type" @@ -187,9 +188,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" +checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" dependencies = [ "bitflags", "hashbrown", @@ -218,36 +219,36 @@ dependencies = [ "hex", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "multiversx-sc-derive" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" +checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" dependencies = [ "hex", "proc-macro2", "quote", "radix_trie", - "syn", + "syn 1.0.109", ] [[package]] name = "multiversx-sc-modules" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" +checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" +checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" dependencies = [ "multiversx-sc", ] @@ -263,18 +264,18 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", ] [[package]] name = "once_cell" -version = "1.17.1" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "pair" @@ -310,9 +311,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] @@ -363,9 +364,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.10.0" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" [[package]] name = "syn" @@ -378,6 +379,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "token_send" version = "0.0.0" @@ -389,9 +401,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.8" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unwrappable" @@ -435,3 +447,23 @@ dependencies = [ "unwrappable", "week-timekeeping", ] + +[[package]] +name = "zerocopy" +version = "0.7.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cd369a67c0edfef15010f980c3cbe45d7f651deac2cd67ce097cd801de16557" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2f140bda219a26ccc0cdb03dba58af72590c53b22642577d88a927bc5c87d6b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] diff --git a/dex/pair/wasm/Cargo.lock b/dex/pair/wasm/Cargo.lock index a6616f012..97a69bdd0 100644 --- a/dex/pair/wasm/Cargo.lock +++ b/dex/pair/wasm/Cargo.lock @@ -4,20 +4,21 @@ version = 3 [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if", "once_cell", "version_check", + "zerocopy", ] [[package]] name = "arrayvec" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "autocfg" @@ -64,9 +65,9 @@ dependencies = [ [[package]] name = "either" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "endian-type" @@ -187,9 +188,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" +checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" dependencies = [ "bitflags", "hashbrown", @@ -218,36 +219,36 @@ dependencies = [ "hex", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "multiversx-sc-derive" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" +checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" dependencies = [ "hex", "proc-macro2", "quote", "radix_trie", - "syn", + "syn 1.0.109", ] [[package]] name = "multiversx-sc-modules" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" +checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" +checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" dependencies = [ "multiversx-sc", ] @@ -263,18 +264,18 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", ] [[package]] name = "once_cell" -version = "1.17.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "pair" @@ -318,9 +319,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.67" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] @@ -363,15 +364,26 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.10.0" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" [[package]] name = "syn" -version = "1.0.107" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" dependencies = [ "proc-macro2", "quote", @@ -389,9 +401,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.6" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unwrappable" @@ -435,3 +447,23 @@ dependencies = [ "unwrappable", "week-timekeeping", ] + +[[package]] +name = "zerocopy" +version = "0.7.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cd369a67c0edfef15010f980c3cbe45d7f651deac2cd67ce097cd801de16557" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2f140bda219a26ccc0cdb03dba58af72590c53b22642577d88a927bc5c87d6b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] diff --git a/dex/pair/wasm/src/lib.rs b/dex/pair/wasm/src/lib.rs index 9f65c8a35..e29fca244 100644 --- a/dex/pair/wasm/src/lib.rs +++ b/dex/pair/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 54 +// Endpoints: 55 // Async Callback (empty): 1 -// Total number of exported functions: 56 +// Total number of exported functions: 57 #![no_std] @@ -22,6 +22,7 @@ multiversx_sc_wasm_adapter::endpoints! { pair ( init => init + upgrade => upgrade addInitialLiquidity => add_initial_liquidity addLiquidity => add_liquidity removeLiquidity => remove_liquidity diff --git a/dex/price-discovery/wasm/Cargo.lock b/dex/price-discovery/wasm/Cargo.lock index 71637c4d0..6dd07147f 100644 --- a/dex/price-discovery/wasm/Cargo.lock +++ b/dex/price-discovery/wasm/Cargo.lock @@ -139,9 +139,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" +checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" dependencies = [ "bitflags", "hashbrown", @@ -175,9 +175,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" +checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" dependencies = [ "hex", "proc-macro2", @@ -188,18 +188,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" +checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" +checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" dependencies = [ "multiversx-sc", ] diff --git a/dex/price-discovery/wasm/src/lib.rs b/dex/price-discovery/wasm/src/lib.rs index 0a3ed110d..5256b0b94 100644 --- a/dex/price-discovery/wasm/src/lib.rs +++ b/dex/price-discovery/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 27 +// Endpoints: 28 // Async Callback: 1 -// Total number of exported functions: 29 +// Total number of exported functions: 30 #![no_std] @@ -22,6 +22,7 @@ multiversx_sc_wasm_adapter::endpoints! { price_discovery ( init => init + upgrade => upgrade deposit => deposit withdraw => withdraw redeem => redeem diff --git a/dex/proxy-deployer/wasm/Cargo.lock b/dex/proxy-deployer/wasm/Cargo.lock index 26a4d02fc..9670bff71 100644 --- a/dex/proxy-deployer/wasm/Cargo.lock +++ b/dex/proxy-deployer/wasm/Cargo.lock @@ -303,9 +303,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" +checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" dependencies = [ "bitflags", "hashbrown", @@ -339,9 +339,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" +checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" dependencies = [ "hex", "proc-macro2", @@ -352,18 +352,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" +checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" +checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" dependencies = [ "multiversx-sc", ] diff --git a/dex/proxy-deployer/wasm/src/lib.rs b/dex/proxy-deployer/wasm/src/lib.rs index b8d5311f2..b5cfc7d6e 100644 --- a/dex/proxy-deployer/wasm/src/lib.rs +++ b/dex/proxy-deployer/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 4 +// Endpoints: 5 // Async Callback (empty): 1 -// Total number of exported functions: 6 +// Total number of exported functions: 7 #![no_std] @@ -22,6 +22,7 @@ multiversx_sc_wasm_adapter::endpoints! { proxy_deployer ( init => init + upgrade => upgrade deployFarm => deploy_farm callFarmEndpoint => call_farm_endpoint getAllDeployedFarms => get_all_deployed_farms diff --git a/dex/router/src/contract.rs b/dex/router/src/contract.rs index e5db4235f..8247dada9 100644 --- a/dex/router/src/contract.rs +++ b/dex/router/src/contract.rs @@ -70,6 +70,7 @@ pub trait Router: } } + #[allow_multiple_var_args] #[endpoint(createPair)] fn create_pair_endpoint( &self, diff --git a/dex/router/wasm/Cargo.lock b/dex/router/wasm/Cargo.lock index 22954b04d..2a3e24482 100644 --- a/dex/router/wasm/Cargo.lock +++ b/dex/router/wasm/Cargo.lock @@ -187,9 +187,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" +checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" dependencies = [ "bitflags", "hashbrown", @@ -223,9 +223,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" +checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" dependencies = [ "hex", "proc-macro2", @@ -236,18 +236,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" +checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" +checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" dependencies = [ "multiversx-sc", ] diff --git a/dex/router/wasm/src/lib.rs b/dex/router/wasm/src/lib.rs index a33c1a146..6f9525b47 100644 --- a/dex/router/wasm/src/lib.rs +++ b/dex/router/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 31 +// Endpoints: 32 // Async Callback: 1 -// Total number of exported functions: 33 +// Total number of exported functions: 34 #![no_std] @@ -22,6 +22,7 @@ multiversx_sc_wasm_adapter::endpoints! { router ( init => init + upgrade => upgrade pause => pause resume => resume createPair => create_pair_endpoint diff --git a/energy-integration/energy-factory-mock/wasm/Cargo.lock b/energy-integration/energy-factory-mock/wasm/Cargo.lock index f3ebd3fc5..e8018c634 100644 --- a/energy-integration/energy-factory-mock/wasm/Cargo.lock +++ b/energy-integration/energy-factory-mock/wasm/Cargo.lock @@ -154,9 +154,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" +checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" dependencies = [ "bitflags", "hashbrown", @@ -190,9 +190,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" +checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" dependencies = [ "hex", "proc-macro2", @@ -203,18 +203,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" +checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" +checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" dependencies = [ "multiversx-sc", ] diff --git a/energy-integration/energy-update/wasm/Cargo.lock b/energy-integration/energy-update/wasm/Cargo.lock index 6b131311e..cbc57af66 100644 --- a/energy-integration/energy-update/wasm/Cargo.lock +++ b/energy-integration/energy-update/wasm/Cargo.lock @@ -321,9 +321,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" +checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" dependencies = [ "bitflags", "hashbrown", @@ -357,9 +357,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" +checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" dependencies = [ "hex", "proc-macro2", @@ -370,18 +370,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" +checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" +checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" dependencies = [ "multiversx-sc", ] diff --git a/energy-integration/energy-update/wasm/src/lib.rs b/energy-integration/energy-update/wasm/src/lib.rs index 18eb3df45..52bd9be34 100644 --- a/energy-integration/energy-update/wasm/src/lib.rs +++ b/energy-integration/energy-update/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 1 +// Endpoints: 2 // Async Callback (empty): 1 -// Total number of exported functions: 3 +// Total number of exported functions: 4 #![no_std] @@ -22,6 +22,7 @@ multiversx_sc_wasm_adapter::endpoints! { energy_update ( init => init + upgrade => upgrade updateFarmsEnergyForUser => update_farms_energy_for_user ) } diff --git a/energy-integration/fees-collector/wasm/Cargo.lock b/energy-integration/fees-collector/wasm/Cargo.lock index 0c9a34eaf..635ae3787 100644 --- a/energy-integration/fees-collector/wasm/Cargo.lock +++ b/energy-integration/fees-collector/wasm/Cargo.lock @@ -180,9 +180,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" +checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" dependencies = [ "bitflags", "hashbrown", @@ -216,9 +216,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" +checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" dependencies = [ "hex", "proc-macro2", @@ -229,18 +229,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" +checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" +checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" dependencies = [ "multiversx-sc", ] diff --git a/energy-integration/fees-collector/wasm/src/lib.rs b/energy-integration/fees-collector/wasm/src/lib.rs index a3065aeaf..aa65ffda9 100644 --- a/energy-integration/fees-collector/wasm/src/lib.rs +++ b/energy-integration/fees-collector/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 37 +// Endpoints: 38 // Async Callback (empty): 1 -// Total number of exported functions: 39 +// Total number of exported functions: 40 #![no_std] @@ -22,6 +22,7 @@ multiversx_sc_wasm_adapter::endpoints! { fees_collector ( init => init + upgrade => upgrade claimRewards => claim_rewards addKnownContracts => add_known_contracts removeKnownContracts => remove_known_contracts diff --git a/energy-integration/governance-v2/wasm/Cargo.lock b/energy-integration/governance-v2/wasm/Cargo.lock index f214936de..eb412b8c1 100644 --- a/energy-integration/governance-v2/wasm/Cargo.lock +++ b/energy-integration/governance-v2/wasm/Cargo.lock @@ -191,9 +191,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" +checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" dependencies = [ "bitflags", "hashbrown", @@ -227,9 +227,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" +checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" dependencies = [ "hex", "proc-macro2", @@ -240,18 +240,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" +checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" +checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" dependencies = [ "multiversx-sc", ] diff --git a/energy-integration/governance-v2/wasm/src/lib.rs b/energy-integration/governance-v2/wasm/src/lib.rs index 7b63bb856..efb0a10e5 100644 --- a/energy-integration/governance-v2/wasm/src/lib.rs +++ b/energy-integration/governance-v2/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 28 +// Endpoints: 29 // Async Callback (empty): 1 -// Total number of exported functions: 30 +// Total number of exported functions: 31 #![no_std] @@ -22,6 +22,7 @@ multiversx_sc_wasm_adapter::endpoints! { governance_v2 ( init => init + upgrade => upgrade propose => propose vote => vote cancel => cancel diff --git a/farm-staking/farm-staking-proxy/wasm/Cargo.lock b/farm-staking/farm-staking-proxy/wasm/Cargo.lock index 381d25474..e66ae0b2c 100644 --- a/farm-staking/farm-staking-proxy/wasm/Cargo.lock +++ b/farm-staking/farm-staking-proxy/wasm/Cargo.lock @@ -396,9 +396,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" +checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" dependencies = [ "bitflags", "hashbrown", @@ -432,9 +432,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" +checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" dependencies = [ "hex", "proc-macro2", @@ -445,18 +445,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" +checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" +checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" dependencies = [ "multiversx-sc", ] diff --git a/farm-staking/farm-staking-proxy/wasm/src/lib.rs b/farm-staking/farm-staking-proxy/wasm/src/lib.rs index c233a2125..a9bf9ad9f 100644 --- a/farm-staking/farm-staking-proxy/wasm/src/lib.rs +++ b/farm-staking/farm-staking-proxy/wasm/src/lib.rs @@ -32,11 +32,11 @@ multiversx_sc_wasm_adapter::endpoints! { getFarmTokenId => staking_farm_token_id getLpTokenId => lp_token_id getLpFarmTokenId => lp_farm_token_id + setEnergyFactoryAddress => set_energy_factory_address + getEnergyFactoryAddress => energy_factory_address addSCAddressToWhitelist => add_sc_address_to_whitelist removeSCAddressFromWhitelist => remove_sc_address_from_whitelist isSCAddressWhitelisted => is_sc_address_whitelisted - setEnergyFactoryAddress => set_energy_factory_address - getEnergyFactoryAddress => energy_factory_address stakeFarmTokens => stake_farm_tokens claimDualYield => claim_dual_yield_endpoint unstakeFarmTokens => unstake_farm_tokens diff --git a/farm-staking/farm-staking/wasm/Cargo.lock b/farm-staking/farm-staking/wasm/Cargo.lock index 6f95fbf0e..61af83ab8 100644 --- a/farm-staking/farm-staking/wasm/Cargo.lock +++ b/farm-staking/farm-staking/wasm/Cargo.lock @@ -342,9 +342,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" +checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" dependencies = [ "bitflags", "hashbrown", @@ -378,9 +378,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" +checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" dependencies = [ "hex", "proc-macro2", @@ -391,18 +391,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" +checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" +checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" dependencies = [ "multiversx-sc", ] diff --git a/farm-staking/metabonding-staking/wasm/Cargo.lock b/farm-staking/metabonding-staking/wasm/Cargo.lock index 82f364c2e..9a9f60ae5 100644 --- a/farm-staking/metabonding-staking/wasm/Cargo.lock +++ b/farm-staking/metabonding-staking/wasm/Cargo.lock @@ -196,9 +196,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" +checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" dependencies = [ "bitflags", "hashbrown", @@ -232,9 +232,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" +checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" dependencies = [ "hex", "proc-macro2", @@ -245,18 +245,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" +checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" +checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" dependencies = [ "multiversx-sc", ] diff --git a/farm-staking/metabonding-staking/wasm/src/lib.rs b/farm-staking/metabonding-staking/wasm/src/lib.rs index ce110b30f..929c74ffe 100644 --- a/farm-staking/metabonding-staking/wasm/src/lib.rs +++ b/farm-staking/metabonding-staking/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 10 +// Endpoints: 11 // Async Callback (empty): 1 -// Total number of exported functions: 12 +// Total number of exported functions: 13 #![no_std] @@ -22,6 +22,7 @@ multiversx_sc_wasm_adapter::endpoints! { metabonding_staking ( init => init + upgrade => upgrade stakeLockedAsset => stake_locked_asset unstake => unstake unbond => unbond diff --git a/locked-asset/distribution/wasm/Cargo.lock b/locked-asset/distribution/wasm/Cargo.lock index 87717fb9d..6c10d39f1 100644 --- a/locked-asset/distribution/wasm/Cargo.lock +++ b/locked-asset/distribution/wasm/Cargo.lock @@ -196,9 +196,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" +checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" dependencies = [ "bitflags", "hashbrown", @@ -232,9 +232,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" +checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" dependencies = [ "hex", "proc-macro2", @@ -245,18 +245,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" +checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" +checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" dependencies = [ "multiversx-sc", ] diff --git a/locked-asset/distribution/wasm/src/lib.rs b/locked-asset/distribution/wasm/src/lib.rs index 7713b182b..bcc38e141 100644 --- a/locked-asset/distribution/wasm/src/lib.rs +++ b/locked-asset/distribution/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 15 +// Endpoints: 16 // Async Callback (empty): 1 -// Total number of exported functions: 17 +// Total number of exported functions: 18 #![no_std] @@ -22,6 +22,7 @@ multiversx_sc_wasm_adapter::endpoints! { distribution ( init => init + upgrade => upgrade setCommunityDistribution => set_community_distribution setPerUserDistributedLockedAssets => set_per_user_distributed_locked_assets claimLockedAssets => claim_locked_assets diff --git a/locked-asset/energy-factory/wasm/Cargo.lock b/locked-asset/energy-factory/wasm/Cargo.lock index b51127ae1..13e9713f7 100644 --- a/locked-asset/energy-factory/wasm/Cargo.lock +++ b/locked-asset/energy-factory/wasm/Cargo.lock @@ -138,9 +138,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" +checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" dependencies = [ "bitflags", "hashbrown", @@ -174,9 +174,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" +checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" dependencies = [ "hex", "proc-macro2", @@ -187,18 +187,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" +checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" +checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" dependencies = [ "multiversx-sc", ] diff --git a/locked-asset/factory/wasm/Cargo.lock b/locked-asset/factory/wasm/Cargo.lock index 5b759e551..850e59d80 100644 --- a/locked-asset/factory/wasm/Cargo.lock +++ b/locked-asset/factory/wasm/Cargo.lock @@ -187,9 +187,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" +checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" dependencies = [ "bitflags", "hashbrown", @@ -223,9 +223,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" +checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" dependencies = [ "hex", "proc-macro2", @@ -236,18 +236,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" +checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" +checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" dependencies = [ "multiversx-sc", ] diff --git a/locked-asset/factory/wasm/src/lib.rs b/locked-asset/factory/wasm/src/lib.rs index 3593ccb49..cfff38be7 100644 --- a/locked-asset/factory/wasm/src/lib.rs +++ b/locked-asset/factory/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 24 +// Endpoints: 25 // Async Callback: 1 -// Total number of exported functions: 26 +// Total number of exported functions: 27 #![no_std] @@ -22,6 +22,7 @@ multiversx_sc_wasm_adapter::endpoints! { factory ( init => init + upgrade => upgrade whitelist => whitelist removeWhitelist => remove_whitelist createAndForwardCustomPeriod => create_and_forward_custom_period diff --git a/locked-asset/lkmex-transfer/wasm/Cargo.lock b/locked-asset/lkmex-transfer/wasm/Cargo.lock index de13098e5..670c79e98 100644 --- a/locked-asset/lkmex-transfer/wasm/Cargo.lock +++ b/locked-asset/lkmex-transfer/wasm/Cargo.lock @@ -160,9 +160,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" +checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" dependencies = [ "bitflags", "hashbrown", @@ -196,9 +196,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" +checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" dependencies = [ "hex", "proc-macro2", @@ -209,18 +209,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" +checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" +checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" dependencies = [ "multiversx-sc", ] diff --git a/locked-asset/lkmex-transfer/wasm/src/lib.rs b/locked-asset/lkmex-transfer/wasm/src/lib.rs index 88d45c5f9..c7eb21c2e 100644 --- a/locked-asset/lkmex-transfer/wasm/src/lib.rs +++ b/locked-asset/lkmex-transfer/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 11 +// Endpoints: 12 // Async Callback (empty): 1 -// Total number of exported functions: 13 +// Total number of exported functions: 14 #![no_std] @@ -22,6 +22,7 @@ multiversx_sc_wasm_adapter::endpoints! { lkmex_transfer ( init => init + upgrade => upgrade withdraw => withdraw cancelTransfer => cancel_transfer lockFunds => lock_funds diff --git a/locked-asset/locked-token-wrapper/wasm/Cargo.lock b/locked-asset/locked-token-wrapper/wasm/Cargo.lock index 023c10693..58cbacca2 100644 --- a/locked-asset/locked-token-wrapper/wasm/Cargo.lock +++ b/locked-asset/locked-token-wrapper/wasm/Cargo.lock @@ -184,9 +184,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" +checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" dependencies = [ "bitflags", "hashbrown", @@ -220,9 +220,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" +checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" dependencies = [ "hex", "proc-macro2", @@ -233,18 +233,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" +checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" +checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" dependencies = [ "multiversx-sc", ] diff --git a/locked-asset/locked-token-wrapper/wasm/src/lib.rs b/locked-asset/locked-token-wrapper/wasm/src/lib.rs index dd7c8fd96..9d0073791 100644 --- a/locked-asset/locked-token-wrapper/wasm/src/lib.rs +++ b/locked-asset/locked-token-wrapper/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 8 +// Endpoints: 9 // Async Callback: 1 -// Total number of exported functions: 10 +// Total number of exported functions: 11 #![no_std] @@ -22,6 +22,7 @@ multiversx_sc_wasm_adapter::endpoints! { locked_token_wrapper ( init => init + upgrade => upgrade wrapLockedToken => wrap_locked_token_endpoint unwrapLockedToken => unwrap_locked_token_endpoint issueWrappedToken => issue_wrapped_token diff --git a/locked-asset/proxy_dex/wasm/Cargo.lock b/locked-asset/proxy_dex/wasm/Cargo.lock index 4af1937e2..cb086aad0 100644 --- a/locked-asset/proxy_dex/wasm/Cargo.lock +++ b/locked-asset/proxy_dex/wasm/Cargo.lock @@ -333,9 +333,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" +checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" dependencies = [ "bitflags", "hashbrown", @@ -369,9 +369,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" +checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" dependencies = [ "hex", "proc-macro2", @@ -382,18 +382,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" +checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" +checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" dependencies = [ "multiversx-sc", ] diff --git a/locked-asset/simple-lock-whitelist/wasm/Cargo.lock b/locked-asset/simple-lock-whitelist/wasm/Cargo.lock index 294b59f7c..57b4462d0 100644 --- a/locked-asset/simple-lock-whitelist/wasm/Cargo.lock +++ b/locked-asset/simple-lock-whitelist/wasm/Cargo.lock @@ -98,9 +98,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" +checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" dependencies = [ "bitflags", "hashbrown", @@ -134,9 +134,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" +checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" dependencies = [ "hex", "proc-macro2", @@ -147,18 +147,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" +checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" +checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" dependencies = [ "multiversx-sc", ] diff --git a/locked-asset/simple-lock-whitelist/wasm/src/lib.rs b/locked-asset/simple-lock-whitelist/wasm/src/lib.rs index 8d60bed84..efc26b739 100644 --- a/locked-asset/simple-lock-whitelist/wasm/src/lib.rs +++ b/locked-asset/simple-lock-whitelist/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 24 +// Endpoints: 25 // Async Callback: 1 -// Total number of exported functions: 26 +// Total number of exported functions: 27 #![no_std] @@ -22,6 +22,7 @@ multiversx_sc_wasm_adapter::endpoints! { simple_lock_whitelist ( init => init + upgrade => upgrade setTransferRoleLockedToken => set_transfer_role setTransferRoleProxyLpToken => set_transfer_role_proxy_lp setTransferRoleProxyFarmToken => set_transfer_role_proxy_farm diff --git a/locked-asset/simple-lock/wasm/Cargo.lock b/locked-asset/simple-lock/wasm/Cargo.lock index 3e1b222c7..644ec86c6 100644 --- a/locked-asset/simple-lock/wasm/Cargo.lock +++ b/locked-asset/simple-lock/wasm/Cargo.lock @@ -98,9 +98,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" +checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" dependencies = [ "bitflags", "hashbrown", @@ -134,9 +134,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" +checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" dependencies = [ "hex", "proc-macro2", @@ -147,18 +147,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" +checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" +checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" dependencies = [ "multiversx-sc", ] diff --git a/locked-asset/simple-lock/wasm/src/lib.rs b/locked-asset/simple-lock/wasm/src/lib.rs index afe83b5ff..c416ef0e6 100644 --- a/locked-asset/simple-lock/wasm/src/lib.rs +++ b/locked-asset/simple-lock/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 19 +// Endpoints: 20 // Async Callback: 1 -// Total number of exported functions: 21 +// Total number of exported functions: 22 #![no_std] @@ -22,6 +22,7 @@ multiversx_sc_wasm_adapter::endpoints! { simple_lock ( init => init + upgrade => upgrade lockTokens => lock_tokens_endpoint unlockTokens => unlock_tokens_endpoint issueLockedToken => issue_locked_token diff --git a/locked-asset/token-unstake/wasm/Cargo.lock b/locked-asset/token-unstake/wasm/Cargo.lock index 9558941a9..2f279db4b 100644 --- a/locked-asset/token-unstake/wasm/Cargo.lock +++ b/locked-asset/token-unstake/wasm/Cargo.lock @@ -145,9 +145,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" +checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" dependencies = [ "bitflags", "hashbrown", @@ -181,9 +181,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" +checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" dependencies = [ "hex", "proc-macro2", @@ -194,18 +194,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" +checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" +checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" dependencies = [ "multiversx-sc", ] diff --git a/locked-asset/token-unstake/wasm/src/lib.rs b/locked-asset/token-unstake/wasm/src/lib.rs index f2f371c21..b508d164c 100644 --- a/locked-asset/token-unstake/wasm/src/lib.rs +++ b/locked-asset/token-unstake/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 10 +// Endpoints: 11 // Async Callback (empty): 1 -// Total number of exported functions: 12 +// Total number of exported functions: 13 #![no_std] @@ -22,6 +22,7 @@ multiversx_sc_wasm_adapter::endpoints! { token_unstake ( init => init + upgrade => upgrade getUnbondEpochs => unbond_epochs getUnlockedTokensForUser => unlocked_tokens_for_user claimUnlockedTokens => claim_unlocked_tokens diff --git a/pause-all/wasm/Cargo.lock b/pause-all/wasm/Cargo.lock index ef99da944..9114f573f 100644 --- a/pause-all/wasm/Cargo.lock +++ b/pause-all/wasm/Cargo.lock @@ -73,9 +73,9 @@ checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" [[package]] name = "multiversx-sc" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5889db6e6f6814b221cf4c1cd2937aa047b419e2a80b08695d85b4a9f537bdfd" +checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" dependencies = [ "bitflags", "hashbrown", @@ -109,9 +109,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23fead13b29d79f702e021926402588e9a7822ed9dfadfdfe71c436dce100e4f" +checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" dependencies = [ "hex", "proc-macro2", @@ -122,18 +122,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5c160745bf0c997146fa816a19fba8a8d0517e99ed30cc514eca0967f2eed74" +checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.43.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f6fce7b968fec7ea27f6fef909d4149e515e31aa2486a93dcd7c72a8a01e571" +checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" dependencies = [ "multiversx-sc", ] diff --git a/pause-all/wasm/src/lib.rs b/pause-all/wasm/src/lib.rs index d92fcfc45..d181e94e8 100644 --- a/pause-all/wasm/src/lib.rs +++ b/pause-all/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 7 +// Endpoints: 8 // Async Callback (empty): 1 -// Total number of exported functions: 9 +// Total number of exported functions: 10 #![no_std] @@ -22,6 +22,7 @@ multiversx_sc_wasm_adapter::endpoints! { pause_all ( init => init + upgrade => upgrade addPausableContracts => add_pausable_contracts removePausableContracts => remove_pausable_contracts pauseSelected => pause_selected From 2e9a5006a60ef7a9240291d4bd3c0d353706fe24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Fri, 10 Nov 2023 14:25:14 +0200 Subject: [PATCH 130/213] Fix clippy issues --- dex/farm-with-locked-rewards/src/lib.rs | 2 +- farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dex/farm-with-locked-rewards/src/lib.rs b/dex/farm-with-locked-rewards/src/lib.rs index 2a6b299a3..d4f5ec52b 100644 --- a/dex/farm-with-locked-rewards/src/lib.rs +++ b/dex/farm-with-locked-rewards/src/lib.rs @@ -169,7 +169,7 @@ pub trait Farm: let locked_rewards_payment = self.send_to_lock_contract_non_zero( rewards.token_identifier.clone(), - rewards.amount.clone(), + rewards.amount, caller, orig_caller.clone(), ); diff --git a/farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs b/farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs index 3c46ffd3e..f4388c9c0 100644 --- a/farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs +++ b/farm-staking/farm-staking-proxy/src/proxy_actions/unstake.rs @@ -47,7 +47,7 @@ pub trait ProxyUnstakeModule: ); let staking_farm_exit_result = self.staking_farm_unstake( - orig_caller.clone(), + orig_caller, remove_liq_result.staking_token_payment, exit_attributes.staking_farm_token_nonce, exit_attributes.staking_farm_token_amount, From bd02b83fa276d11a24fb435bb5a8a69164f442eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Fri, 10 Nov 2023 14:25:54 +0200 Subject: [PATCH 131/213] Clippy fix test --- dex/farm/tests/farm_setup/farm_rewards_distr_setup.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dex/farm/tests/farm_setup/farm_rewards_distr_setup.rs b/dex/farm/tests/farm_setup/farm_rewards_distr_setup.rs index 4f144d8c4..f39c3136e 100644 --- a/dex/farm/tests/farm_setup/farm_rewards_distr_setup.rs +++ b/dex/farm/tests/farm_setup/farm_rewards_distr_setup.rs @@ -183,7 +183,7 @@ where &self.farm_wrapper, FARM_TOKEN_ID, farm_token_nonce, - &farm_out_amount.clone(), + &farm_out_amount, |sc| { let multi_result = sc.exit_farm_endpoint(OptionalValue::None); From 9e31d59a76b39e7719df5527d2205723f4adf342 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Mon, 27 Nov 2023 14:36:50 +0200 Subject: [PATCH 132/213] Upgrade to framework 0.45.1 --- common/common_errors/Cargo.toml | 3 +- common/common_structs/Cargo.toml | 3 +- common/modules/farm/config/Cargo.toml | 3 +- common/modules/farm/contexts/Cargo.toml | 5 +- common/modules/farm/events/Cargo.toml | 3 +- common/modules/farm/farm_base_impl/Cargo.toml | 8 +- common/modules/farm/farm_token/Cargo.toml | 5 +- .../modules/farm/farm_token_merge/Cargo.toml | 4 +- common/modules/farm/rewards/Cargo.toml | 5 +- .../legacy_token_decode_module/Cargo.toml | 3 +- common/modules/locking_module/Cargo.toml | 3 +- common/modules/math/Cargo.toml | 3 +- common/modules/pausable/Cargo.toml | 3 +- common/modules/permissions_module/Cargo.toml | 7 +- common/modules/sc_whitelist_module/Cargo.toml | 3 +- common/modules/token_merge_helper/Cargo.toml | 3 +- common/modules/token_send/Cargo.toml | 3 +- common/modules/utils/Cargo.toml | 3 +- common/traits/fixed-supply-token/Cargo.toml | 3 +- common/traits/mergeable/Cargo.toml | 3 +- common/traits/unwrappable/Cargo.toml | 3 +- dex/Cargo.toml | 7 +- dex/farm-with-locked-rewards/Cargo.toml | 7 +- dex/farm-with-locked-rewards/meta/Cargo.toml | 4 +- dex/farm-with-locked-rewards/wasm/Cargo.lock | 79 ++++++++++++----- dex/farm-with-locked-rewards/wasm/Cargo.toml | 18 ++-- dex/farm-with-locked-rewards/wasm/src/lib.rs | 2 +- dex/farm/Cargo.toml | 7 +- dex/farm/meta/Cargo.toml | 4 +- dex/farm/wasm/Cargo.lock | 79 ++++++++++++----- dex/farm/wasm/Cargo.toml | 18 ++-- dex/farm/wasm/src/lib.rs | 2 +- dex/fuzz/Cargo.toml | 4 +- dex/governance/Cargo.toml | 5 +- dex/governance/meta/Cargo.toml | 4 +- dex/governance/wasm/Cargo.lock | 75 ++++++++++++---- dex/governance/wasm/Cargo.toml | 17 ++-- dex/governance/wasm/src/lib.rs | 2 +- dex/pair-mock/Cargo.toml | 6 +- dex/pair-mock/meta/Cargo.toml | 4 +- dex/pair-mock/wasm/Cargo.lock | 75 ++++++++++++---- dex/pair-mock/wasm/Cargo.toml | 17 ++-- dex/pair-mock/wasm/src/lib.rs | 2 +- dex/pair/Cargo.toml | 5 +- dex/pair/meta/Cargo.toml | 4 +- dex/pair/wasm-pair-full/Cargo.lock | 39 +++++---- dex/pair/wasm-pair-full/Cargo.toml | 17 ++-- dex/pair/wasm-pair-full/src/lib.rs | 2 +- dex/pair/wasm-safe-price-view/Cargo.lock | 39 +++++---- dex/pair/wasm-safe-price-view/Cargo.toml | 17 ++-- dex/pair/wasm-safe-price-view/src/lib.rs | 2 +- dex/pair/wasm/Cargo.lock | 39 +++++---- dex/pair/wasm/Cargo.toml | 17 ++-- dex/pair/wasm/src/lib.rs | 2 +- dex/price-discovery/Cargo.toml | 6 +- dex/price-discovery/meta/Cargo.toml | 4 +- dex/price-discovery/wasm/Cargo.lock | 85 ++++++++++++++----- dex/price-discovery/wasm/Cargo.toml | 17 ++-- dex/price-discovery/wasm/src/lib.rs | 2 +- dex/proxy-deployer/Cargo.toml | 5 +- dex/proxy-deployer/meta/Cargo.toml | 4 +- dex/proxy-deployer/wasm/Cargo.lock | 79 ++++++++++++----- dex/proxy-deployer/wasm/Cargo.toml | 17 ++-- dex/proxy-deployer/wasm/src/lib.rs | 2 +- dex/router/Cargo.toml | 6 +- dex/router/meta/Cargo.toml | 4 +- dex/router/wasm/Cargo.lock | 79 ++++++++++++----- dex/router/wasm/Cargo.toml | 18 ++-- dex/router/wasm/src/lib.rs | 2 +- .../common-modules/energy-query/Cargo.toml | 3 +- .../week-timekeeping/Cargo.toml | 3 +- .../weekly-rewards-splitting/Cargo.toml | 3 +- energy-integration/common-types/Cargo.toml | 3 +- .../energy-factory-mock/Cargo.toml | 6 +- .../energy-factory-mock/meta/Cargo.toml | 4 +- .../energy-factory-mock/wasm/Cargo.lock | 79 ++++++++++++----- .../energy-factory-mock/wasm/Cargo.toml | 17 ++-- .../energy-factory-mock/wasm/src/lib.rs | 2 +- energy-integration/energy-update/Cargo.toml | 7 +- .../energy-update/meta/Cargo.toml | 4 +- .../energy-update/wasm/Cargo.lock | 79 ++++++++++++----- .../energy-update/wasm/Cargo.toml | 17 ++-- .../energy-update/wasm/src/lib.rs | 2 +- .../farm-boosted-yields/Cargo.toml | 3 +- energy-integration/fees-collector/Cargo.toml | 7 +- .../fees-collector/meta/Cargo.toml | 4 +- .../fees-collector/wasm/Cargo.lock | 79 ++++++++++++----- .../fees-collector/wasm/Cargo.toml | 17 ++-- .../fees-collector/wasm/src/lib.rs | 2 +- energy-integration/governance-v2/Cargo.toml | 5 +- .../governance-v2/meta/Cargo.toml | 4 +- .../governance-v2/wasm/Cargo.lock | 79 ++++++++++++----- .../governance-v2/wasm/Cargo.toml | 17 ++-- .../governance-v2/wasm/src/lib.rs | 2 +- farm-staking/farm-staking-proxy/Cargo.toml | 6 +- .../farm-staking-proxy/meta/Cargo.toml | 4 +- .../farm-staking-proxy/wasm/Cargo.lock | 85 ++++++++++++++----- .../farm-staking-proxy/wasm/Cargo.toml | 17 ++-- .../farm-staking-proxy/wasm/src/lib.rs | 2 +- farm-staking/farm-staking/Cargo.toml | 7 +- farm-staking/farm-staking/meta/Cargo.toml | 4 +- farm-staking/farm-staking/wasm/Cargo.lock | 79 ++++++++++++----- farm-staking/farm-staking/wasm/Cargo.toml | 18 ++-- farm-staking/farm-staking/wasm/src/lib.rs | 2 +- farm-staking/metabonding-staking/Cargo.toml | 7 +- .../metabonding-staking/meta/Cargo.toml | 4 +- .../metabonding-staking/wasm/Cargo.lock | 79 ++++++++++++----- .../metabonding-staking/wasm/Cargo.toml | 17 ++-- .../metabonding-staking/wasm/src/lib.rs | 2 +- locked-asset/Cargo.toml | 7 +- locked-asset/distribution/Cargo.toml | 6 +- locked-asset/distribution/meta/Cargo.toml | 4 +- locked-asset/distribution/wasm/Cargo.lock | 79 ++++++++++++----- locked-asset/distribution/wasm/Cargo.toml | 18 ++-- locked-asset/distribution/wasm/src/lib.rs | 2 +- locked-asset/energy-factory/Cargo.toml | 7 +- locked-asset/energy-factory/meta/Cargo.toml | 4 +- locked-asset/energy-factory/wasm/Cargo.lock | 79 ++++++++++++----- locked-asset/energy-factory/wasm/Cargo.toml | 17 ++-- locked-asset/energy-factory/wasm/src/lib.rs | 2 +- locked-asset/factory/Cargo.toml | 6 +- locked-asset/factory/meta/Cargo.toml | 4 +- locked-asset/factory/wasm/Cargo.lock | 79 ++++++++++++----- locked-asset/factory/wasm/Cargo.toml | 18 ++-- locked-asset/factory/wasm/src/lib.rs | 2 +- locked-asset/lkmex-transfer/Cargo.toml | 7 +- locked-asset/lkmex-transfer/meta/Cargo.toml | 4 +- locked-asset/lkmex-transfer/wasm/Cargo.lock | 79 ++++++++++++----- locked-asset/lkmex-transfer/wasm/Cargo.toml | 18 ++-- locked-asset/lkmex-transfer/wasm/src/lib.rs | 2 +- locked-asset/locked-token-wrapper/Cargo.toml | 7 +- .../locked-token-wrapper/meta/Cargo.toml | 4 +- .../locked-token-wrapper/wasm/Cargo.lock | 79 ++++++++++++----- .../locked-token-wrapper/wasm/Cargo.toml | 17 ++-- .../locked-token-wrapper/wasm/src/lib.rs | 2 +- locked-asset/proxy_dex/Cargo.toml | 7 +- locked-asset/proxy_dex/meta/Cargo.toml | 4 +- locked-asset/proxy_dex/wasm/Cargo.lock | 79 ++++++++++++----- locked-asset/proxy_dex/wasm/Cargo.toml | 18 ++-- locked-asset/proxy_dex/wasm/src/lib.rs | 2 +- locked-asset/simple-lock-whitelist/Cargo.toml | 7 +- .../simple-lock-whitelist/meta/Cargo.toml | 4 +- .../simple-lock-whitelist/wasm/Cargo.lock | 79 ++++++++++++----- .../simple-lock-whitelist/wasm/Cargo.toml | 17 ++-- .../simple-lock-whitelist/wasm/src/lib.rs | 2 +- locked-asset/simple-lock/Cargo.toml | 7 +- locked-asset/simple-lock/meta/Cargo.toml | 4 +- locked-asset/simple-lock/wasm/Cargo.lock | 79 ++++++++++++----- locked-asset/simple-lock/wasm/Cargo.toml | 17 ++-- locked-asset/simple-lock/wasm/src/lib.rs | 2 +- locked-asset/token-unstake/Cargo.toml | 7 +- locked-asset/token-unstake/meta/Cargo.toml | 4 +- locked-asset/token-unstake/wasm/Cargo.lock | 79 ++++++++++++----- locked-asset/token-unstake/wasm/Cargo.toml | 18 ++-- locked-asset/token-unstake/wasm/src/lib.rs | 2 +- pause-all/Cargo.toml | 8 +- pause-all/meta/Cargo.toml | 4 +- pause-all/wasm/Cargo.lock | 79 ++++++++++++----- pause-all/wasm/Cargo.toml | 17 ++-- pause-all/wasm/src/lib.rs | 2 +- 160 files changed, 2057 insertions(+), 855 deletions(-) diff --git a/common/common_errors/Cargo.toml b/common/common_errors/Cargo.toml index 5ef0030f2..b5c633cf8 100644 --- a/common/common_errors/Cargo.toml +++ b/common/common_errors/Cargo.toml @@ -6,6 +6,7 @@ edition = "2021" [lib] path = "src/lib.rs" + [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/common_structs/Cargo.toml b/common/common_structs/Cargo.toml index e0c4ea791..5d3b853af 100644 --- a/common/common_structs/Cargo.toml +++ b/common/common_structs/Cargo.toml @@ -6,8 +6,9 @@ edition = "2021" [lib] path = "src/lib.rs" + [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.mergeable] diff --git a/common/modules/farm/config/Cargo.toml b/common/modules/farm/config/Cargo.toml index b1cc79243..46bcfcda3 100644 --- a/common/modules/farm/config/Cargo.toml +++ b/common/modules/farm/config/Cargo.toml @@ -6,6 +6,7 @@ edition = "2021" [lib] path = "src/config.rs" + [dependencies.common_structs] path = "../../../common_structs" @@ -22,5 +23,5 @@ path = "../../pausable" path = "../../permissions_module" [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/farm/contexts/Cargo.toml b/common/modules/farm/contexts/Cargo.toml index 82cd4e451..c3e261f27 100644 --- a/common/modules/farm/contexts/Cargo.toml +++ b/common/modules/farm/contexts/Cargo.toml @@ -6,6 +6,7 @@ edition = "2021" [lib] path = "src/mod.rs" + [dependencies.common_structs] path = "../../../common_structs" @@ -34,8 +35,8 @@ path = "../../pausable" path = "../../permissions_module" [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.44.0" +version = "=0.45.1" diff --git a/common/modules/farm/events/Cargo.toml b/common/modules/farm/events/Cargo.toml index 984cff301..7a2bd48df 100644 --- a/common/modules/farm/events/Cargo.toml +++ b/common/modules/farm/events/Cargo.toml @@ -6,6 +6,7 @@ edition = "2021" [lib] path = "src/events.rs" + [dependencies.common_structs] path = "../../../common_structs" @@ -13,5 +14,5 @@ path = "../../../common_structs" path = "../contexts" [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/farm/farm_base_impl/Cargo.toml b/common/modules/farm/farm_base_impl/Cargo.toml index 9305cfd08..c3cc61a4d 100644 --- a/common/modules/farm/farm_base_impl/Cargo.toml +++ b/common/modules/farm/farm_base_impl/Cargo.toml @@ -6,6 +6,7 @@ edition = "2021" [lib] path = "src/lib.rs" + [dependencies.config] path = "../config" @@ -49,10 +50,11 @@ path = "../../../traits/mergeable" path = "../../../traits/fixed-supply-token" [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.44.0" +version = "=0.45.1" + [dev-dependencies.multiversx-sc-scenario] -version = "=0.44.0" +version = "=0.45.1" diff --git a/common/modules/farm/farm_token/Cargo.toml b/common/modules/farm/farm_token/Cargo.toml index dd52a3e41..3ecd30056 100644 --- a/common/modules/farm/farm_token/Cargo.toml +++ b/common/modules/farm/farm_token/Cargo.toml @@ -6,6 +6,7 @@ edition = "2021" [lib] path = "src/farm_token.rs" + [dependencies.common_structs] path = "../../../common_structs" @@ -25,8 +26,8 @@ path = "../../pausable" path = "../../permissions_module" [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.44.0" +version = "=0.45.1" diff --git a/common/modules/farm/farm_token_merge/Cargo.toml b/common/modules/farm/farm_token_merge/Cargo.toml index 6976c0402..900965698 100644 --- a/common/modules/farm/farm_token_merge/Cargo.toml +++ b/common/modules/farm/farm_token_merge/Cargo.toml @@ -22,8 +22,8 @@ path = "../../token_merge_helper" path = "../farm_token" [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.44.0" +version = "=0.45.1" diff --git a/common/modules/farm/rewards/Cargo.toml b/common/modules/farm/rewards/Cargo.toml index 4ae605524..5bc3b2d99 100644 --- a/common/modules/farm/rewards/Cargo.toml +++ b/common/modules/farm/rewards/Cargo.toml @@ -6,6 +6,7 @@ edition = "2021" [lib] path = "src/rewards.rs" + [dependencies.common_structs] path = "../../../common_structs" @@ -28,8 +29,8 @@ path = "../../pausable" path = "../../permissions_module" [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.44.0" +version = "=0.45.1" diff --git a/common/modules/legacy_token_decode_module/Cargo.toml b/common/modules/legacy_token_decode_module/Cargo.toml index 2b0b0152c..763f657e9 100644 --- a/common/modules/legacy_token_decode_module/Cargo.toml +++ b/common/modules/legacy_token_decode_module/Cargo.toml @@ -6,8 +6,9 @@ edition = "2018" [lib] path = "src/lib.rs" + [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.common_structs] diff --git a/common/modules/locking_module/Cargo.toml b/common/modules/locking_module/Cargo.toml index 9ee2e08b5..5758d06ba 100644 --- a/common/modules/locking_module/Cargo.toml +++ b/common/modules/locking_module/Cargo.toml @@ -6,8 +6,9 @@ edition = "2021" [lib] path = "src/lib.rs" + [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.simple-lock] diff --git a/common/modules/math/Cargo.toml b/common/modules/math/Cargo.toml index 621d25bd4..eb662b047 100644 --- a/common/modules/math/Cargo.toml +++ b/common/modules/math/Cargo.toml @@ -6,6 +6,7 @@ edition = "2021" [lib] path = "src/lib.rs" + [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/pausable/Cargo.toml b/common/modules/pausable/Cargo.toml index 1d93a6a20..a6d964ecc 100644 --- a/common/modules/pausable/Cargo.toml +++ b/common/modules/pausable/Cargo.toml @@ -6,9 +6,10 @@ edition = "2021" [lib] path = "src/pausable.rs" + [dependencies.permissions_module] path = "../permissions_module" [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/permissions_module/Cargo.toml b/common/modules/permissions_module/Cargo.toml index cd6cd9424..ce4aa0ff9 100644 --- a/common/modules/permissions_module/Cargo.toml +++ b/common/modules/permissions_module/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "permissions_module" version = "0.0.0" -authors = ["Dorin Iancu ", "Claudiu-Marcel Bruda "] +authors = [ + "Dorin Iancu ", + "Claudiu-Marcel Bruda ", +] edition = "2021" [lib] @@ -14,5 +17,5 @@ bitflags = "1.3.2" path = "../../common_errors" [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/sc_whitelist_module/Cargo.toml b/common/modules/sc_whitelist_module/Cargo.toml index 87b9d6874..6daa10013 100644 --- a/common/modules/sc_whitelist_module/Cargo.toml +++ b/common/modules/sc_whitelist_module/Cargo.toml @@ -6,9 +6,10 @@ edition = "2021" [lib] path = "src/sc_whitelist_module.rs" + [dependencies.common_errors] path = "../../common_errors" [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/token_merge_helper/Cargo.toml b/common/modules/token_merge_helper/Cargo.toml index a11e5d61b..5cbbe8cf1 100644 --- a/common/modules/token_merge_helper/Cargo.toml +++ b/common/modules/token_merge_helper/Cargo.toml @@ -6,9 +6,10 @@ edition = "2021" [lib] path = "src/lib.rs" + [dependencies.common_errors] path = "../../common_errors" [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/token_send/Cargo.toml b/common/modules/token_send/Cargo.toml index 2961d8287..33a3ec594 100644 --- a/common/modules/token_send/Cargo.toml +++ b/common/modules/token_send/Cargo.toml @@ -6,6 +6,7 @@ edition = "2021" [lib] path = "src/token_send.rs" + [dependencies.common_structs] path = "../../common_structs" @@ -13,5 +14,5 @@ path = "../../common_structs" path = "../../common_errors" [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/utils/Cargo.toml b/common/modules/utils/Cargo.toml index a4f77ac25..26f1fd2d9 100644 --- a/common/modules/utils/Cargo.toml +++ b/common/modules/utils/Cargo.toml @@ -6,8 +6,9 @@ edition = "2021" [lib] path = "src/lib.rs" + [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.common_structs] diff --git a/common/traits/fixed-supply-token/Cargo.toml b/common/traits/fixed-supply-token/Cargo.toml index 6b8d4c8f2..f1c259334 100644 --- a/common/traits/fixed-supply-token/Cargo.toml +++ b/common/traits/fixed-supply-token/Cargo.toml @@ -6,5 +6,6 @@ edition = "2021" [lib] path = "src/lib.rs" + [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" diff --git a/common/traits/mergeable/Cargo.toml b/common/traits/mergeable/Cargo.toml index 582354504..c089e91ea 100644 --- a/common/traits/mergeable/Cargo.toml +++ b/common/traits/mergeable/Cargo.toml @@ -6,6 +6,7 @@ edition = "2021" [lib] path = "src/lib.rs" + [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/traits/unwrappable/Cargo.toml b/common/traits/unwrappable/Cargo.toml index f4cdc6ad3..0f75c390d 100644 --- a/common/traits/unwrappable/Cargo.toml +++ b/common/traits/unwrappable/Cargo.toml @@ -6,6 +6,7 @@ edition = "2021" [lib] path = "src/lib.rs" + [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] diff --git a/dex/Cargo.toml b/dex/Cargo.toml index e79055dd1..b6337bc18 100644 --- a/dex/Cargo.toml +++ b/dex/Cargo.toml @@ -3,18 +3,19 @@ name = "dex-tests" version = "0.0.0" edition = "2021" publish = false + [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-modules] -version = "=0.44.0" +version = "=0.45.1" [dev-dependencies.multiversx-sc-scenario] -version = "=0.44.0" +version = "=0.45.1" [dev-dependencies.config] path = "../common/modules/farm/config" diff --git a/dex/farm-with-locked-rewards/Cargo.toml b/dex/farm-with-locked-rewards/Cargo.toml index 6409db6ac..96817d3e5 100644 --- a/dex/farm-with-locked-rewards/Cargo.toml +++ b/dex/farm-with-locked-rewards/Cargo.toml @@ -7,6 +7,7 @@ publish = false [lib] path = "src/lib.rs" + [dependencies.farm_base_impl] path = "../../common/modules/farm/farm_base_impl" @@ -74,17 +75,17 @@ path = "../../locked-asset/energy-factory" path = "../../energy-integration/common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.44.0" +version = "=0.45.1" [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.44.0" +version = "=0.45.1" [dev-dependencies.simple-lock] path = "../../locked-asset/simple-lock" diff --git a/dex/farm-with-locked-rewards/meta/Cargo.toml b/dex/farm-with-locked-rewards/meta/Cargo.toml index 0fc20f13c..93a54b97b 100644 --- a/dex/farm-with-locked-rewards/meta/Cargo.toml +++ b/dex/farm-with-locked-rewards/meta/Cargo.toml @@ -4,8 +4,10 @@ version = "0.0.0" authors = ["MultiversX "] edition = "2021" publish = false + [dependencies.farm-with-locked-rewards] path = ".." [dependencies.multiversx-sc-meta] -version = "0.44.0" +version = "0.45.1" +default-features = false diff --git a/dex/farm-with-locked-rewards/wasm/Cargo.lock b/dex/farm-with-locked-rewards/wasm/Cargo.lock index 7ba8571cc..f4eff6884 100644 --- a/dex/farm-with-locked-rewards/wasm/Cargo.lock +++ b/dex/farm-with-locked-rewards/wasm/Cargo.lock @@ -4,15 +4,22 @@ version = 3 [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if", "once_cell", "version_check", + "zerocopy", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "arrayvec" version = "0.7.2" @@ -279,11 +286,12 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", + "allocator-api2", ] [[package]] @@ -294,9 +302,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-literal" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "itertools" @@ -341,9 +349,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" +checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" dependencies = [ "bitflags", "hashbrown", @@ -355,9 +363,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" +checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -365,43 +373,43 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" +checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" dependencies = [ "hex", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-derive" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" +checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" dependencies = [ "hex", "proc-macro2", "quote", "radix_trie", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-modules" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" +checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" +checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" dependencies = [ "multiversx-sc", ] @@ -539,6 +547,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "token_merge_helper" version = "0.0.0" @@ -604,3 +623,23 @@ dependencies = [ "unwrappable", "week-timekeeping", ] + +[[package]] +name = "zerocopy" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] diff --git a/dex/farm-with-locked-rewards/wasm/Cargo.toml b/dex/farm-with-locked-rewards/wasm/Cargo.toml index db4ffa5d8..d99bc8a30 100644 --- a/dex/farm-with-locked-rewards/wasm/Cargo.toml +++ b/dex/farm-with-locked-rewards/wasm/Cargo.toml @@ -1,26 +1,30 @@ +# Code generated by the multiversx-sc build system. DO NOT EDIT. + +# ########################################## +# ############## AUTO-GENERATED ############# +# ########################################## + [package] name = "farm-with-locked-rewards-wasm" version = "0.0.0" -authors = ["MultiversX "] edition = "2021" publish = false [lib] crate-type = ["cdylib"] -[workspace] -members = ["."] - -[dev-dependencies] [profile.release] codegen-units = 1 opt-level = "z" lto = true debug = false panic = "abort" + [dependencies.farm-with-locked-rewards] -default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.44.0" +version = "=0.45.1" + +[workspace] +members = ["."] diff --git a/dex/farm-with-locked-rewards/wasm/src/lib.rs b/dex/farm-with-locked-rewards/wasm/src/lib.rs index 9e0b6c29e..94154f32c 100644 --- a/dex/farm-with-locked-rewards/wasm/src/lib.rs +++ b/dex/farm-with-locked-rewards/wasm/src/lib.rs @@ -1,4 +1,4 @@ -// Code generated by the multiversx-sc multi-contract system. DO NOT EDIT. +// Code generated by the multiversx-sc build system. DO NOT EDIT. //////////////////////////////////////////////////// ////////////////// AUTO-GENERATED ////////////////// diff --git a/dex/farm/Cargo.toml b/dex/farm/Cargo.toml index 87adca99e..be1ce3b4c 100644 --- a/dex/farm/Cargo.toml +++ b/dex/farm/Cargo.toml @@ -7,6 +7,7 @@ publish = false [lib] path = "src/lib.rs" + [dependencies.farm_base_impl] path = "../../common/modules/farm/farm_base_impl" @@ -68,11 +69,11 @@ path = "../../energy-integration/common-modules/weekly-rewards-splitting" path = "../../energy-integration/common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.44.0" +version = "=0.45.1" [dev-dependencies] num-bigint = "0.4.2" @@ -81,7 +82,7 @@ num-bigint = "0.4.2" path = "../../energy-integration/energy-update" [dev-dependencies.multiversx-sc-scenario] -version = "=0.44.0" +version = "=0.45.1" [dev-dependencies.energy-factory-mock] path = "../../energy-integration/energy-factory-mock" diff --git a/dex/farm/meta/Cargo.toml b/dex/farm/meta/Cargo.toml index bcd565cdd..528a6e60e 100644 --- a/dex/farm/meta/Cargo.toml +++ b/dex/farm/meta/Cargo.toml @@ -4,8 +4,10 @@ version = "0.0.0" authors = ["MultiversX "] edition = "2021" publish = false + [dependencies.farm] path = ".." [dependencies.multiversx-sc-meta] -version = "0.44.0" +version = "0.45.1" +default-features = false diff --git a/dex/farm/wasm/Cargo.lock b/dex/farm/wasm/Cargo.lock index 0152a5383..cad4d8f84 100644 --- a/dex/farm/wasm/Cargo.lock +++ b/dex/farm/wasm/Cargo.lock @@ -4,15 +4,22 @@ version = 3 [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if", "once_cell", "version_check", + "zerocopy", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "arrayvec" version = "0.7.2" @@ -249,11 +256,12 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", + "allocator-api2", ] [[package]] @@ -264,9 +272,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-literal" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "itertools" @@ -311,9 +319,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" +checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" dependencies = [ "bitflags", "hashbrown", @@ -325,9 +333,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" +checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -335,43 +343,43 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" +checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" dependencies = [ "hex", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-derive" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" +checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" dependencies = [ "hex", "proc-macro2", "quote", "radix_trie", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-modules" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" +checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" +checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" dependencies = [ "multiversx-sc", ] @@ -509,6 +517,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "token_merge_helper" version = "0.0.0" @@ -574,3 +593,23 @@ dependencies = [ "unwrappable", "week-timekeeping", ] + +[[package]] +name = "zerocopy" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] diff --git a/dex/farm/wasm/Cargo.toml b/dex/farm/wasm/Cargo.toml index c48ebba22..7b6c5f571 100644 --- a/dex/farm/wasm/Cargo.toml +++ b/dex/farm/wasm/Cargo.toml @@ -1,26 +1,30 @@ +# Code generated by the multiversx-sc build system. DO NOT EDIT. + +# ########################################## +# ############## AUTO-GENERATED ############# +# ########################################## + [package] name = "farm-wasm" version = "0.0.0" -authors = ["MultiversX "] edition = "2021" publish = false [lib] crate-type = ["cdylib"] -[workspace] -members = ["."] - -[dev-dependencies] [profile.release] codegen-units = 1 opt-level = "z" lto = true debug = false panic = "abort" + [dependencies.farm] -default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.44.0" +version = "=0.45.1" + +[workspace] +members = ["."] diff --git a/dex/farm/wasm/src/lib.rs b/dex/farm/wasm/src/lib.rs index 7a14847a9..f760737d3 100644 --- a/dex/farm/wasm/src/lib.rs +++ b/dex/farm/wasm/src/lib.rs @@ -1,4 +1,4 @@ -// Code generated by the multiversx-sc multi-contract system. DO NOT EDIT. +// Code generated by the multiversx-sc build system. DO NOT EDIT. //////////////////////////////////////////////////// ////////////////// AUTO-GENERATED ////////////////// diff --git a/dex/fuzz/Cargo.toml b/dex/fuzz/Cargo.toml index 6d1dd0eb5..41bdbb843 100644 --- a/dex/fuzz/Cargo.toml +++ b/dex/fuzz/Cargo.toml @@ -12,11 +12,11 @@ num-bigint = "0.4.2" rand = "0.8.4" [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-scenario] -version = "=0.44.0" +version = "=0.45.1" [dependencies.pausable] path = "../../common/modules/pausable" diff --git a/dex/governance/Cargo.toml b/dex/governance/Cargo.toml index d6cf219f6..3f97655c5 100644 --- a/dex/governance/Cargo.toml +++ b/dex/governance/Cargo.toml @@ -7,15 +7,16 @@ publish = false [lib] path = "src/lib.rs" + [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.44.0" +version = "=0.45.1" [dev-dependencies.pair-mock] path = "../pair-mock" diff --git a/dex/governance/meta/Cargo.toml b/dex/governance/meta/Cargo.toml index 8aa3f3d5d..7c7d7e8f4 100644 --- a/dex/governance/meta/Cargo.toml +++ b/dex/governance/meta/Cargo.toml @@ -6,8 +6,10 @@ publish = false authors = ["MultiversX "] [dev-dependencies] + [dependencies.governance] path = ".." [dependencies.multiversx-sc-meta] -version = "0.44.0" +version = "0.45.1" +default-features = false diff --git a/dex/governance/wasm/Cargo.lock b/dex/governance/wasm/Cargo.lock index bc69789e8..99ba531ee 100644 --- a/dex/governance/wasm/Cargo.lock +++ b/dex/governance/wasm/Cargo.lock @@ -4,15 +4,22 @@ version = 3 [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if", "once_cell", "version_check", + "zerocopy", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "arrayvec" version = "0.7.2" @@ -60,11 +67,12 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", + "allocator-api2", ] [[package]] @@ -75,15 +83,15 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-literal" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "multiversx-sc" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" +checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" dependencies = [ "bitflags", "hashbrown", @@ -95,9 +103,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" +checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -105,34 +113,34 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" +checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" dependencies = [ "hex", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-derive" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" +checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" dependencies = [ "hex", "proc-macro2", "quote", "radix_trie", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" +checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" dependencies = [ "multiversx-sc", ] @@ -206,6 +214,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "unicode-ident" version = "1.0.6" @@ -217,3 +236,23 @@ name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "zerocopy" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] diff --git a/dex/governance/wasm/Cargo.toml b/dex/governance/wasm/Cargo.toml index 61518848f..ac6cf37c7 100644 --- a/dex/governance/wasm/Cargo.toml +++ b/dex/governance/wasm/Cargo.toml @@ -1,25 +1,30 @@ +# Code generated by the multiversx-sc build system. DO NOT EDIT. + +# ########################################## +# ############## AUTO-GENERATED ############# +# ########################################## + [package] name = "governance-wasm" version = "0.0.0" -authors = ["MultiversX "] edition = "2021" publish = false [lib] crate-type = ["cdylib"] -[workspace] -members = ["."] - -[dev-dependencies] [profile.release] codegen-units = 1 opt-level = "z" lto = true debug = false panic = "abort" + [dependencies.governance] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.44.0" +version = "=0.45.1" + +[workspace] +members = ["."] diff --git a/dex/governance/wasm/src/lib.rs b/dex/governance/wasm/src/lib.rs index c4a7c87ff..6bf958180 100644 --- a/dex/governance/wasm/src/lib.rs +++ b/dex/governance/wasm/src/lib.rs @@ -1,4 +1,4 @@ -// Code generated by the multiversx-sc multi-contract system. DO NOT EDIT. +// Code generated by the multiversx-sc build system. DO NOT EDIT. //////////////////////////////////////////////////// ////////////////// AUTO-GENERATED ////////////////// diff --git a/dex/pair-mock/Cargo.toml b/dex/pair-mock/Cargo.toml index fce707f0e..9094c8c8e 100644 --- a/dex/pair-mock/Cargo.toml +++ b/dex/pair-mock/Cargo.toml @@ -7,15 +7,17 @@ publish = false [lib] path = "src/pair.rs" + [dependencies.common_errors] path = "../../common/common_errors" [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.itertools] version = "0.10.1" default-features = false + [dev-dependencies.multiversx-sc-scenario] -version = "=0.44.0" +version = "=0.45.1" diff --git a/dex/pair-mock/meta/Cargo.toml b/dex/pair-mock/meta/Cargo.toml index 66128bd6b..7b88fa807 100644 --- a/dex/pair-mock/meta/Cargo.toml +++ b/dex/pair-mock/meta/Cargo.toml @@ -6,8 +6,10 @@ publish = false authors = ["MultiversX "] [dev-dependencies] + [dependencies.pair-mock] path = ".." [dependencies.multiversx-sc-meta] -version = "0.44.0" +version = "0.45.1" +default-features = false diff --git a/dex/pair-mock/wasm/Cargo.lock b/dex/pair-mock/wasm/Cargo.lock index 40e00a6f8..094057e7c 100644 --- a/dex/pair-mock/wasm/Cargo.lock +++ b/dex/pair-mock/wasm/Cargo.lock @@ -4,15 +4,22 @@ version = 3 [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if", "once_cell", "version_check", + "zerocopy", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "arrayvec" version = "0.7.2" @@ -58,11 +65,12 @@ checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", + "allocator-api2", ] [[package]] @@ -73,9 +81,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-literal" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "itertools" @@ -88,9 +96,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" +checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" dependencies = [ "bitflags", "hashbrown", @@ -102,9 +110,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" +checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -112,34 +120,34 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" +checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" dependencies = [ "hex", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-derive" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" +checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" dependencies = [ "hex", "proc-macro2", "quote", "radix_trie", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" +checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" dependencies = [ "multiversx-sc", ] @@ -230,6 +238,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "unicode-ident" version = "1.0.6" @@ -241,3 +260,23 @@ name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "zerocopy" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] diff --git a/dex/pair-mock/wasm/Cargo.toml b/dex/pair-mock/wasm/Cargo.toml index af68e935b..9f13e95de 100644 --- a/dex/pair-mock/wasm/Cargo.toml +++ b/dex/pair-mock/wasm/Cargo.toml @@ -1,25 +1,30 @@ +# Code generated by the multiversx-sc build system. DO NOT EDIT. + +# ########################################## +# ############## AUTO-GENERATED ############# +# ########################################## + [package] name = "pair-mock-wasm" version = "0.0.0" -authors = ["MultiversX "] edition = "2021" publish = false [lib] crate-type = ["cdylib"] -[workspace] -members = ["."] - -[dev-dependencies] [profile.release] codegen-units = 1 opt-level = "z" lto = true debug = false panic = "abort" + [dependencies.pair-mock] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.44.0" +version = "=0.45.1" + +[workspace] +members = ["."] diff --git a/dex/pair-mock/wasm/src/lib.rs b/dex/pair-mock/wasm/src/lib.rs index 77325383a..ec97d8398 100644 --- a/dex/pair-mock/wasm/src/lib.rs +++ b/dex/pair-mock/wasm/src/lib.rs @@ -1,4 +1,4 @@ -// Code generated by the multiversx-sc multi-contract system. DO NOT EDIT. +// Code generated by the multiversx-sc build system. DO NOT EDIT. //////////////////////////////////////////////////// ////////////////// AUTO-GENERATED ////////////////// diff --git a/dex/pair/Cargo.toml b/dex/pair/Cargo.toml index 201661ef3..a93416232 100644 --- a/dex/pair/Cargo.toml +++ b/dex/pair/Cargo.toml @@ -7,6 +7,7 @@ publish = false [lib] path = "src/lib.rs" + [dependencies.common_errors] path = "../../common/common_errors" @@ -33,11 +34,11 @@ version = "0.10.1" default-features = false [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.44.0" +version = "=0.45.1" diff --git a/dex/pair/meta/Cargo.toml b/dex/pair/meta/Cargo.toml index 1510d7bce..60a6e2018 100644 --- a/dex/pair/meta/Cargo.toml +++ b/dex/pair/meta/Cargo.toml @@ -4,8 +4,10 @@ version = "0.0.0" authors = ["MultiversX "] edition = "2021" publish = false + [dependencies.pair] path = ".." [dependencies.multiversx-sc-meta] -version = "0.44.0" +version = "0.45.1" +default-features = false diff --git a/dex/pair/wasm-pair-full/Cargo.lock b/dex/pair/wasm-pair-full/Cargo.lock index ce6792399..033478aec 100644 --- a/dex/pair/wasm-pair-full/Cargo.lock +++ b/dex/pair/wasm-pair-full/Cargo.lock @@ -14,6 +14,12 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "arrayvec" version = "0.7.4" @@ -126,11 +132,12 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", + "allocator-api2", ] [[package]] @@ -141,9 +148,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-literal" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "itertools" @@ -188,9 +195,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" +checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" dependencies = [ "bitflags", "hashbrown", @@ -202,9 +209,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" +checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -212,9 +219,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" +checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" dependencies = [ "hex", "proc-macro2", @@ -224,9 +231,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" +checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" dependencies = [ "hex", "proc-macro2", @@ -237,18 +244,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" +checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" +checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" dependencies = [ "multiversx-sc", ] diff --git a/dex/pair/wasm-pair-full/Cargo.toml b/dex/pair/wasm-pair-full/Cargo.toml index 82cd43527..860986801 100644 --- a/dex/pair/wasm-pair-full/Cargo.toml +++ b/dex/pair/wasm-pair-full/Cargo.toml @@ -1,25 +1,30 @@ +# Code generated by the multiversx-sc build system. DO NOT EDIT. + +# ########################################## +# ############## AUTO-GENERATED ############# +# ########################################## + [package] name = "pair-full-wasm" version = "0.0.0" -authors = ["MultiversX "] edition = "2021" publish = false [lib] crate-type = ["cdylib"] -[workspace] -members = ["."] - -[dev-dependencies] [profile.release] codegen-units = 1 opt-level = "z" lto = true debug = false panic = "abort" + [dependencies.pair] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.44.0" +version = "=0.45.1" + +[workspace] +members = ["."] diff --git a/dex/pair/wasm-pair-full/src/lib.rs b/dex/pair/wasm-pair-full/src/lib.rs index 020b428db..02da48066 100644 --- a/dex/pair/wasm-pair-full/src/lib.rs +++ b/dex/pair/wasm-pair-full/src/lib.rs @@ -1,4 +1,4 @@ -// Code generated by the multiversx-sc multi-contract system. DO NOT EDIT. +// Code generated by the multiversx-sc build system. DO NOT EDIT. //////////////////////////////////////////////////// ////////////////// AUTO-GENERATED ////////////////// diff --git a/dex/pair/wasm-safe-price-view/Cargo.lock b/dex/pair/wasm-safe-price-view/Cargo.lock index 7bb41b36c..7aff5a185 100644 --- a/dex/pair/wasm-safe-price-view/Cargo.lock +++ b/dex/pair/wasm-safe-price-view/Cargo.lock @@ -14,6 +14,12 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "arrayvec" version = "0.7.4" @@ -126,11 +132,12 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", + "allocator-api2", ] [[package]] @@ -141,9 +148,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-literal" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "itertools" @@ -188,9 +195,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" +checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" dependencies = [ "bitflags", "hashbrown", @@ -202,9 +209,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" +checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -212,9 +219,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" +checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" dependencies = [ "hex", "proc-macro2", @@ -224,9 +231,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" +checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" dependencies = [ "hex", "proc-macro2", @@ -237,18 +244,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" +checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" +checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" dependencies = [ "multiversx-sc", ] diff --git a/dex/pair/wasm-safe-price-view/Cargo.toml b/dex/pair/wasm-safe-price-view/Cargo.toml index 94a49cc47..72cb42e97 100644 --- a/dex/pair/wasm-safe-price-view/Cargo.toml +++ b/dex/pair/wasm-safe-price-view/Cargo.toml @@ -1,25 +1,30 @@ +# Code generated by the multiversx-sc build system. DO NOT EDIT. + +# ########################################## +# ############## AUTO-GENERATED ############# +# ########################################## + [package] name = "safe-price-view-wasm" version = "0.0.0" -authors = ["MultiversX "] edition = "2021" publish = false [lib] crate-type = ["cdylib"] -[workspace] -members = ["."] - -[dev-dependencies] [profile.release] codegen-units = 1 opt-level = "z" lto = true debug = false panic = "abort" + [dependencies.pair] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.44.0" +version = "=0.45.1" + +[workspace] +members = ["."] diff --git a/dex/pair/wasm-safe-price-view/src/lib.rs b/dex/pair/wasm-safe-price-view/src/lib.rs index c5f78382f..66a10d862 100644 --- a/dex/pair/wasm-safe-price-view/src/lib.rs +++ b/dex/pair/wasm-safe-price-view/src/lib.rs @@ -1,4 +1,4 @@ -// Code generated by the multiversx-sc multi-contract system. DO NOT EDIT. +// Code generated by the multiversx-sc build system. DO NOT EDIT. //////////////////////////////////////////////////// ////////////////// AUTO-GENERATED ////////////////// diff --git a/dex/pair/wasm/Cargo.lock b/dex/pair/wasm/Cargo.lock index 97a69bdd0..c00085fc0 100644 --- a/dex/pair/wasm/Cargo.lock +++ b/dex/pair/wasm/Cargo.lock @@ -14,6 +14,12 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "arrayvec" version = "0.7.4" @@ -126,11 +132,12 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", + "allocator-api2", ] [[package]] @@ -141,9 +148,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-literal" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "itertools" @@ -188,9 +195,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" +checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" dependencies = [ "bitflags", "hashbrown", @@ -202,9 +209,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" +checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -212,9 +219,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" +checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" dependencies = [ "hex", "proc-macro2", @@ -224,9 +231,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" +checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" dependencies = [ "hex", "proc-macro2", @@ -237,18 +244,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" +checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" +checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" dependencies = [ "multiversx-sc", ] diff --git a/dex/pair/wasm/Cargo.toml b/dex/pair/wasm/Cargo.toml index 897320ec0..57ecc9c6d 100644 --- a/dex/pair/wasm/Cargo.toml +++ b/dex/pair/wasm/Cargo.toml @@ -1,25 +1,30 @@ +# Code generated by the multiversx-sc build system. DO NOT EDIT. + +# ########################################## +# ############## AUTO-GENERATED ############# +# ########################################## + [package] name = "pair-wasm" version = "0.0.0" -authors = ["MultiversX "] edition = "2021" publish = false [lib] crate-type = ["cdylib"] -[workspace] -members = ["."] - -[dev-dependencies] [profile.release] codegen-units = 1 opt-level = "z" lto = true debug = false panic = "abort" + [dependencies.pair] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.44.0" +version = "=0.45.1" + +[workspace] +members = ["."] diff --git a/dex/pair/wasm/src/lib.rs b/dex/pair/wasm/src/lib.rs index e29fca244..76f992c76 100644 --- a/dex/pair/wasm/src/lib.rs +++ b/dex/pair/wasm/src/lib.rs @@ -1,4 +1,4 @@ -// Code generated by the multiversx-sc multi-contract system. DO NOT EDIT. +// Code generated by the multiversx-sc build system. DO NOT EDIT. //////////////////////////////////////////////////// ////////////////// AUTO-GENERATED ////////////////// diff --git a/dex/price-discovery/Cargo.toml b/dex/price-discovery/Cargo.toml index c611e792e..604049058 100644 --- a/dex/price-discovery/Cargo.toml +++ b/dex/price-discovery/Cargo.toml @@ -12,11 +12,11 @@ path = "src/lib.rs" hex-literal = "0.3.1" [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.44.0" +version = "=0.45.1" [dependencies.locking_module] path = "../../common/modules/locking_module" @@ -30,4 +30,4 @@ hex = "0.4" path = "../../locked-asset/simple-lock" [dev-dependencies.multiversx-sc-scenario] -version = "=0.44.0" +version = "=0.45.1" diff --git a/dex/price-discovery/meta/Cargo.toml b/dex/price-discovery/meta/Cargo.toml index 02766c25e..f1e8ff2c3 100644 --- a/dex/price-discovery/meta/Cargo.toml +++ b/dex/price-discovery/meta/Cargo.toml @@ -4,8 +4,10 @@ version = "0.0.0" edition = "2021" publish = false authors = ["Dorin Iancu "] + [dependencies.price-discovery] path = ".." [dependencies.multiversx-sc-meta] -version = "0.44.0" +version = "0.45.1" +default-features = false diff --git a/dex/price-discovery/wasm/Cargo.lock b/dex/price-discovery/wasm/Cargo.lock index 6dd07147f..8cc440e6e 100644 --- a/dex/price-discovery/wasm/Cargo.lock +++ b/dex/price-discovery/wasm/Cargo.lock @@ -4,15 +4,22 @@ version = 3 [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if", "once_cell", "version_check", + "zerocopy", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "arrayvec" version = "0.7.2" @@ -86,11 +93,12 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", + "allocator-api2", ] [[package]] @@ -105,6 +113,12 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + [[package]] name = "legacy_token_decode_module" version = "0.0.0" @@ -139,13 +153,13 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" +checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" dependencies = [ "bitflags", "hashbrown", - "hex-literal", + "hex-literal 0.4.1", "multiversx-sc-codec", "multiversx-sc-derive", "num-traits", @@ -153,9 +167,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" +checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -163,43 +177,43 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" +checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" dependencies = [ "hex", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-derive" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" +checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" dependencies = [ "hex", "proc-macro2", "quote", "radix_trie", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-modules" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" +checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" +checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" dependencies = [ "multiversx-sc", ] @@ -232,7 +246,7 @@ checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" name = "price-discovery" version = "0.0.0" dependencies = [ - "hex-literal", + "hex-literal 0.3.4", "locking_module", "multiversx-sc", "multiversx-sc-modules", @@ -308,6 +322,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "unicode-ident" version = "1.0.6" @@ -336,3 +361,23 @@ name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "zerocopy" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] diff --git a/dex/price-discovery/wasm/Cargo.toml b/dex/price-discovery/wasm/Cargo.toml index ffa2b5a9d..5c168e828 100644 --- a/dex/price-discovery/wasm/Cargo.toml +++ b/dex/price-discovery/wasm/Cargo.toml @@ -1,25 +1,30 @@ +# Code generated by the multiversx-sc build system. DO NOT EDIT. + +# ########################################## +# ############## AUTO-GENERATED ############# +# ########################################## + [package] name = "price-discovery-wasm" version = "0.0.0" -authors = ["Dorin Iancu "] edition = "2021" publish = false [lib] crate-type = ["cdylib"] -[workspace] -members = ["."] - -[dev-dependencies] [profile.release] codegen-units = 1 opt-level = "z" lto = true debug = false panic = "abort" + [dependencies.price-discovery] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.44.0" +version = "=0.45.1" + +[workspace] +members = ["."] diff --git a/dex/price-discovery/wasm/src/lib.rs b/dex/price-discovery/wasm/src/lib.rs index 5256b0b94..ddaaf9b4c 100644 --- a/dex/price-discovery/wasm/src/lib.rs +++ b/dex/price-discovery/wasm/src/lib.rs @@ -1,4 +1,4 @@ -// Code generated by the multiversx-sc multi-contract system. DO NOT EDIT. +// Code generated by the multiversx-sc build system. DO NOT EDIT. //////////////////////////////////////////////////// ////////////////// AUTO-GENERATED ////////////////// diff --git a/dex/proxy-deployer/Cargo.toml b/dex/proxy-deployer/Cargo.toml index c78c8021a..8569a0404 100644 --- a/dex/proxy-deployer/Cargo.toml +++ b/dex/proxy-deployer/Cargo.toml @@ -7,6 +7,7 @@ publish = false [lib] path = "src/lib.rs" + [dependencies.farm] path = "../farm" @@ -20,11 +21,11 @@ path = "../../common/modules/farm/config" path = "../../common/modules/farm/farm_token" [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.44.0" +version = "=0.45.1" diff --git a/dex/proxy-deployer/meta/Cargo.toml b/dex/proxy-deployer/meta/Cargo.toml index c5ad5aae9..8ecad5d9b 100644 --- a/dex/proxy-deployer/meta/Cargo.toml +++ b/dex/proxy-deployer/meta/Cargo.toml @@ -6,8 +6,10 @@ publish = false authors = ["MultiversX "] [dev-dependencies] + [dependencies.proxy-deployer] path = ".." [dependencies.multiversx-sc-meta] -version = "0.44.0" +version = "0.45.1" +default-features = false diff --git a/dex/proxy-deployer/wasm/Cargo.lock b/dex/proxy-deployer/wasm/Cargo.lock index 9670bff71..c41f2f09d 100644 --- a/dex/proxy-deployer/wasm/Cargo.lock +++ b/dex/proxy-deployer/wasm/Cargo.lock @@ -4,15 +4,22 @@ version = 3 [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if", "once_cell", "version_check", + "zerocopy", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "arrayvec" version = "0.7.2" @@ -241,11 +248,12 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", + "allocator-api2", ] [[package]] @@ -256,9 +264,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-literal" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "itertools" @@ -303,9 +311,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" +checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" dependencies = [ "bitflags", "hashbrown", @@ -317,9 +325,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" +checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -327,43 +335,43 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" +checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" dependencies = [ "hex", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-derive" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" +checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" dependencies = [ "hex", "proc-macro2", "quote", "radix_trie", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-modules" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" +checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" +checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" dependencies = [ "multiversx-sc", ] @@ -520,6 +528,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "token_merge_helper" version = "0.0.0" @@ -585,3 +604,23 @@ dependencies = [ "unwrappable", "week-timekeeping", ] + +[[package]] +name = "zerocopy" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] diff --git a/dex/proxy-deployer/wasm/Cargo.toml b/dex/proxy-deployer/wasm/Cargo.toml index 042bf990e..e4ddc408f 100644 --- a/dex/proxy-deployer/wasm/Cargo.toml +++ b/dex/proxy-deployer/wasm/Cargo.toml @@ -1,25 +1,30 @@ +# Code generated by the multiversx-sc build system. DO NOT EDIT. + +# ########################################## +# ############## AUTO-GENERATED ############# +# ########################################## + [package] name = "proxy-deployer-wasm" version = "0.0.0" edition = "2021" publish = false -authors = ["MultiversX "] [lib] crate-type = ["cdylib"] -[workspace] -members = ["."] - -[dev-dependencies] [profile.release] codegen-units = 1 opt-level = "z" lto = true debug = false panic = "abort" + [dependencies.proxy-deployer] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.44.0" +version = "=0.45.1" + +[workspace] +members = ["."] diff --git a/dex/proxy-deployer/wasm/src/lib.rs b/dex/proxy-deployer/wasm/src/lib.rs index b5cfc7d6e..a74ccdddd 100644 --- a/dex/proxy-deployer/wasm/src/lib.rs +++ b/dex/proxy-deployer/wasm/src/lib.rs @@ -1,4 +1,4 @@ -// Code generated by the multiversx-sc multi-contract system. DO NOT EDIT. +// Code generated by the multiversx-sc build system. DO NOT EDIT. //////////////////////////////////////////////////// ////////////////// AUTO-GENERATED ////////////////// diff --git a/dex/router/Cargo.toml b/dex/router/Cargo.toml index ec3bead6c..782266a32 100644 --- a/dex/router/Cargo.toml +++ b/dex/router/Cargo.toml @@ -7,6 +7,7 @@ publish = false [lib] path = "src/contract.rs" + [dependencies.token_send] path = "../../common/modules/token_send" @@ -14,7 +15,7 @@ path = "../../common/modules/token_send" path = "../../common/modules/pausable" [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.pair] @@ -25,5 +26,6 @@ path = "../../common/modules/locking_module" [dependencies.simple-lock] path = "../../locked-asset/simple-lock" + [dev-dependencies.multiversx-sc-scenario] -version = "=0.44.0" +version = "=0.45.1" diff --git a/dex/router/meta/Cargo.toml b/dex/router/meta/Cargo.toml index d0513a5b8..3b74d589d 100644 --- a/dex/router/meta/Cargo.toml +++ b/dex/router/meta/Cargo.toml @@ -4,8 +4,10 @@ version = "0.0.0" authors = ["MultiversX "] edition = "2021" publish = false + [dependencies.router] path = ".." [dependencies.multiversx-sc-meta] -version = "0.44.0" +version = "0.45.1" +default-features = false diff --git a/dex/router/wasm/Cargo.lock b/dex/router/wasm/Cargo.lock index 2a3e24482..4d00c8b27 100644 --- a/dex/router/wasm/Cargo.lock +++ b/dex/router/wasm/Cargo.lock @@ -4,15 +4,22 @@ version = 3 [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if", "once_cell", "version_check", + "zerocopy", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "arrayvec" version = "0.7.2" @@ -125,11 +132,12 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", + "allocator-api2", ] [[package]] @@ -140,9 +148,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-literal" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "itertools" @@ -187,9 +195,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" +checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" dependencies = [ "bitflags", "hashbrown", @@ -201,9 +209,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" +checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -211,43 +219,43 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" +checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" dependencies = [ "hex", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-derive" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" +checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" dependencies = [ "hex", "proc-macro2", "quote", "radix_trie", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-modules" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" +checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" +checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" dependencies = [ "multiversx-sc", ] @@ -390,6 +398,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "token_send" version = "0.0.0" @@ -447,3 +466,23 @@ dependencies = [ "unwrappable", "week-timekeeping", ] + +[[package]] +name = "zerocopy" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] diff --git a/dex/router/wasm/Cargo.toml b/dex/router/wasm/Cargo.toml index 527d41c2a..6c848a614 100644 --- a/dex/router/wasm/Cargo.toml +++ b/dex/router/wasm/Cargo.toml @@ -1,26 +1,30 @@ +# Code generated by the multiversx-sc build system. DO NOT EDIT. + +# ########################################## +# ############## AUTO-GENERATED ############# +# ########################################## + [package] name = "router-wasm" version = "0.0.0" -authors = ["MultiversX "] edition = "2021" publish = false [lib] crate-type = ["cdylib"] -[workspace] -members = ["."] - -[dev-dependencies] [profile.release] codegen-units = 1 opt-level = "z" lto = true debug = false panic = "abort" + [dependencies.router] -default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.44.0" +version = "=0.45.1" + +[workspace] +members = ["."] diff --git a/dex/router/wasm/src/lib.rs b/dex/router/wasm/src/lib.rs index 6f9525b47..ac06c8060 100644 --- a/dex/router/wasm/src/lib.rs +++ b/dex/router/wasm/src/lib.rs @@ -1,4 +1,4 @@ -// Code generated by the multiversx-sc multi-contract system. DO NOT EDIT. +// Code generated by the multiversx-sc build system. DO NOT EDIT. //////////////////////////////////////////////////// ////////////////// AUTO-GENERATED ////////////////// diff --git a/energy-integration/common-modules/energy-query/Cargo.toml b/energy-integration/common-modules/energy-query/Cargo.toml index 5817c0e0d..b26ea759f 100644 --- a/energy-integration/common-modules/energy-query/Cargo.toml +++ b/energy-integration/common-modules/energy-query/Cargo.toml @@ -6,8 +6,9 @@ edition = "2021" [lib] path = "src/lib.rs" + [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.energy-factory] diff --git a/energy-integration/common-modules/week-timekeeping/Cargo.toml b/energy-integration/common-modules/week-timekeeping/Cargo.toml index 425e82770..b39d7c46a 100644 --- a/energy-integration/common-modules/week-timekeeping/Cargo.toml +++ b/energy-integration/common-modules/week-timekeeping/Cargo.toml @@ -6,8 +6,9 @@ edition = "2021" [lib] path = "src/lib.rs" + [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.common-types] diff --git a/energy-integration/common-modules/weekly-rewards-splitting/Cargo.toml b/energy-integration/common-modules/weekly-rewards-splitting/Cargo.toml index 0d4392996..2b9f9dbd2 100644 --- a/energy-integration/common-modules/weekly-rewards-splitting/Cargo.toml +++ b/energy-integration/common-modules/weekly-rewards-splitting/Cargo.toml @@ -6,8 +6,9 @@ edition = "2021" [lib] path = "src/lib.rs" + [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.energy-query] diff --git a/energy-integration/common-types/Cargo.toml b/energy-integration/common-types/Cargo.toml index a9330d1ab..102ed16a3 100644 --- a/energy-integration/common-types/Cargo.toml +++ b/energy-integration/common-types/Cargo.toml @@ -6,6 +6,7 @@ edition = "2021" [lib] path = "src/lib.rs" + [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] diff --git a/energy-integration/energy-factory-mock/Cargo.toml b/energy-integration/energy-factory-mock/Cargo.toml index 1a56fbd10..19aa040ef 100644 --- a/energy-integration/energy-factory-mock/Cargo.toml +++ b/energy-integration/energy-factory-mock/Cargo.toml @@ -7,11 +7,13 @@ publish = false [lib] path = "src/lib.rs" + [dependencies.energy-query] path = "../common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] + [dev-dependencies.multiversx-sc-scenario] -version = "=0.44.0" +version = "=0.45.1" diff --git a/energy-integration/energy-factory-mock/meta/Cargo.toml b/energy-integration/energy-factory-mock/meta/Cargo.toml index 206f5ad1f..6feebd510 100644 --- a/energy-integration/energy-factory-mock/meta/Cargo.toml +++ b/energy-integration/energy-factory-mock/meta/Cargo.toml @@ -6,8 +6,10 @@ publish = false authors = ["MultiversX "] [dev-dependencies] + [dependencies.energy-factory-mock] path = ".." [dependencies.multiversx-sc-meta] -version = "0.44.0" +version = "0.45.1" +default-features = false diff --git a/energy-integration/energy-factory-mock/wasm/Cargo.lock b/energy-integration/energy-factory-mock/wasm/Cargo.lock index e8018c634..38b809c8b 100644 --- a/energy-integration/energy-factory-mock/wasm/Cargo.lock +++ b/energy-integration/energy-factory-mock/wasm/Cargo.lock @@ -4,15 +4,22 @@ version = 3 [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if", "once_cell", "version_check", + "zerocopy", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "arrayvec" version = "0.7.2" @@ -110,11 +117,12 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", + "allocator-api2", ] [[package]] @@ -125,9 +133,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-literal" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "legacy_token_decode_module" @@ -154,9 +162,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" +checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" dependencies = [ "bitflags", "hashbrown", @@ -168,9 +176,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" +checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -178,43 +186,43 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" +checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" dependencies = [ "hex", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-derive" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" +checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" dependencies = [ "hex", "proc-macro2", "quote", "radix_trie", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-modules" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" +checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" +checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" dependencies = [ "multiversx-sc", ] @@ -305,6 +313,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "unicode-ident" version = "1.0.6" @@ -333,3 +352,23 @@ name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "zerocopy" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] diff --git a/energy-integration/energy-factory-mock/wasm/Cargo.toml b/energy-integration/energy-factory-mock/wasm/Cargo.toml index c477bfcea..38881c4b4 100644 --- a/energy-integration/energy-factory-mock/wasm/Cargo.toml +++ b/energy-integration/energy-factory-mock/wasm/Cargo.toml @@ -1,25 +1,30 @@ +# Code generated by the multiversx-sc build system. DO NOT EDIT. + +# ########################################## +# ############## AUTO-GENERATED ############# +# ########################################## + [package] name = "energy-factory-mock-wasm" version = "0.0.0" edition = "2021" publish = false -authors = ["MultiversX "] [lib] crate-type = ["cdylib"] -[workspace] -members = ["."] - -[dev-dependencies] [profile.release] codegen-units = 1 opt-level = "z" lto = true debug = false panic = "abort" + [dependencies.energy-factory-mock] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.44.0" +version = "=0.45.1" + +[workspace] +members = ["."] diff --git a/energy-integration/energy-factory-mock/wasm/src/lib.rs b/energy-integration/energy-factory-mock/wasm/src/lib.rs index 89a4cb257..4ac2e4094 100644 --- a/energy-integration/energy-factory-mock/wasm/src/lib.rs +++ b/energy-integration/energy-factory-mock/wasm/src/lib.rs @@ -1,4 +1,4 @@ -// Code generated by the multiversx-sc multi-contract system. DO NOT EDIT. +// Code generated by the multiversx-sc build system. DO NOT EDIT. //////////////////////////////////////////////////// ////////////////// AUTO-GENERATED ////////////////// diff --git a/energy-integration/energy-update/Cargo.toml b/energy-integration/energy-update/Cargo.toml index 53d8179a0..3d43c1761 100644 --- a/energy-integration/energy-update/Cargo.toml +++ b/energy-integration/energy-update/Cargo.toml @@ -7,12 +7,13 @@ publish = false [lib] path = "src/lib.rs" + [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.44.0" +version = "=0.45.1" [dependencies.farm] path = "../../dex/farm" @@ -24,4 +25,4 @@ path = "../common-modules/weekly-rewards-splitting" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.44.0" +version = "=0.45.1" diff --git a/energy-integration/energy-update/meta/Cargo.toml b/energy-integration/energy-update/meta/Cargo.toml index 4775ffc90..55eae49eb 100644 --- a/energy-integration/energy-update/meta/Cargo.toml +++ b/energy-integration/energy-update/meta/Cargo.toml @@ -6,8 +6,10 @@ publish = false authors = ["MultiversX "] [dev-dependencies] + [dependencies.energy-update] path = ".." [dependencies.multiversx-sc-meta] -version = "0.44.0" +version = "0.45.1" +default-features = false diff --git a/energy-integration/energy-update/wasm/Cargo.lock b/energy-integration/energy-update/wasm/Cargo.lock index cbc57af66..3edccc869 100644 --- a/energy-integration/energy-update/wasm/Cargo.lock +++ b/energy-integration/energy-update/wasm/Cargo.lock @@ -4,15 +4,22 @@ version = 3 [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if", "once_cell", "version_check", + "zerocopy", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "arrayvec" version = "0.7.2" @@ -259,11 +266,12 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", + "allocator-api2", ] [[package]] @@ -274,9 +282,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-literal" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "itertools" @@ -321,9 +329,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" +checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" dependencies = [ "bitflags", "hashbrown", @@ -335,9 +343,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" +checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -345,43 +353,43 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" +checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" dependencies = [ "hex", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-derive" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" +checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" dependencies = [ "hex", "proc-macro2", "quote", "radix_trie", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-modules" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" +checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" +checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" dependencies = [ "multiversx-sc", ] @@ -519,6 +527,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "token_merge_helper" version = "0.0.0" @@ -584,3 +603,23 @@ dependencies = [ "unwrappable", "week-timekeeping", ] + +[[package]] +name = "zerocopy" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] diff --git a/energy-integration/energy-update/wasm/Cargo.toml b/energy-integration/energy-update/wasm/Cargo.toml index 710ad77d1..106076ba9 100644 --- a/energy-integration/energy-update/wasm/Cargo.toml +++ b/energy-integration/energy-update/wasm/Cargo.toml @@ -1,25 +1,30 @@ +# Code generated by the multiversx-sc build system. DO NOT EDIT. + +# ########################################## +# ############## AUTO-GENERATED ############# +# ########################################## + [package] name = "energy-update-wasm" version = "0.0.0" edition = "2021" publish = false -authors = ["MultiversX "] [lib] crate-type = ["cdylib"] -[workspace] -members = ["."] - -[dev-dependencies] [profile.release] codegen-units = 1 opt-level = "z" lto = true debug = false panic = "abort" + [dependencies.energy-update] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.44.0" +version = "=0.45.1" + +[workspace] +members = ["."] diff --git a/energy-integration/energy-update/wasm/src/lib.rs b/energy-integration/energy-update/wasm/src/lib.rs index 52bd9be34..7200d8146 100644 --- a/energy-integration/energy-update/wasm/src/lib.rs +++ b/energy-integration/energy-update/wasm/src/lib.rs @@ -1,4 +1,4 @@ -// Code generated by the multiversx-sc multi-contract system. DO NOT EDIT. +// Code generated by the multiversx-sc build system. DO NOT EDIT. //////////////////////////////////////////////////// ////////////////// AUTO-GENERATED ////////////////// diff --git a/energy-integration/farm-boosted-yields/Cargo.toml b/energy-integration/farm-boosted-yields/Cargo.toml index 6e574c3e9..f70e8d561 100644 --- a/energy-integration/farm-boosted-yields/Cargo.toml +++ b/energy-integration/farm-boosted-yields/Cargo.toml @@ -6,8 +6,9 @@ edition = "2021" [lib] path = "src/lib.rs" + [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.config] diff --git a/energy-integration/fees-collector/Cargo.toml b/energy-integration/fees-collector/Cargo.toml index be3fd2f4f..371aba09c 100644 --- a/energy-integration/fees-collector/Cargo.toml +++ b/energy-integration/fees-collector/Cargo.toml @@ -7,12 +7,13 @@ publish = false [lib] path = "src/lib.rs" + [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.44.0" +version = "=0.45.1" [dependencies.energy-query] path = "../common-modules/energy-query" @@ -48,7 +49,7 @@ path = "../../common/common_errors" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.44.0" +version = "=0.45.1" [dev-dependencies.sc_whitelist_module] path = "../../common/modules/sc_whitelist_module" diff --git a/energy-integration/fees-collector/meta/Cargo.toml b/energy-integration/fees-collector/meta/Cargo.toml index ca6b8aa0e..4804ca99a 100644 --- a/energy-integration/fees-collector/meta/Cargo.toml +++ b/energy-integration/fees-collector/meta/Cargo.toml @@ -6,8 +6,10 @@ publish = false authors = ["MultiversX "] [dev-dependencies] + [dependencies.fees-collector] path = ".." [dependencies.multiversx-sc-meta] -version = "0.44.0" +version = "0.45.1" +default-features = false diff --git a/energy-integration/fees-collector/wasm/Cargo.lock b/energy-integration/fees-collector/wasm/Cargo.lock index 635ae3787..01d90f50a 100644 --- a/energy-integration/fees-collector/wasm/Cargo.lock +++ b/energy-integration/fees-collector/wasm/Cargo.lock @@ -4,15 +4,22 @@ version = 3 [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if", "once_cell", "version_check", + "zerocopy", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "arrayvec" version = "0.7.2" @@ -127,11 +134,12 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", + "allocator-api2", ] [[package]] @@ -142,9 +150,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-literal" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "legacy_token_decode_module" @@ -180,9 +188,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" +checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" dependencies = [ "bitflags", "hashbrown", @@ -194,9 +202,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" +checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -204,43 +212,43 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" +checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" dependencies = [ "hex", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-derive" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" +checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" dependencies = [ "hex", "proc-macro2", "quote", "radix_trie", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-modules" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" +checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" +checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" dependencies = [ "multiversx-sc", ] @@ -331,6 +339,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "unicode-ident" version = "1.0.6" @@ -379,3 +398,23 @@ dependencies = [ "unwrappable", "week-timekeeping", ] + +[[package]] +name = "zerocopy" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] diff --git a/energy-integration/fees-collector/wasm/Cargo.toml b/energy-integration/fees-collector/wasm/Cargo.toml index 4fb89d1cf..eed8e6b8a 100644 --- a/energy-integration/fees-collector/wasm/Cargo.toml +++ b/energy-integration/fees-collector/wasm/Cargo.toml @@ -1,25 +1,30 @@ +# Code generated by the multiversx-sc build system. DO NOT EDIT. + +# ########################################## +# ############## AUTO-GENERATED ############# +# ########################################## + [package] name = "fees-collector-wasm" version = "0.0.0" edition = "2021" publish = false -authors = ["MultiversX "] [lib] crate-type = ["cdylib"] -[workspace] -members = ["."] - -[dev-dependencies] [profile.release] codegen-units = 1 opt-level = "z" lto = true debug = false panic = "abort" + [dependencies.fees-collector] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.44.0" +version = "=0.45.1" + +[workspace] +members = ["."] diff --git a/energy-integration/fees-collector/wasm/src/lib.rs b/energy-integration/fees-collector/wasm/src/lib.rs index aa65ffda9..b0f3b7178 100644 --- a/energy-integration/fees-collector/wasm/src/lib.rs +++ b/energy-integration/fees-collector/wasm/src/lib.rs @@ -1,4 +1,4 @@ -// Code generated by the multiversx-sc multi-contract system. DO NOT EDIT. +// Code generated by the multiversx-sc build system. DO NOT EDIT. //////////////////////////////////////////////////// ////////////////// AUTO-GENERATED ////////////////// diff --git a/energy-integration/governance-v2/Cargo.toml b/energy-integration/governance-v2/Cargo.toml index 6c75811b9..422148e5b 100644 --- a/energy-integration/governance-v2/Cargo.toml +++ b/energy-integration/governance-v2/Cargo.toml @@ -7,11 +7,12 @@ publish = false [lib] path = "src/lib.rs" + [dependencies.energy-query] path = "../common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.permissions_module] @@ -27,7 +28,7 @@ path = "../common-modules/weekly-rewards-splitting" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.44.0" +version = "=0.45.1" [dev-dependencies.energy-factory-mock] path = "../energy-factory-mock" diff --git a/energy-integration/governance-v2/meta/Cargo.toml b/energy-integration/governance-v2/meta/Cargo.toml index e7e4e174c..d82963004 100644 --- a/energy-integration/governance-v2/meta/Cargo.toml +++ b/energy-integration/governance-v2/meta/Cargo.toml @@ -6,8 +6,10 @@ publish = false authors = ["MultiversX "] [dev-dependencies] + [dependencies.governance-v2] path = ".." [dependencies.multiversx-sc-meta] -version = "0.44.0" +version = "0.45.1" +default-features = false diff --git a/energy-integration/governance-v2/wasm/Cargo.lock b/energy-integration/governance-v2/wasm/Cargo.lock index eb412b8c1..f3a4c9923 100644 --- a/energy-integration/governance-v2/wasm/Cargo.lock +++ b/energy-integration/governance-v2/wasm/Cargo.lock @@ -4,15 +4,22 @@ version = 3 [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if", "once_cell", "version_check", + "zerocopy", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "arrayvec" version = "0.7.4" @@ -138,11 +145,12 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", + "allocator-api2", ] [[package]] @@ -153,9 +161,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-literal" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "legacy_token_decode_module" @@ -191,9 +199,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" +checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" dependencies = [ "bitflags", "hashbrown", @@ -205,9 +213,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" +checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -215,43 +223,43 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" +checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" dependencies = [ "hex", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "multiversx-sc-derive" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" +checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" dependencies = [ "hex", "proc-macro2", "quote", "radix_trie", - "syn", + "syn 1.0.109", ] [[package]] name = "multiversx-sc-modules" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" +checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" +checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" dependencies = [ "multiversx-sc", ] @@ -351,6 +359,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "unicode-ident" version = "1.0.11" @@ -399,3 +418,23 @@ dependencies = [ "unwrappable", "week-timekeeping", ] + +[[package]] +name = "zerocopy" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] diff --git a/energy-integration/governance-v2/wasm/Cargo.toml b/energy-integration/governance-v2/wasm/Cargo.toml index f14805733..921e5bb3c 100644 --- a/energy-integration/governance-v2/wasm/Cargo.toml +++ b/energy-integration/governance-v2/wasm/Cargo.toml @@ -1,25 +1,30 @@ +# Code generated by the multiversx-sc build system. DO NOT EDIT. + +# ########################################## +# ############## AUTO-GENERATED ############# +# ########################################## + [package] name = "governance-v2-wasm" version = "0.0.0" edition = "2021" publish = false -authors = ["MultiversX "] [lib] crate-type = ["cdylib"] -[workspace] -members = ["."] - -[dev-dependencies] [profile.release] codegen-units = 1 opt-level = "z" lto = true debug = false panic = "abort" + [dependencies.governance-v2] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.44.0" +version = "=0.45.1" + +[workspace] +members = ["."] diff --git a/energy-integration/governance-v2/wasm/src/lib.rs b/energy-integration/governance-v2/wasm/src/lib.rs index efb0a10e5..dfcfc2d47 100644 --- a/energy-integration/governance-v2/wasm/src/lib.rs +++ b/energy-integration/governance-v2/wasm/src/lib.rs @@ -1,4 +1,4 @@ -// Code generated by the multiversx-sc multi-contract system. DO NOT EDIT. +// Code generated by the multiversx-sc build system. DO NOT EDIT. //////////////////////////////////////////////////// ////////////////// AUTO-GENERATED ////////////////// diff --git a/farm-staking/farm-staking-proxy/Cargo.toml b/farm-staking/farm-staking-proxy/Cargo.toml index a6c3ce176..eec567ff5 100644 --- a/farm-staking/farm-staking-proxy/Cargo.toml +++ b/farm-staking/farm-staking-proxy/Cargo.toml @@ -12,11 +12,11 @@ path = "src/lib.rs" hex-literal = "0.3.1" [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.44.0" +version = "=0.45.1" [dependencies.farm] path = "../../dex/farm" @@ -67,7 +67,7 @@ path = "../../energy-integration/common-modules/energy-query" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.44.0" +version = "=0.45.1" [dev-dependencies.farm_token] path = "../../common/modules/farm/farm_token" diff --git a/farm-staking/farm-staking-proxy/meta/Cargo.toml b/farm-staking/farm-staking-proxy/meta/Cargo.toml index bfa27096f..09920700e 100644 --- a/farm-staking/farm-staking-proxy/meta/Cargo.toml +++ b/farm-staking/farm-staking-proxy/meta/Cargo.toml @@ -6,8 +6,10 @@ publish = false authors = ["MultiversX "] [dev-dependencies] + [dependencies.farm-staking-proxy] path = ".." [dependencies.multiversx-sc-meta] -version = "0.44.0" +version = "0.45.1" +default-features = false diff --git a/farm-staking/farm-staking-proxy/wasm/Cargo.lock b/farm-staking/farm-staking-proxy/wasm/Cargo.lock index e66ae0b2c..7f875ba74 100644 --- a/farm-staking/farm-staking-proxy/wasm/Cargo.lock +++ b/farm-staking/farm-staking-proxy/wasm/Cargo.lock @@ -4,15 +4,22 @@ version = 3 [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if", "once_cell", "version_check", + "zerocopy", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "arrayvec" version = "0.7.2" @@ -220,7 +227,7 @@ dependencies = [ "farm-staking", "farm-with-locked-rewards", "fixed-supply-token", - "hex-literal", + "hex-literal 0.3.4", "mergeable", "multiversx-sc", "multiversx-sc-modules", @@ -334,11 +341,12 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", + "allocator-api2", ] [[package]] @@ -353,6 +361,12 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + [[package]] name = "itertools" version = "0.10.5" @@ -396,13 +410,13 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" +checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" dependencies = [ "bitflags", "hashbrown", - "hex-literal", + "hex-literal 0.4.1", "multiversx-sc-codec", "multiversx-sc-derive", "num-traits", @@ -410,9 +424,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" +checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -420,43 +434,43 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" +checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" dependencies = [ "hex", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-derive" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" +checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" dependencies = [ "hex", "proc-macro2", "quote", "radix_trie", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-modules" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" +checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" +checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" dependencies = [ "multiversx-sc", ] @@ -594,6 +608,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "token_merge_helper" version = "0.0.0" @@ -659,3 +684,23 @@ dependencies = [ "unwrappable", "week-timekeeping", ] + +[[package]] +name = "zerocopy" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] diff --git a/farm-staking/farm-staking-proxy/wasm/Cargo.toml b/farm-staking/farm-staking-proxy/wasm/Cargo.toml index 080d8441f..f51beedb9 100644 --- a/farm-staking/farm-staking-proxy/wasm/Cargo.toml +++ b/farm-staking/farm-staking-proxy/wasm/Cargo.toml @@ -1,25 +1,30 @@ +# Code generated by the multiversx-sc build system. DO NOT EDIT. + +# ########################################## +# ############## AUTO-GENERATED ############# +# ########################################## + [package] name = "farm-staking-proxy-wasm" version = "0.0.0" -authors = ["MultiversX "] edition = "2021" publish = false [lib] crate-type = ["cdylib"] -[workspace] -members = ["."] - -[dev-dependencies] [profile.release] codegen-units = 1 opt-level = "z" lto = true debug = false panic = "abort" + [dependencies.farm-staking-proxy] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.44.0" +version = "=0.45.1" + +[workspace] +members = ["."] diff --git a/farm-staking/farm-staking-proxy/wasm/src/lib.rs b/farm-staking/farm-staking-proxy/wasm/src/lib.rs index a9bf9ad9f..93272496c 100644 --- a/farm-staking/farm-staking-proxy/wasm/src/lib.rs +++ b/farm-staking/farm-staking-proxy/wasm/src/lib.rs @@ -1,4 +1,4 @@ -// Code generated by the multiversx-sc multi-contract system. DO NOT EDIT. +// Code generated by the multiversx-sc build system. DO NOT EDIT. //////////////////////////////////////////////////// ////////////////// AUTO-GENERATED ////////////////// diff --git a/farm-staking/farm-staking/Cargo.toml b/farm-staking/farm-staking/Cargo.toml index 40d1367fd..698f6afd1 100644 --- a/farm-staking/farm-staking/Cargo.toml +++ b/farm-staking/farm-staking/Cargo.toml @@ -7,6 +7,7 @@ publish = false [lib] path = "src/lib.rs" + [dependencies.farm] path = "../../dex/farm" @@ -77,14 +78,14 @@ path = "../../common/common_structs" path = "../../common/common_errors" [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.44.0" +version = "=0.45.1" [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.44.0" +version = "=0.45.1" diff --git a/farm-staking/farm-staking/meta/Cargo.toml b/farm-staking/farm-staking/meta/Cargo.toml index d6cd46c5e..f9fd518b0 100644 --- a/farm-staking/farm-staking/meta/Cargo.toml +++ b/farm-staking/farm-staking/meta/Cargo.toml @@ -4,8 +4,10 @@ version = "0.0.0" authors = ["MultiversX "] edition = "2021" publish = false + [dependencies.farm-staking] path = ".." [dependencies.multiversx-sc-meta] -version = "0.44.0" +version = "0.45.1" +default-features = false diff --git a/farm-staking/farm-staking/wasm/Cargo.lock b/farm-staking/farm-staking/wasm/Cargo.lock index 61af83ab8..f334f59c8 100644 --- a/farm-staking/farm-staking/wasm/Cargo.lock +++ b/farm-staking/farm-staking/wasm/Cargo.lock @@ -4,15 +4,22 @@ version = 3 [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if", "once_cell", "version_check", + "zerocopy", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "arrayvec" version = "0.7.2" @@ -280,11 +287,12 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", + "allocator-api2", ] [[package]] @@ -295,9 +303,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-literal" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "itertools" @@ -342,9 +350,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" +checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" dependencies = [ "bitflags", "hashbrown", @@ -356,9 +364,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" +checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -366,43 +374,43 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" +checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" dependencies = [ "hex", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-derive" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" +checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" dependencies = [ "hex", "proc-macro2", "quote", "radix_trie", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-modules" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" +checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" +checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" dependencies = [ "multiversx-sc", ] @@ -540,6 +548,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "token_merge_helper" version = "0.0.0" @@ -605,3 +624,23 @@ dependencies = [ "unwrappable", "week-timekeeping", ] + +[[package]] +name = "zerocopy" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] diff --git a/farm-staking/farm-staking/wasm/Cargo.toml b/farm-staking/farm-staking/wasm/Cargo.toml index 2a49b495a..5efd002d9 100644 --- a/farm-staking/farm-staking/wasm/Cargo.toml +++ b/farm-staking/farm-staking/wasm/Cargo.toml @@ -1,26 +1,30 @@ +# Code generated by the multiversx-sc build system. DO NOT EDIT. + +# ########################################## +# ############## AUTO-GENERATED ############# +# ########################################## + [package] name = "farm-staking-wasm" version = "0.0.0" -authors = ["MultiversX "] edition = "2021" publish = false [lib] crate-type = ["cdylib"] -[workspace] -members = ["."] - -[dev-dependencies] [profile.release] codegen-units = 1 opt-level = "z" lto = true debug = false panic = "abort" + [dependencies.farm-staking] -default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.44.0" +version = "=0.45.1" + +[workspace] +members = ["."] diff --git a/farm-staking/farm-staking/wasm/src/lib.rs b/farm-staking/farm-staking/wasm/src/lib.rs index 3c3946ede..b938d5475 100644 --- a/farm-staking/farm-staking/wasm/src/lib.rs +++ b/farm-staking/farm-staking/wasm/src/lib.rs @@ -1,4 +1,4 @@ -// Code generated by the multiversx-sc multi-contract system. DO NOT EDIT. +// Code generated by the multiversx-sc build system. DO NOT EDIT. //////////////////////////////////////////////////// ////////////////// AUTO-GENERATED ////////////////// diff --git a/farm-staking/metabonding-staking/Cargo.toml b/farm-staking/metabonding-staking/Cargo.toml index 789fa82e3..62be494a0 100644 --- a/farm-staking/metabonding-staking/Cargo.toml +++ b/farm-staking/metabonding-staking/Cargo.toml @@ -7,12 +7,13 @@ publish = false [lib] path = "src/lib.rs" + [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.44.0" +version = "=0.45.1" [dependencies.factory] path = "../../locked-asset/factory" @@ -21,7 +22,7 @@ path = "../../locked-asset/factory" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.44.0" +version = "=0.45.1" [dev-dependencies.common_structs] path = "../../common/common_structs" diff --git a/farm-staking/metabonding-staking/meta/Cargo.toml b/farm-staking/metabonding-staking/meta/Cargo.toml index 847b77d09..05d2a6a5e 100644 --- a/farm-staking/metabonding-staking/meta/Cargo.toml +++ b/farm-staking/metabonding-staking/meta/Cargo.toml @@ -6,8 +6,10 @@ publish = false authors = ["MultiversX "] [dev-dependencies] + [dependencies.metabonding-staking] path = ".." [dependencies.multiversx-sc-meta] -version = "0.44.0" +version = "0.45.1" +default-features = false diff --git a/farm-staking/metabonding-staking/wasm/Cargo.lock b/farm-staking/metabonding-staking/wasm/Cargo.lock index 9a9f60ae5..1d8f9f5c4 100644 --- a/farm-staking/metabonding-staking/wasm/Cargo.lock +++ b/farm-staking/metabonding-staking/wasm/Cargo.lock @@ -4,15 +4,22 @@ version = 3 [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if 1.0.0", "once_cell", "version_check", + "zerocopy", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "arrayvec" version = "0.7.2" @@ -114,11 +121,12 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", + "allocator-api2", ] [[package]] @@ -129,9 +137,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-literal" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "itertools" @@ -196,9 +204,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" +checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" dependencies = [ "bitflags", "hashbrown", @@ -210,9 +218,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" +checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -220,43 +228,43 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" +checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" dependencies = [ "hex", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-derive" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" +checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" dependencies = [ "hex", "proc-macro2", "quote", "radix_trie", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-modules" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" +checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" +checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" dependencies = [ "multiversx-sc", ] @@ -347,6 +355,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "token_merge_helper" version = "0.0.0" @@ -426,3 +445,23 @@ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "zerocopy" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] diff --git a/farm-staking/metabonding-staking/wasm/Cargo.toml b/farm-staking/metabonding-staking/wasm/Cargo.toml index 655c190d8..4892cba26 100644 --- a/farm-staking/metabonding-staking/wasm/Cargo.toml +++ b/farm-staking/metabonding-staking/wasm/Cargo.toml @@ -1,25 +1,30 @@ +# Code generated by the multiversx-sc build system. DO NOT EDIT. + +# ########################################## +# ############## AUTO-GENERATED ############# +# ########################################## + [package] name = "metabonding-staking-wasm" version = "0.0.0" -authors = ["MultiversX "] edition = "2021" publish = false [lib] crate-type = ["cdylib"] -[workspace] -members = ["."] - -[dev-dependencies] [profile.release] codegen-units = 1 opt-level = "z" lto = true debug = false panic = "abort" + [dependencies.metabonding-staking] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.44.0" +version = "=0.45.1" + +[workspace] +members = ["."] diff --git a/farm-staking/metabonding-staking/wasm/src/lib.rs b/farm-staking/metabonding-staking/wasm/src/lib.rs index 929c74ffe..8e1fcaad3 100644 --- a/farm-staking/metabonding-staking/wasm/src/lib.rs +++ b/farm-staking/metabonding-staking/wasm/src/lib.rs @@ -1,4 +1,4 @@ -// Code generated by the multiversx-sc multi-contract system. DO NOT EDIT. +// Code generated by the multiversx-sc build system. DO NOT EDIT. //////////////////////////////////////////////////// ////////////////// AUTO-GENERATED ////////////////// diff --git a/locked-asset/Cargo.toml b/locked-asset/Cargo.toml index d2e856bb7..2b1d1ee7e 100644 --- a/locked-asset/Cargo.toml +++ b/locked-asset/Cargo.toml @@ -3,8 +3,9 @@ name = "distribution-tests" version = "0.0.0" edition = "2021" publish = false + [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.farm] @@ -49,7 +50,7 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-modules] -version = "=0.44.0" +version = "=0.45.1" [dev-dependencies.multiversx-sc-scenario] -version = "=0.44.0" +version = "=0.45.1" diff --git a/locked-asset/distribution/Cargo.toml b/locked-asset/distribution/Cargo.toml index a15f30ce0..55a002c9b 100644 --- a/locked-asset/distribution/Cargo.toml +++ b/locked-asset/distribution/Cargo.toml @@ -6,6 +6,7 @@ version = "0.0.0" [lib] path = "src/lib.rs" + [dependencies.common_structs] path = "../../common/common_structs" @@ -13,7 +14,8 @@ path = "../../common/common_structs" path = "../factory" [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] + [dev-dependencies.multiversx-sc-scenario] -version = "=0.44.0" +version = "=0.45.1" diff --git a/locked-asset/distribution/meta/Cargo.toml b/locked-asset/distribution/meta/Cargo.toml index 30ef56d2d..ca97bbd66 100644 --- a/locked-asset/distribution/meta/Cargo.toml +++ b/locked-asset/distribution/meta/Cargo.toml @@ -4,8 +4,10 @@ version = "0.0.0" authors = ["MultiversX "] edition = "2021" publish = false + [dependencies.distribution] path = ".." [dependencies.multiversx-sc-meta] -version = "0.44.0" +version = "0.45.1" +default-features = false diff --git a/locked-asset/distribution/wasm/Cargo.lock b/locked-asset/distribution/wasm/Cargo.lock index 6c10d39f1..ca683518c 100644 --- a/locked-asset/distribution/wasm/Cargo.lock +++ b/locked-asset/distribution/wasm/Cargo.lock @@ -4,15 +4,22 @@ version = 3 [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if 1.0.0", "once_cell", "version_check", + "zerocopy", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "arrayvec" version = "0.7.2" @@ -131,11 +138,12 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", + "allocator-api2", ] [[package]] @@ -146,9 +154,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-literal" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "itertools" @@ -196,9 +204,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" +checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" dependencies = [ "bitflags", "hashbrown", @@ -210,9 +218,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" +checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -220,43 +228,43 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" +checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" dependencies = [ "hex", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-derive" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" +checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" dependencies = [ "hex", "proc-macro2", "quote", "radix_trie", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-modules" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" +checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" +checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" dependencies = [ "multiversx-sc", ] @@ -347,6 +355,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "token_merge_helper" version = "0.0.0" @@ -426,3 +445,23 @@ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "zerocopy" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] diff --git a/locked-asset/distribution/wasm/Cargo.toml b/locked-asset/distribution/wasm/Cargo.toml index 71b117c75..2a42ccf77 100644 --- a/locked-asset/distribution/wasm/Cargo.toml +++ b/locked-asset/distribution/wasm/Cargo.toml @@ -1,26 +1,30 @@ +# Code generated by the multiversx-sc build system. DO NOT EDIT. + +# ########################################## +# ############## AUTO-GENERATED ############# +# ########################################## + [package] name = "distribution-wasm" version = "0.0.0" -authors = ["MultiversX "] edition = "2021" publish = false [lib] crate-type = ["cdylib"] -[workspace] -members = ["."] - -[dev-dependencies] [profile.release] codegen-units = 1 opt-level = "z" lto = true debug = false panic = "abort" + [dependencies.distribution] -default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.44.0" +version = "=0.45.1" + +[workspace] +members = ["."] diff --git a/locked-asset/distribution/wasm/src/lib.rs b/locked-asset/distribution/wasm/src/lib.rs index bcc38e141..a6757be7e 100644 --- a/locked-asset/distribution/wasm/src/lib.rs +++ b/locked-asset/distribution/wasm/src/lib.rs @@ -1,4 +1,4 @@ -// Code generated by the multiversx-sc multi-contract system. DO NOT EDIT. +// Code generated by the multiversx-sc build system. DO NOT EDIT. //////////////////////////////////////////////////// ////////////////// AUTO-GENERATED ////////////////// diff --git a/locked-asset/energy-factory/Cargo.toml b/locked-asset/energy-factory/Cargo.toml index 6ac8f5e33..6a6481cbe 100644 --- a/locked-asset/energy-factory/Cargo.toml +++ b/locked-asset/energy-factory/Cargo.toml @@ -7,6 +7,7 @@ publish = false [lib] path = "src/lib.rs" + [dependencies.simple-lock] path = "../simple-lock" @@ -32,11 +33,11 @@ path = "../../common/traits/unwrappable" path = "../../common/modules/legacy_token_decode_module" [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.44.0" +version = "=0.45.1" [dev-dependencies] num-bigint = "0.4.2" @@ -44,4 +45,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.44.0" +version = "=0.45.1" diff --git a/locked-asset/energy-factory/meta/Cargo.toml b/locked-asset/energy-factory/meta/Cargo.toml index dd63568c2..38b2c2110 100644 --- a/locked-asset/energy-factory/meta/Cargo.toml +++ b/locked-asset/energy-factory/meta/Cargo.toml @@ -6,8 +6,10 @@ publish = false authors = ["MultiversX "] [dev-dependencies] + [dependencies.energy-factory] path = ".." [dependencies.multiversx-sc-meta] -version = "0.44.0" +version = "0.45.1" +default-features = false diff --git a/locked-asset/energy-factory/wasm/Cargo.lock b/locked-asset/energy-factory/wasm/Cargo.lock index 13e9713f7..f3c21cf5b 100644 --- a/locked-asset/energy-factory/wasm/Cargo.lock +++ b/locked-asset/energy-factory/wasm/Cargo.lock @@ -4,15 +4,22 @@ version = 3 [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if", "once_cell", "version_check", + "zerocopy", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "arrayvec" version = "0.7.2" @@ -94,11 +101,12 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", + "allocator-api2", ] [[package]] @@ -109,9 +117,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-literal" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "legacy_token_decode_module" @@ -138,9 +146,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" +checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" dependencies = [ "bitflags", "hashbrown", @@ -152,9 +160,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" +checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -162,43 +170,43 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" +checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" dependencies = [ "hex", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-derive" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" +checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" dependencies = [ "hex", "proc-macro2", "quote", "radix_trie", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-modules" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" +checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" +checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" dependencies = [ "multiversx-sc", ] @@ -289,6 +297,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "unicode-ident" version = "1.0.6" @@ -317,3 +336,23 @@ name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "zerocopy" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] diff --git a/locked-asset/energy-factory/wasm/Cargo.toml b/locked-asset/energy-factory/wasm/Cargo.toml index fcb22bfb0..9a42dad09 100644 --- a/locked-asset/energy-factory/wasm/Cargo.toml +++ b/locked-asset/energy-factory/wasm/Cargo.toml @@ -1,25 +1,30 @@ +# Code generated by the multiversx-sc build system. DO NOT EDIT. + +# ########################################## +# ############## AUTO-GENERATED ############# +# ########################################## + [package] name = "energy-factory-wasm" version = "0.0.0" -authors = ["MultiversX "] edition = "2021" publish = false [lib] crate-type = ["cdylib"] -[workspace] -members = ["."] - -[dev-dependencies] [profile.release] codegen-units = 1 opt-level = "z" lto = true debug = false panic = "abort" + [dependencies.energy-factory] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.44.0" +version = "=0.45.1" + +[workspace] +members = ["."] diff --git a/locked-asset/energy-factory/wasm/src/lib.rs b/locked-asset/energy-factory/wasm/src/lib.rs index a116e6ce7..a96da35ba 100644 --- a/locked-asset/energy-factory/wasm/src/lib.rs +++ b/locked-asset/energy-factory/wasm/src/lib.rs @@ -1,4 +1,4 @@ -// Code generated by the multiversx-sc multi-contract system. DO NOT EDIT. +// Code generated by the multiversx-sc build system. DO NOT EDIT. //////////////////////////////////////////////////// ////////////////// AUTO-GENERATED ////////////////// diff --git a/locked-asset/factory/Cargo.toml b/locked-asset/factory/Cargo.toml index f513c5e57..b1f626e2a 100644 --- a/locked-asset/factory/Cargo.toml +++ b/locked-asset/factory/Cargo.toml @@ -26,11 +26,11 @@ path = "../../common/modules/token_merge_helper" path = "../energy-factory" [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.44.0" +version = "=0.45.1" [dependencies.arrayvec] version = "0.7.1" @@ -49,4 +49,4 @@ hex = "0.4" path = "../simple-lock" [dev-dependencies.multiversx-sc-scenario] -version = "=0.44.0" +version = "=0.45.1" diff --git a/locked-asset/factory/meta/Cargo.toml b/locked-asset/factory/meta/Cargo.toml index ae59970a1..2ab3634ab 100644 --- a/locked-asset/factory/meta/Cargo.toml +++ b/locked-asset/factory/meta/Cargo.toml @@ -4,8 +4,10 @@ version = "0.0.0" authors = ["MultiversX "] edition = "2021" publish = false + [dependencies.factory] path = ".." [dependencies.multiversx-sc-meta] -version = "0.44.0" +version = "0.45.1" +default-features = false diff --git a/locked-asset/factory/wasm/Cargo.lock b/locked-asset/factory/wasm/Cargo.lock index 850e59d80..fd3099779 100644 --- a/locked-asset/factory/wasm/Cargo.lock +++ b/locked-asset/factory/wasm/Cargo.lock @@ -4,15 +4,22 @@ version = 3 [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if 1.0.0", "once_cell", "version_check", + "zerocopy", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "arrayvec" version = "0.7.2" @@ -122,11 +129,12 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", + "allocator-api2", ] [[package]] @@ -137,9 +145,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-literal" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "itertools" @@ -187,9 +195,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" +checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" dependencies = [ "bitflags", "hashbrown", @@ -201,9 +209,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" +checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -211,43 +219,43 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" +checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" dependencies = [ "hex", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-derive" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" +checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" dependencies = [ "hex", "proc-macro2", "quote", "radix_trie", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-modules" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" +checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" +checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" dependencies = [ "multiversx-sc", ] @@ -338,6 +346,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "token_merge_helper" version = "0.0.0" @@ -417,3 +436,23 @@ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "zerocopy" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] diff --git a/locked-asset/factory/wasm/Cargo.toml b/locked-asset/factory/wasm/Cargo.toml index 3c22e1cb5..36ddee8d1 100644 --- a/locked-asset/factory/wasm/Cargo.toml +++ b/locked-asset/factory/wasm/Cargo.toml @@ -1,26 +1,30 @@ +# Code generated by the multiversx-sc build system. DO NOT EDIT. + +# ########################################## +# ############## AUTO-GENERATED ############# +# ########################################## + [package] name = "factory-wasm" version = "0.0.0" -authors = ["MultiversX "] edition = "2021" publish = false [lib] crate-type = ["cdylib"] -[workspace] -members = ["."] - -[dev-dependencies] [profile.release] codegen-units = 1 opt-level = "z" lto = true debug = false panic = "abort" + [dependencies.factory] -default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.44.0" +version = "=0.45.1" + +[workspace] +members = ["."] diff --git a/locked-asset/factory/wasm/src/lib.rs b/locked-asset/factory/wasm/src/lib.rs index cfff38be7..2cfab5356 100644 --- a/locked-asset/factory/wasm/src/lib.rs +++ b/locked-asset/factory/wasm/src/lib.rs @@ -1,4 +1,4 @@ -// Code generated by the multiversx-sc multi-contract system. DO NOT EDIT. +// Code generated by the multiversx-sc build system. DO NOT EDIT. //////////////////////////////////////////////////// ////////////////// AUTO-GENERATED ////////////////// diff --git a/locked-asset/lkmex-transfer/Cargo.toml b/locked-asset/lkmex-transfer/Cargo.toml index abb39fa97..f2ff5729c 100644 --- a/locked-asset/lkmex-transfer/Cargo.toml +++ b/locked-asset/lkmex-transfer/Cargo.toml @@ -7,6 +7,7 @@ publish = false [lib] path = "src/lib.rs" + [dependencies.common_structs] path = "../../common/common_structs" @@ -29,14 +30,14 @@ path = "../energy-factory" path = "../../energy-integration/common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.44.0" +version = "=0.45.1" [dev-dependencies.multiversx-sc-modules] -version = "=0.44.0" +version = "=0.45.1" diff --git a/locked-asset/lkmex-transfer/meta/Cargo.toml b/locked-asset/lkmex-transfer/meta/Cargo.toml index 52865b0ee..558b01a51 100644 --- a/locked-asset/lkmex-transfer/meta/Cargo.toml +++ b/locked-asset/lkmex-transfer/meta/Cargo.toml @@ -4,8 +4,10 @@ version = "0.0.0" authors = ["MultiversX "] edition = "2021" publish = false + [dependencies.lkmex-transfer] path = ".." [dependencies.multiversx-sc-meta] -version = "0.44.0" +version = "0.45.1" +default-features = false diff --git a/locked-asset/lkmex-transfer/wasm/Cargo.lock b/locked-asset/lkmex-transfer/wasm/Cargo.lock index 670c79e98..a2f435976 100644 --- a/locked-asset/lkmex-transfer/wasm/Cargo.lock +++ b/locked-asset/lkmex-transfer/wasm/Cargo.lock @@ -4,15 +4,22 @@ version = 3 [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if", "once_cell", "version_check", + "zerocopy", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "arrayvec" version = "0.7.2" @@ -94,11 +101,12 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", + "allocator-api2", ] [[package]] @@ -109,9 +117,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-literal" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "legacy_token_decode_module" @@ -160,9 +168,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" +checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" dependencies = [ "bitflags", "hashbrown", @@ -174,9 +182,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" +checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -184,43 +192,43 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" +checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" dependencies = [ "hex", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-derive" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" +checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" dependencies = [ "hex", "proc-macro2", "quote", "radix_trie", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-modules" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" +checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" +checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" dependencies = [ "multiversx-sc", ] @@ -320,6 +328,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "unicode-ident" version = "1.0.6" @@ -348,3 +367,23 @@ name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "zerocopy" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] diff --git a/locked-asset/lkmex-transfer/wasm/Cargo.toml b/locked-asset/lkmex-transfer/wasm/Cargo.toml index 824aef74a..a6f1f4950 100644 --- a/locked-asset/lkmex-transfer/wasm/Cargo.toml +++ b/locked-asset/lkmex-transfer/wasm/Cargo.toml @@ -1,26 +1,30 @@ +# Code generated by the multiversx-sc build system. DO NOT EDIT. + +# ########################################## +# ############## AUTO-GENERATED ############# +# ########################################## + [package] name = "lkmex-transfer-wasm" version = "0.0.0" -authors = ["MultiversX "] edition = "2021" publish = false [lib] crate-type = ["cdylib"] -[workspace] -members = ["."] - -[dev-dependencies] [profile.release] codegen-units = 1 opt-level = "z" lto = true debug = false panic = "abort" + [dependencies.lkmex-transfer] -default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.44.0" +version = "=0.45.1" + +[workspace] +members = ["."] diff --git a/locked-asset/lkmex-transfer/wasm/src/lib.rs b/locked-asset/lkmex-transfer/wasm/src/lib.rs index c7eb21c2e..4cd5ab561 100644 --- a/locked-asset/lkmex-transfer/wasm/src/lib.rs +++ b/locked-asset/lkmex-transfer/wasm/src/lib.rs @@ -1,4 +1,4 @@ -// Code generated by the multiversx-sc multi-contract system. DO NOT EDIT. +// Code generated by the multiversx-sc build system. DO NOT EDIT. //////////////////////////////////////////////////// ////////////////// AUTO-GENERATED ////////////////// diff --git a/locked-asset/locked-token-wrapper/Cargo.toml b/locked-asset/locked-token-wrapper/Cargo.toml index 6e6b793a5..a9cfbcf02 100644 --- a/locked-asset/locked-token-wrapper/Cargo.toml +++ b/locked-asset/locked-token-wrapper/Cargo.toml @@ -7,11 +7,12 @@ publish = false [lib] path = "src/lib.rs" + [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" [dependencies.multiversx-sc-modules] -version = "=0.44.0" +version = "=0.45.1" [dependencies.utils] path = "../../common/modules/utils" @@ -43,4 +44,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.44.0" +version = "=0.45.1" diff --git a/locked-asset/locked-token-wrapper/meta/Cargo.toml b/locked-asset/locked-token-wrapper/meta/Cargo.toml index 757968c19..8054e27a1 100644 --- a/locked-asset/locked-token-wrapper/meta/Cargo.toml +++ b/locked-asset/locked-token-wrapper/meta/Cargo.toml @@ -6,8 +6,10 @@ publish = false authors = ["MultiversX "] [dev-dependencies] + [dependencies.locked-token-wrapper] path = ".." [dependencies.multiversx-sc-meta] -version = "0.44.0" +version = "0.45.1" +default-features = false diff --git a/locked-asset/locked-token-wrapper/wasm/Cargo.lock b/locked-asset/locked-token-wrapper/wasm/Cargo.lock index 58cbacca2..0b9f3ecc8 100644 --- a/locked-asset/locked-token-wrapper/wasm/Cargo.lock +++ b/locked-asset/locked-token-wrapper/wasm/Cargo.lock @@ -4,15 +4,22 @@ version = 3 [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if", "once_cell", "version_check", + "zerocopy", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "arrayvec" version = "0.7.2" @@ -102,11 +109,12 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", + "allocator-api2", ] [[package]] @@ -117,9 +125,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-literal" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "legacy_token_decode_module" @@ -184,9 +192,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" +checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" dependencies = [ "bitflags", "hashbrown", @@ -198,9 +206,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" +checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -208,43 +216,43 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" +checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" dependencies = [ "hex", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-derive" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" +checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" dependencies = [ "hex", "proc-macro2", "quote", "radix_trie", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-modules" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" +checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" +checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" dependencies = [ "multiversx-sc", ] @@ -344,6 +352,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "unicode-ident" version = "1.0.6" @@ -372,3 +391,23 @@ name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "zerocopy" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] diff --git a/locked-asset/locked-token-wrapper/wasm/Cargo.toml b/locked-asset/locked-token-wrapper/wasm/Cargo.toml index 627c55b94..0b59c9c35 100644 --- a/locked-asset/locked-token-wrapper/wasm/Cargo.toml +++ b/locked-asset/locked-token-wrapper/wasm/Cargo.toml @@ -1,25 +1,30 @@ +# Code generated by the multiversx-sc build system. DO NOT EDIT. + +# ########################################## +# ############## AUTO-GENERATED ############# +# ########################################## + [package] name = "locked-token-wrapper-wasm" version = "0.0.0" -authors = ["MultiversX "] edition = "2021" publish = false [lib] crate-type = ["cdylib"] -[workspace] -members = ["."] - -[dev-dependencies] [profile.release] codegen-units = 1 opt-level = "z" lto = true debug = false panic = "abort" + [dependencies.locked-token-wrapper] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.44.0" +version = "=0.45.1" + +[workspace] +members = ["."] diff --git a/locked-asset/locked-token-wrapper/wasm/src/lib.rs b/locked-asset/locked-token-wrapper/wasm/src/lib.rs index 9d0073791..ad8d060c2 100644 --- a/locked-asset/locked-token-wrapper/wasm/src/lib.rs +++ b/locked-asset/locked-token-wrapper/wasm/src/lib.rs @@ -1,4 +1,4 @@ -// Code generated by the multiversx-sc multi-contract system. DO NOT EDIT. +// Code generated by the multiversx-sc build system. DO NOT EDIT. //////////////////////////////////////////////////// ////////////////// AUTO-GENERATED ////////////////// diff --git a/locked-asset/proxy_dex/Cargo.toml b/locked-asset/proxy_dex/Cargo.toml index 1ffbd2439..fc148b824 100644 --- a/locked-asset/proxy_dex/Cargo.toml +++ b/locked-asset/proxy_dex/Cargo.toml @@ -6,6 +6,7 @@ publish = false [lib] path = "src/lib.rs" + [dependencies.common_structs] path = "../../common/common_structs" @@ -44,11 +45,11 @@ path = "../../common/traits/mergeable" path = "../../common/traits/fixed-supply-token" [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.44.0" +version = "=0.45.1" [dependencies.energy-factory] path = "../energy-factory" @@ -68,7 +69,7 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.44.0" +version = "=0.45.1" [dev-dependencies.pausable] path = "../../common/modules/pausable" diff --git a/locked-asset/proxy_dex/meta/Cargo.toml b/locked-asset/proxy_dex/meta/Cargo.toml index 2d3ef8dea..b5e0da267 100644 --- a/locked-asset/proxy_dex/meta/Cargo.toml +++ b/locked-asset/proxy_dex/meta/Cargo.toml @@ -4,8 +4,10 @@ version = "0.0.0" authors = ["MultiversX "] edition = "2021" publish = false + [dependencies.proxy_dex] path = ".." [dependencies.multiversx-sc-meta] -version = "0.44.0" +version = "0.45.1" +default-features = false diff --git a/locked-asset/proxy_dex/wasm/Cargo.lock b/locked-asset/proxy_dex/wasm/Cargo.lock index cb086aad0..cc318a570 100644 --- a/locked-asset/proxy_dex/wasm/Cargo.lock +++ b/locked-asset/proxy_dex/wasm/Cargo.lock @@ -4,15 +4,22 @@ version = 3 [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if", "once_cell", "version_check", + "zerocopy", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "arrayvec" version = "0.7.2" @@ -271,11 +278,12 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", + "allocator-api2", ] [[package]] @@ -286,9 +294,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-literal" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "itertools" @@ -333,9 +341,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" +checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" dependencies = [ "bitflags", "hashbrown", @@ -347,9 +355,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" +checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -357,43 +365,43 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" +checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" dependencies = [ "hex", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-derive" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" +checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" dependencies = [ "hex", "proc-macro2", "quote", "radix_trie", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-modules" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" +checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" +checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" dependencies = [ "multiversx-sc", ] @@ -563,6 +571,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "token_merge_helper" version = "0.0.0" @@ -628,3 +647,23 @@ dependencies = [ "unwrappable", "week-timekeeping", ] + +[[package]] +name = "zerocopy" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] diff --git a/locked-asset/proxy_dex/wasm/Cargo.toml b/locked-asset/proxy_dex/wasm/Cargo.toml index 8da106653..f27fdd7ee 100644 --- a/locked-asset/proxy_dex/wasm/Cargo.toml +++ b/locked-asset/proxy_dex/wasm/Cargo.toml @@ -1,26 +1,30 @@ +# Code generated by the multiversx-sc build system. DO NOT EDIT. + +# ########################################## +# ############## AUTO-GENERATED ############# +# ########################################## + [package] name = "proxy_dex-wasm" version = "0.0.0" -authors = ["MultiversX "] edition = "2021" publish = false [lib] crate-type = ["cdylib"] -[workspace] -members = ["."] - -[dev-dependencies] [profile.release] codegen-units = 1 opt-level = "z" lto = true debug = false panic = "abort" + [dependencies.proxy_dex] -default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.44.0" +version = "=0.45.1" + +[workspace] +members = ["."] diff --git a/locked-asset/proxy_dex/wasm/src/lib.rs b/locked-asset/proxy_dex/wasm/src/lib.rs index 5ffdc8d79..8fc9b2c67 100644 --- a/locked-asset/proxy_dex/wasm/src/lib.rs +++ b/locked-asset/proxy_dex/wasm/src/lib.rs @@ -1,4 +1,4 @@ -// Code generated by the multiversx-sc multi-contract system. DO NOT EDIT. +// Code generated by the multiversx-sc build system. DO NOT EDIT. //////////////////////////////////////////////////// ////////////////// AUTO-GENERATED ////////////////// diff --git a/locked-asset/simple-lock-whitelist/Cargo.toml b/locked-asset/simple-lock-whitelist/Cargo.toml index 66f7bcc4b..d424146c9 100644 --- a/locked-asset/simple-lock-whitelist/Cargo.toml +++ b/locked-asset/simple-lock-whitelist/Cargo.toml @@ -7,6 +7,7 @@ publish = false [lib] path = "src/lib.rs" + [dependencies.simple-lock] path = "../simple-lock" @@ -14,11 +15,11 @@ path = "../simple-lock" path = "../../common/modules/utils" [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.44.0" +version = "=0.45.1" [dev-dependencies] num-bigint = "0.4.2" @@ -26,4 +27,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.44.0" +version = "=0.45.1" diff --git a/locked-asset/simple-lock-whitelist/meta/Cargo.toml b/locked-asset/simple-lock-whitelist/meta/Cargo.toml index 45465ec56..68bf43ce6 100644 --- a/locked-asset/simple-lock-whitelist/meta/Cargo.toml +++ b/locked-asset/simple-lock-whitelist/meta/Cargo.toml @@ -4,8 +4,10 @@ version = "0.0.0" edition = "2021" publish = false authors = ["Dorin Iancu "] + [dependencies.simple-lock-whitelist] path = ".." [dependencies.multiversx-sc-meta] -version = "0.44.0" +version = "0.45.1" +default-features = false diff --git a/locked-asset/simple-lock-whitelist/wasm/Cargo.lock b/locked-asset/simple-lock-whitelist/wasm/Cargo.lock index 57b4462d0..d8716714d 100644 --- a/locked-asset/simple-lock-whitelist/wasm/Cargo.lock +++ b/locked-asset/simple-lock-whitelist/wasm/Cargo.lock @@ -4,15 +4,22 @@ version = 3 [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if", "once_cell", "version_check", + "zerocopy", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "arrayvec" version = "0.7.2" @@ -63,11 +70,12 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", + "allocator-api2", ] [[package]] @@ -78,9 +86,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-literal" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "math" @@ -98,9 +106,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" +checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" dependencies = [ "bitflags", "hashbrown", @@ -112,9 +120,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" +checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -122,43 +130,43 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" +checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" dependencies = [ "hex", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-derive" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" +checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" dependencies = [ "hex", "proc-macro2", "quote", "radix_trie", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-modules" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" +checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" +checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" dependencies = [ "multiversx-sc", ] @@ -259,6 +267,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "unicode-ident" version = "1.0.6" @@ -287,3 +306,23 @@ name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "zerocopy" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] diff --git a/locked-asset/simple-lock-whitelist/wasm/Cargo.toml b/locked-asset/simple-lock-whitelist/wasm/Cargo.toml index acc47027b..cfc170d6c 100644 --- a/locked-asset/simple-lock-whitelist/wasm/Cargo.toml +++ b/locked-asset/simple-lock-whitelist/wasm/Cargo.toml @@ -1,25 +1,30 @@ +# Code generated by the multiversx-sc build system. DO NOT EDIT. + +# ########################################## +# ############## AUTO-GENERATED ############# +# ########################################## + [package] name = "simple-lock-whitelist-wasm" version = "0.0.0" -authors = ["Dorin Iancu "] edition = "2021" publish = false [lib] crate-type = ["cdylib"] -[workspace] -members = ["."] - -[dev-dependencies] [profile.release] codegen-units = 1 opt-level = "z" lto = true debug = false panic = "abort" + [dependencies.simple-lock-whitelist] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.44.0" +version = "=0.45.1" + +[workspace] +members = ["."] diff --git a/locked-asset/simple-lock-whitelist/wasm/src/lib.rs b/locked-asset/simple-lock-whitelist/wasm/src/lib.rs index efc26b739..440806734 100644 --- a/locked-asset/simple-lock-whitelist/wasm/src/lib.rs +++ b/locked-asset/simple-lock-whitelist/wasm/src/lib.rs @@ -1,4 +1,4 @@ -// Code generated by the multiversx-sc multi-contract system. DO NOT EDIT. +// Code generated by the multiversx-sc build system. DO NOT EDIT. //////////////////////////////////////////////////// ////////////////// AUTO-GENERATED ////////////////// diff --git a/locked-asset/simple-lock/Cargo.toml b/locked-asset/simple-lock/Cargo.toml index 0e95b6dfc..21ee4bd8b 100644 --- a/locked-asset/simple-lock/Cargo.toml +++ b/locked-asset/simple-lock/Cargo.toml @@ -7,12 +7,13 @@ publish = false [lib] path = "src/lib.rs" + [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.44.0" +version = "=0.45.1" [dependencies.common_structs] path = "../../common/common_structs" @@ -23,4 +24,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.44.0" +version = "=0.45.1" diff --git a/locked-asset/simple-lock/meta/Cargo.toml b/locked-asset/simple-lock/meta/Cargo.toml index fe846129c..cdd8ad123 100644 --- a/locked-asset/simple-lock/meta/Cargo.toml +++ b/locked-asset/simple-lock/meta/Cargo.toml @@ -4,8 +4,10 @@ version = "0.0.0" edition = "2021" publish = false authors = ["Dorin Iancu "] + [dependencies.simple-lock] path = ".." [dependencies.multiversx-sc-meta] -version = "0.44.0" +version = "0.45.1" +default-features = false diff --git a/locked-asset/simple-lock/wasm/Cargo.lock b/locked-asset/simple-lock/wasm/Cargo.lock index 644ec86c6..1bf159055 100644 --- a/locked-asset/simple-lock/wasm/Cargo.lock +++ b/locked-asset/simple-lock/wasm/Cargo.lock @@ -4,15 +4,22 @@ version = 3 [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if", "once_cell", "version_check", + "zerocopy", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "arrayvec" version = "0.7.2" @@ -63,11 +70,12 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", + "allocator-api2", ] [[package]] @@ -78,9 +86,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-literal" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "math" @@ -98,9 +106,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" +checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" dependencies = [ "bitflags", "hashbrown", @@ -112,9 +120,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" +checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -122,43 +130,43 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" +checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" dependencies = [ "hex", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-derive" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" +checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" dependencies = [ "hex", "proc-macro2", "quote", "radix_trie", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-modules" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" +checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" +checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" dependencies = [ "multiversx-sc", ] @@ -249,6 +257,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "unicode-ident" version = "1.0.6" @@ -267,3 +286,23 @@ name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "zerocopy" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] diff --git a/locked-asset/simple-lock/wasm/Cargo.toml b/locked-asset/simple-lock/wasm/Cargo.toml index 49ab66c07..a5b7ca6d7 100644 --- a/locked-asset/simple-lock/wasm/Cargo.toml +++ b/locked-asset/simple-lock/wasm/Cargo.toml @@ -1,25 +1,30 @@ +# Code generated by the multiversx-sc build system. DO NOT EDIT. + +# ########################################## +# ############## AUTO-GENERATED ############# +# ########################################## + [package] name = "simple-lock-wasm" version = "0.0.0" -authors = ["Dorin Iancu "] edition = "2021" publish = false [lib] crate-type = ["cdylib"] -[workspace] -members = ["."] - -[dev-dependencies] [profile.release] codegen-units = 1 opt-level = "z" lto = true debug = false panic = "abort" + [dependencies.simple-lock] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.44.0" +version = "=0.45.1" + +[workspace] +members = ["."] diff --git a/locked-asset/simple-lock/wasm/src/lib.rs b/locked-asset/simple-lock/wasm/src/lib.rs index c416ef0e6..0d610b3bc 100644 --- a/locked-asset/simple-lock/wasm/src/lib.rs +++ b/locked-asset/simple-lock/wasm/src/lib.rs @@ -1,4 +1,4 @@ -// Code generated by the multiversx-sc multi-contract system. DO NOT EDIT. +// Code generated by the multiversx-sc build system. DO NOT EDIT. //////////////////////////////////////////////////// ////////////////// AUTO-GENERATED ////////////////// diff --git a/locked-asset/token-unstake/Cargo.toml b/locked-asset/token-unstake/Cargo.toml index 4741e1602..7f564e0e5 100644 --- a/locked-asset/token-unstake/Cargo.toml +++ b/locked-asset/token-unstake/Cargo.toml @@ -7,8 +7,9 @@ publish = false [lib] path = "src/lib.rs" + [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.mergeable] @@ -38,7 +39,7 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.44.0" +version = "=0.45.1" [dev-dependencies.multiversx-sc-modules] -version = "=0.44.0" +version = "=0.45.1" diff --git a/locked-asset/token-unstake/meta/Cargo.toml b/locked-asset/token-unstake/meta/Cargo.toml index bcb227c50..073670290 100644 --- a/locked-asset/token-unstake/meta/Cargo.toml +++ b/locked-asset/token-unstake/meta/Cargo.toml @@ -4,8 +4,10 @@ version = "0.0.0" authors = ["MultiversX "] edition = "2021" publish = false + [dependencies.token-unstake] path = ".." [dependencies.multiversx-sc-meta] -version = "0.44.0" +version = "0.45.1" +default-features = false diff --git a/locked-asset/token-unstake/wasm/Cargo.lock b/locked-asset/token-unstake/wasm/Cargo.lock index 2f279db4b..a714cb288 100644 --- a/locked-asset/token-unstake/wasm/Cargo.lock +++ b/locked-asset/token-unstake/wasm/Cargo.lock @@ -4,15 +4,22 @@ version = 3 [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if", "once_cell", "version_check", + "zerocopy", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "arrayvec" version = "0.7.2" @@ -101,11 +108,12 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", + "allocator-api2", ] [[package]] @@ -116,9 +124,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-literal" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "legacy_token_decode_module" @@ -145,9 +153,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" +checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" dependencies = [ "bitflags", "hashbrown", @@ -159,9 +167,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" +checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -169,43 +177,43 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" +checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" dependencies = [ "hex", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-derive" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" +checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" dependencies = [ "hex", "proc-macro2", "quote", "radix_trie", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-modules" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" +checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" +checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" dependencies = [ "multiversx-sc", ] @@ -296,6 +304,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "token-unstake" version = "0.0.0" @@ -354,3 +373,23 @@ dependencies = [ "common-types", "multiversx-sc", ] + +[[package]] +name = "zerocopy" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] diff --git a/locked-asset/token-unstake/wasm/Cargo.toml b/locked-asset/token-unstake/wasm/Cargo.toml index 8411d3ccb..e53c1c314 100644 --- a/locked-asset/token-unstake/wasm/Cargo.toml +++ b/locked-asset/token-unstake/wasm/Cargo.toml @@ -1,26 +1,30 @@ +# Code generated by the multiversx-sc build system. DO NOT EDIT. + +# ########################################## +# ############## AUTO-GENERATED ############# +# ########################################## + [package] name = "token-unstake-wasm" version = "0.0.0" -authors = ["MultiversX "] edition = "2021" publish = false [lib] crate-type = ["cdylib"] -[workspace] -members = ["."] - -[dev-dependencies] [profile.release] codegen-units = 1 opt-level = "z" lto = true debug = false panic = "abort" + [dependencies.token-unstake] -default-features = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.44.0" +version = "=0.45.1" + +[workspace] +members = ["."] diff --git a/locked-asset/token-unstake/wasm/src/lib.rs b/locked-asset/token-unstake/wasm/src/lib.rs index b508d164c..b46a23840 100644 --- a/locked-asset/token-unstake/wasm/src/lib.rs +++ b/locked-asset/token-unstake/wasm/src/lib.rs @@ -1,4 +1,4 @@ -// Code generated by the multiversx-sc multi-contract system. DO NOT EDIT. +// Code generated by the multiversx-sc build system. DO NOT EDIT. //////////////////////////////////////////////////// ////////////////// AUTO-GENERATED ////////////////// diff --git a/pause-all/Cargo.toml b/pause-all/Cargo.toml index 193baee17..808df9824 100644 --- a/pause-all/Cargo.toml +++ b/pause-all/Cargo.toml @@ -7,17 +7,19 @@ publish = false [lib] path = "src/lib.rs" + [dependencies.pausable] path = "../common/modules/pausable" [dependencies.multiversx-sc] -version = "=0.44.0" +version = "=0.45.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.44.0" +version = "=0.45.1" + [dev-dependencies.multiversx-sc-scenario] -version = "=0.44.0" +version = "=0.45.1" [dev-dependencies.farm] path = "../dex/farm" diff --git a/pause-all/meta/Cargo.toml b/pause-all/meta/Cargo.toml index b03137124..e3513c084 100644 --- a/pause-all/meta/Cargo.toml +++ b/pause-all/meta/Cargo.toml @@ -6,8 +6,10 @@ publish = false authors = ["MultiversX "] [dev-dependencies] + [dependencies.pause-all] path = ".." [dependencies.multiversx-sc-meta] -version = "0.44.0" +version = "0.45.1" +default-features = false diff --git a/pause-all/wasm/Cargo.lock b/pause-all/wasm/Cargo.lock index 9114f573f..3afdd10cb 100644 --- a/pause-all/wasm/Cargo.lock +++ b/pause-all/wasm/Cargo.lock @@ -4,15 +4,22 @@ version = 3 [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if", "once_cell", "version_check", + "zerocopy", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "arrayvec" version = "0.7.2" @@ -52,11 +59,12 @@ checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", + "allocator-api2", ] [[package]] @@ -67,15 +75,15 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-literal" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "multiversx-sc" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6c3347b9ebfa2886c866b7740dbeac14d087accd52ec0e71961d54508e819b" +checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" dependencies = [ "bitflags", "hashbrown", @@ -87,9 +95,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e15b46c17b87c0c7cdd79b041a4abd7f3a2b45f3c993f6ce38c0f233e82b6" +checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -97,43 +105,43 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a7bc0762cd6d88f8bc54805bc652b042a61cd7fbc2d0a325010f088b78fb2ac" +checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" dependencies = [ "hex", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-derive" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7624ccef17a2378fb5d5d741497d224ee1650b90504d57988c1fa648f374a5" +checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" dependencies = [ "hex", "proc-macro2", "quote", "radix_trie", - "syn", + "syn 1.0.107", ] [[package]] name = "multiversx-sc-modules" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb542d310c66d72c0c9cab6cc78f0750322b76cd074b88d9f84fcbc42d62893d" +checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.44.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25a23b0a10bf77174c11178d510555cc875e1f557d4256cbbe4d9c2dbf60d00d" +checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" dependencies = [ "multiversx-sc", ] @@ -241,6 +249,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "unicode-ident" version = "1.0.6" @@ -252,3 +271,23 @@ name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "zerocopy" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] diff --git a/pause-all/wasm/Cargo.toml b/pause-all/wasm/Cargo.toml index a82c6c8d1..b6d43fef6 100644 --- a/pause-all/wasm/Cargo.toml +++ b/pause-all/wasm/Cargo.toml @@ -1,25 +1,30 @@ +# Code generated by the multiversx-sc build system. DO NOT EDIT. + +# ########################################## +# ############## AUTO-GENERATED ############# +# ########################################## + [package] name = "pause-all-wasm" version = "0.0.0" edition = "2021" publish = false -authors = ["MultiversX "] [lib] crate-type = ["cdylib"] -[workspace] -members = ["."] - -[dev-dependencies] [profile.release] codegen-units = 1 opt-level = "z" lto = true debug = false panic = "abort" + [dependencies.pause-all] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.44.0" +version = "=0.45.1" + +[workspace] +members = ["."] diff --git a/pause-all/wasm/src/lib.rs b/pause-all/wasm/src/lib.rs index d181e94e8..d8a4c88c3 100644 --- a/pause-all/wasm/src/lib.rs +++ b/pause-all/wasm/src/lib.rs @@ -1,4 +1,4 @@ -// Code generated by the multiversx-sc multi-contract system. DO NOT EDIT. +// Code generated by the multiversx-sc build system. DO NOT EDIT. //////////////////////////////////////////////////// ////////////////// AUTO-GENERATED ////////////////// From b9f5d2df97b9b722c53143fff399a3796fbb8cd7 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Mon, 27 Nov 2023 14:43:32 +0200 Subject: [PATCH 133/213] dex test update --- dex/scenarios/upgrade_contract.scen.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dex/scenarios/upgrade_contract.scen.json b/dex/scenarios/upgrade_contract.scen.json index b895f78f4..cdadc752b 100644 --- a/dex/scenarios/upgrade_contract.scen.json +++ b/dex/scenarios/upgrade_contract.scen.json @@ -16,7 +16,7 @@ "str:ALC-abcdef", "str:WEGLD-abcdef", "0x0000000000000000000000000000000000000000000000000000000000000000", - "301", + "300", "100" ], "gasLimit": "1,000,000,000", @@ -38,7 +38,7 @@ "balance": "*", "esdt": "*", "storage": { - "str:total_fee_percent": "301", + "str:total_fee_percent": "300", "+": "" }, "code": "file:../pair/output/pair.wasm" From 445a4662a71c481950daf16759eea26e82a68506 Mon Sep 17 00:00:00 2001 From: ovidiuolteanu Date: Mon, 4 Dec 2023 15:56:21 +0200 Subject: [PATCH 134/213] usage of latest actions versions --- .github/workflows/actions.yml | 2 +- .github/workflows/release.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index c5fdba201..a5b84de9a 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -20,7 +20,7 @@ permissions: jobs: contracts: name: Contracts - uses: multiversx/mx-sc-actions/.github/workflows/contracts.yml@v2.3.1 + uses: multiversx/mx-sc-actions/.github/workflows/contracts.yml@v2.3.3 with: rust-toolchain: nightly-2023-05-26 vmtools-version: v1.4.60 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6c10eb4fe..34bccc0cd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,7 +9,7 @@ permissions: jobs: build: - uses: multiversx/mx-sc-actions/.github/workflows/reproducible-build.yml@v2.3.1 + uses: multiversx/mx-sc-actions/.github/workflows/reproducible-build.yml@v2.3.3 with: - image_tag: v5.2.0 + image_tag: v5.3.0 attach_to_existing_release: true From 26607bd71aec9303891c3a65b2e0be53bd2bfaf4 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Thu, 7 Dec 2023 16:22:35 +0200 Subject: [PATCH 135/213] Add claimBoostedRewards endpoint in Fees Collector --- energy-integration/fees-collector/src/lib.rs | 29 ++++++++++++++++--- .../tests/fees_collector_test_setup/mod.rs | 4 +-- .../fees-collector/wasm/src/lib.rs | 7 +++-- .../governance-v2/tests/gov_test_setup/mod.rs | 6 ++-- 4 files changed, 34 insertions(+), 12 deletions(-) diff --git a/energy-integration/fees-collector/src/lib.rs b/energy-integration/fees-collector/src/lib.rs index cf1d8b6c8..b5a37d7fb 100644 --- a/energy-integration/fees-collector/src/lib.rs +++ b/energy-integration/fees-collector/src/lib.rs @@ -48,13 +48,24 @@ pub trait FeesCollector: fn upgrade(&self) {} #[endpoint(claimRewards)] - fn claim_rewards( + fn claim_rewards_endpoint( &self, opt_original_caller: OptionalValue, ) -> PaymentsVec { require!(self.not_paused(), "Cannot claim while paused"); - self.accumulate_additional_locked_tokens(); + let caller = self.blockchain().get_caller(); + let original_caller = self.get_orig_caller_from_opt(&caller, opt_original_caller); + + self.claim_rewards(caller, original_caller) + } + + #[endpoint(claimBoostedRewards)] + fn claim_boosted_rewards( + &self, + opt_original_caller: OptionalValue, + ) -> PaymentsVec { + require!(self.not_paused(), "Cannot claim while paused"); let original_caller = match opt_original_caller { OptionalValue::Some(user) => { @@ -67,6 +78,16 @@ pub trait FeesCollector: OptionalValue::None => self.blockchain().get_caller(), }; + self.claim_rewards(original_caller.clone(), original_caller) + } + + fn claim_rewards( + &self, + caller: ManagedAddress, + original_caller: ManagedAddress, + ) -> PaymentsVec { + self.accumulate_additional_locked_tokens(); + let wrapper = FeesCollectorWrapper::new(); let mut rewards = self.claim_multi(&wrapper, &original_caller); if rewards.is_empty() { @@ -90,14 +111,14 @@ pub trait FeesCollector: } if !rewards.is_empty() { - self.send().direct_multi(&original_caller, &rewards); + self.send().direct_multi(&caller, &rewards); } if total_locked_token_rewards_amount > 0 { let locked_rewards = self.lock_virtual( self.get_base_token_id(), total_locked_token_rewards_amount, - original_caller.clone(), + caller, original_caller, ); diff --git a/energy-integration/fees-collector/tests/fees_collector_test_setup/mod.rs b/energy-integration/fees-collector/tests/fees_collector_test_setup/mod.rs index 2809ac297..359c4eeb5 100644 --- a/energy-integration/fees-collector/tests/fees_collector_test_setup/mod.rs +++ b/energy-integration/fees-collector/tests/fees_collector_test_setup/mod.rs @@ -225,14 +225,14 @@ where pub fn claim(&mut self, user: &Address) -> TxResult { self.b_mock .execute_tx(user, &self.fc_wrapper, &rust_biguint!(0), |sc| { - let _ = sc.claim_rewards(OptionalValue::None); + let _ = sc.claim_rewards_endpoint(OptionalValue::None); }) } pub fn claim_for_user(&mut self, owner: &Address, broker: &Address) -> TxResult { self.b_mock .execute_tx(broker, &self.fc_wrapper, &rust_biguint!(0), |sc| { - let _ = sc.claim_rewards(OptionalValue::Some(managed_address!(owner))); + let _ = sc.claim_boosted_rewards(OptionalValue::Some(managed_address!(owner))); }) } diff --git a/energy-integration/fees-collector/wasm/src/lib.rs b/energy-integration/fees-collector/wasm/src/lib.rs index b0f3b7178..f8d4ac038 100644 --- a/energy-integration/fees-collector/wasm/src/lib.rs +++ b/energy-integration/fees-collector/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 38 +// Endpoints: 39 // Async Callback (empty): 1 -// Total number of exported functions: 40 +// Total number of exported functions: 41 #![no_std] @@ -23,7 +23,8 @@ multiversx_sc_wasm_adapter::endpoints! { ( init => init upgrade => upgrade - claimRewards => claim_rewards + claimRewards => claim_rewards_endpoint + claimBoostedRewards => claim_boosted_rewards addKnownContracts => add_known_contracts removeKnownContracts => remove_known_contracts addKnownTokens => add_known_tokens diff --git a/energy-integration/governance-v2/tests/gov_test_setup/mod.rs b/energy-integration/governance-v2/tests/gov_test_setup/mod.rs index 520b5b0b4..8c5cc9242 100644 --- a/energy-integration/governance-v2/tests/gov_test_setup/mod.rs +++ b/energy-integration/governance-v2/tests/gov_test_setup/mod.rs @@ -121,7 +121,7 @@ where &fees_collector_wrapper, &rust_biguint!(0), |sc| { - sc.claim_rewards(OptionalValue::None); + sc.claim_rewards_endpoint(OptionalValue::None); }, ) .assert_ok(); @@ -132,7 +132,7 @@ where &fees_collector_wrapper, &rust_biguint!(0), |sc| { - sc.claim_rewards(OptionalValue::None); + sc.claim_rewards_endpoint(OptionalValue::None); }, ) .assert_ok(); @@ -143,7 +143,7 @@ where &fees_collector_wrapper, &rust_biguint!(0), |sc| { - sc.claim_rewards(OptionalValue::None); + sc.claim_rewards_endpoint(OptionalValue::None); }, ) .assert_ok(); From 412c3056e42f9590ff74ec7cba2148e9dfd56a2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Fri, 8 Dec 2023 17:00:37 +0200 Subject: [PATCH 136/213] Governance-v2:Allow users with 0 energy to propose --- energy-integration/governance-v2/src/configurable.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/energy-integration/governance-v2/src/configurable.rs b/energy-integration/governance-v2/src/configurable.rs index 3fe44e7b0..a2c626935 100644 --- a/energy-integration/governance-v2/src/configurable.rs +++ b/energy-integration/governance-v2/src/configurable.rs @@ -86,8 +86,6 @@ pub trait ConfigurablePropertiesModule: } fn try_change_min_energy_for_propose(&self, new_value: BigUint) { - require!(new_value != 0, "Min energy for proposal can't be set to 0"); - self.min_energy_for_propose().set(&new_value); } From 143aebc15b59bf709d264776a8c82c6d68ddd29c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Mon, 11 Dec 2023 09:57:43 +0200 Subject: [PATCH 137/213] Add test for propose with 0 energy --- energy-integration/governance-v2/src/lib.rs | 2 +- .../governance-v2/tests/gov_rust_test.rs | 14 ++++++-------- .../governance-v2/tests/gov_test_setup/mod.rs | 16 ++++++++++++++++ 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/energy-integration/governance-v2/src/lib.rs b/energy-integration/governance-v2/src/lib.rs index 9c9de7613..325c0e198 100644 --- a/energy-integration/governance-v2/src/lib.rs +++ b/energy-integration/governance-v2/src/lib.rs @@ -88,7 +88,7 @@ pub trait GovernanceV2: EXEEDED_MAX_ACTIONS ); - let user_energy = self.get_energy_amount_non_zero(&proposer); + let user_energy = self.get_energy_amount(&proposer); let min_energy_for_propose = self.min_energy_for_propose().get(); require!(user_energy >= min_energy_for_propose, NOT_ENOUGH_ENERGY); diff --git a/energy-integration/governance-v2/tests/gov_rust_test.rs b/energy-integration/governance-v2/tests/gov_rust_test.rs index 573278722..05f61c7cc 100644 --- a/energy-integration/governance-v2/tests/gov_rust_test.rs +++ b/energy-integration/governance-v2/tests/gov_rust_test.rs @@ -88,16 +88,18 @@ fn gov_propose_test() { fn gov_propose_total_energy_0_test() { let mut gov_setup = GovSetup::new(governance_v2::contract_obj); - let first_user_addr = gov_setup.first_user.clone(); + let no_energy_user = gov_setup.no_energy_user.clone(); let sc_addr = gov_setup.gov_wrapper.address_ref().clone(); let min_fee = rust_biguint!(MIN_FEE_FOR_PROPOSE) * DECIMALS_CONST; // Give proposer the minimum fee gov_setup .b_mock - .set_nft_balance(&first_user_addr, WXMEX_TOKEN_ID, 1, &min_fee, &Empty); + .set_nft_balance(&no_energy_user, WXMEX_TOKEN_ID, 1, &min_fee, &Empty); + + gov_setup.change_min_energy(0).assert_ok(); let (result, proposal_id) = gov_setup.propose( - &first_user_addr, + &no_energy_user, &min_fee, &sc_addr, b"changeTODO", @@ -105,16 +107,12 @@ fn gov_propose_total_energy_0_test() { ); result.assert_ok(); assert_eq!(proposal_id, 1); - gov_setup.increment_block_nonce(VOTING_PERIOD_BLOCKS + VOTING_DELAY_BLOCKS); gov_setup .b_mock .execute_query(&gov_setup.gov_wrapper, |sc| { - let mut proposal = sc.proposals().get(1); - proposal.total_quorum = managed_biguint!(0); - sc.proposals().set(1, &proposal); assert!( - sc.get_proposal_status(1) == GovernanceProposalStatus::Defeated, + sc.get_proposal_status(1) == GovernanceProposalStatus::Pending, "Action should have been Defeated" ); }) diff --git a/energy-integration/governance-v2/tests/gov_test_setup/mod.rs b/energy-integration/governance-v2/tests/gov_test_setup/mod.rs index 520b5b0b4..c195ff877 100644 --- a/energy-integration/governance-v2/tests/gov_test_setup/mod.rs +++ b/energy-integration/governance-v2/tests/gov_test_setup/mod.rs @@ -50,6 +50,7 @@ where pub first_user: Address, pub second_user: Address, pub third_user: Address, + pub no_energy_user: Address, pub gov_wrapper: ContractObjWrapper, GovBuilder>, pub current_block: u64, } @@ -65,6 +66,7 @@ where let first_user = b_mock.create_user_account(&rust_zero); let second_user = b_mock.create_user_account(&rust_zero); let third_user = b_mock.create_user_account(&rust_zero); + let no_energy_user = b_mock.create_user_account(&rust_zero); // init energy factory let energy_factory_wrapper = b_mock.create_sc_account( @@ -103,6 +105,12 @@ where 0, managed_biguint!(0), )); + sc.user_energy(&managed_address!(&no_energy_user)) + .set(&Energy::new( + BigInt::from(managed_biguint!(0)), + 0, + managed_biguint!(0), + )); }) .assert_ok(); @@ -192,6 +200,7 @@ where first_user, second_user, third_user, + no_energy_user, gov_wrapper, current_block: 0, } @@ -278,6 +287,13 @@ where }) } + pub fn change_min_energy(&mut self, min_energy_for_propose: usize) -> TxResult { + self.b_mock + .execute_tx(&self.owner, &self.gov_wrapper, &rust_biguint!(0), |sc| { + sc.min_energy_for_propose().set(&managed_biguint!(min_energy_for_propose)); + }) + } + pub fn cancel_proposal(&mut self, caller: &Address, proposal_id: usize) -> TxResult { self.b_mock .execute_tx(caller, &self.gov_wrapper, &rust_biguint!(0), |sc| { From c079eb2e507631285297cade5b2cd8cec9889c6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Mon, 11 Dec 2023 14:30:52 +0200 Subject: [PATCH 138/213] Fix clippy issues --- .../governance-v2/src/configurable.rs | 28 +++++----- energy-integration/governance-v2/src/lib.rs | 2 +- .../governance-v2/src/proposal.rs | 4 +- energy-integration/governance-v2/src/views.rs | 2 +- .../governance-v2/tests/gov_rust_test.rs | 56 +++++++++---------- .../governance-v2/tests/gov_test_setup/mod.rs | 26 ++++----- 6 files changed, 58 insertions(+), 60 deletions(-) diff --git a/energy-integration/governance-v2/src/configurable.rs b/energy-integration/governance-v2/src/configurable.rs index a2c626935..6ff4151d1 100644 --- a/energy-integration/governance-v2/src/configurable.rs +++ b/energy-integration/governance-v2/src/configurable.rs @@ -63,7 +63,7 @@ pub trait ConfigurablePropertiesModule: #[only_owner] #[endpoint(changeQuorumPercentage)] - fn change_quorum_percentage(&self, new_value: BigUint) { + fn change_quorum_percentage(&self, new_value: u64) { self.try_change_quorum_percentage(new_value); } @@ -102,40 +102,40 @@ pub trait ConfigurablePropertiesModule: self.min_fee_for_propose().set(&new_value); } - fn try_change_quorum_percentage(&self, new_value: BigUint) { + fn try_change_quorum_percentage(&self, new_quorum_percetange: u64) { require!( - new_value > MIN_QUORUM && new_value < MAX_QUORUM, + (MIN_QUORUM..MAX_QUORUM).contains(&new_quorum_percetange), "Not valid value for Quorum!" ); - self.quorum_percentage().set(&new_value); + self.quorum_percentage().set(new_quorum_percetange); } - fn try_change_voting_delay_in_blocks(&self, new_value: u64) { + fn try_change_voting_delay_in_blocks(&self, new_voting_delay: u64) { require!( - new_value > MIN_VOTING_DELAY && new_value < MAX_VOTING_DELAY, + (MIN_VOTING_DELAY..MAX_VOTING_DELAY).contains(&new_voting_delay), "Not valid value for voting delay!" ); - self.voting_delay_in_blocks().set(new_value); + self.voting_delay_in_blocks().set(new_voting_delay); } - fn try_change_voting_period_in_blocks(&self, new_value: u64) { + fn try_change_voting_period_in_blocks(&self, new_voting_period: u64) { require!( - new_value > MIN_VOTING_PERIOD && new_value < MAX_VOTING_PERIOD, + (MIN_VOTING_PERIOD..MAX_VOTING_PERIOD).contains(&new_voting_period), "Not valid value for voting period!" ); - self.voting_period_in_blocks().set(new_value); + self.voting_period_in_blocks().set(new_voting_period); } - fn try_change_withdraw_percentage_defeated(&self, new_value: u64) { + fn try_change_withdraw_percentage_defeated(&self, new_withdraw_percentage: u64) { require!( - new_value <= FULL_PERCENTAGE, + new_withdraw_percentage <= FULL_PERCENTAGE, "Not valid value for withdraw percentage if defeated!" ); - self.withdraw_percentage_defeated().set(new_value); + self.withdraw_percentage_defeated().set(new_withdraw_percentage); } fn try_change_fee_token_id(&self, fee_token_id: TokenIdentifier) { @@ -157,7 +157,7 @@ pub trait ConfigurablePropertiesModule: #[view(getQuorum)] #[storage_mapper("quorumPercentage")] - fn quorum_percentage(&self) -> SingleValueMapper; + fn quorum_percentage(&self) -> SingleValueMapper; #[view(getVotingDelayInBlocks)] #[storage_mapper("votingDelayInBlocks")] diff --git a/energy-integration/governance-v2/src/lib.rs b/energy-integration/governance-v2/src/lib.rs index 325c0e198..0fcb53dca 100644 --- a/energy-integration/governance-v2/src/lib.rs +++ b/energy-integration/governance-v2/src/lib.rs @@ -42,7 +42,7 @@ pub trait GovernanceV2: &self, min_energy_for_propose: BigUint, min_fee_for_propose: BigUint, - quorum_percentage: BigUint, + quorum_percentage: u64, voting_delay_in_blocks: u64, voting_period_in_blocks: u64, withdraw_percentage_defeated: u64, diff --git a/energy-integration/governance-v2/src/proposal.rs b/energy-integration/governance-v2/src/proposal.rs index 94c66a131..e26591817 100644 --- a/energy-integration/governance-v2/src/proposal.rs +++ b/energy-integration/governance-v2/src/proposal.rs @@ -61,7 +61,7 @@ pub struct GovernanceProposal { pub actions: ArrayVec, MAX_GOVERNANCE_PROPOSAL_ACTIONS>, pub description: ManagedBuffer, pub fee_payment: EsdtTokenPayment, - pub minimum_quorum: BigUint, + pub minimum_quorum: u64, pub voting_delay_in_blocks: u64, pub voting_period_in_blocks: u64, pub withdraw_percentage_defeated: u64, @@ -100,7 +100,7 @@ impl GovernanceProposal { token_nonce: 0, amount: BigUint::zero(), }, - minimum_quorum: BigUint::default(), + minimum_quorum: 0, voting_delay_in_blocks: 0, voting_period_in_blocks: 0, withdraw_percentage_defeated: 0, diff --git a/energy-integration/governance-v2/src/views.rs b/energy-integration/governance-v2/src/views.rs index 79b33c20c..84b53c537 100644 --- a/energy-integration/governance-v2/src/views.rs +++ b/energy-integration/governance-v2/src/views.rs @@ -73,7 +73,7 @@ pub trait ViewsModule: fn quorum_reached(&self, proposal_id: ProposalId) -> bool { let proposal = self.proposals().get(proposal_id); let total_quorum_for_proposal = proposal.total_quorum; - let required_minimum_percentage = proposal.minimum_quorum; + let required_minimum_percentage = BigUint::from(proposal.minimum_quorum); let current_quorum = self.proposal_votes(proposal_id).get().quorum; current_quorum * FULL_PERCENTAGE >= required_minimum_percentage * total_quorum_for_proposal diff --git a/energy-integration/governance-v2/tests/gov_rust_test.rs b/energy-integration/governance-v2/tests/gov_rust_test.rs index 05f61c7cc..a6fd55feb 100644 --- a/energy-integration/governance-v2/tests/gov_rust_test.rs +++ b/energy-integration/governance-v2/tests/gov_rust_test.rs @@ -8,7 +8,7 @@ use governance_v2::{ proposal_storage::ProposalStorageModule, views::ViewsModule, }; use multiversx_sc::{codec::Empty, types::ManagedVec}; -use multiversx_sc_scenario::{managed_biguint, managed_buffer, rust_biguint}; +use multiversx_sc_scenario::{managed_buffer, rust_biguint}; #[test] fn init_gov_test() { @@ -26,7 +26,7 @@ fn gov_propose_test() { // Give proposer the minimum fee gov_setup .b_mock - .set_nft_balance(&first_user_addr, WXMEX_TOKEN_ID, 1, &min_fee, &Empty); + .set_nft_balance(&first_user_addr, MEX_TOKEN_ID, 1, &min_fee, &Empty); let (result, proposal_id) = gov_setup.propose( &first_user_addr, @@ -94,7 +94,7 @@ fn gov_propose_total_energy_0_test() { // Give proposer the minimum fee gov_setup .b_mock - .set_nft_balance(&no_energy_user, WXMEX_TOKEN_ID, 1, &min_fee, &Empty); + .set_nft_balance(&no_energy_user, MEX_TOKEN_ID, 1, &min_fee, &Empty); gov_setup.change_min_energy(0).assert_ok(); @@ -131,7 +131,7 @@ fn gov_no_veto_vote_test() { // Give proposer the minimum fee gov_setup .b_mock - .set_nft_balance(&first_user_addr, WXMEX_TOKEN_ID, 1, &min_fee, &Empty); + .set_nft_balance(&first_user_addr, MEX_TOKEN_ID, 1, &min_fee, &Empty); let (result, proposal_id) = gov_setup.propose( &first_user_addr, @@ -148,7 +148,7 @@ fn gov_no_veto_vote_test() { .execute_query(&gov_setup.gov_wrapper, |sc| { assert_eq!( sc.quorum_percentage().get(), - managed_biguint!(QUORUM_PERCENTAGE) + QUORUM_PERCENTAGE ); }) .assert_ok(); @@ -189,7 +189,7 @@ fn gov_abstain_vote_test() { // Give proposer the minimum fee gov_setup .b_mock - .set_nft_balance(&first_user_addr, WXMEX_TOKEN_ID, 1, &min_fee, &Empty); + .set_nft_balance(&first_user_addr, MEX_TOKEN_ID, 1, &min_fee, &Empty); let (result, proposal_id) = gov_setup.propose( &first_user_addr, @@ -231,7 +231,7 @@ fn gov_no_quorum_test() { // Give proposer the minimum fee gov_setup .b_mock - .set_nft_balance(&first_user_addr, WXMEX_TOKEN_ID, 1, &min_fee, &Empty); + .set_nft_balance(&first_user_addr, MEX_TOKEN_ID, 1, &min_fee, &Empty); let (result, proposal_id) = gov_setup.propose( &first_user_addr, @@ -270,7 +270,7 @@ fn gov_modify_quorum_after_end_vote_test() { // Give proposer the minimum fee gov_setup .b_mock - .set_nft_balance(&first_user_addr, WXMEX_TOKEN_ID, 1, &min_fee, &Empty); + .set_nft_balance(&first_user_addr, MEX_TOKEN_ID, 1, &min_fee, &Empty); let (result, proposal_id) = gov_setup.propose( &first_user_addr, @@ -295,8 +295,8 @@ fn gov_modify_quorum_after_end_vote_test() { sc.get_proposal_status(1) == GovernanceProposalStatus::Defeated, "Action should have been Defeated" ); - sc.try_change_quorum_percentage(managed_biguint!(QUORUM_PERCENTAGE / 2)); - assert!(sc.quorum_percentage().get() == managed_biguint!(QUORUM_PERCENTAGE / 2)); + sc.try_change_quorum_percentage(QUORUM_PERCENTAGE / 2); + assert!(sc.quorum_percentage().get() == QUORUM_PERCENTAGE / 2); assert!( sc.get_proposal_status(1) == GovernanceProposalStatus::Defeated, @@ -317,7 +317,7 @@ fn gov_withdraw_defeated_proposal_test() { // Give proposer the minimum fee gov_setup .b_mock - .set_nft_balance(&first_user_addr, WXMEX_TOKEN_ID, 1, &min_fee, &Empty); + .set_nft_balance(&first_user_addr, MEX_TOKEN_ID, 1, &min_fee, &Empty); let (result, proposal_id) = gov_setup.propose( &first_user_addr, @@ -332,7 +332,7 @@ fn gov_withdraw_defeated_proposal_test() { // Check proposer balance gov_setup.b_mock.check_nft_balance::( &first_user_addr, - WXMEX_TOKEN_ID, + MEX_TOKEN_ID, 1, &rust_biguint!(0), None, @@ -370,7 +370,7 @@ fn gov_withdraw_defeated_proposal_test() { // Check proposer balance (fee) gov_setup.b_mock.check_nft_balance::( &first_user_addr, - WXMEX_TOKEN_ID, + MEX_TOKEN_ID, 1, &min_fee, None, @@ -388,7 +388,7 @@ fn gov_modify_withdraw_defeated_proposal_test() { // Give proposer the minimum fee gov_setup .b_mock - .set_nft_balance(&first_user_addr, WXMEX_TOKEN_ID, 1, &min_fee, &Empty); + .set_nft_balance(&first_user_addr, MEX_TOKEN_ID, 1, &min_fee, &Empty); let (result, proposal_id) = gov_setup.propose( &first_user_addr, @@ -403,7 +403,7 @@ fn gov_modify_withdraw_defeated_proposal_test() { // Check proposer balance gov_setup.b_mock.check_nft_balance::( &first_user_addr, - WXMEX_TOKEN_ID, + MEX_TOKEN_ID, 1, &rust_biguint!(0), None, @@ -449,7 +449,7 @@ fn gov_modify_withdraw_defeated_proposal_test() { // Check proposer balance (fee) gov_setup.b_mock.check_nft_balance::( &first_user_addr, - WXMEX_TOKEN_ID, + MEX_TOKEN_ID, 1, &min_fee, None, @@ -467,7 +467,7 @@ fn gov_withdraw_no_with_veto_defeated_proposal_test() { // Give proposer the minimum fee gov_setup .b_mock - .set_nft_balance(&first_user_addr, WXMEX_TOKEN_ID, 1, &min_fee, &Empty); + .set_nft_balance(&first_user_addr, MEX_TOKEN_ID, 1, &min_fee, &Empty); let (result, proposal_id) = gov_setup.propose( &first_user_addr, @@ -482,7 +482,7 @@ fn gov_withdraw_no_with_veto_defeated_proposal_test() { // Check proposer balance gov_setup.b_mock.check_nft_balance::( &first_user_addr, - WXMEX_TOKEN_ID, + MEX_TOKEN_ID, 1, &rust_biguint!(0), None, @@ -515,7 +515,7 @@ fn gov_withdraw_no_with_veto_defeated_proposal_test() { // Check proposer balance (fee) gov_setup.b_mock.check_nft_balance::( &first_user_addr, - WXMEX_TOKEN_ID, + MEX_TOKEN_ID, 1, &(min_fee / 2u64), None, @@ -538,7 +538,7 @@ fn gov_withdraw_no_with_veto_penalty_limits_test() { // Give proposer the minimum fee gov_setup .b_mock - .set_nft_balance(&first_user_addr, WXMEX_TOKEN_ID, 1, &min_fee, &Empty); + .set_nft_balance(&first_user_addr, MEX_TOKEN_ID, 1, &min_fee, &Empty); gov_setup.change_withdraw_percentage(0).assert_ok(); let (result, proposal_id) = gov_setup.propose( @@ -554,7 +554,7 @@ fn gov_withdraw_no_with_veto_penalty_limits_test() { // Check proposer balance gov_setup.b_mock.check_nft_balance::( &first_user_addr, - WXMEX_TOKEN_ID, + MEX_TOKEN_ID, 1, &rust_biguint!(0), None, @@ -587,7 +587,7 @@ fn gov_withdraw_no_with_veto_penalty_limits_test() { // Check proposer balance (fee) gov_setup.b_mock.check_nft_balance::( &first_user_addr, - WXMEX_TOKEN_ID, + MEX_TOKEN_ID, 1, &rust_biguint!(0), None, @@ -596,7 +596,7 @@ fn gov_withdraw_no_with_veto_penalty_limits_test() { // Give proposer the minimum fee gov_setup .b_mock - .set_nft_balance(&first_user_addr, WXMEX_TOKEN_ID, 1, &min_fee, &Empty); + .set_nft_balance(&first_user_addr, MEX_TOKEN_ID, 1, &min_fee, &Empty); gov_setup.change_withdraw_percentage(10_000).assert_ok(); let (result, proposal_id) = gov_setup.propose( @@ -612,7 +612,7 @@ fn gov_withdraw_no_with_veto_penalty_limits_test() { // Check proposer balance gov_setup.b_mock.check_nft_balance::( &first_user_addr, - WXMEX_TOKEN_ID, + MEX_TOKEN_ID, 1, &rust_biguint!(0), None, @@ -645,7 +645,7 @@ fn gov_withdraw_no_with_veto_penalty_limits_test() { // Check proposer balance (fee) gov_setup.b_mock.check_nft_balance::( &first_user_addr, - WXMEX_TOKEN_ID, + MEX_TOKEN_ID, 1, &min_fee, None, @@ -662,7 +662,7 @@ fn gov_propose_cancel_proposal_id_test() { // Give proposer the minimum fee gov_setup.b_mock.set_nft_balance( &first_user_addr, - WXMEX_TOKEN_ID, + MEX_TOKEN_ID, 1, &(min_fee.clone() * 3u64), &Empty, @@ -712,7 +712,7 @@ fn gov_propose_cancel_proposal_id_test() { // Check proposer balance (fee = 0) gov_setup.b_mock.check_nft_balance::( &first_user_addr, - WXMEX_TOKEN_ID, + MEX_TOKEN_ID, 1, &rust_biguint!(0), None, @@ -736,7 +736,7 @@ fn gov_propose_cancel_proposal_id_test() { // Check proposer balance (fee should be refunded) gov_setup.b_mock.check_nft_balance::( &first_user_addr, - WXMEX_TOKEN_ID, + MEX_TOKEN_ID, 1, &min_fee, None, diff --git a/energy-integration/governance-v2/tests/gov_test_setup/mod.rs b/energy-integration/governance-v2/tests/gov_test_setup/mod.rs index c195ff877..d31d0f77d 100644 --- a/energy-integration/governance-v2/tests/gov_test_setup/mod.rs +++ b/energy-integration/governance-v2/tests/gov_test_setup/mod.rs @@ -20,15 +20,14 @@ use multiversx_sc_scenario::{ }; use num_bigint::BigUint; -pub const MIN_ENERGY_FOR_PROPOSE: u64 = 500_000; -pub const MIN_FEE_FOR_PROPOSE: u64 = 3_000_000; -pub const QUORUM_PERCENTAGE: u64 = 5000; -pub const VOTING_DELAY_BLOCKS: u64 = 10; -pub const VOTING_PERIOD_BLOCKS: u64 = 14_500; +pub const MIN_ENERGY_FOR_PROPOSE: u64 = 0; +pub const MIN_FEE_FOR_PROPOSE: u64 = 1_000_000_000; // 1B MEX +pub const QUORUM_PERCENTAGE: u64 = 4_000; // 40% +pub const VOTING_DELAY_BLOCKS: u64 = 1; +pub const VOTING_PERIOD_BLOCKS: u64 = 144_000; // 10 days pub const LOCKING_PERIOD_BLOCKS: u64 = 30; pub const WITHDRAW_PERCENTAGE: u64 = 5_000; // 50% -pub static WXMEX_TOKEN_ID: &[u8] = b"WXMEX-123456"; -pub const LOCKED_TOKEN_ID: &[u8] = b"LOCKED-abcdef"; +pub const MEX_TOKEN_ID: &[u8] = b"MEX-123456"; pub const DECIMALS_CONST: u64 = 1_000_000_000_000_000_000; pub const FULL_PERCENTAGE: u64 = 10_000; pub const USER_ENERGY: u64 = 1_000_000; @@ -117,7 +116,7 @@ where b_mock .execute_tx(&owner, &fees_collector_wrapper, &rust_biguint!(0), |sc| { sc.init( - managed_token_id!(LOCKED_TOKEN_ID), + managed_token_id!(MEX_TOKEN_ID), managed_address!(energy_factory_wrapper.address_ref()), ); }) @@ -160,26 +159,25 @@ where let gov_wrapper = b_mock.create_sc_account(&rust_zero, Some(&owner), gov_builder, "gov path"); - // let min_fee = managed_biguint!(MIN_FEE_FOR_PROPOSE )* managed_biguint!(DECIMALS_CONST); b_mock .execute_tx(&owner, &gov_wrapper, &rust_zero, |sc| { sc.init( managed_biguint!(MIN_ENERGY_FOR_PROPOSE), managed_biguint!(MIN_FEE_FOR_PROPOSE) * DECIMALS_CONST, - managed_biguint!(QUORUM_PERCENTAGE), + QUORUM_PERCENTAGE, VOTING_DELAY_BLOCKS, VOTING_PERIOD_BLOCKS, WITHDRAW_PERCENTAGE, managed_address!(energy_factory_wrapper.address_ref()), managed_address!(fees_collector_wrapper.address_ref()), - managed_token_id!(WXMEX_TOKEN_ID), + managed_token_id!(MEX_TOKEN_ID), ); }) .assert_ok(); b_mock .execute_tx(&owner, &gov_wrapper, &rust_zero, |sc| { - sc.fee_token_id().set(managed_token_id!(WXMEX_TOKEN_ID)); + sc.fee_token_id().set(managed_token_id!(MEX_TOKEN_ID)); }) .assert_ok(); @@ -190,7 +188,7 @@ where ]; b_mock.set_esdt_local_roles( gov_wrapper.address_ref(), - WXMEX_TOKEN_ID, + MEX_TOKEN_ID, &vote_nft_roles[..], ); @@ -218,7 +216,7 @@ where let result = self.b_mock.execute_esdt_transfer( proposer, &self.gov_wrapper, - WXMEX_TOKEN_ID, + MEX_TOKEN_ID, 1u64, fee_amount, |sc| { From 9668b071a872f4ec1dd90bcd6263d30595754a4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Mon, 11 Dec 2023 14:49:27 +0200 Subject: [PATCH 139/213] Fix typo --- energy-integration/governance-v2/src/configurable.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/energy-integration/governance-v2/src/configurable.rs b/energy-integration/governance-v2/src/configurable.rs index 6ff4151d1..a6e5891b8 100644 --- a/energy-integration/governance-v2/src/configurable.rs +++ b/energy-integration/governance-v2/src/configurable.rs @@ -102,13 +102,13 @@ pub trait ConfigurablePropertiesModule: self.min_fee_for_propose().set(&new_value); } - fn try_change_quorum_percentage(&self, new_quorum_percetange: u64) { + fn try_change_quorum_percentage(&self, new_quorum_percentage: u64) { require!( - (MIN_QUORUM..MAX_QUORUM).contains(&new_quorum_percetange), + (MIN_QUORUM..MAX_QUORUM).contains(&new_quorum_percentage), "Not valid value for Quorum!" ); - self.quorum_percentage().set(new_quorum_percetange); + self.quorum_percentage().set(new_quorum_percentage); } fn try_change_voting_delay_in_blocks(&self, new_voting_delay: u64) { From 9384ff33428250881001749df77796f585dbf488 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Mon, 11 Dec 2023 15:17:29 +0200 Subject: [PATCH 140/213] Governance-v2 tests:Change MEX from SFT to FT --- .../governance-v2/tests/gov_rust_test.rs | 161 ++++++------------ .../governance-v2/tests/gov_test_setup/mod.rs | 10 +- 2 files changed, 57 insertions(+), 114 deletions(-) diff --git a/energy-integration/governance-v2/tests/gov_rust_test.rs b/energy-integration/governance-v2/tests/gov_rust_test.rs index a6fd55feb..d5f371bc2 100644 --- a/energy-integration/governance-v2/tests/gov_rust_test.rs +++ b/energy-integration/governance-v2/tests/gov_rust_test.rs @@ -7,7 +7,7 @@ use governance_v2::{ configurable::ConfigurablePropertiesModule, proposal::GovernanceProposalStatus, proposal_storage::ProposalStorageModule, views::ViewsModule, }; -use multiversx_sc::{codec::Empty, types::ManagedVec}; +use multiversx_sc::{types::ManagedVec}; use multiversx_sc_scenario::{managed_buffer, rust_biguint}; #[test] @@ -26,7 +26,7 @@ fn gov_propose_test() { // Give proposer the minimum fee gov_setup .b_mock - .set_nft_balance(&first_user_addr, MEX_TOKEN_ID, 1, &min_fee, &Empty); + .set_esdt_balance(&first_user_addr, MEX_TOKEN_ID, &min_fee); let (result, proposal_id) = gov_setup.propose( &first_user_addr, @@ -94,7 +94,7 @@ fn gov_propose_total_energy_0_test() { // Give proposer the minimum fee gov_setup .b_mock - .set_nft_balance(&no_energy_user, MEX_TOKEN_ID, 1, &min_fee, &Empty); + .set_esdt_balance(&no_energy_user, MEX_TOKEN_ID, &min_fee); gov_setup.change_min_energy(0).assert_ok(); @@ -131,7 +131,7 @@ fn gov_no_veto_vote_test() { // Give proposer the minimum fee gov_setup .b_mock - .set_nft_balance(&first_user_addr, MEX_TOKEN_ID, 1, &min_fee, &Empty); + .set_esdt_balance(&first_user_addr, MEX_TOKEN_ID, &min_fee); let (result, proposal_id) = gov_setup.propose( &first_user_addr, @@ -146,10 +146,7 @@ fn gov_no_veto_vote_test() { gov_setup .b_mock .execute_query(&gov_setup.gov_wrapper, |sc| { - assert_eq!( - sc.quorum_percentage().get(), - QUORUM_PERCENTAGE - ); + assert_eq!(sc.quorum_percentage().get(), QUORUM_PERCENTAGE); }) .assert_ok(); @@ -189,7 +186,7 @@ fn gov_abstain_vote_test() { // Give proposer the minimum fee gov_setup .b_mock - .set_nft_balance(&first_user_addr, MEX_TOKEN_ID, 1, &min_fee, &Empty); + .set_esdt_balance(&first_user_addr, MEX_TOKEN_ID, &min_fee); let (result, proposal_id) = gov_setup.propose( &first_user_addr, @@ -231,7 +228,7 @@ fn gov_no_quorum_test() { // Give proposer the minimum fee gov_setup .b_mock - .set_nft_balance(&first_user_addr, MEX_TOKEN_ID, 1, &min_fee, &Empty); + .set_esdt_balance(&first_user_addr, MEX_TOKEN_ID, &min_fee); let (result, proposal_id) = gov_setup.propose( &first_user_addr, @@ -270,7 +267,7 @@ fn gov_modify_quorum_after_end_vote_test() { // Give proposer the minimum fee gov_setup .b_mock - .set_nft_balance(&first_user_addr, MEX_TOKEN_ID, 1, &min_fee, &Empty); + .set_esdt_balance(&first_user_addr, MEX_TOKEN_ID, &min_fee); let (result, proposal_id) = gov_setup.propose( &first_user_addr, @@ -317,7 +314,7 @@ fn gov_withdraw_defeated_proposal_test() { // Give proposer the minimum fee gov_setup .b_mock - .set_nft_balance(&first_user_addr, MEX_TOKEN_ID, 1, &min_fee, &Empty); + .set_esdt_balance(&first_user_addr, MEX_TOKEN_ID, &min_fee); let (result, proposal_id) = gov_setup.propose( &first_user_addr, @@ -329,14 +326,9 @@ fn gov_withdraw_defeated_proposal_test() { result.assert_ok(); assert_eq!(proposal_id, 1); - // Check proposer balance - gov_setup.b_mock.check_nft_balance::( - &first_user_addr, - MEX_TOKEN_ID, - 1, - &rust_biguint!(0), - None, - ); + gov_setup + .b_mock + .check_esdt_balance(&first_user_addr, MEX_TOKEN_ID, &rust_biguint!(0)); gov_setup.increment_block_nonce(VOTING_PERIOD_BLOCKS); @@ -367,14 +359,9 @@ fn gov_withdraw_defeated_proposal_test() { .withdraw_after_defeated(&first_user_addr, proposal_id) .assert_ok(); - // Check proposer balance (fee) - gov_setup.b_mock.check_nft_balance::( - &first_user_addr, - MEX_TOKEN_ID, - 1, - &min_fee, - None, - ); + gov_setup + .b_mock + .check_esdt_balance(&first_user_addr, MEX_TOKEN_ID, &min_fee); } #[test] @@ -388,7 +375,7 @@ fn gov_modify_withdraw_defeated_proposal_test() { // Give proposer the minimum fee gov_setup .b_mock - .set_nft_balance(&first_user_addr, MEX_TOKEN_ID, 1, &min_fee, &Empty); + .set_esdt_balance(&first_user_addr, MEX_TOKEN_ID, &min_fee); let (result, proposal_id) = gov_setup.propose( &first_user_addr, @@ -401,13 +388,9 @@ fn gov_modify_withdraw_defeated_proposal_test() { assert_eq!(proposal_id, 1); // Check proposer balance - gov_setup.b_mock.check_nft_balance::( - &first_user_addr, - MEX_TOKEN_ID, - 1, - &rust_biguint!(0), - None, - ); + gov_setup + .b_mock + .check_esdt_balance(&first_user_addr, MEX_TOKEN_ID, &rust_biguint!(0)); gov_setup.increment_block_nonce(VOTING_PERIOD_BLOCKS); @@ -447,13 +430,9 @@ fn gov_modify_withdraw_defeated_proposal_test() { .assert_ok(); // Check proposer balance (fee) - gov_setup.b_mock.check_nft_balance::( - &first_user_addr, - MEX_TOKEN_ID, - 1, - &min_fee, - None, - ); + gov_setup + .b_mock + .check_esdt_balance(&first_user_addr, MEX_TOKEN_ID, &min_fee); } #[test] @@ -467,7 +446,7 @@ fn gov_withdraw_no_with_veto_defeated_proposal_test() { // Give proposer the minimum fee gov_setup .b_mock - .set_nft_balance(&first_user_addr, MEX_TOKEN_ID, 1, &min_fee, &Empty); + .set_esdt_balance(&first_user_addr, MEX_TOKEN_ID, &min_fee); let (result, proposal_id) = gov_setup.propose( &first_user_addr, @@ -480,13 +459,9 @@ fn gov_withdraw_no_with_veto_defeated_proposal_test() { assert_eq!(proposal_id, 1); // Check proposer balance - gov_setup.b_mock.check_nft_balance::( - &first_user_addr, - MEX_TOKEN_ID, - 1, - &rust_biguint!(0), - None, - ); + gov_setup + .b_mock + .check_esdt_balance(&first_user_addr, MEX_TOKEN_ID, &rust_biguint!(0)); gov_setup.increment_block_nonce(VOTING_PERIOD_BLOCKS); @@ -513,13 +488,9 @@ fn gov_withdraw_no_with_veto_defeated_proposal_test() { .assert_ok(); // Check proposer balance (fee) - gov_setup.b_mock.check_nft_balance::( - &first_user_addr, - MEX_TOKEN_ID, - 1, - &(min_fee / 2u64), - None, - ); + gov_setup + .b_mock + .check_esdt_balance(&first_user_addr, MEX_TOKEN_ID, &(&min_fee / 2u64)); // Withdraw the fee twice - error gov_setup @@ -538,7 +509,7 @@ fn gov_withdraw_no_with_veto_penalty_limits_test() { // Give proposer the minimum fee gov_setup .b_mock - .set_nft_balance(&first_user_addr, MEX_TOKEN_ID, 1, &min_fee, &Empty); + .set_esdt_balance(&first_user_addr, MEX_TOKEN_ID, &min_fee); gov_setup.change_withdraw_percentage(0).assert_ok(); let (result, proposal_id) = gov_setup.propose( @@ -552,13 +523,9 @@ fn gov_withdraw_no_with_veto_penalty_limits_test() { assert_eq!(proposal_id, 1); // Check proposer balance - gov_setup.b_mock.check_nft_balance::( - &first_user_addr, - MEX_TOKEN_ID, - 1, - &rust_biguint!(0), - None, - ); + gov_setup + .b_mock + .check_esdt_balance(&first_user_addr, MEX_TOKEN_ID, &rust_biguint!(0)); gov_setup.increment_block_nonce(VOTING_PERIOD_BLOCKS); @@ -585,18 +552,14 @@ fn gov_withdraw_no_with_veto_penalty_limits_test() { .assert_ok(); // Check proposer balance (fee) - gov_setup.b_mock.check_nft_balance::( - &first_user_addr, - MEX_TOKEN_ID, - 1, - &rust_biguint!(0), - None, - ); + gov_setup + .b_mock + .check_esdt_balance(&first_user_addr, MEX_TOKEN_ID, &rust_biguint!(0)); // Give proposer the minimum fee gov_setup .b_mock - .set_nft_balance(&first_user_addr, MEX_TOKEN_ID, 1, &min_fee, &Empty); + .set_esdt_balance(&first_user_addr, MEX_TOKEN_ID, &min_fee); gov_setup.change_withdraw_percentage(10_000).assert_ok(); let (result, proposal_id) = gov_setup.propose( @@ -610,13 +573,9 @@ fn gov_withdraw_no_with_veto_penalty_limits_test() { assert_eq!(proposal_id, 2); // Check proposer balance - gov_setup.b_mock.check_nft_balance::( - &first_user_addr, - MEX_TOKEN_ID, - 1, - &rust_biguint!(0), - None, - ); + gov_setup + .b_mock + .check_esdt_balance(&first_user_addr, MEX_TOKEN_ID, &rust_biguint!(0)); gov_setup.increment_block_nonce(VOTING_PERIOD_BLOCKS); @@ -643,13 +602,9 @@ fn gov_withdraw_no_with_veto_penalty_limits_test() { .assert_ok(); // Check proposer balance (fee) - gov_setup.b_mock.check_nft_balance::( - &first_user_addr, - MEX_TOKEN_ID, - 1, - &min_fee, - None, - ); + gov_setup + .b_mock + .check_esdt_balance(&first_user_addr, MEX_TOKEN_ID, &min_fee); } #[test] @@ -660,13 +615,9 @@ fn gov_propose_cancel_proposal_id_test() { let sc_addr = gov_setup.gov_wrapper.address_ref().clone(); let min_fee = rust_biguint!(MIN_FEE_FOR_PROPOSE) * DECIMALS_CONST; // Give proposer the minimum fee - gov_setup.b_mock.set_nft_balance( - &first_user_addr, - MEX_TOKEN_ID, - 1, - &(min_fee.clone() * 3u64), - &Empty, - ); + gov_setup + .b_mock + .set_esdt_balance(&first_user_addr, MEX_TOKEN_ID, &(&min_fee * 3u64)); let (result, proposal_id) = gov_setup.propose( &first_user_addr, @@ -710,13 +661,9 @@ fn gov_propose_cancel_proposal_id_test() { .assert_ok(); // Check proposer balance (fee = 0) - gov_setup.b_mock.check_nft_balance::( - &first_user_addr, - MEX_TOKEN_ID, - 1, - &rust_biguint!(0), - None, - ); + gov_setup + .b_mock + .check_esdt_balance(&first_user_addr, MEX_TOKEN_ID, &rust_biguint!(0)); gov_setup.cancel_proposal(&first_user_addr, 2).assert_ok(); @@ -734,13 +681,9 @@ fn gov_propose_cancel_proposal_id_test() { .assert_ok(); // Check proposer balance (fee should be refunded) - gov_setup.b_mock.check_nft_balance::( - &first_user_addr, - MEX_TOKEN_ID, - 1, - &min_fee, - None, - ); + gov_setup + .b_mock + .check_esdt_balance(&first_user_addr, MEX_TOKEN_ID, &min_fee); assert_eq!(proposal_id, 3); gov_setup .check_proposal_id_consistency(&first_user_addr, proposal_id) diff --git a/energy-integration/governance-v2/tests/gov_test_setup/mod.rs b/energy-integration/governance-v2/tests/gov_test_setup/mod.rs index d31d0f77d..3c13e70c7 100644 --- a/energy-integration/governance-v2/tests/gov_test_setup/mod.rs +++ b/energy-integration/governance-v2/tests/gov_test_setup/mod.rs @@ -28,6 +28,7 @@ pub const VOTING_PERIOD_BLOCKS: u64 = 144_000; // 10 days pub const LOCKING_PERIOD_BLOCKS: u64 = 30; pub const WITHDRAW_PERCENTAGE: u64 = 5_000; // 50% pub const MEX_TOKEN_ID: &[u8] = b"MEX-123456"; +pub const XMEX_TOKEN_ID: &[u8] = b"XMEX-123456"; pub const DECIMALS_CONST: u64 = 1_000_000_000_000_000_000; pub const FULL_PERCENTAGE: u64 = 10_000; pub const USER_ENERGY: u64 = 1_000_000; @@ -116,7 +117,7 @@ where b_mock .execute_tx(&owner, &fees_collector_wrapper, &rust_biguint!(0), |sc| { sc.init( - managed_token_id!(MEX_TOKEN_ID), + managed_token_id!(XMEX_TOKEN_ID), managed_address!(energy_factory_wrapper.address_ref()), ); }) @@ -182,9 +183,8 @@ where .assert_ok(); let vote_nft_roles = [ - EsdtLocalRole::NftCreate, - EsdtLocalRole::NftBurn, - EsdtLocalRole::NftUpdateAttributes, + EsdtLocalRole::Mint, + EsdtLocalRole::Burn, ]; b_mock.set_esdt_local_roles( gov_wrapper.address_ref(), @@ -217,7 +217,7 @@ where proposer, &self.gov_wrapper, MEX_TOKEN_ID, - 1u64, + 0, fee_amount, |sc| { let mut args_managed = ManagedVec::new(); From b6049bf5b10b33bf4d85c8a4ccb8da8533f6148f Mon Sep 17 00:00:00 2001 From: ovidiuolteanu Date: Wed, 13 Dec 2023 13:04:52 +0200 Subject: [PATCH 141/213] separate upgrade endpoint --- dex/farm-with-locked-rewards/src/lib.rs | 6 +++++- farm-staking/farm-staking/src/lib.rs | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dex/farm-with-locked-rewards/src/lib.rs b/dex/farm-with-locked-rewards/src/lib.rs index d4f5ec52b..473fa77d2 100644 --- a/dex/farm-with-locked-rewards/src/lib.rs +++ b/dex/farm-with-locked-rewards/src/lib.rs @@ -82,7 +82,11 @@ pub trait Farm: } #[endpoint] - fn upgrade(&self) {} + fn upgrade(&self) { + // Farm position migration code + let farm_token_mapper = self.farm_token(); + self.try_set_farm_position_migration_nonce(farm_token_mapper); + } #[payable("*")] #[endpoint(enterFarm)] diff --git a/farm-staking/farm-staking/src/lib.rs b/farm-staking/farm-staking/src/lib.rs index 32cbec0e1..33f5bbd1a 100644 --- a/farm-staking/farm-staking/src/lib.rs +++ b/farm-staking/farm-staking/src/lib.rs @@ -95,7 +95,11 @@ pub trait FarmStaking: } #[endpoint] - fn upgrade(&self) {} + fn upgrade(&self) { + // Farm position migration code + let farm_token_mapper = self.farm_token(); + self.try_set_farm_position_migration_nonce(farm_token_mapper); + } #[payable("*")] #[endpoint(mergeFarmTokens)] From d35e367368cfa30abf938befb6ab0d60fc10e1af Mon Sep 17 00:00:00 2001 From: ovidiuolteanu Date: Wed, 13 Dec 2023 13:25:53 +0200 Subject: [PATCH 142/213] separate upgrade endpoint update for farm --- dex/farm/src/lib.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dex/farm/src/lib.rs b/dex/farm/src/lib.rs index b29d7c8a5..48cf893f1 100644 --- a/dex/farm/src/lib.rs +++ b/dex/farm/src/lib.rs @@ -83,7 +83,11 @@ pub trait Farm: } #[endpoint] - fn upgrade(&self) {} + fn upgrade(&self) { + // Farm position migration code + let farm_token_mapper = self.farm_token(); + self.try_set_farm_position_migration_nonce(farm_token_mapper); + } #[payable("*")] #[endpoint(enterFarm)] From 56a8e770400a589c85cae86c9998990ea14ff1b4 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Thu, 14 Dec 2023 16:01:00 +0200 Subject: [PATCH 143/213] add getAllowExternalClaimRewards view in farms --- common/modules/farm/config/src/config.rs | 6 ++++++ dex/farm-with-locked-rewards/wasm/src/lib.rs | 5 +++-- dex/farm/wasm/src/lib.rs | 5 +++-- farm-staking/farm-staking/wasm/src/lib.rs | 5 +++-- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/common/modules/farm/config/src/config.rs b/common/modules/farm/config/src/config.rs index e65056062..b712765e5 100644 --- a/common/modules/farm/config/src/config.rs +++ b/common/modules/farm/config/src/config.rs @@ -45,6 +45,12 @@ pub trait ConfigModule: pausable::PausableModule + permissions_module::Permissio .set(user_total_farm_position); } + #[view(getAllowExternalClaimRewards)] + fn get_allow_external_claim_rewards(&self, user: ManagedAddress) -> bool { + let user_total_farm_position = self.get_user_total_farm_position(&user); + user_total_farm_position.allow_external_claim_boosted_rewards + } + #[inline] fn is_active(&self) -> bool { let state = self.state().get(); diff --git a/dex/farm-with-locked-rewards/wasm/src/lib.rs b/dex/farm-with-locked-rewards/wasm/src/lib.rs index 94154f32c..e1b1ca74e 100644 --- a/dex/farm-with-locked-rewards/wasm/src/lib.rs +++ b/dex/farm-with-locked-rewards/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 67 +// Endpoints: 68 // Async Callback: 1 -// Total number of exported functions: 69 +// Total number of exported functions: 70 #![no_std] @@ -35,6 +35,7 @@ multiversx_sc_wasm_adapter::endpoints! { getRewardPerShare => reward_per_share getRewardReserve => reward_reserve allowExternalClaimBoostedRewards => allow_external_claim_boosted_rewards + getAllowExternalClaimRewards => get_allow_external_claim_rewards getFarmingTokenId => farming_token_id getRewardTokenId => reward_token_id getPerBlockRewardAmount => per_block_reward_amount diff --git a/dex/farm/wasm/src/lib.rs b/dex/farm/wasm/src/lib.rs index f760737d3..ef653de72 100644 --- a/dex/farm/wasm/src/lib.rs +++ b/dex/farm/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 64 +// Endpoints: 65 // Async Callback: 1 -// Total number of exported functions: 66 +// Total number of exported functions: 67 #![no_std] @@ -36,6 +36,7 @@ multiversx_sc_wasm_adapter::endpoints! { getRewardPerShare => reward_per_share getRewardReserve => reward_reserve allowExternalClaimBoostedRewards => allow_external_claim_boosted_rewards + getAllowExternalClaimRewards => get_allow_external_claim_rewards getFarmingTokenId => farming_token_id getRewardTokenId => reward_token_id getPerBlockRewardAmount => per_block_reward_amount diff --git a/farm-staking/farm-staking/wasm/src/lib.rs b/farm-staking/farm-staking/wasm/src/lib.rs index b938d5475..1baf98ce9 100644 --- a/farm-staking/farm-staking/wasm/src/lib.rs +++ b/farm-staking/farm-staking/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 69 +// Endpoints: 70 // Async Callback: 1 -// Total number of exported functions: 71 +// Total number of exported functions: 72 #![no_std] @@ -38,6 +38,7 @@ multiversx_sc_wasm_adapter::endpoints! { getRewardPerShare => reward_per_share getRewardReserve => reward_reserve allowExternalClaimBoostedRewards => allow_external_claim_boosted_rewards + getAllowExternalClaimRewards => get_allow_external_claim_rewards getFarmingTokenId => farming_token_id getRewardTokenId => reward_token_id getPerBlockRewardAmount => per_block_reward_amount From 52f976b1f08f84ec1e731efcc3004fc408871f02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Wed, 20 Dec 2023 09:10:22 +0200 Subject: [PATCH 144/213] Framework upgrade 0.45.2 --- common/common_errors/Cargo.toml | 2 +- common/common_structs/Cargo.toml | 2 +- common/modules/farm/config/Cargo.toml | 2 +- common/modules/farm/contexts/Cargo.toml | 4 +- common/modules/farm/events/Cargo.toml | 2 +- common/modules/farm/farm_base_impl/Cargo.toml | 6 +- common/modules/farm/farm_token/Cargo.toml | 4 +- .../modules/farm/farm_token_merge/Cargo.toml | 4 +- common/modules/farm/rewards/Cargo.toml | 4 +- .../legacy_token_decode_module/Cargo.toml | 2 +- common/modules/locking_module/Cargo.toml | 2 +- common/modules/math/Cargo.toml | 2 +- common/modules/pausable/Cargo.toml | 2 +- common/modules/permissions_module/Cargo.toml | 4 +- .../permissions_module/src/permissions.rs | 1 + common/modules/sc_whitelist_module/Cargo.toml | 2 +- common/modules/token_merge_helper/Cargo.toml | 2 +- common/modules/token_send/Cargo.toml | 2 +- common/modules/utils/Cargo.toml | 2 +- common/traits/fixed-supply-token/Cargo.toml | 2 +- common/traits/mergeable/Cargo.toml | 2 +- common/traits/unwrappable/Cargo.toml | 2 +- dex/Cargo.toml | 6 +- dex/farm-with-locked-rewards/Cargo.toml | 6 +- dex/farm-with-locked-rewards/meta/Cargo.toml | 2 +- dex/farm-with-locked-rewards/wasm/Cargo.lock | 645 ---------------- dex/farm-with-locked-rewards/wasm/Cargo.toml | 2 +- dex/farm/Cargo.toml | 6 +- dex/farm/meta/Cargo.toml | 2 +- dex/farm/wasm/Cargo.lock | 615 --------------- dex/farm/wasm/Cargo.toml | 2 +- dex/fuzz/Cargo.toml | 4 +- dex/governance/Cargo.toml | 4 +- dex/governance/meta/Cargo.toml | 2 +- dex/governance/wasm/Cargo.lock | 258 ------- dex/governance/wasm/Cargo.toml | 2 +- dex/pair-mock/Cargo.toml | 4 +- dex/pair-mock/meta/Cargo.toml | 2 +- dex/pair-mock/wasm/Cargo.lock | 282 ------- dex/pair-mock/wasm/Cargo.toml | 2 +- dex/pair/Cargo.toml | 4 +- dex/pair/meta/Cargo.toml | 2 +- dex/pair/wasm-pair-full/Cargo.lock | 476 ------------ dex/pair/wasm-pair-full/Cargo.toml | 2 +- dex/pair/wasm-safe-price-view/Cargo.lock | 476 ------------ dex/pair/wasm-safe-price-view/Cargo.toml | 2 +- dex/pair/wasm/Cargo.lock | 476 ------------ dex/pair/wasm/Cargo.toml | 2 +- dex/price-discovery/Cargo.toml | 6 +- dex/price-discovery/meta/Cargo.toml | 2 +- dex/price-discovery/wasm/Cargo.lock | 383 ---------- dex/price-discovery/wasm/Cargo.toml | 2 +- dex/proxy-deployer/Cargo.toml | 4 +- dex/proxy-deployer/meta/Cargo.toml | 2 +- dex/proxy-deployer/wasm/Cargo.lock | 626 ---------------- dex/proxy-deployer/wasm/Cargo.toml | 2 +- dex/router/Cargo.toml | 4 +- dex/router/meta/Cargo.toml | 2 +- dex/router/wasm/Cargo.lock | 488 ------------ dex/router/wasm/Cargo.toml | 2 +- .../common-modules/energy-query/Cargo.toml | 2 +- .../week-timekeeping/Cargo.toml | 2 +- .../weekly-rewards-splitting/Cargo.toml | 2 +- energy-integration/common-types/Cargo.toml | 2 +- .../energy-factory-mock/Cargo.toml | 4 +- .../energy-factory-mock/meta/Cargo.toml | 2 +- .../energy-factory-mock/wasm/Cargo.lock | 374 ---------- .../energy-factory-mock/wasm/Cargo.toml | 2 +- energy-integration/energy-update/Cargo.toml | 6 +- .../energy-update/meta/Cargo.toml | 2 +- .../energy-update/wasm/Cargo.lock | 625 ---------------- .../energy-update/wasm/Cargo.toml | 2 +- .../farm-boosted-yields/Cargo.toml | 2 +- energy-integration/fees-collector/Cargo.toml | 6 +- .../fees-collector/meta/Cargo.toml | 2 +- .../fees-collector/wasm/Cargo.lock | 420 ----------- .../fees-collector/wasm/Cargo.toml | 2 +- energy-integration/governance-v2/Cargo.toml | 4 +- .../governance-v2/meta/Cargo.toml | 2 +- .../governance-v2/wasm/Cargo.lock | 440 ----------- .../governance-v2/wasm/Cargo.toml | 2 +- farm-staking/farm-staking-proxy/Cargo.toml | 6 +- .../farm-staking-proxy/meta/Cargo.toml | 2 +- .../farm-staking-proxy/wasm/Cargo.lock | 706 ------------------ .../farm-staking-proxy/wasm/Cargo.toml | 2 +- farm-staking/farm-staking/Cargo.toml | 6 +- farm-staking/farm-staking/meta/Cargo.toml | 2 +- farm-staking/farm-staking/wasm/Cargo.lock | 646 ---------------- farm-staking/farm-staking/wasm/Cargo.toml | 2 +- farm-staking/metabonding-staking/Cargo.toml | 6 +- .../metabonding-staking/meta/Cargo.toml | 2 +- .../metabonding-staking/wasm/Cargo.lock | 467 ------------ .../metabonding-staking/wasm/Cargo.toml | 2 +- locked-asset/Cargo.toml | 6 +- locked-asset/distribution/Cargo.toml | 4 +- locked-asset/distribution/meta/Cargo.toml | 2 +- locked-asset/distribution/wasm/Cargo.lock | 467 ------------ locked-asset/distribution/wasm/Cargo.toml | 2 +- locked-asset/energy-factory/Cargo.toml | 6 +- locked-asset/energy-factory/meta/Cargo.toml | 2 +- locked-asset/energy-factory/wasm/Cargo.lock | 358 --------- locked-asset/energy-factory/wasm/Cargo.toml | 2 +- locked-asset/factory/Cargo.toml | 6 +- locked-asset/factory/meta/Cargo.toml | 2 +- locked-asset/factory/wasm/Cargo.lock | 458 ------------ locked-asset/factory/wasm/Cargo.toml | 2 +- locked-asset/lkmex-transfer/Cargo.toml | 6 +- locked-asset/lkmex-transfer/meta/Cargo.toml | 2 +- locked-asset/lkmex-transfer/wasm/Cargo.lock | 389 ---------- locked-asset/lkmex-transfer/wasm/Cargo.toml | 2 +- locked-asset/locked-token-wrapper/Cargo.toml | 6 +- .../locked-token-wrapper/meta/Cargo.toml | 2 +- .../locked-token-wrapper/wasm/Cargo.lock | 413 ---------- .../locked-token-wrapper/wasm/Cargo.toml | 2 +- locked-asset/proxy_dex/Cargo.toml | 6 +- locked-asset/proxy_dex/meta/Cargo.toml | 2 +- locked-asset/proxy_dex/wasm/Cargo.lock | 669 ----------------- locked-asset/proxy_dex/wasm/Cargo.toml | 2 +- locked-asset/simple-lock-whitelist/Cargo.toml | 6 +- .../simple-lock-whitelist/meta/Cargo.toml | 2 +- .../simple-lock-whitelist/wasm/Cargo.lock | 328 -------- .../simple-lock-whitelist/wasm/Cargo.toml | 2 +- locked-asset/simple-lock/Cargo.toml | 6 +- locked-asset/simple-lock/meta/Cargo.toml | 2 +- locked-asset/simple-lock/wasm/Cargo.lock | 308 -------- locked-asset/simple-lock/wasm/Cargo.toml | 2 +- locked-asset/token-unstake/Cargo.toml | 6 +- locked-asset/token-unstake/meta/Cargo.toml | 2 +- locked-asset/token-unstake/wasm/Cargo.lock | 395 ---------- locked-asset/token-unstake/wasm/Cargo.toml | 2 +- pause-all/Cargo.toml | 6 +- pause-all/meta/Cargo.toml | 2 +- pause-all/wasm/Cargo.lock | 293 -------- pause-all/wasm/Cargo.toml | 2 +- 134 files changed, 161 insertions(+), 12641 deletions(-) delete mode 100644 dex/farm-with-locked-rewards/wasm/Cargo.lock delete mode 100644 dex/farm/wasm/Cargo.lock delete mode 100644 dex/governance/wasm/Cargo.lock delete mode 100644 dex/pair-mock/wasm/Cargo.lock delete mode 100644 dex/pair/wasm-pair-full/Cargo.lock delete mode 100644 dex/pair/wasm-safe-price-view/Cargo.lock delete mode 100644 dex/pair/wasm/Cargo.lock delete mode 100644 dex/price-discovery/wasm/Cargo.lock delete mode 100644 dex/proxy-deployer/wasm/Cargo.lock delete mode 100644 dex/router/wasm/Cargo.lock delete mode 100644 energy-integration/energy-factory-mock/wasm/Cargo.lock delete mode 100644 energy-integration/energy-update/wasm/Cargo.lock delete mode 100644 energy-integration/fees-collector/wasm/Cargo.lock delete mode 100644 energy-integration/governance-v2/wasm/Cargo.lock delete mode 100644 farm-staking/farm-staking-proxy/wasm/Cargo.lock delete mode 100644 farm-staking/farm-staking/wasm/Cargo.lock delete mode 100644 farm-staking/metabonding-staking/wasm/Cargo.lock delete mode 100644 locked-asset/distribution/wasm/Cargo.lock delete mode 100644 locked-asset/energy-factory/wasm/Cargo.lock delete mode 100644 locked-asset/factory/wasm/Cargo.lock delete mode 100644 locked-asset/lkmex-transfer/wasm/Cargo.lock delete mode 100644 locked-asset/locked-token-wrapper/wasm/Cargo.lock delete mode 100644 locked-asset/proxy_dex/wasm/Cargo.lock delete mode 100644 locked-asset/simple-lock-whitelist/wasm/Cargo.lock delete mode 100644 locked-asset/simple-lock/wasm/Cargo.lock delete mode 100644 locked-asset/token-unstake/wasm/Cargo.lock delete mode 100644 pause-all/wasm/Cargo.lock diff --git a/common/common_errors/Cargo.toml b/common/common_errors/Cargo.toml index b5c633cf8..533491ee0 100644 --- a/common/common_errors/Cargo.toml +++ b/common/common_errors/Cargo.toml @@ -8,5 +8,5 @@ edition = "2021" path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/common_structs/Cargo.toml b/common/common_structs/Cargo.toml index 5d3b853af..ae9425ff9 100644 --- a/common/common_structs/Cargo.toml +++ b/common/common_structs/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.mergeable] diff --git a/common/modules/farm/config/Cargo.toml b/common/modules/farm/config/Cargo.toml index 46bcfcda3..99faae217 100644 --- a/common/modules/farm/config/Cargo.toml +++ b/common/modules/farm/config/Cargo.toml @@ -23,5 +23,5 @@ path = "../../pausable" path = "../../permissions_module" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/farm/contexts/Cargo.toml b/common/modules/farm/contexts/Cargo.toml index c3e261f27..3c1bb6649 100644 --- a/common/modules/farm/contexts/Cargo.toml +++ b/common/modules/farm/contexts/Cargo.toml @@ -35,8 +35,8 @@ path = "../../pausable" path = "../../permissions_module" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.45.1" +version = "=0.45.2" diff --git a/common/modules/farm/events/Cargo.toml b/common/modules/farm/events/Cargo.toml index 7a2bd48df..244a8e514 100644 --- a/common/modules/farm/events/Cargo.toml +++ b/common/modules/farm/events/Cargo.toml @@ -14,5 +14,5 @@ path = "../../../common_structs" path = "../contexts" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/farm/farm_base_impl/Cargo.toml b/common/modules/farm/farm_base_impl/Cargo.toml index c3cc61a4d..79013c05c 100644 --- a/common/modules/farm/farm_base_impl/Cargo.toml +++ b/common/modules/farm/farm_base_impl/Cargo.toml @@ -50,11 +50,11 @@ path = "../../../traits/mergeable" path = "../../../traits/fixed-supply-token" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.45.1" +version = "=0.45.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.1" +version = "=0.45.2" diff --git a/common/modules/farm/farm_token/Cargo.toml b/common/modules/farm/farm_token/Cargo.toml index 3ecd30056..24154dfe6 100644 --- a/common/modules/farm/farm_token/Cargo.toml +++ b/common/modules/farm/farm_token/Cargo.toml @@ -26,8 +26,8 @@ path = "../../pausable" path = "../../permissions_module" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.45.1" +version = "=0.45.2" diff --git a/common/modules/farm/farm_token_merge/Cargo.toml b/common/modules/farm/farm_token_merge/Cargo.toml index 900965698..395d15072 100644 --- a/common/modules/farm/farm_token_merge/Cargo.toml +++ b/common/modules/farm/farm_token_merge/Cargo.toml @@ -22,8 +22,8 @@ path = "../../token_merge_helper" path = "../farm_token" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.45.1" +version = "=0.45.2" diff --git a/common/modules/farm/rewards/Cargo.toml b/common/modules/farm/rewards/Cargo.toml index 5bc3b2d99..606e04ef9 100644 --- a/common/modules/farm/rewards/Cargo.toml +++ b/common/modules/farm/rewards/Cargo.toml @@ -29,8 +29,8 @@ path = "../../pausable" path = "../../permissions_module" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.45.1" +version = "=0.45.2" diff --git a/common/modules/legacy_token_decode_module/Cargo.toml b/common/modules/legacy_token_decode_module/Cargo.toml index 763f657e9..636a9418d 100644 --- a/common/modules/legacy_token_decode_module/Cargo.toml +++ b/common/modules/legacy_token_decode_module/Cargo.toml @@ -8,7 +8,7 @@ edition = "2018" path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.common_structs] diff --git a/common/modules/locking_module/Cargo.toml b/common/modules/locking_module/Cargo.toml index 5758d06ba..8976ebabd 100644 --- a/common/modules/locking_module/Cargo.toml +++ b/common/modules/locking_module/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.simple-lock] diff --git a/common/modules/math/Cargo.toml b/common/modules/math/Cargo.toml index eb662b047..fc1b4014f 100644 --- a/common/modules/math/Cargo.toml +++ b/common/modules/math/Cargo.toml @@ -8,5 +8,5 @@ edition = "2021" path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/pausable/Cargo.toml b/common/modules/pausable/Cargo.toml index a6d964ecc..2fa1fdf6b 100644 --- a/common/modules/pausable/Cargo.toml +++ b/common/modules/pausable/Cargo.toml @@ -11,5 +11,5 @@ path = "src/pausable.rs" path = "../permissions_module" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/permissions_module/Cargo.toml b/common/modules/permissions_module/Cargo.toml index ce4aa0ff9..e5e960814 100644 --- a/common/modules/permissions_module/Cargo.toml +++ b/common/modules/permissions_module/Cargo.toml @@ -11,11 +11,11 @@ edition = "2021" path = "src/permissions_module.rs" [dependencies] -bitflags = "1.3.2" +bitflags = "2.4.1" [dependencies.common_errors] path = "../../common_errors" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/permissions_module/src/permissions.rs b/common/modules/permissions_module/src/permissions.rs index db63950ca..623c72718 100644 --- a/common/modules/permissions_module/src/permissions.rs +++ b/common/modules/permissions_module/src/permissions.rs @@ -4,6 +4,7 @@ use multiversx_sc::{ codec::{DecodeError, TopDecode, TopEncode}, }; bitflags! { + #[derive(Clone)] pub struct Permissions: u32 { const NONE = 0; const OWNER = 1; diff --git a/common/modules/sc_whitelist_module/Cargo.toml b/common/modules/sc_whitelist_module/Cargo.toml index 6daa10013..df68e6dcd 100644 --- a/common/modules/sc_whitelist_module/Cargo.toml +++ b/common/modules/sc_whitelist_module/Cargo.toml @@ -11,5 +11,5 @@ path = "src/sc_whitelist_module.rs" path = "../../common_errors" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/token_merge_helper/Cargo.toml b/common/modules/token_merge_helper/Cargo.toml index 5cbbe8cf1..626ed6bad 100644 --- a/common/modules/token_merge_helper/Cargo.toml +++ b/common/modules/token_merge_helper/Cargo.toml @@ -11,5 +11,5 @@ path = "src/lib.rs" path = "../../common_errors" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/token_send/Cargo.toml b/common/modules/token_send/Cargo.toml index 33a3ec594..4b70a5293 100644 --- a/common/modules/token_send/Cargo.toml +++ b/common/modules/token_send/Cargo.toml @@ -14,5 +14,5 @@ path = "../../common_structs" path = "../../common_errors" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/utils/Cargo.toml b/common/modules/utils/Cargo.toml index 26f1fd2d9..2c64b0ef7 100644 --- a/common/modules/utils/Cargo.toml +++ b/common/modules/utils/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.common_structs] diff --git a/common/traits/fixed-supply-token/Cargo.toml b/common/traits/fixed-supply-token/Cargo.toml index f1c259334..b4e0386ec 100644 --- a/common/traits/fixed-supply-token/Cargo.toml +++ b/common/traits/fixed-supply-token/Cargo.toml @@ -8,4 +8,4 @@ edition = "2021" path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" diff --git a/common/traits/mergeable/Cargo.toml b/common/traits/mergeable/Cargo.toml index c089e91ea..5de5b862a 100644 --- a/common/traits/mergeable/Cargo.toml +++ b/common/traits/mergeable/Cargo.toml @@ -8,5 +8,5 @@ edition = "2021" path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/traits/unwrappable/Cargo.toml b/common/traits/unwrappable/Cargo.toml index 0f75c390d..4801e658e 100644 --- a/common/traits/unwrappable/Cargo.toml +++ b/common/traits/unwrappable/Cargo.toml @@ -8,5 +8,5 @@ edition = "2021" path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] diff --git a/dex/Cargo.toml b/dex/Cargo.toml index b6337bc18..8d22ce26f 100644 --- a/dex/Cargo.toml +++ b/dex/Cargo.toml @@ -5,17 +5,17 @@ edition = "2021" publish = false [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-modules] -version = "=0.45.1" +version = "=0.45.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.1" +version = "=0.45.2" [dev-dependencies.config] path = "../common/modules/farm/config" diff --git a/dex/farm-with-locked-rewards/Cargo.toml b/dex/farm-with-locked-rewards/Cargo.toml index 96817d3e5..c681b9a26 100644 --- a/dex/farm-with-locked-rewards/Cargo.toml +++ b/dex/farm-with-locked-rewards/Cargo.toml @@ -75,17 +75,17 @@ path = "../../locked-asset/energy-factory" path = "../../energy-integration/common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.45.1" +version = "=0.45.2" [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.1" +version = "=0.45.2" [dev-dependencies.simple-lock] path = "../../locked-asset/simple-lock" diff --git a/dex/farm-with-locked-rewards/meta/Cargo.toml b/dex/farm-with-locked-rewards/meta/Cargo.toml index 93a54b97b..108fc94d7 100644 --- a/dex/farm-with-locked-rewards/meta/Cargo.toml +++ b/dex/farm-with-locked-rewards/meta/Cargo.toml @@ -9,5 +9,5 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.1" +version = "0.45.2" default-features = false diff --git a/dex/farm-with-locked-rewards/wasm/Cargo.lock b/dex/farm-with-locked-rewards/wasm/Cargo.lock deleted file mode 100644 index f4eff6884..000000000 --- a/dex/farm-with-locked-rewards/wasm/Cargo.lock +++ /dev/null @@ -1,645 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - -[[package]] -name = "arrayvec" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "common-types" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "config" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "contexts" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "farm_token", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "rewards", - "token_merge_helper", - "token_send", -] - -[[package]] -name = "either" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "energy-query" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", -] - -[[package]] -name = "events" -version = "0.0.0" -dependencies = [ - "common_structs", - "contexts", - "multiversx-sc", -] - -[[package]] -name = "farm" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "contexts", - "energy-query", - "events", - "farm-boosted-yields", - "farm_base_impl", - "farm_token", - "fixed-supply-token", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pair", - "pausable", - "permissions_module", - "rewards", - "sc_whitelist_module", - "token_send", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "farm-boosted-yields" -version = "0.0.0" -dependencies = [ - "common-types", - "config", - "energy-query", - "multiversx-sc", - "pausable", - "permissions_module", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "farm-with-locked-rewards" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "contexts", - "energy-factory", - "energy-query", - "events", - "farm", - "farm-boosted-yields", - "farm_base_impl", - "farm_token", - "fixed-supply-token", - "locking_module", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "rewards", - "sc_whitelist_module", - "token_send", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "farm-with-locked-rewards-wasm" -version = "0.0.0" -dependencies = [ - "farm-with-locked-rewards", - "multiversx-sc-wasm-adapter", -] - -[[package]] -name = "farm_base_impl" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "contexts", - "events", - "farm_token", - "fixed-supply-token", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "rewards", - "token_merge_helper", - "token_send", - "utils", -] - -[[package]] -name = "farm_token" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "fees-collector" -version = "0.0.0" -dependencies = [ - "common-types", - "common_errors", - "energy-factory", - "energy-query", - "locking_module", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "locking_module" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", - "simple-lock", -] - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" -dependencies = [ - "bitflags", - "hashbrown", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" - -[[package]] -name = "pair" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "fees-collector", - "itertools", - "multiversx-sc", - "pausable", - "permissions_module", - "simple-lock", - "token_send", -] - -[[package]] -name = "pausable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", - "permissions_module", -] - -[[package]] -name = "permissions_module" -version = "0.0.0" -dependencies = [ - "bitflags", - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "proc-macro2" -version = "1.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "rewards" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "farm_token", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" - -[[package]] -name = "syn" -version = "1.0.107" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "token_merge_helper" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "token_send" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", -] - -[[package]] -name = "unicode-ident" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "week-timekeeping" -version = "0.0.0" -dependencies = [ - "common-types", - "multiversx-sc", -] - -[[package]] -name = "weekly-rewards-splitting" -version = "0.0.0" -dependencies = [ - "common-types", - "energy-query", - "math", - "multiversx-sc", - "unwrappable", - "week-timekeeping", -] - -[[package]] -name = "zerocopy" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.32", -] diff --git a/dex/farm-with-locked-rewards/wasm/Cargo.toml b/dex/farm-with-locked-rewards/wasm/Cargo.toml index d99bc8a30..1dae9301a 100644 --- a/dex/farm-with-locked-rewards/wasm/Cargo.toml +++ b/dex/farm-with-locked-rewards/wasm/Cargo.toml @@ -24,7 +24,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.1" +version = "=0.45.2" [workspace] members = ["."] diff --git a/dex/farm/Cargo.toml b/dex/farm/Cargo.toml index be1ce3b4c..78a83310c 100644 --- a/dex/farm/Cargo.toml +++ b/dex/farm/Cargo.toml @@ -69,11 +69,11 @@ path = "../../energy-integration/common-modules/weekly-rewards-splitting" path = "../../energy-integration/common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.45.1" +version = "=0.45.2" [dev-dependencies] num-bigint = "0.4.2" @@ -82,7 +82,7 @@ num-bigint = "0.4.2" path = "../../energy-integration/energy-update" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.1" +version = "=0.45.2" [dev-dependencies.energy-factory-mock] path = "../../energy-integration/energy-factory-mock" diff --git a/dex/farm/meta/Cargo.toml b/dex/farm/meta/Cargo.toml index 528a6e60e..51e69c1f8 100644 --- a/dex/farm/meta/Cargo.toml +++ b/dex/farm/meta/Cargo.toml @@ -9,5 +9,5 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.1" +version = "0.45.2" default-features = false diff --git a/dex/farm/wasm/Cargo.lock b/dex/farm/wasm/Cargo.lock deleted file mode 100644 index cad4d8f84..000000000 --- a/dex/farm/wasm/Cargo.lock +++ /dev/null @@ -1,615 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - -[[package]] -name = "arrayvec" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "common-types" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "config" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "contexts" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "farm_token", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "rewards", - "token_merge_helper", - "token_send", -] - -[[package]] -name = "either" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "energy-query" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", -] - -[[package]] -name = "events" -version = "0.0.0" -dependencies = [ - "common_structs", - "contexts", - "multiversx-sc", -] - -[[package]] -name = "farm" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "contexts", - "energy-query", - "events", - "farm-boosted-yields", - "farm_base_impl", - "farm_token", - "fixed-supply-token", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pair", - "pausable", - "permissions_module", - "rewards", - "sc_whitelist_module", - "token_send", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "farm-boosted-yields" -version = "0.0.0" -dependencies = [ - "common-types", - "config", - "energy-query", - "multiversx-sc", - "pausable", - "permissions_module", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "farm-wasm" -version = "0.0.0" -dependencies = [ - "farm", - "multiversx-sc-wasm-adapter", -] - -[[package]] -name = "farm_base_impl" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "contexts", - "events", - "farm_token", - "fixed-supply-token", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "rewards", - "token_merge_helper", - "token_send", - "utils", -] - -[[package]] -name = "farm_token" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "fees-collector" -version = "0.0.0" -dependencies = [ - "common-types", - "common_errors", - "energy-factory", - "energy-query", - "locking_module", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "locking_module" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", - "simple-lock", -] - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" -dependencies = [ - "bitflags", - "hashbrown", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" - -[[package]] -name = "pair" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "fees-collector", - "itertools", - "multiversx-sc", - "pausable", - "permissions_module", - "simple-lock", - "token_send", -] - -[[package]] -name = "pausable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", - "permissions_module", -] - -[[package]] -name = "permissions_module" -version = "0.0.0" -dependencies = [ - "bitflags", - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "proc-macro2" -version = "1.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "rewards" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "farm_token", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" - -[[package]] -name = "syn" -version = "1.0.107" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "token_merge_helper" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "token_send" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", -] - -[[package]] -name = "unicode-ident" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "week-timekeeping" -version = "0.0.0" -dependencies = [ - "common-types", - "multiversx-sc", -] - -[[package]] -name = "weekly-rewards-splitting" -version = "0.0.0" -dependencies = [ - "common-types", - "energy-query", - "math", - "multiversx-sc", - "unwrappable", - "week-timekeeping", -] - -[[package]] -name = "zerocopy" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.32", -] diff --git a/dex/farm/wasm/Cargo.toml b/dex/farm/wasm/Cargo.toml index 7b6c5f571..cc2ae376d 100644 --- a/dex/farm/wasm/Cargo.toml +++ b/dex/farm/wasm/Cargo.toml @@ -24,7 +24,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.1" +version = "=0.45.2" [workspace] members = ["."] diff --git a/dex/fuzz/Cargo.toml b/dex/fuzz/Cargo.toml index 41bdbb843..9aa8097a1 100644 --- a/dex/fuzz/Cargo.toml +++ b/dex/fuzz/Cargo.toml @@ -12,11 +12,11 @@ num-bigint = "0.4.2" rand = "0.8.4" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-scenario] -version = "=0.45.1" +version = "=0.45.2" [dependencies.pausable] path = "../../common/modules/pausable" diff --git a/dex/governance/Cargo.toml b/dex/governance/Cargo.toml index 3f97655c5..b224ca25f 100644 --- a/dex/governance/Cargo.toml +++ b/dex/governance/Cargo.toml @@ -9,14 +9,14 @@ publish = false path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.1" +version = "=0.45.2" [dev-dependencies.pair-mock] path = "../pair-mock" diff --git a/dex/governance/meta/Cargo.toml b/dex/governance/meta/Cargo.toml index 7c7d7e8f4..ad90459d6 100644 --- a/dex/governance/meta/Cargo.toml +++ b/dex/governance/meta/Cargo.toml @@ -11,5 +11,5 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.1" +version = "0.45.2" default-features = false diff --git a/dex/governance/wasm/Cargo.lock b/dex/governance/wasm/Cargo.lock deleted file mode 100644 index 99ba531ee..000000000 --- a/dex/governance/wasm/Cargo.lock +++ /dev/null @@ -1,258 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - -[[package]] -name = "arrayvec" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "governance" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "governance-wasm" -version = "0.0.0" -dependencies = [ - "governance", - "multiversx-sc-wasm-adapter", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "multiversx-sc" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" -dependencies = [ - "bitflags", - "hashbrown", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" - -[[package]] -name = "proc-macro2" -version = "1.0.67" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "smallvec" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" - -[[package]] -name = "syn" -version = "1.0.107" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.39" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "unicode-ident" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "zerocopy" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.39", -] diff --git a/dex/governance/wasm/Cargo.toml b/dex/governance/wasm/Cargo.toml index ac6cf37c7..0e22d2d36 100644 --- a/dex/governance/wasm/Cargo.toml +++ b/dex/governance/wasm/Cargo.toml @@ -24,7 +24,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.1" +version = "=0.45.2" [workspace] members = ["."] diff --git a/dex/pair-mock/Cargo.toml b/dex/pair-mock/Cargo.toml index 9094c8c8e..ab530b3cb 100644 --- a/dex/pair-mock/Cargo.toml +++ b/dex/pair-mock/Cargo.toml @@ -12,7 +12,7 @@ path = "src/pair.rs" path = "../../common/common_errors" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.itertools] @@ -20,4 +20,4 @@ version = "0.10.1" default-features = false [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.1" +version = "=0.45.2" diff --git a/dex/pair-mock/meta/Cargo.toml b/dex/pair-mock/meta/Cargo.toml index 7b88fa807..788d25b8c 100644 --- a/dex/pair-mock/meta/Cargo.toml +++ b/dex/pair-mock/meta/Cargo.toml @@ -11,5 +11,5 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.1" +version = "0.45.2" default-features = false diff --git a/dex/pair-mock/wasm/Cargo.lock b/dex/pair-mock/wasm/Cargo.lock deleted file mode 100644 index 094057e7c..000000000 --- a/dex/pair-mock/wasm/Cargo.lock +++ /dev/null @@ -1,282 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - -[[package]] -name = "arrayvec" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "either" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "multiversx-sc" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" -dependencies = [ - "bitflags", - "hashbrown", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" - -[[package]] -name = "pair-mock" -version = "0.0.0" -dependencies = [ - "common_errors", - "itertools", - "multiversx-sc", -] - -[[package]] -name = "pair-mock-wasm" -version = "0.0.0" -dependencies = [ - "multiversx-sc-wasm-adapter", - "pair-mock", -] - -[[package]] -name = "proc-macro2" -version = "1.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "smallvec" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" - -[[package]] -name = "syn" -version = "1.0.107" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "unicode-ident" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "zerocopy" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.32", -] diff --git a/dex/pair-mock/wasm/Cargo.toml b/dex/pair-mock/wasm/Cargo.toml index 9f13e95de..a6a87b14d 100644 --- a/dex/pair-mock/wasm/Cargo.toml +++ b/dex/pair-mock/wasm/Cargo.toml @@ -24,7 +24,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.1" +version = "=0.45.2" [workspace] members = ["."] diff --git a/dex/pair/Cargo.toml b/dex/pair/Cargo.toml index a93416232..c60efb4f0 100644 --- a/dex/pair/Cargo.toml +++ b/dex/pair/Cargo.toml @@ -34,11 +34,11 @@ version = "0.10.1" default-features = false [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.1" +version = "=0.45.2" diff --git a/dex/pair/meta/Cargo.toml b/dex/pair/meta/Cargo.toml index 60a6e2018..ab18428df 100644 --- a/dex/pair/meta/Cargo.toml +++ b/dex/pair/meta/Cargo.toml @@ -9,5 +9,5 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.1" +version = "0.45.2" default-features = false diff --git a/dex/pair/wasm-pair-full/Cargo.lock b/dex/pair/wasm-pair-full/Cargo.lock deleted file mode 100644 index 033478aec..000000000 --- a/dex/pair/wasm-pair-full/Cargo.lock +++ /dev/null @@ -1,476 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "common-types" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "energy-query" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", -] - -[[package]] -name = "fees-collector" -version = "0.0.0" -dependencies = [ - "common-types", - "common_errors", - "energy-factory", - "energy-query", - "locking_module", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "locking_module" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", - "simple-lock", -] - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" -dependencies = [ - "bitflags", - "hashbrown", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn 1.0.109", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" - -[[package]] -name = "pair" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "fees-collector", - "itertools", - "multiversx-sc", - "pausable", - "permissions_module", - "simple-lock", - "token_send", -] - -[[package]] -name = "pair-full-wasm" -version = "0.0.0" -dependencies = [ - "multiversx-sc-wasm-adapter", - "pair", -] - -[[package]] -name = "pausable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", - "permissions_module", -] - -[[package]] -name = "permissions_module" -version = "0.0.0" -dependencies = [ - "bitflags", - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "proc-macro2" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.39" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "token_send" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "week-timekeeping" -version = "0.0.0" -dependencies = [ - "common-types", - "multiversx-sc", -] - -[[package]] -name = "weekly-rewards-splitting" -version = "0.0.0" -dependencies = [ - "common-types", - "energy-query", - "math", - "multiversx-sc", - "unwrappable", - "week-timekeeping", -] - -[[package]] -name = "zerocopy" -version = "0.7.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cd369a67c0edfef15010f980c3cbe45d7f651deac2cd67ce097cd801de16557" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2f140bda219a26ccc0cdb03dba58af72590c53b22642577d88a927bc5c87d6b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.39", -] diff --git a/dex/pair/wasm-pair-full/Cargo.toml b/dex/pair/wasm-pair-full/Cargo.toml index 860986801..a2ee3ac96 100644 --- a/dex/pair/wasm-pair-full/Cargo.toml +++ b/dex/pair/wasm-pair-full/Cargo.toml @@ -24,7 +24,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.1" +version = "=0.45.2" [workspace] members = ["."] diff --git a/dex/pair/wasm-safe-price-view/Cargo.lock b/dex/pair/wasm-safe-price-view/Cargo.lock deleted file mode 100644 index 7aff5a185..000000000 --- a/dex/pair/wasm-safe-price-view/Cargo.lock +++ /dev/null @@ -1,476 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "common-types" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "energy-query" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", -] - -[[package]] -name = "fees-collector" -version = "0.0.0" -dependencies = [ - "common-types", - "common_errors", - "energy-factory", - "energy-query", - "locking_module", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "locking_module" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", - "simple-lock", -] - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" -dependencies = [ - "bitflags", - "hashbrown", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn 1.0.109", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" - -[[package]] -name = "pair" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "fees-collector", - "itertools", - "multiversx-sc", - "pausable", - "permissions_module", - "simple-lock", - "token_send", -] - -[[package]] -name = "pausable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", - "permissions_module", -] - -[[package]] -name = "permissions_module" -version = "0.0.0" -dependencies = [ - "bitflags", - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "proc-macro2" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "safe-price-view-wasm" -version = "0.0.0" -dependencies = [ - "multiversx-sc-wasm-adapter", - "pair", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.39" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "token_send" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "week-timekeeping" -version = "0.0.0" -dependencies = [ - "common-types", - "multiversx-sc", -] - -[[package]] -name = "weekly-rewards-splitting" -version = "0.0.0" -dependencies = [ - "common-types", - "energy-query", - "math", - "multiversx-sc", - "unwrappable", - "week-timekeeping", -] - -[[package]] -name = "zerocopy" -version = "0.7.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cd369a67c0edfef15010f980c3cbe45d7f651deac2cd67ce097cd801de16557" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2f140bda219a26ccc0cdb03dba58af72590c53b22642577d88a927bc5c87d6b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.39", -] diff --git a/dex/pair/wasm-safe-price-view/Cargo.toml b/dex/pair/wasm-safe-price-view/Cargo.toml index 72cb42e97..7edd6f4a4 100644 --- a/dex/pair/wasm-safe-price-view/Cargo.toml +++ b/dex/pair/wasm-safe-price-view/Cargo.toml @@ -24,7 +24,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.1" +version = "=0.45.2" [workspace] members = ["."] diff --git a/dex/pair/wasm/Cargo.lock b/dex/pair/wasm/Cargo.lock deleted file mode 100644 index c00085fc0..000000000 --- a/dex/pair/wasm/Cargo.lock +++ /dev/null @@ -1,476 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "common-types" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "energy-query" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", -] - -[[package]] -name = "fees-collector" -version = "0.0.0" -dependencies = [ - "common-types", - "common_errors", - "energy-factory", - "energy-query", - "locking_module", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "locking_module" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", - "simple-lock", -] - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" -dependencies = [ - "bitflags", - "hashbrown", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn 1.0.109", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" - -[[package]] -name = "pair" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "fees-collector", - "itertools", - "multiversx-sc", - "pausable", - "permissions_module", - "simple-lock", - "token_send", -] - -[[package]] -name = "pair-wasm" -version = "0.0.0" -dependencies = [ - "multiversx-sc-wasm-adapter", - "pair", -] - -[[package]] -name = "pausable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", - "permissions_module", -] - -[[package]] -name = "permissions_module" -version = "0.0.0" -dependencies = [ - "bitflags", - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "proc-macro2" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.39" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "token_send" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "week-timekeeping" -version = "0.0.0" -dependencies = [ - "common-types", - "multiversx-sc", -] - -[[package]] -name = "weekly-rewards-splitting" -version = "0.0.0" -dependencies = [ - "common-types", - "energy-query", - "math", - "multiversx-sc", - "unwrappable", - "week-timekeeping", -] - -[[package]] -name = "zerocopy" -version = "0.7.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cd369a67c0edfef15010f980c3cbe45d7f651deac2cd67ce097cd801de16557" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2f140bda219a26ccc0cdb03dba58af72590c53b22642577d88a927bc5c87d6b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.39", -] diff --git a/dex/pair/wasm/Cargo.toml b/dex/pair/wasm/Cargo.toml index 57ecc9c6d..0248e4fd5 100644 --- a/dex/pair/wasm/Cargo.toml +++ b/dex/pair/wasm/Cargo.toml @@ -24,7 +24,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.1" +version = "=0.45.2" [workspace] members = ["."] diff --git a/dex/price-discovery/Cargo.toml b/dex/price-discovery/Cargo.toml index 604049058..8c8f6c2ff 100644 --- a/dex/price-discovery/Cargo.toml +++ b/dex/price-discovery/Cargo.toml @@ -12,11 +12,11 @@ path = "src/lib.rs" hex-literal = "0.3.1" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.45.1" +version = "=0.45.2" [dependencies.locking_module] path = "../../common/modules/locking_module" @@ -30,4 +30,4 @@ hex = "0.4" path = "../../locked-asset/simple-lock" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.1" +version = "=0.45.2" diff --git a/dex/price-discovery/meta/Cargo.toml b/dex/price-discovery/meta/Cargo.toml index f1e8ff2c3..4a20900e1 100644 --- a/dex/price-discovery/meta/Cargo.toml +++ b/dex/price-discovery/meta/Cargo.toml @@ -9,5 +9,5 @@ authors = ["Dorin Iancu "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.1" +version = "0.45.2" default-features = false diff --git a/dex/price-discovery/wasm/Cargo.lock b/dex/price-discovery/wasm/Cargo.lock deleted file mode 100644 index 8cc440e6e..000000000 --- a/dex/price-discovery/wasm/Cargo.lock +++ /dev/null @@ -1,383 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - -[[package]] -name = "arrayvec" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "locking_module" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", - "simple-lock", -] - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" -dependencies = [ - "bitflags", - "hashbrown", - "hex-literal 0.4.1", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" - -[[package]] -name = "price-discovery" -version = "0.0.0" -dependencies = [ - "hex-literal 0.3.4", - "locking_module", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "price-discovery-wasm" -version = "0.0.0" -dependencies = [ - "multiversx-sc-wasm-adapter", - "price-discovery", -] - -[[package]] -name = "proc-macro2" -version = "1.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" - -[[package]] -name = "syn" -version = "1.0.107" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "unicode-ident" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "zerocopy" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.32", -] diff --git a/dex/price-discovery/wasm/Cargo.toml b/dex/price-discovery/wasm/Cargo.toml index 5c168e828..8063eaf78 100644 --- a/dex/price-discovery/wasm/Cargo.toml +++ b/dex/price-discovery/wasm/Cargo.toml @@ -24,7 +24,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.1" +version = "=0.45.2" [workspace] members = ["."] diff --git a/dex/proxy-deployer/Cargo.toml b/dex/proxy-deployer/Cargo.toml index 8569a0404..171be109a 100644 --- a/dex/proxy-deployer/Cargo.toml +++ b/dex/proxy-deployer/Cargo.toml @@ -21,11 +21,11 @@ path = "../../common/modules/farm/config" path = "../../common/modules/farm/farm_token" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.1" +version = "=0.45.2" diff --git a/dex/proxy-deployer/meta/Cargo.toml b/dex/proxy-deployer/meta/Cargo.toml index 8ecad5d9b..b4d612a03 100644 --- a/dex/proxy-deployer/meta/Cargo.toml +++ b/dex/proxy-deployer/meta/Cargo.toml @@ -11,5 +11,5 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.1" +version = "0.45.2" default-features = false diff --git a/dex/proxy-deployer/wasm/Cargo.lock b/dex/proxy-deployer/wasm/Cargo.lock deleted file mode 100644 index c41f2f09d..000000000 --- a/dex/proxy-deployer/wasm/Cargo.lock +++ /dev/null @@ -1,626 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - -[[package]] -name = "arrayvec" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "common-types" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "config" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "contexts" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "farm_token", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "rewards", - "token_merge_helper", - "token_send", -] - -[[package]] -name = "either" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "energy-query" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", -] - -[[package]] -name = "events" -version = "0.0.0" -dependencies = [ - "common_structs", - "contexts", - "multiversx-sc", -] - -[[package]] -name = "farm" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "contexts", - "energy-query", - "events", - "farm-boosted-yields", - "farm_base_impl", - "farm_token", - "fixed-supply-token", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pair", - "pausable", - "permissions_module", - "rewards", - "sc_whitelist_module", - "token_send", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "farm-boosted-yields" -version = "0.0.0" -dependencies = [ - "common-types", - "config", - "energy-query", - "multiversx-sc", - "pausable", - "permissions_module", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "farm_base_impl" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "contexts", - "events", - "farm_token", - "fixed-supply-token", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "rewards", - "token_merge_helper", - "token_send", - "utils", -] - -[[package]] -name = "farm_token" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "fees-collector" -version = "0.0.0" -dependencies = [ - "common-types", - "common_errors", - "energy-factory", - "energy-query", - "locking_module", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "locking_module" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", - "simple-lock", -] - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" -dependencies = [ - "bitflags", - "hashbrown", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" - -[[package]] -name = "pair" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "fees-collector", - "itertools", - "multiversx-sc", - "pausable", - "permissions_module", - "simple-lock", - "token_send", -] - -[[package]] -name = "pausable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", - "permissions_module", -] - -[[package]] -name = "permissions_module" -version = "0.0.0" -dependencies = [ - "bitflags", - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "proc-macro2" -version = "1.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "proxy-deployer" -version = "0.0.0" -dependencies = [ - "config", - "farm", - "farm_token", - "multiversx-sc", - "pausable", -] - -[[package]] -name = "proxy-deployer-wasm" -version = "0.0.0" -dependencies = [ - "multiversx-sc-wasm-adapter", - "proxy-deployer", -] - -[[package]] -name = "quote" -version = "1.0.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "rewards" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "farm_token", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" - -[[package]] -name = "syn" -version = "1.0.107" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "token_merge_helper" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "token_send" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", -] - -[[package]] -name = "unicode-ident" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "week-timekeeping" -version = "0.0.0" -dependencies = [ - "common-types", - "multiversx-sc", -] - -[[package]] -name = "weekly-rewards-splitting" -version = "0.0.0" -dependencies = [ - "common-types", - "energy-query", - "math", - "multiversx-sc", - "unwrappable", - "week-timekeeping", -] - -[[package]] -name = "zerocopy" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.32", -] diff --git a/dex/proxy-deployer/wasm/Cargo.toml b/dex/proxy-deployer/wasm/Cargo.toml index e4ddc408f..1c32d76eb 100644 --- a/dex/proxy-deployer/wasm/Cargo.toml +++ b/dex/proxy-deployer/wasm/Cargo.toml @@ -24,7 +24,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.1" +version = "=0.45.2" [workspace] members = ["."] diff --git a/dex/router/Cargo.toml b/dex/router/Cargo.toml index 782266a32..b96ecd5d2 100644 --- a/dex/router/Cargo.toml +++ b/dex/router/Cargo.toml @@ -15,7 +15,7 @@ path = "../../common/modules/token_send" path = "../../common/modules/pausable" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.pair] @@ -28,4 +28,4 @@ path = "../../common/modules/locking_module" path = "../../locked-asset/simple-lock" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.1" +version = "=0.45.2" diff --git a/dex/router/meta/Cargo.toml b/dex/router/meta/Cargo.toml index 3b74d589d..1b850b06c 100644 --- a/dex/router/meta/Cargo.toml +++ b/dex/router/meta/Cargo.toml @@ -9,5 +9,5 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.1" +version = "0.45.2" default-features = false diff --git a/dex/router/wasm/Cargo.lock b/dex/router/wasm/Cargo.lock deleted file mode 100644 index 4d00c8b27..000000000 --- a/dex/router/wasm/Cargo.lock +++ /dev/null @@ -1,488 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - -[[package]] -name = "arrayvec" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "common-types" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "either" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "energy-query" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", -] - -[[package]] -name = "fees-collector" -version = "0.0.0" -dependencies = [ - "common-types", - "common_errors", - "energy-factory", - "energy-query", - "locking_module", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "locking_module" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", - "simple-lock", -] - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" -dependencies = [ - "bitflags", - "hashbrown", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" - -[[package]] -name = "pair" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "fees-collector", - "itertools", - "multiversx-sc", - "pausable", - "permissions_module", - "simple-lock", - "token_send", -] - -[[package]] -name = "pausable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", - "permissions_module", -] - -[[package]] -name = "permissions_module" -version = "0.0.0" -dependencies = [ - "bitflags", - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "proc-macro2" -version = "1.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "router" -version = "0.0.0" -dependencies = [ - "locking_module", - "multiversx-sc", - "pair", - "pausable", - "simple-lock", - "token_send", -] - -[[package]] -name = "router-wasm" -version = "0.0.0" -dependencies = [ - "multiversx-sc-wasm-adapter", - "router", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" - -[[package]] -name = "syn" -version = "1.0.107" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "token_send" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", -] - -[[package]] -name = "unicode-ident" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "week-timekeeping" -version = "0.0.0" -dependencies = [ - "common-types", - "multiversx-sc", -] - -[[package]] -name = "weekly-rewards-splitting" -version = "0.0.0" -dependencies = [ - "common-types", - "energy-query", - "math", - "multiversx-sc", - "unwrappable", - "week-timekeeping", -] - -[[package]] -name = "zerocopy" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.32", -] diff --git a/dex/router/wasm/Cargo.toml b/dex/router/wasm/Cargo.toml index 6c848a614..9f2585560 100644 --- a/dex/router/wasm/Cargo.toml +++ b/dex/router/wasm/Cargo.toml @@ -24,7 +24,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.1" +version = "=0.45.2" [workspace] members = ["."] diff --git a/energy-integration/common-modules/energy-query/Cargo.toml b/energy-integration/common-modules/energy-query/Cargo.toml index b26ea759f..193d37066 100644 --- a/energy-integration/common-modules/energy-query/Cargo.toml +++ b/energy-integration/common-modules/energy-query/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.energy-factory] diff --git a/energy-integration/common-modules/week-timekeeping/Cargo.toml b/energy-integration/common-modules/week-timekeeping/Cargo.toml index b39d7c46a..f79f7f244 100644 --- a/energy-integration/common-modules/week-timekeeping/Cargo.toml +++ b/energy-integration/common-modules/week-timekeeping/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.common-types] diff --git a/energy-integration/common-modules/weekly-rewards-splitting/Cargo.toml b/energy-integration/common-modules/weekly-rewards-splitting/Cargo.toml index 2b9f9dbd2..a48598c22 100644 --- a/energy-integration/common-modules/weekly-rewards-splitting/Cargo.toml +++ b/energy-integration/common-modules/weekly-rewards-splitting/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.energy-query] diff --git a/energy-integration/common-types/Cargo.toml b/energy-integration/common-types/Cargo.toml index 102ed16a3..5a10a67ab 100644 --- a/energy-integration/common-types/Cargo.toml +++ b/energy-integration/common-types/Cargo.toml @@ -8,5 +8,5 @@ edition = "2021" path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] diff --git a/energy-integration/energy-factory-mock/Cargo.toml b/energy-integration/energy-factory-mock/Cargo.toml index 19aa040ef..5e6be1508 100644 --- a/energy-integration/energy-factory-mock/Cargo.toml +++ b/energy-integration/energy-factory-mock/Cargo.toml @@ -12,8 +12,8 @@ path = "src/lib.rs" path = "../common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.1" +version = "=0.45.2" diff --git a/energy-integration/energy-factory-mock/meta/Cargo.toml b/energy-integration/energy-factory-mock/meta/Cargo.toml index 6feebd510..1ec8801fe 100644 --- a/energy-integration/energy-factory-mock/meta/Cargo.toml +++ b/energy-integration/energy-factory-mock/meta/Cargo.toml @@ -11,5 +11,5 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.1" +version = "0.45.2" default-features = false diff --git a/energy-integration/energy-factory-mock/wasm/Cargo.lock b/energy-integration/energy-factory-mock/wasm/Cargo.lock deleted file mode 100644 index 38b809c8b..000000000 --- a/energy-integration/energy-factory-mock/wasm/Cargo.lock +++ /dev/null @@ -1,374 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - -[[package]] -name = "arrayvec" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "energy-factory-mock" -version = "0.0.0" -dependencies = [ - "energy-query", - "multiversx-sc", -] - -[[package]] -name = "energy-factory-mock-wasm" -version = "0.0.0" -dependencies = [ - "energy-factory-mock", - "multiversx-sc-wasm-adapter", -] - -[[package]] -name = "energy-query" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" -dependencies = [ - "bitflags", - "hashbrown", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" - -[[package]] -name = "proc-macro2" -version = "1.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" - -[[package]] -name = "syn" -version = "1.0.107" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "unicode-ident" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "zerocopy" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.32", -] diff --git a/energy-integration/energy-factory-mock/wasm/Cargo.toml b/energy-integration/energy-factory-mock/wasm/Cargo.toml index 38881c4b4..6974d9fc0 100644 --- a/energy-integration/energy-factory-mock/wasm/Cargo.toml +++ b/energy-integration/energy-factory-mock/wasm/Cargo.toml @@ -24,7 +24,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.1" +version = "=0.45.2" [workspace] members = ["."] diff --git a/energy-integration/energy-update/Cargo.toml b/energy-integration/energy-update/Cargo.toml index 3d43c1761..b7d6a7d54 100644 --- a/energy-integration/energy-update/Cargo.toml +++ b/energy-integration/energy-update/Cargo.toml @@ -9,11 +9,11 @@ publish = false path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.45.1" +version = "=0.45.2" [dependencies.farm] path = "../../dex/farm" @@ -25,4 +25,4 @@ path = "../common-modules/weekly-rewards-splitting" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.1" +version = "=0.45.2" diff --git a/energy-integration/energy-update/meta/Cargo.toml b/energy-integration/energy-update/meta/Cargo.toml index 55eae49eb..fdd5be171 100644 --- a/energy-integration/energy-update/meta/Cargo.toml +++ b/energy-integration/energy-update/meta/Cargo.toml @@ -11,5 +11,5 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.1" +version = "0.45.2" default-features = false diff --git a/energy-integration/energy-update/wasm/Cargo.lock b/energy-integration/energy-update/wasm/Cargo.lock deleted file mode 100644 index 3edccc869..000000000 --- a/energy-integration/energy-update/wasm/Cargo.lock +++ /dev/null @@ -1,625 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - -[[package]] -name = "arrayvec" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "common-types" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "config" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "contexts" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "farm_token", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "rewards", - "token_merge_helper", - "token_send", -] - -[[package]] -name = "either" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "energy-query" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", -] - -[[package]] -name = "energy-update" -version = "0.0.0" -dependencies = [ - "farm", - "multiversx-sc", - "multiversx-sc-modules", - "weekly-rewards-splitting", -] - -[[package]] -name = "energy-update-wasm" -version = "0.0.0" -dependencies = [ - "energy-update", - "multiversx-sc-wasm-adapter", -] - -[[package]] -name = "events" -version = "0.0.0" -dependencies = [ - "common_structs", - "contexts", - "multiversx-sc", -] - -[[package]] -name = "farm" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "contexts", - "energy-query", - "events", - "farm-boosted-yields", - "farm_base_impl", - "farm_token", - "fixed-supply-token", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pair", - "pausable", - "permissions_module", - "rewards", - "sc_whitelist_module", - "token_send", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "farm-boosted-yields" -version = "0.0.0" -dependencies = [ - "common-types", - "config", - "energy-query", - "multiversx-sc", - "pausable", - "permissions_module", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "farm_base_impl" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "contexts", - "events", - "farm_token", - "fixed-supply-token", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "rewards", - "token_merge_helper", - "token_send", - "utils", -] - -[[package]] -name = "farm_token" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "fees-collector" -version = "0.0.0" -dependencies = [ - "common-types", - "common_errors", - "energy-factory", - "energy-query", - "locking_module", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "locking_module" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", - "simple-lock", -] - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" -dependencies = [ - "bitflags", - "hashbrown", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" - -[[package]] -name = "pair" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "fees-collector", - "itertools", - "multiversx-sc", - "pausable", - "permissions_module", - "simple-lock", - "token_send", -] - -[[package]] -name = "pausable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", - "permissions_module", -] - -[[package]] -name = "permissions_module" -version = "0.0.0" -dependencies = [ - "bitflags", - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "proc-macro2" -version = "1.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "rewards" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "farm_token", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" - -[[package]] -name = "syn" -version = "1.0.107" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "token_merge_helper" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "token_send" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", -] - -[[package]] -name = "unicode-ident" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "week-timekeeping" -version = "0.0.0" -dependencies = [ - "common-types", - "multiversx-sc", -] - -[[package]] -name = "weekly-rewards-splitting" -version = "0.0.0" -dependencies = [ - "common-types", - "energy-query", - "math", - "multiversx-sc", - "unwrappable", - "week-timekeeping", -] - -[[package]] -name = "zerocopy" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.32", -] diff --git a/energy-integration/energy-update/wasm/Cargo.toml b/energy-integration/energy-update/wasm/Cargo.toml index 106076ba9..d5ba7b533 100644 --- a/energy-integration/energy-update/wasm/Cargo.toml +++ b/energy-integration/energy-update/wasm/Cargo.toml @@ -24,7 +24,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.1" +version = "=0.45.2" [workspace] members = ["."] diff --git a/energy-integration/farm-boosted-yields/Cargo.toml b/energy-integration/farm-boosted-yields/Cargo.toml index f70e8d561..f83469191 100644 --- a/energy-integration/farm-boosted-yields/Cargo.toml +++ b/energy-integration/farm-boosted-yields/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.config] diff --git a/energy-integration/fees-collector/Cargo.toml b/energy-integration/fees-collector/Cargo.toml index 371aba09c..67398c493 100644 --- a/energy-integration/fees-collector/Cargo.toml +++ b/energy-integration/fees-collector/Cargo.toml @@ -9,11 +9,11 @@ publish = false path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.45.1" +version = "=0.45.2" [dependencies.energy-query] path = "../common-modules/energy-query" @@ -49,7 +49,7 @@ path = "../../common/common_errors" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.1" +version = "=0.45.2" [dev-dependencies.sc_whitelist_module] path = "../../common/modules/sc_whitelist_module" diff --git a/energy-integration/fees-collector/meta/Cargo.toml b/energy-integration/fees-collector/meta/Cargo.toml index 4804ca99a..28958a4c9 100644 --- a/energy-integration/fees-collector/meta/Cargo.toml +++ b/energy-integration/fees-collector/meta/Cargo.toml @@ -11,5 +11,5 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.1" +version = "0.45.2" default-features = false diff --git a/energy-integration/fees-collector/wasm/Cargo.lock b/energy-integration/fees-collector/wasm/Cargo.lock deleted file mode 100644 index 01d90f50a..000000000 --- a/energy-integration/fees-collector/wasm/Cargo.lock +++ /dev/null @@ -1,420 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - -[[package]] -name = "arrayvec" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "common-types" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "energy-query" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", -] - -[[package]] -name = "fees-collector" -version = "0.0.0" -dependencies = [ - "common-types", - "common_errors", - "energy-factory", - "energy-query", - "locking_module", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "fees-collector-wasm" -version = "0.0.0" -dependencies = [ - "fees-collector", - "multiversx-sc-wasm-adapter", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "locking_module" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", - "simple-lock", -] - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" -dependencies = [ - "bitflags", - "hashbrown", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" - -[[package]] -name = "proc-macro2" -version = "1.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" - -[[package]] -name = "syn" -version = "1.0.107" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "unicode-ident" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "week-timekeeping" -version = "0.0.0" -dependencies = [ - "common-types", - "multiversx-sc", -] - -[[package]] -name = "weekly-rewards-splitting" -version = "0.0.0" -dependencies = [ - "common-types", - "energy-query", - "math", - "multiversx-sc", - "unwrappable", - "week-timekeeping", -] - -[[package]] -name = "zerocopy" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.32", -] diff --git a/energy-integration/fees-collector/wasm/Cargo.toml b/energy-integration/fees-collector/wasm/Cargo.toml index eed8e6b8a..531c606d8 100644 --- a/energy-integration/fees-collector/wasm/Cargo.toml +++ b/energy-integration/fees-collector/wasm/Cargo.toml @@ -24,7 +24,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.1" +version = "=0.45.2" [workspace] members = ["."] diff --git a/energy-integration/governance-v2/Cargo.toml b/energy-integration/governance-v2/Cargo.toml index 422148e5b..5ba76fc54 100644 --- a/energy-integration/governance-v2/Cargo.toml +++ b/energy-integration/governance-v2/Cargo.toml @@ -12,7 +12,7 @@ path = "src/lib.rs" path = "../common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.permissions_module] @@ -28,7 +28,7 @@ path = "../common-modules/weekly-rewards-splitting" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.1" +version = "=0.45.2" [dev-dependencies.energy-factory-mock] path = "../energy-factory-mock" diff --git a/energy-integration/governance-v2/meta/Cargo.toml b/energy-integration/governance-v2/meta/Cargo.toml index d82963004..44a2c08c1 100644 --- a/energy-integration/governance-v2/meta/Cargo.toml +++ b/energy-integration/governance-v2/meta/Cargo.toml @@ -11,5 +11,5 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.1" +version = "0.45.2" default-features = false diff --git a/energy-integration/governance-v2/wasm/Cargo.lock b/energy-integration/governance-v2/wasm/Cargo.lock deleted file mode 100644 index f3a4c9923..000000000 --- a/energy-integration/governance-v2/wasm/Cargo.lock +++ /dev/null @@ -1,440 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "common-types" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "energy-query" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", -] - -[[package]] -name = "fees-collector" -version = "0.0.0" -dependencies = [ - "common-types", - "common_errors", - "energy-factory", - "energy-query", - "locking_module", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "governance-v2" -version = "0.0.0" -dependencies = [ - "energy-query", - "fees-collector", - "multiversx-sc", - "permissions_module", - "weekly-rewards-splitting", -] - -[[package]] -name = "governance-v2-wasm" -version = "0.0.0" -dependencies = [ - "governance-v2", - "multiversx-sc-wasm-adapter", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "locking_module" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", - "simple-lock", -] - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" -dependencies = [ - "bitflags", - "hashbrown", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn 1.0.109", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" - -[[package]] -name = "permissions_module" -version = "0.0.0" -dependencies = [ - "bitflags", - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "proc-macro2" -version = "1.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "unicode-ident" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "week-timekeeping" -version = "0.0.0" -dependencies = [ - "common-types", - "multiversx-sc", -] - -[[package]] -name = "weekly-rewards-splitting" -version = "0.0.0" -dependencies = [ - "common-types", - "energy-query", - "math", - "multiversx-sc", - "unwrappable", - "week-timekeeping", -] - -[[package]] -name = "zerocopy" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.32", -] diff --git a/energy-integration/governance-v2/wasm/Cargo.toml b/energy-integration/governance-v2/wasm/Cargo.toml index 921e5bb3c..59b888d93 100644 --- a/energy-integration/governance-v2/wasm/Cargo.toml +++ b/energy-integration/governance-v2/wasm/Cargo.toml @@ -24,7 +24,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.1" +version = "=0.45.2" [workspace] members = ["."] diff --git a/farm-staking/farm-staking-proxy/Cargo.toml b/farm-staking/farm-staking-proxy/Cargo.toml index eec567ff5..e724d1e43 100644 --- a/farm-staking/farm-staking-proxy/Cargo.toml +++ b/farm-staking/farm-staking-proxy/Cargo.toml @@ -12,11 +12,11 @@ path = "src/lib.rs" hex-literal = "0.3.1" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.45.1" +version = "=0.45.2" [dependencies.farm] path = "../../dex/farm" @@ -67,7 +67,7 @@ path = "../../energy-integration/common-modules/energy-query" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.1" +version = "=0.45.2" [dev-dependencies.farm_token] path = "../../common/modules/farm/farm_token" diff --git a/farm-staking/farm-staking-proxy/meta/Cargo.toml b/farm-staking/farm-staking-proxy/meta/Cargo.toml index 09920700e..dc41bf009 100644 --- a/farm-staking/farm-staking-proxy/meta/Cargo.toml +++ b/farm-staking/farm-staking-proxy/meta/Cargo.toml @@ -11,5 +11,5 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.1" +version = "0.45.2" default-features = false diff --git a/farm-staking/farm-staking-proxy/wasm/Cargo.lock b/farm-staking/farm-staking-proxy/wasm/Cargo.lock deleted file mode 100644 index 7f875ba74..000000000 --- a/farm-staking/farm-staking-proxy/wasm/Cargo.lock +++ /dev/null @@ -1,706 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - -[[package]] -name = "arrayvec" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "common-types" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "config" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "contexts" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "farm_token", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "rewards", - "token_merge_helper", - "token_send", -] - -[[package]] -name = "either" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "energy-query" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", -] - -[[package]] -name = "events" -version = "0.0.0" -dependencies = [ - "common_structs", - "contexts", - "multiversx-sc", -] - -[[package]] -name = "farm" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "contexts", - "energy-query", - "events", - "farm-boosted-yields", - "farm_base_impl", - "farm_token", - "fixed-supply-token", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pair", - "pausable", - "permissions_module", - "rewards", - "sc_whitelist_module", - "token_send", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "farm-boosted-yields" -version = "0.0.0" -dependencies = [ - "common-types", - "config", - "energy-query", - "multiversx-sc", - "pausable", - "permissions_module", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "farm-staking" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "contexts", - "energy-factory", - "energy-query", - "events", - "farm", - "farm-boosted-yields", - "farm_base_impl", - "farm_token", - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pair", - "pausable", - "permissions_module", - "rewards", - "sc_whitelist_module", - "token_send", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "farm-staking-proxy" -version = "0.0.0" -dependencies = [ - "common_structs", - "config", - "energy-query", - "farm", - "farm-staking", - "farm-with-locked-rewards", - "fixed-supply-token", - "hex-literal 0.3.4", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pair", - "pausable", - "rewards", - "sc_whitelist_module", - "token_send", - "unwrappable", - "utils", -] - -[[package]] -name = "farm-staking-proxy-wasm" -version = "0.0.0" -dependencies = [ - "farm-staking-proxy", - "multiversx-sc-wasm-adapter", -] - -[[package]] -name = "farm-with-locked-rewards" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "contexts", - "energy-factory", - "energy-query", - "events", - "farm", - "farm-boosted-yields", - "farm_base_impl", - "farm_token", - "fixed-supply-token", - "locking_module", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "rewards", - "sc_whitelist_module", - "token_send", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "farm_base_impl" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "contexts", - "events", - "farm_token", - "fixed-supply-token", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "rewards", - "token_merge_helper", - "token_send", - "utils", -] - -[[package]] -name = "farm_token" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "fees-collector" -version = "0.0.0" -dependencies = [ - "common-types", - "common_errors", - "energy-factory", - "energy-query", - "locking_module", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "locking_module" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", - "simple-lock", -] - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" -dependencies = [ - "bitflags", - "hashbrown", - "hex-literal 0.4.1", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" - -[[package]] -name = "pair" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "fees-collector", - "itertools", - "multiversx-sc", - "pausable", - "permissions_module", - "simple-lock", - "token_send", -] - -[[package]] -name = "pausable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", - "permissions_module", -] - -[[package]] -name = "permissions_module" -version = "0.0.0" -dependencies = [ - "bitflags", - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "proc-macro2" -version = "1.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "rewards" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "farm_token", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" - -[[package]] -name = "syn" -version = "1.0.107" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "token_merge_helper" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "token_send" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", -] - -[[package]] -name = "unicode-ident" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "week-timekeeping" -version = "0.0.0" -dependencies = [ - "common-types", - "multiversx-sc", -] - -[[package]] -name = "weekly-rewards-splitting" -version = "0.0.0" -dependencies = [ - "common-types", - "energy-query", - "math", - "multiversx-sc", - "unwrappable", - "week-timekeeping", -] - -[[package]] -name = "zerocopy" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.32", -] diff --git a/farm-staking/farm-staking-proxy/wasm/Cargo.toml b/farm-staking/farm-staking-proxy/wasm/Cargo.toml index f51beedb9..784aea80d 100644 --- a/farm-staking/farm-staking-proxy/wasm/Cargo.toml +++ b/farm-staking/farm-staking-proxy/wasm/Cargo.toml @@ -24,7 +24,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.1" +version = "=0.45.2" [workspace] members = ["."] diff --git a/farm-staking/farm-staking/Cargo.toml b/farm-staking/farm-staking/Cargo.toml index 698f6afd1..afc450bc6 100644 --- a/farm-staking/farm-staking/Cargo.toml +++ b/farm-staking/farm-staking/Cargo.toml @@ -78,14 +78,14 @@ path = "../../common/common_structs" path = "../../common/common_errors" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.45.1" +version = "=0.45.2" [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.1" +version = "=0.45.2" diff --git a/farm-staking/farm-staking/meta/Cargo.toml b/farm-staking/farm-staking/meta/Cargo.toml index f9fd518b0..c503cdf01 100644 --- a/farm-staking/farm-staking/meta/Cargo.toml +++ b/farm-staking/farm-staking/meta/Cargo.toml @@ -9,5 +9,5 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.1" +version = "0.45.2" default-features = false diff --git a/farm-staking/farm-staking/wasm/Cargo.lock b/farm-staking/farm-staking/wasm/Cargo.lock deleted file mode 100644 index f334f59c8..000000000 --- a/farm-staking/farm-staking/wasm/Cargo.lock +++ /dev/null @@ -1,646 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - -[[package]] -name = "arrayvec" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "common-types" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "config" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "contexts" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "farm_token", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "rewards", - "token_merge_helper", - "token_send", -] - -[[package]] -name = "either" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "energy-query" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", -] - -[[package]] -name = "events" -version = "0.0.0" -dependencies = [ - "common_structs", - "contexts", - "multiversx-sc", -] - -[[package]] -name = "farm" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "contexts", - "energy-query", - "events", - "farm-boosted-yields", - "farm_base_impl", - "farm_token", - "fixed-supply-token", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pair", - "pausable", - "permissions_module", - "rewards", - "sc_whitelist_module", - "token_send", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "farm-boosted-yields" -version = "0.0.0" -dependencies = [ - "common-types", - "config", - "energy-query", - "multiversx-sc", - "pausable", - "permissions_module", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "farm-staking" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "contexts", - "energy-factory", - "energy-query", - "events", - "farm", - "farm-boosted-yields", - "farm_base_impl", - "farm_token", - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pair", - "pausable", - "permissions_module", - "rewards", - "sc_whitelist_module", - "token_send", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "farm-staking-wasm" -version = "0.0.0" -dependencies = [ - "farm-staking", - "multiversx-sc-wasm-adapter", -] - -[[package]] -name = "farm_base_impl" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "contexts", - "events", - "farm_token", - "fixed-supply-token", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "rewards", - "token_merge_helper", - "token_send", - "utils", -] - -[[package]] -name = "farm_token" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "fees-collector" -version = "0.0.0" -dependencies = [ - "common-types", - "common_errors", - "energy-factory", - "energy-query", - "locking_module", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "locking_module" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", - "simple-lock", -] - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" -dependencies = [ - "bitflags", - "hashbrown", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" - -[[package]] -name = "pair" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "fees-collector", - "itertools", - "multiversx-sc", - "pausable", - "permissions_module", - "simple-lock", - "token_send", -] - -[[package]] -name = "pausable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", - "permissions_module", -] - -[[package]] -name = "permissions_module" -version = "0.0.0" -dependencies = [ - "bitflags", - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "proc-macro2" -version = "1.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "rewards" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "farm_token", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" - -[[package]] -name = "syn" -version = "1.0.107" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "token_merge_helper" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "token_send" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", -] - -[[package]] -name = "unicode-ident" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "week-timekeeping" -version = "0.0.0" -dependencies = [ - "common-types", - "multiversx-sc", -] - -[[package]] -name = "weekly-rewards-splitting" -version = "0.0.0" -dependencies = [ - "common-types", - "energy-query", - "math", - "multiversx-sc", - "unwrappable", - "week-timekeeping", -] - -[[package]] -name = "zerocopy" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.32", -] diff --git a/farm-staking/farm-staking/wasm/Cargo.toml b/farm-staking/farm-staking/wasm/Cargo.toml index 5efd002d9..f4a5c2c4b 100644 --- a/farm-staking/farm-staking/wasm/Cargo.toml +++ b/farm-staking/farm-staking/wasm/Cargo.toml @@ -24,7 +24,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.1" +version = "=0.45.2" [workspace] members = ["."] diff --git a/farm-staking/metabonding-staking/Cargo.toml b/farm-staking/metabonding-staking/Cargo.toml index 62be494a0..b210e5089 100644 --- a/farm-staking/metabonding-staking/Cargo.toml +++ b/farm-staking/metabonding-staking/Cargo.toml @@ -9,11 +9,11 @@ publish = false path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.45.1" +version = "=0.45.2" [dependencies.factory] path = "../../locked-asset/factory" @@ -22,7 +22,7 @@ path = "../../locked-asset/factory" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.1" +version = "=0.45.2" [dev-dependencies.common_structs] path = "../../common/common_structs" diff --git a/farm-staking/metabonding-staking/meta/Cargo.toml b/farm-staking/metabonding-staking/meta/Cargo.toml index 05d2a6a5e..713820f48 100644 --- a/farm-staking/metabonding-staking/meta/Cargo.toml +++ b/farm-staking/metabonding-staking/meta/Cargo.toml @@ -11,5 +11,5 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.1" +version = "0.45.2" default-features = false diff --git a/farm-staking/metabonding-staking/wasm/Cargo.lock b/farm-staking/metabonding-staking/wasm/Cargo.lock deleted file mode 100644 index 1d8f9f5c4..000000000 --- a/farm-staking/metabonding-staking/wasm/Cargo.lock +++ /dev/null @@ -1,467 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" -dependencies = [ - "cfg-if 1.0.0", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - -[[package]] -name = "arrayvec" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "either" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "factory" -version = "0.0.0" -dependencies = [ - "arrayvec", - "common_errors", - "common_structs", - "energy-factory", - "itertools", - "multiversx-sc", - "multiversx-sc-modules", - "token_merge_helper", - "token_send", - "wee_alloc", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "metabonding-staking" -version = "0.0.0" -dependencies = [ - "factory", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "metabonding-staking-wasm" -version = "0.0.0" -dependencies = [ - "metabonding-staking", - "multiversx-sc-wasm-adapter", -] - -[[package]] -name = "multiversx-sc" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" -dependencies = [ - "bitflags", - "hashbrown", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" - -[[package]] -name = "proc-macro2" -version = "1.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" - -[[package]] -name = "syn" -version = "1.0.107" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "token_merge_helper" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "token_send" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", -] - -[[package]] -name = "unicode-ident" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "zerocopy" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.32", -] diff --git a/farm-staking/metabonding-staking/wasm/Cargo.toml b/farm-staking/metabonding-staking/wasm/Cargo.toml index 4892cba26..58d42713a 100644 --- a/farm-staking/metabonding-staking/wasm/Cargo.toml +++ b/farm-staking/metabonding-staking/wasm/Cargo.toml @@ -24,7 +24,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.1" +version = "=0.45.2" [workspace] members = ["."] diff --git a/locked-asset/Cargo.toml b/locked-asset/Cargo.toml index 2b1d1ee7e..7990a182e 100644 --- a/locked-asset/Cargo.toml +++ b/locked-asset/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" publish = false [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.farm] @@ -50,7 +50,7 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-modules] -version = "=0.45.1" +version = "=0.45.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.1" +version = "=0.45.2" diff --git a/locked-asset/distribution/Cargo.toml b/locked-asset/distribution/Cargo.toml index 55a002c9b..5abf471eb 100644 --- a/locked-asset/distribution/Cargo.toml +++ b/locked-asset/distribution/Cargo.toml @@ -14,8 +14,8 @@ path = "../../common/common_structs" path = "../factory" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.1" +version = "=0.45.2" diff --git a/locked-asset/distribution/meta/Cargo.toml b/locked-asset/distribution/meta/Cargo.toml index ca97bbd66..447244a37 100644 --- a/locked-asset/distribution/meta/Cargo.toml +++ b/locked-asset/distribution/meta/Cargo.toml @@ -9,5 +9,5 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.1" +version = "0.45.2" default-features = false diff --git a/locked-asset/distribution/wasm/Cargo.lock b/locked-asset/distribution/wasm/Cargo.lock deleted file mode 100644 index ca683518c..000000000 --- a/locked-asset/distribution/wasm/Cargo.lock +++ /dev/null @@ -1,467 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" -dependencies = [ - "cfg-if 1.0.0", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - -[[package]] -name = "arrayvec" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "distribution" -version = "0.0.0" -dependencies = [ - "common_structs", - "factory", - "multiversx-sc", -] - -[[package]] -name = "distribution-wasm" -version = "0.0.0" -dependencies = [ - "distribution", - "multiversx-sc-wasm-adapter", -] - -[[package]] -name = "either" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "factory" -version = "0.0.0" -dependencies = [ - "arrayvec", - "common_errors", - "common_structs", - "energy-factory", - "itertools", - "multiversx-sc", - "multiversx-sc-modules", - "token_merge_helper", - "token_send", - "wee_alloc", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" -dependencies = [ - "bitflags", - "hashbrown", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" - -[[package]] -name = "proc-macro2" -version = "1.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" - -[[package]] -name = "syn" -version = "1.0.107" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "token_merge_helper" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "token_send" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", -] - -[[package]] -name = "unicode-ident" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "zerocopy" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.32", -] diff --git a/locked-asset/distribution/wasm/Cargo.toml b/locked-asset/distribution/wasm/Cargo.toml index 2a42ccf77..f24f2d30b 100644 --- a/locked-asset/distribution/wasm/Cargo.toml +++ b/locked-asset/distribution/wasm/Cargo.toml @@ -24,7 +24,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.1" +version = "=0.45.2" [workspace] members = ["."] diff --git a/locked-asset/energy-factory/Cargo.toml b/locked-asset/energy-factory/Cargo.toml index 6a6481cbe..bd55671cc 100644 --- a/locked-asset/energy-factory/Cargo.toml +++ b/locked-asset/energy-factory/Cargo.toml @@ -33,11 +33,11 @@ path = "../../common/traits/unwrappable" path = "../../common/modules/legacy_token_decode_module" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.45.1" +version = "=0.45.2" [dev-dependencies] num-bigint = "0.4.2" @@ -45,4 +45,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.1" +version = "=0.45.2" diff --git a/locked-asset/energy-factory/meta/Cargo.toml b/locked-asset/energy-factory/meta/Cargo.toml index 38b2c2110..b16a22bce 100644 --- a/locked-asset/energy-factory/meta/Cargo.toml +++ b/locked-asset/energy-factory/meta/Cargo.toml @@ -11,5 +11,5 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.1" +version = "0.45.2" default-features = false diff --git a/locked-asset/energy-factory/wasm/Cargo.lock b/locked-asset/energy-factory/wasm/Cargo.lock deleted file mode 100644 index f3c21cf5b..000000000 --- a/locked-asset/energy-factory/wasm/Cargo.lock +++ /dev/null @@ -1,358 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - -[[package]] -name = "arrayvec" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "energy-factory-wasm" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc-wasm-adapter", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" -dependencies = [ - "bitflags", - "hashbrown", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" - -[[package]] -name = "proc-macro2" -version = "1.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" - -[[package]] -name = "syn" -version = "1.0.107" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "unicode-ident" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "zerocopy" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.32", -] diff --git a/locked-asset/energy-factory/wasm/Cargo.toml b/locked-asset/energy-factory/wasm/Cargo.toml index 9a42dad09..c6497dd76 100644 --- a/locked-asset/energy-factory/wasm/Cargo.toml +++ b/locked-asset/energy-factory/wasm/Cargo.toml @@ -24,7 +24,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.1" +version = "=0.45.2" [workspace] members = ["."] diff --git a/locked-asset/factory/Cargo.toml b/locked-asset/factory/Cargo.toml index b1f626e2a..c6f56bb50 100644 --- a/locked-asset/factory/Cargo.toml +++ b/locked-asset/factory/Cargo.toml @@ -26,11 +26,11 @@ path = "../../common/modules/token_merge_helper" path = "../energy-factory" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.45.1" +version = "=0.45.2" [dependencies.arrayvec] version = "0.7.1" @@ -49,4 +49,4 @@ hex = "0.4" path = "../simple-lock" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.1" +version = "=0.45.2" diff --git a/locked-asset/factory/meta/Cargo.toml b/locked-asset/factory/meta/Cargo.toml index 2ab3634ab..c5027e6d1 100644 --- a/locked-asset/factory/meta/Cargo.toml +++ b/locked-asset/factory/meta/Cargo.toml @@ -9,5 +9,5 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.1" +version = "0.45.2" default-features = false diff --git a/locked-asset/factory/wasm/Cargo.lock b/locked-asset/factory/wasm/Cargo.lock deleted file mode 100644 index fd3099779..000000000 --- a/locked-asset/factory/wasm/Cargo.lock +++ /dev/null @@ -1,458 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" -dependencies = [ - "cfg-if 1.0.0", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - -[[package]] -name = "arrayvec" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "either" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "factory" -version = "0.0.0" -dependencies = [ - "arrayvec", - "common_errors", - "common_structs", - "energy-factory", - "itertools", - "multiversx-sc", - "multiversx-sc-modules", - "token_merge_helper", - "token_send", - "wee_alloc", -] - -[[package]] -name = "factory-wasm" -version = "0.0.0" -dependencies = [ - "factory", - "multiversx-sc-wasm-adapter", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" -dependencies = [ - "bitflags", - "hashbrown", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" - -[[package]] -name = "proc-macro2" -version = "1.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" - -[[package]] -name = "syn" -version = "1.0.107" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "token_merge_helper" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "token_send" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", -] - -[[package]] -name = "unicode-ident" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "zerocopy" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.32", -] diff --git a/locked-asset/factory/wasm/Cargo.toml b/locked-asset/factory/wasm/Cargo.toml index 36ddee8d1..981cad91d 100644 --- a/locked-asset/factory/wasm/Cargo.toml +++ b/locked-asset/factory/wasm/Cargo.toml @@ -24,7 +24,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.1" +version = "=0.45.2" [workspace] members = ["."] diff --git a/locked-asset/lkmex-transfer/Cargo.toml b/locked-asset/lkmex-transfer/Cargo.toml index f2ff5729c..28f501408 100644 --- a/locked-asset/lkmex-transfer/Cargo.toml +++ b/locked-asset/lkmex-transfer/Cargo.toml @@ -30,14 +30,14 @@ path = "../energy-factory" path = "../../energy-integration/common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.1" +version = "=0.45.2" [dev-dependencies.multiversx-sc-modules] -version = "=0.45.1" +version = "=0.45.2" diff --git a/locked-asset/lkmex-transfer/meta/Cargo.toml b/locked-asset/lkmex-transfer/meta/Cargo.toml index 558b01a51..390ebcc9c 100644 --- a/locked-asset/lkmex-transfer/meta/Cargo.toml +++ b/locked-asset/lkmex-transfer/meta/Cargo.toml @@ -9,5 +9,5 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.1" +version = "0.45.2" default-features = false diff --git a/locked-asset/lkmex-transfer/wasm/Cargo.lock b/locked-asset/lkmex-transfer/wasm/Cargo.lock deleted file mode 100644 index a2f435976..000000000 --- a/locked-asset/lkmex-transfer/wasm/Cargo.lock +++ /dev/null @@ -1,389 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - -[[package]] -name = "arrayvec" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "energy-query" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "lkmex-transfer" -version = "0.0.0" -dependencies = [ - "common_structs", - "energy-factory", - "energy-query", - "legacy_token_decode_module", - "multiversx-sc", - "permissions_module", - "simple-lock", - "utils", -] - -[[package]] -name = "lkmex-transfer-wasm" -version = "0.0.0" -dependencies = [ - "lkmex-transfer", - "multiversx-sc-wasm-adapter", -] - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" -dependencies = [ - "bitflags", - "hashbrown", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" - -[[package]] -name = "permissions_module" -version = "0.0.0" -dependencies = [ - "bitflags", - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "proc-macro2" -version = "1.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" - -[[package]] -name = "syn" -version = "1.0.107" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "unicode-ident" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "zerocopy" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.32", -] diff --git a/locked-asset/lkmex-transfer/wasm/Cargo.toml b/locked-asset/lkmex-transfer/wasm/Cargo.toml index a6f1f4950..985ca4ec1 100644 --- a/locked-asset/lkmex-transfer/wasm/Cargo.toml +++ b/locked-asset/lkmex-transfer/wasm/Cargo.toml @@ -24,7 +24,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.1" +version = "=0.45.2" [workspace] members = ["."] diff --git a/locked-asset/locked-token-wrapper/Cargo.toml b/locked-asset/locked-token-wrapper/Cargo.toml index a9cfbcf02..c71dcf00a 100644 --- a/locked-asset/locked-token-wrapper/Cargo.toml +++ b/locked-asset/locked-token-wrapper/Cargo.toml @@ -9,10 +9,10 @@ publish = false path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" [dependencies.multiversx-sc-modules] -version = "=0.45.1" +version = "=0.45.2" [dependencies.utils] path = "../../common/modules/utils" @@ -44,4 +44,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.1" +version = "=0.45.2" diff --git a/locked-asset/locked-token-wrapper/meta/Cargo.toml b/locked-asset/locked-token-wrapper/meta/Cargo.toml index 8054e27a1..3ec2b3f73 100644 --- a/locked-asset/locked-token-wrapper/meta/Cargo.toml +++ b/locked-asset/locked-token-wrapper/meta/Cargo.toml @@ -11,5 +11,5 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.1" +version = "0.45.2" default-features = false diff --git a/locked-asset/locked-token-wrapper/wasm/Cargo.lock b/locked-asset/locked-token-wrapper/wasm/Cargo.lock deleted file mode 100644 index 0b9f3ecc8..000000000 --- a/locked-asset/locked-token-wrapper/wasm/Cargo.lock +++ /dev/null @@ -1,413 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - -[[package]] -name = "arrayvec" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "energy-factory-mock" -version = "0.0.0" -dependencies = [ - "energy-query", - "multiversx-sc", -] - -[[package]] -name = "energy-query" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "lkmex-transfer" -version = "0.0.0" -dependencies = [ - "common_structs", - "energy-factory", - "energy-query", - "legacy_token_decode_module", - "multiversx-sc", - "permissions_module", - "simple-lock", - "utils", -] - -[[package]] -name = "locked-token-wrapper" -version = "0.0.0" -dependencies = [ - "common_structs", - "energy-factory", - "energy-factory-mock", - "energy-query", - "legacy_token_decode_module", - "lkmex-transfer", - "multiversx-sc", - "multiversx-sc-modules", - "simple-lock", - "utils", -] - -[[package]] -name = "locked-token-wrapper-wasm" -version = "0.0.0" -dependencies = [ - "locked-token-wrapper", - "multiversx-sc-wasm-adapter", -] - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" -dependencies = [ - "bitflags", - "hashbrown", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" - -[[package]] -name = "permissions_module" -version = "0.0.0" -dependencies = [ - "bitflags", - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "proc-macro2" -version = "1.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" - -[[package]] -name = "syn" -version = "1.0.107" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "unicode-ident" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "zerocopy" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.32", -] diff --git a/locked-asset/locked-token-wrapper/wasm/Cargo.toml b/locked-asset/locked-token-wrapper/wasm/Cargo.toml index 0b59c9c35..1d58fc660 100644 --- a/locked-asset/locked-token-wrapper/wasm/Cargo.toml +++ b/locked-asset/locked-token-wrapper/wasm/Cargo.toml @@ -24,7 +24,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.1" +version = "=0.45.2" [workspace] members = ["."] diff --git a/locked-asset/proxy_dex/Cargo.toml b/locked-asset/proxy_dex/Cargo.toml index fc148b824..d25a5cd7c 100644 --- a/locked-asset/proxy_dex/Cargo.toml +++ b/locked-asset/proxy_dex/Cargo.toml @@ -45,11 +45,11 @@ path = "../../common/traits/mergeable" path = "../../common/traits/fixed-supply-token" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.45.1" +version = "=0.45.2" [dependencies.energy-factory] path = "../energy-factory" @@ -69,7 +69,7 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.1" +version = "=0.45.2" [dev-dependencies.pausable] path = "../../common/modules/pausable" diff --git a/locked-asset/proxy_dex/meta/Cargo.toml b/locked-asset/proxy_dex/meta/Cargo.toml index b5e0da267..3854ed332 100644 --- a/locked-asset/proxy_dex/meta/Cargo.toml +++ b/locked-asset/proxy_dex/meta/Cargo.toml @@ -9,5 +9,5 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.1" +version = "0.45.2" default-features = false diff --git a/locked-asset/proxy_dex/wasm/Cargo.lock b/locked-asset/proxy_dex/wasm/Cargo.lock deleted file mode 100644 index cc318a570..000000000 --- a/locked-asset/proxy_dex/wasm/Cargo.lock +++ /dev/null @@ -1,669 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - -[[package]] -name = "arrayvec" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "common-types" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "config" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "contexts" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "farm_token", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "rewards", - "token_merge_helper", - "token_send", -] - -[[package]] -name = "either" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "energy-query" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", -] - -[[package]] -name = "events" -version = "0.0.0" -dependencies = [ - "common_structs", - "contexts", - "multiversx-sc", -] - -[[package]] -name = "farm" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "contexts", - "energy-query", - "events", - "farm-boosted-yields", - "farm_base_impl", - "farm_token", - "fixed-supply-token", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pair", - "pausable", - "permissions_module", - "rewards", - "sc_whitelist_module", - "token_send", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "farm-boosted-yields" -version = "0.0.0" -dependencies = [ - "common-types", - "config", - "energy-query", - "multiversx-sc", - "pausable", - "permissions_module", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "farm-with-locked-rewards" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "contexts", - "energy-factory", - "energy-query", - "events", - "farm", - "farm-boosted-yields", - "farm_base_impl", - "farm_token", - "fixed-supply-token", - "locking_module", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "rewards", - "sc_whitelist_module", - "token_send", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "farm_base_impl" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "contexts", - "events", - "farm_token", - "fixed-supply-token", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "rewards", - "token_merge_helper", - "token_send", - "utils", -] - -[[package]] -name = "farm_token" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "fees-collector" -version = "0.0.0" -dependencies = [ - "common-types", - "common_errors", - "energy-factory", - "energy-query", - "locking_module", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "locking_module" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", - "simple-lock", -] - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" -dependencies = [ - "bitflags", - "hashbrown", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" - -[[package]] -name = "pair" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "fees-collector", - "itertools", - "multiversx-sc", - "pausable", - "permissions_module", - "simple-lock", - "token_send", -] - -[[package]] -name = "pausable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", - "permissions_module", -] - -[[package]] -name = "permissions_module" -version = "0.0.0" -dependencies = [ - "bitflags", - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "proc-macro2" -version = "1.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "proxy_dex" -version = "0.0.0" -dependencies = [ - "common_structs", - "energy-factory", - "energy-query", - "farm", - "farm-with-locked-rewards", - "fixed-supply-token", - "itertools", - "legacy_token_decode_module", - "locking_module", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pair", - "sc_whitelist_module", - "simple-lock", - "token_merge_helper", - "token_send", - "utils", -] - -[[package]] -name = "proxy_dex-wasm" -version = "0.0.0" -dependencies = [ - "multiversx-sc-wasm-adapter", - "proxy_dex", -] - -[[package]] -name = "quote" -version = "1.0.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "rewards" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "farm_token", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" - -[[package]] -name = "syn" -version = "1.0.107" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "token_merge_helper" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "token_send" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", -] - -[[package]] -name = "unicode-ident" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "week-timekeeping" -version = "0.0.0" -dependencies = [ - "common-types", - "multiversx-sc", -] - -[[package]] -name = "weekly-rewards-splitting" -version = "0.0.0" -dependencies = [ - "common-types", - "energy-query", - "math", - "multiversx-sc", - "unwrappable", - "week-timekeeping", -] - -[[package]] -name = "zerocopy" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.32", -] diff --git a/locked-asset/proxy_dex/wasm/Cargo.toml b/locked-asset/proxy_dex/wasm/Cargo.toml index f27fdd7ee..66b8df41b 100644 --- a/locked-asset/proxy_dex/wasm/Cargo.toml +++ b/locked-asset/proxy_dex/wasm/Cargo.toml @@ -24,7 +24,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.1" +version = "=0.45.2" [workspace] members = ["."] diff --git a/locked-asset/simple-lock-whitelist/Cargo.toml b/locked-asset/simple-lock-whitelist/Cargo.toml index d424146c9..fdaf54bdc 100644 --- a/locked-asset/simple-lock-whitelist/Cargo.toml +++ b/locked-asset/simple-lock-whitelist/Cargo.toml @@ -15,11 +15,11 @@ path = "../simple-lock" path = "../../common/modules/utils" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.45.1" +version = "=0.45.2" [dev-dependencies] num-bigint = "0.4.2" @@ -27,4 +27,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.1" +version = "=0.45.2" diff --git a/locked-asset/simple-lock-whitelist/meta/Cargo.toml b/locked-asset/simple-lock-whitelist/meta/Cargo.toml index 68bf43ce6..819edb911 100644 --- a/locked-asset/simple-lock-whitelist/meta/Cargo.toml +++ b/locked-asset/simple-lock-whitelist/meta/Cargo.toml @@ -9,5 +9,5 @@ authors = ["Dorin Iancu "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.1" +version = "0.45.2" default-features = false diff --git a/locked-asset/simple-lock-whitelist/wasm/Cargo.lock b/locked-asset/simple-lock-whitelist/wasm/Cargo.lock deleted file mode 100644 index d8716714d..000000000 --- a/locked-asset/simple-lock-whitelist/wasm/Cargo.lock +++ /dev/null @@ -1,328 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - -[[package]] -name = "arrayvec" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" -dependencies = [ - "bitflags", - "hashbrown", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" - -[[package]] -name = "proc-macro2" -version = "1.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "simple-lock-whitelist" -version = "0.0.0" -dependencies = [ - "multiversx-sc", - "multiversx-sc-modules", - "simple-lock", - "utils", -] - -[[package]] -name = "simple-lock-whitelist-wasm" -version = "0.0.0" -dependencies = [ - "multiversx-sc-wasm-adapter", - "simple-lock-whitelist", -] - -[[package]] -name = "smallvec" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" - -[[package]] -name = "syn" -version = "1.0.107" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "unicode-ident" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "zerocopy" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.32", -] diff --git a/locked-asset/simple-lock-whitelist/wasm/Cargo.toml b/locked-asset/simple-lock-whitelist/wasm/Cargo.toml index cfc170d6c..7a4d66d89 100644 --- a/locked-asset/simple-lock-whitelist/wasm/Cargo.toml +++ b/locked-asset/simple-lock-whitelist/wasm/Cargo.toml @@ -24,7 +24,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.1" +version = "=0.45.2" [workspace] members = ["."] diff --git a/locked-asset/simple-lock/Cargo.toml b/locked-asset/simple-lock/Cargo.toml index 21ee4bd8b..a31f8d814 100644 --- a/locked-asset/simple-lock/Cargo.toml +++ b/locked-asset/simple-lock/Cargo.toml @@ -9,11 +9,11 @@ publish = false path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.45.1" +version = "=0.45.2" [dependencies.common_structs] path = "../../common/common_structs" @@ -24,4 +24,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.1" +version = "=0.45.2" diff --git a/locked-asset/simple-lock/meta/Cargo.toml b/locked-asset/simple-lock/meta/Cargo.toml index cdd8ad123..4321eba25 100644 --- a/locked-asset/simple-lock/meta/Cargo.toml +++ b/locked-asset/simple-lock/meta/Cargo.toml @@ -9,5 +9,5 @@ authors = ["Dorin Iancu "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.1" +version = "0.45.2" default-features = false diff --git a/locked-asset/simple-lock/wasm/Cargo.lock b/locked-asset/simple-lock/wasm/Cargo.lock deleted file mode 100644 index 1bf159055..000000000 --- a/locked-asset/simple-lock/wasm/Cargo.lock +++ /dev/null @@ -1,308 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - -[[package]] -name = "arrayvec" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" -dependencies = [ - "bitflags", - "hashbrown", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" - -[[package]] -name = "proc-macro2" -version = "1.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "simple-lock-wasm" -version = "0.0.0" -dependencies = [ - "multiversx-sc-wasm-adapter", - "simple-lock", -] - -[[package]] -name = "smallvec" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" - -[[package]] -name = "syn" -version = "1.0.107" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "unicode-ident" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "zerocopy" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.32", -] diff --git a/locked-asset/simple-lock/wasm/Cargo.toml b/locked-asset/simple-lock/wasm/Cargo.toml index a5b7ca6d7..091897d1b 100644 --- a/locked-asset/simple-lock/wasm/Cargo.toml +++ b/locked-asset/simple-lock/wasm/Cargo.toml @@ -24,7 +24,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.1" +version = "=0.45.2" [workspace] members = ["."] diff --git a/locked-asset/token-unstake/Cargo.toml b/locked-asset/token-unstake/Cargo.toml index 7f564e0e5..ae26ec3ea 100644 --- a/locked-asset/token-unstake/Cargo.toml +++ b/locked-asset/token-unstake/Cargo.toml @@ -9,7 +9,7 @@ publish = false path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.mergeable] @@ -39,7 +39,7 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.1" +version = "=0.45.2" [dev-dependencies.multiversx-sc-modules] -version = "=0.45.1" +version = "=0.45.2" diff --git a/locked-asset/token-unstake/meta/Cargo.toml b/locked-asset/token-unstake/meta/Cargo.toml index 073670290..afe467638 100644 --- a/locked-asset/token-unstake/meta/Cargo.toml +++ b/locked-asset/token-unstake/meta/Cargo.toml @@ -9,5 +9,5 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.1" +version = "0.45.2" default-features = false diff --git a/locked-asset/token-unstake/wasm/Cargo.lock b/locked-asset/token-unstake/wasm/Cargo.lock deleted file mode 100644 index a714cb288..000000000 --- a/locked-asset/token-unstake/wasm/Cargo.lock +++ /dev/null @@ -1,395 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - -[[package]] -name = "arrayvec" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "common-types" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "energy-query" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" -dependencies = [ - "bitflags", - "hashbrown", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" - -[[package]] -name = "proc-macro2" -version = "1.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" - -[[package]] -name = "syn" -version = "1.0.107" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "token-unstake" -version = "0.0.0" -dependencies = [ - "common_structs", - "energy-factory", - "energy-query", - "mergeable", - "multiversx-sc", - "simple-lock", - "utils", - "week-timekeeping", -] - -[[package]] -name = "token-unstake-wasm" -version = "0.0.0" -dependencies = [ - "multiversx-sc-wasm-adapter", - "token-unstake", -] - -[[package]] -name = "unicode-ident" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "week-timekeeping" -version = "0.0.0" -dependencies = [ - "common-types", - "multiversx-sc", -] - -[[package]] -name = "zerocopy" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.32", -] diff --git a/locked-asset/token-unstake/wasm/Cargo.toml b/locked-asset/token-unstake/wasm/Cargo.toml index e53c1c314..45e8e43be 100644 --- a/locked-asset/token-unstake/wasm/Cargo.toml +++ b/locked-asset/token-unstake/wasm/Cargo.toml @@ -24,7 +24,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.1" +version = "=0.45.2" [workspace] members = ["."] diff --git a/pause-all/Cargo.toml b/pause-all/Cargo.toml index 808df9824..97c036824 100644 --- a/pause-all/Cargo.toml +++ b/pause-all/Cargo.toml @@ -12,14 +12,14 @@ path = "src/lib.rs" path = "../common/modules/pausable" [dependencies.multiversx-sc] -version = "=0.45.1" +version = "=0.45.2" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.45.1" +version = "=0.45.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.1" +version = "=0.45.2" [dev-dependencies.farm] path = "../dex/farm" diff --git a/pause-all/meta/Cargo.toml b/pause-all/meta/Cargo.toml index e3513c084..c31e82073 100644 --- a/pause-all/meta/Cargo.toml +++ b/pause-all/meta/Cargo.toml @@ -11,5 +11,5 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.1" +version = "0.45.2" default-features = false diff --git a/pause-all/wasm/Cargo.lock b/pause-all/wasm/Cargo.lock deleted file mode 100644 index 3afdd10cb..000000000 --- a/pause-all/wasm/Cargo.lock +++ /dev/null @@ -1,293 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ahash" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - -[[package]] -name = "arrayvec" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "multiversx-sc" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f11b51d6a2ab0218585ed58e100c5ac2218de09490fbfc4243b5ecd0ca7f5cbc" -dependencies = [ - "bitflags", - "hashbrown", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327b0ad1c3477cab0d7c84391439ba302238f738ef3c6e1fcd18e247fba84875" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f444038e0043b8eda816b26952479c2aca3c4a643580f4337f71fb362a586db5" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784f0fc505806102fe6f808b368e12fcb13096dd73c5678f09c5663230724d6f" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn 1.0.107", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75cc759dda52661f2fc776dfd810a6e90e681d4697a8c866d0f23f3e068f1b29" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.45.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5afb8b8cc380eabd82dc8f9b02afbab3dce16fc2b5de1dbc601fcfcf261278ba" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" - -[[package]] -name = "pausable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", - "permissions_module", -] - -[[package]] -name = "pause-all" -version = "0.0.0" -dependencies = [ - "multiversx-sc", - "multiversx-sc-modules", - "pausable", -] - -[[package]] -name = "pause-all-wasm" -version = "0.0.0" -dependencies = [ - "multiversx-sc-wasm-adapter", - "pause-all", -] - -[[package]] -name = "permissions_module" -version = "0.0.0" -dependencies = [ - "bitflags", - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "proc-macro2" -version = "1.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "smallvec" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" - -[[package]] -name = "syn" -version = "1.0.107" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "unicode-ident" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "zerocopy" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.32", -] diff --git a/pause-all/wasm/Cargo.toml b/pause-all/wasm/Cargo.toml index b6d43fef6..54d6f7ab0 100644 --- a/pause-all/wasm/Cargo.toml +++ b/pause-all/wasm/Cargo.toml @@ -24,7 +24,7 @@ panic = "abort" path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.1" +version = "=0.45.2" [workspace] members = ["."] From b2023199ec050b4d99721a10121e6beeac2e0827 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Wed, 20 Dec 2023 09:10:43 +0200 Subject: [PATCH 145/213] Fix Permissions borrowing issue --- common/modules/permissions_module/src/permissions_module.rs | 2 +- dex/pair/src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/modules/permissions_module/src/permissions_module.rs b/common/modules/permissions_module/src/permissions_module.rs index 0bf91aafd..5853ca0da 100644 --- a/common/modules/permissions_module/src/permissions_module.rs +++ b/common/modules/permissions_module/src/permissions_module.rs @@ -54,7 +54,7 @@ pub trait PermissionsModule { permissions: Permissions, ) { for address in addresses { - self.add_permissions(address, permissions); + self.add_permissions(address, permissions.clone()); } } diff --git a/dex/pair/src/lib.rs b/dex/pair/src/lib.rs index 7bc69c42b..9b800e67a 100644 --- a/dex/pair/src/lib.rs +++ b/dex/pair/src/lib.rs @@ -90,7 +90,7 @@ pub trait Pair: if admins.is_empty() { // backwards compatibility let all_permissions = Permissions::OWNER | Permissions::ADMIN | Permissions::PAUSE; - self.add_permissions(router_address, all_permissions); + self.add_permissions(router_address, all_permissions.clone()); self.add_permissions(router_owner_address, all_permissions); } else { self.add_permissions(router_address, Permissions::OWNER | Permissions::PAUSE); From fc6012b4e93cff49aa6d8b47df182a8e4d5d658b Mon Sep 17 00:00:00 2001 From: ovidiuolteanu Date: Fri, 5 Jan 2024 17:38:38 +0200 Subject: [PATCH 146/213] rebuilt locks and new framework structures --- dex/farm-with-locked-rewards/wasm/Cargo.lock | 634 ++++++++++++++++ dex/farm-with-locked-rewards/wasm/Cargo.toml | 1 + dex/farm-with-locked-rewards/wasm/src/lib.rs | 4 +- dex/farm/wasm/Cargo.lock | 604 +++++++++++++++ dex/farm/wasm/Cargo.toml | 1 + dex/farm/wasm/src/lib.rs | 4 +- dex/governance/wasm/Cargo.lock | 247 +++++++ dex/governance/wasm/Cargo.toml | 1 + dex/governance/wasm/src/lib.rs | 4 +- dex/pair-mock/wasm/Cargo.lock | 271 +++++++ dex/pair-mock/wasm/Cargo.toml | 1 + dex/pair-mock/wasm/src/lib.rs | 4 +- dex/pair/wasm-pair-full/Cargo.lock | 465 ++++++++++++ dex/pair/wasm-pair-full/Cargo.toml | 1 + dex/pair/wasm-pair-full/src/lib.rs | 4 +- dex/pair/wasm-safe-price-view/Cargo.lock | 465 ++++++++++++ dex/pair/wasm-safe-price-view/Cargo.toml | 1 + dex/pair/wasm-safe-price-view/src/lib.rs | 4 +- dex/pair/wasm/Cargo.lock | 465 ++++++++++++ dex/pair/wasm/Cargo.toml | 1 + dex/pair/wasm/src/lib.rs | 4 +- dex/price-discovery/wasm/Cargo.lock | 372 ++++++++++ dex/price-discovery/wasm/Cargo.toml | 1 + dex/price-discovery/wasm/src/lib.rs | 4 +- dex/proxy-deployer/wasm/Cargo.lock | 615 ++++++++++++++++ dex/proxy-deployer/wasm/Cargo.toml | 1 + dex/proxy-deployer/wasm/src/lib.rs | 4 +- dex/router/wasm/Cargo.lock | 477 ++++++++++++ dex/router/wasm/Cargo.toml | 1 + dex/router/wasm/src/lib.rs | 4 +- .../energy-factory-mock/wasm/Cargo.lock | 363 +++++++++ .../energy-factory-mock/wasm/Cargo.toml | 1 + .../energy-factory-mock/wasm/src/lib.rs | 4 +- .../energy-update/wasm/Cargo.lock | 614 ++++++++++++++++ .../energy-update/wasm/Cargo.toml | 1 + .../energy-update/wasm/src/lib.rs | 4 +- .../fees-collector/wasm/Cargo.lock | 409 +++++++++++ .../fees-collector/wasm/Cargo.toml | 1 + .../fees-collector/wasm/src/lib.rs | 4 +- .../governance-v2/wasm/Cargo.lock | 429 +++++++++++ .../governance-v2/wasm/Cargo.toml | 1 + .../governance-v2/wasm/src/lib.rs | 4 +- .../farm-staking-proxy/wasm/Cargo.lock | 695 ++++++++++++++++++ .../farm-staking-proxy/wasm/Cargo.toml | 1 + .../farm-staking-proxy/wasm/src/lib.rs | 4 +- farm-staking/farm-staking/wasm/Cargo.lock | 635 ++++++++++++++++ farm-staking/farm-staking/wasm/Cargo.toml | 1 + farm-staking/farm-staking/wasm/src/lib.rs | 4 +- .../metabonding-staking/wasm/Cargo.lock | 456 ++++++++++++ .../metabonding-staking/wasm/Cargo.toml | 1 + .../metabonding-staking/wasm/src/lib.rs | 4 +- locked-asset/distribution/wasm/Cargo.lock | 456 ++++++++++++ locked-asset/distribution/wasm/Cargo.toml | 1 + locked-asset/distribution/wasm/src/lib.rs | 4 +- locked-asset/energy-factory/wasm/Cargo.lock | 347 +++++++++ locked-asset/energy-factory/wasm/Cargo.toml | 1 + locked-asset/energy-factory/wasm/src/lib.rs | 4 +- locked-asset/factory/wasm/Cargo.lock | 447 +++++++++++ locked-asset/factory/wasm/Cargo.toml | 1 + locked-asset/factory/wasm/src/lib.rs | 4 +- locked-asset/lkmex-transfer/wasm/Cargo.lock | 378 ++++++++++ locked-asset/lkmex-transfer/wasm/Cargo.toml | 1 + locked-asset/lkmex-transfer/wasm/src/lib.rs | 4 +- .../locked-token-wrapper/wasm/Cargo.lock | 402 ++++++++++ .../locked-token-wrapper/wasm/Cargo.toml | 1 + .../locked-token-wrapper/wasm/src/lib.rs | 4 +- locked-asset/proxy_dex/wasm/Cargo.lock | 658 +++++++++++++++++ locked-asset/proxy_dex/wasm/Cargo.toml | 1 + locked-asset/proxy_dex/wasm/src/lib.rs | 4 +- .../simple-lock-whitelist/wasm/Cargo.lock | 317 ++++++++ .../simple-lock-whitelist/wasm/Cargo.toml | 1 + .../simple-lock-whitelist/wasm/src/lib.rs | 4 +- locked-asset/simple-lock/wasm/Cargo.lock | 297 ++++++++ locked-asset/simple-lock/wasm/Cargo.toml | 1 + locked-asset/simple-lock/wasm/src/lib.rs | 4 +- locked-asset/token-unstake/wasm/Cargo.lock | 384 ++++++++++ locked-asset/token-unstake/wasm/Cargo.toml | 1 + locked-asset/token-unstake/wasm/src/lib.rs | 4 +- pause-all/wasm/Cargo.lock | 282 +++++++ pause-all/wasm/Cargo.toml | 1 + pause-all/wasm/src/lib.rs | 4 +- 81 files changed, 12238 insertions(+), 81 deletions(-) create mode 100644 dex/farm-with-locked-rewards/wasm/Cargo.lock create mode 100644 dex/farm/wasm/Cargo.lock create mode 100644 dex/governance/wasm/Cargo.lock create mode 100644 dex/pair-mock/wasm/Cargo.lock create mode 100644 dex/pair/wasm-pair-full/Cargo.lock create mode 100644 dex/pair/wasm-safe-price-view/Cargo.lock create mode 100644 dex/pair/wasm/Cargo.lock create mode 100644 dex/price-discovery/wasm/Cargo.lock create mode 100644 dex/proxy-deployer/wasm/Cargo.lock create mode 100644 dex/router/wasm/Cargo.lock create mode 100644 energy-integration/energy-factory-mock/wasm/Cargo.lock create mode 100644 energy-integration/energy-update/wasm/Cargo.lock create mode 100644 energy-integration/fees-collector/wasm/Cargo.lock create mode 100644 energy-integration/governance-v2/wasm/Cargo.lock create mode 100644 farm-staking/farm-staking-proxy/wasm/Cargo.lock create mode 100644 farm-staking/farm-staking/wasm/Cargo.lock create mode 100644 farm-staking/metabonding-staking/wasm/Cargo.lock create mode 100644 locked-asset/distribution/wasm/Cargo.lock create mode 100644 locked-asset/energy-factory/wasm/Cargo.lock create mode 100644 locked-asset/factory/wasm/Cargo.lock create mode 100644 locked-asset/lkmex-transfer/wasm/Cargo.lock create mode 100644 locked-asset/locked-token-wrapper/wasm/Cargo.lock create mode 100644 locked-asset/proxy_dex/wasm/Cargo.lock create mode 100644 locked-asset/simple-lock-whitelist/wasm/Cargo.lock create mode 100644 locked-asset/simple-lock/wasm/Cargo.lock create mode 100644 locked-asset/token-unstake/wasm/Cargo.lock create mode 100644 pause-all/wasm/Cargo.lock diff --git a/dex/farm-with-locked-rewards/wasm/Cargo.lock b/dex/farm-with-locked-rewards/wasm/Cargo.lock new file mode 100644 index 000000000..9d6c35eb4 --- /dev/null +++ b/dex/farm-with-locked-rewards/wasm/Cargo.lock @@ -0,0 +1,634 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "common-types" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "config" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "contexts" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "farm_token", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "rewards", + "token_merge_helper", + "token_send", +] + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "energy-query" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", +] + +[[package]] +name = "events" +version = "0.0.0" +dependencies = [ + "common_structs", + "contexts", + "multiversx-sc", +] + +[[package]] +name = "farm" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "energy-query", + "events", + "farm-boosted-yields", + "farm_base_impl", + "farm_token", + "fixed-supply-token", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pair", + "pausable", + "permissions_module", + "rewards", + "sc_whitelist_module", + "token_send", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm-boosted-yields" +version = "0.0.0" +dependencies = [ + "common-types", + "config", + "energy-query", + "multiversx-sc", + "pausable", + "permissions_module", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm-with-locked-rewards" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "energy-factory", + "energy-query", + "events", + "farm", + "farm-boosted-yields", + "farm_base_impl", + "farm_token", + "fixed-supply-token", + "locking_module", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "rewards", + "sc_whitelist_module", + "token_send", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm-with-locked-rewards-wasm" +version = "0.0.0" +dependencies = [ + "farm-with-locked-rewards", + "multiversx-sc-wasm-adapter", +] + +[[package]] +name = "farm_base_impl" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "events", + "farm_token", + "fixed-supply-token", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "rewards", + "token_merge_helper", + "token_send", + "utils", +] + +[[package]] +name = "farm_token" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "fees-collector" +version = "0.0.0" +dependencies = [ + "common-types", + "common_errors", + "energy-factory", + "energy-query", + "locking_module", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "locking_module" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", + "simple-lock", +] + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +dependencies = [ + "bitflags", + "hashbrown", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19908153158c03df4582af08f47c0eb39fb52a7dff4736b301a66acbbb9955d3" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b03b43f9cad320992f54ed162de2ed63e3ec83ed01361e57ee9c1865fba5a2" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "pair" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "fees-collector", + "itertools", + "multiversx-sc", + "pausable", + "permissions_module", + "simple-lock", + "token_send", +] + +[[package]] +name = "pausable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", + "permissions_module", +] + +[[package]] +name = "permissions_module" +version = "0.0.0" +dependencies = [ + "bitflags", + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "proc-macro2" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "rewards" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "farm_token", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "token_merge_helper" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "token_send" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "week-timekeeping" +version = "0.0.0" +dependencies = [ + "common-types", + "multiversx-sc", +] + +[[package]] +name = "weekly-rewards-splitting" +version = "0.0.0" +dependencies = [ + "common-types", + "energy-query", + "math", + "multiversx-sc", + "unwrappable", + "week-timekeeping", +] + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/dex/farm-with-locked-rewards/wasm/Cargo.toml b/dex/farm-with-locked-rewards/wasm/Cargo.toml index 1dae9301a..b5c12e892 100644 --- a/dex/farm-with-locked-rewards/wasm/Cargo.toml +++ b/dex/farm-with-locked-rewards/wasm/Cargo.toml @@ -19,6 +19,7 @@ opt-level = "z" lto = true debug = false panic = "abort" +overflow-checks = false [dependencies.farm-with-locked-rewards] path = ".." diff --git a/dex/farm-with-locked-rewards/wasm/src/lib.rs b/dex/farm-with-locked-rewards/wasm/src/lib.rs index e1b1ca74e..47d140e12 100644 --- a/dex/farm-with-locked-rewards/wasm/src/lib.rs +++ b/dex/farm-with-locked-rewards/wasm/src/lib.rs @@ -10,9 +10,7 @@ // Total number of exported functions: 70 #![no_std] - -// Configuration that works with rustc < 1.73.0. -// TODO: Recommended rustc version: 1.73.0 or newer. +#![allow(internal_features)] #![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); diff --git a/dex/farm/wasm/Cargo.lock b/dex/farm/wasm/Cargo.lock new file mode 100644 index 000000000..96ca800f9 --- /dev/null +++ b/dex/farm/wasm/Cargo.lock @@ -0,0 +1,604 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "common-types" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "config" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "contexts" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "farm_token", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "rewards", + "token_merge_helper", + "token_send", +] + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "energy-query" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", +] + +[[package]] +name = "events" +version = "0.0.0" +dependencies = [ + "common_structs", + "contexts", + "multiversx-sc", +] + +[[package]] +name = "farm" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "energy-query", + "events", + "farm-boosted-yields", + "farm_base_impl", + "farm_token", + "fixed-supply-token", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pair", + "pausable", + "permissions_module", + "rewards", + "sc_whitelist_module", + "token_send", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm-boosted-yields" +version = "0.0.0" +dependencies = [ + "common-types", + "config", + "energy-query", + "multiversx-sc", + "pausable", + "permissions_module", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm-wasm" +version = "0.0.0" +dependencies = [ + "farm", + "multiversx-sc-wasm-adapter", +] + +[[package]] +name = "farm_base_impl" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "events", + "farm_token", + "fixed-supply-token", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "rewards", + "token_merge_helper", + "token_send", + "utils", +] + +[[package]] +name = "farm_token" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "fees-collector" +version = "0.0.0" +dependencies = [ + "common-types", + "common_errors", + "energy-factory", + "energy-query", + "locking_module", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "locking_module" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", + "simple-lock", +] + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +dependencies = [ + "bitflags", + "hashbrown", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19908153158c03df4582af08f47c0eb39fb52a7dff4736b301a66acbbb9955d3" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b03b43f9cad320992f54ed162de2ed63e3ec83ed01361e57ee9c1865fba5a2" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "pair" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "fees-collector", + "itertools", + "multiversx-sc", + "pausable", + "permissions_module", + "simple-lock", + "token_send", +] + +[[package]] +name = "pausable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", + "permissions_module", +] + +[[package]] +name = "permissions_module" +version = "0.0.0" +dependencies = [ + "bitflags", + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "proc-macro2" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "rewards" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "farm_token", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "token_merge_helper" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "token_send" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "week-timekeeping" +version = "0.0.0" +dependencies = [ + "common-types", + "multiversx-sc", +] + +[[package]] +name = "weekly-rewards-splitting" +version = "0.0.0" +dependencies = [ + "common-types", + "energy-query", + "math", + "multiversx-sc", + "unwrappable", + "week-timekeeping", +] + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/dex/farm/wasm/Cargo.toml b/dex/farm/wasm/Cargo.toml index cc2ae376d..44656dfc4 100644 --- a/dex/farm/wasm/Cargo.toml +++ b/dex/farm/wasm/Cargo.toml @@ -19,6 +19,7 @@ opt-level = "z" lto = true debug = false panic = "abort" +overflow-checks = false [dependencies.farm] path = ".." diff --git a/dex/farm/wasm/src/lib.rs b/dex/farm/wasm/src/lib.rs index ef653de72..de7b89ee5 100644 --- a/dex/farm/wasm/src/lib.rs +++ b/dex/farm/wasm/src/lib.rs @@ -10,9 +10,7 @@ // Total number of exported functions: 67 #![no_std] - -// Configuration that works with rustc < 1.73.0. -// TODO: Recommended rustc version: 1.73.0 or newer. +#![allow(internal_features)] #![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); diff --git a/dex/governance/wasm/Cargo.lock b/dex/governance/wasm/Cargo.lock new file mode 100644 index 000000000..7a7db0dd1 --- /dev/null +++ b/dex/governance/wasm/Cargo.lock @@ -0,0 +1,247 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "governance" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "governance-wasm" +version = "0.0.0" +dependencies = [ + "governance", + "multiversx-sc-wasm-adapter", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "multiversx-sc" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +dependencies = [ + "bitflags", + "hashbrown", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19908153158c03df4582af08f47c0eb39fb52a7dff4736b301a66acbbb9955d3" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b03b43f9cad320992f54ed162de2ed63e3ec83ed01361e57ee9c1865fba5a2" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "proc-macro2" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "smallvec" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/dex/governance/wasm/Cargo.toml b/dex/governance/wasm/Cargo.toml index 0e22d2d36..798cb3472 100644 --- a/dex/governance/wasm/Cargo.toml +++ b/dex/governance/wasm/Cargo.toml @@ -19,6 +19,7 @@ opt-level = "z" lto = true debug = false panic = "abort" +overflow-checks = false [dependencies.governance] path = ".." diff --git a/dex/governance/wasm/src/lib.rs b/dex/governance/wasm/src/lib.rs index 6bf958180..913c84bba 100644 --- a/dex/governance/wasm/src/lib.rs +++ b/dex/governance/wasm/src/lib.rs @@ -10,9 +10,7 @@ // Total number of exported functions: 24 #![no_std] - -// Configuration that works with rustc < 1.73.0. -// TODO: Recommended rustc version: 1.73.0 or newer. +#![allow(internal_features)] #![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); diff --git a/dex/pair-mock/wasm/Cargo.lock b/dex/pair-mock/wasm/Cargo.lock new file mode 100644 index 000000000..d095e3103 --- /dev/null +++ b/dex/pair-mock/wasm/Cargo.lock @@ -0,0 +1,271 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "multiversx-sc" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +dependencies = [ + "bitflags", + "hashbrown", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19908153158c03df4582af08f47c0eb39fb52a7dff4736b301a66acbbb9955d3" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b03b43f9cad320992f54ed162de2ed63e3ec83ed01361e57ee9c1865fba5a2" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "pair-mock" +version = "0.0.0" +dependencies = [ + "common_errors", + "itertools", + "multiversx-sc", +] + +[[package]] +name = "pair-mock-wasm" +version = "0.0.0" +dependencies = [ + "multiversx-sc-wasm-adapter", + "pair-mock", +] + +[[package]] +name = "proc-macro2" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "smallvec" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/dex/pair-mock/wasm/Cargo.toml b/dex/pair-mock/wasm/Cargo.toml index a6a87b14d..c364b2ca3 100644 --- a/dex/pair-mock/wasm/Cargo.toml +++ b/dex/pair-mock/wasm/Cargo.toml @@ -19,6 +19,7 @@ opt-level = "z" lto = true debug = false panic = "abort" +overflow-checks = false [dependencies.pair-mock] path = ".." diff --git a/dex/pair-mock/wasm/src/lib.rs b/dex/pair-mock/wasm/src/lib.rs index ec97d8398..e3462d773 100644 --- a/dex/pair-mock/wasm/src/lib.rs +++ b/dex/pair-mock/wasm/src/lib.rs @@ -10,9 +10,7 @@ // Total number of exported functions: 4 #![no_std] - -// Configuration that works with rustc < 1.73.0. -// TODO: Recommended rustc version: 1.73.0 or newer. +#![allow(internal_features)] #![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); diff --git a/dex/pair/wasm-pair-full/Cargo.lock b/dex/pair/wasm-pair-full/Cargo.lock new file mode 100644 index 000000000..7e0ef3cc8 --- /dev/null +++ b/dex/pair/wasm-pair-full/Cargo.lock @@ -0,0 +1,465 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "common-types" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "energy-query" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", +] + +[[package]] +name = "fees-collector" +version = "0.0.0" +dependencies = [ + "common-types", + "common_errors", + "energy-factory", + "energy-query", + "locking_module", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "locking_module" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", + "simple-lock", +] + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +dependencies = [ + "bitflags", + "hashbrown", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19908153158c03df4582af08f47c0eb39fb52a7dff4736b301a66acbbb9955d3" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b03b43f9cad320992f54ed162de2ed63e3ec83ed01361e57ee9c1865fba5a2" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "pair" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "fees-collector", + "itertools", + "multiversx-sc", + "pausable", + "permissions_module", + "simple-lock", + "token_send", +] + +[[package]] +name = "pair-full-wasm" +version = "0.0.0" +dependencies = [ + "multiversx-sc-wasm-adapter", + "pair", +] + +[[package]] +name = "pausable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", + "permissions_module", +] + +[[package]] +name = "permissions_module" +version = "0.0.0" +dependencies = [ + "bitflags", + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "proc-macro2" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "token_send" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "week-timekeeping" +version = "0.0.0" +dependencies = [ + "common-types", + "multiversx-sc", +] + +[[package]] +name = "weekly-rewards-splitting" +version = "0.0.0" +dependencies = [ + "common-types", + "energy-query", + "math", + "multiversx-sc", + "unwrappable", + "week-timekeeping", +] + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/dex/pair/wasm-pair-full/Cargo.toml b/dex/pair/wasm-pair-full/Cargo.toml index a2ee3ac96..663627bb6 100644 --- a/dex/pair/wasm-pair-full/Cargo.toml +++ b/dex/pair/wasm-pair-full/Cargo.toml @@ -19,6 +19,7 @@ opt-level = "z" lto = true debug = false panic = "abort" +overflow-checks = false [dependencies.pair] path = ".." diff --git a/dex/pair/wasm-pair-full/src/lib.rs b/dex/pair/wasm-pair-full/src/lib.rs index 02da48066..17b626ecc 100644 --- a/dex/pair/wasm-pair-full/src/lib.rs +++ b/dex/pair/wasm-pair-full/src/lib.rs @@ -10,9 +10,7 @@ // Total number of exported functions: 66 #![no_std] - -// Configuration that works with rustc < 1.73.0. -// TODO: Recommended rustc version: 1.73.0 or newer. +#![allow(internal_features)] #![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); diff --git a/dex/pair/wasm-safe-price-view/Cargo.lock b/dex/pair/wasm-safe-price-view/Cargo.lock new file mode 100644 index 000000000..68927fa3f --- /dev/null +++ b/dex/pair/wasm-safe-price-view/Cargo.lock @@ -0,0 +1,465 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "common-types" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "energy-query" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", +] + +[[package]] +name = "fees-collector" +version = "0.0.0" +dependencies = [ + "common-types", + "common_errors", + "energy-factory", + "energy-query", + "locking_module", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "locking_module" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", + "simple-lock", +] + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +dependencies = [ + "bitflags", + "hashbrown", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19908153158c03df4582af08f47c0eb39fb52a7dff4736b301a66acbbb9955d3" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b03b43f9cad320992f54ed162de2ed63e3ec83ed01361e57ee9c1865fba5a2" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "pair" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "fees-collector", + "itertools", + "multiversx-sc", + "pausable", + "permissions_module", + "simple-lock", + "token_send", +] + +[[package]] +name = "pausable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", + "permissions_module", +] + +[[package]] +name = "permissions_module" +version = "0.0.0" +dependencies = [ + "bitflags", + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "proc-macro2" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "safe-price-view-wasm" +version = "0.0.0" +dependencies = [ + "multiversx-sc-wasm-adapter", + "pair", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "token_send" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "week-timekeeping" +version = "0.0.0" +dependencies = [ + "common-types", + "multiversx-sc", +] + +[[package]] +name = "weekly-rewards-splitting" +version = "0.0.0" +dependencies = [ + "common-types", + "energy-query", + "math", + "multiversx-sc", + "unwrappable", + "week-timekeeping", +] + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/dex/pair/wasm-safe-price-view/Cargo.toml b/dex/pair/wasm-safe-price-view/Cargo.toml index 7edd6f4a4..3f6bc15d1 100644 --- a/dex/pair/wasm-safe-price-view/Cargo.toml +++ b/dex/pair/wasm-safe-price-view/Cargo.toml @@ -19,6 +19,7 @@ opt-level = "z" lto = true debug = false panic = "abort" +overflow-checks = false [dependencies.pair] path = ".." diff --git a/dex/pair/wasm-safe-price-view/src/lib.rs b/dex/pair/wasm-safe-price-view/src/lib.rs index 66a10d862..cc5f99d90 100644 --- a/dex/pair/wasm-safe-price-view/src/lib.rs +++ b/dex/pair/wasm-safe-price-view/src/lib.rs @@ -10,9 +10,7 @@ // Total number of exported functions: 11 #![no_std] - -// Configuration that works with rustc < 1.73.0. -// TODO: Recommended rustc version: 1.73.0 or newer. +#![allow(internal_features)] #![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); diff --git a/dex/pair/wasm/Cargo.lock b/dex/pair/wasm/Cargo.lock new file mode 100644 index 000000000..3d31934f0 --- /dev/null +++ b/dex/pair/wasm/Cargo.lock @@ -0,0 +1,465 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "common-types" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "energy-query" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", +] + +[[package]] +name = "fees-collector" +version = "0.0.0" +dependencies = [ + "common-types", + "common_errors", + "energy-factory", + "energy-query", + "locking_module", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "locking_module" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", + "simple-lock", +] + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +dependencies = [ + "bitflags", + "hashbrown", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19908153158c03df4582af08f47c0eb39fb52a7dff4736b301a66acbbb9955d3" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b03b43f9cad320992f54ed162de2ed63e3ec83ed01361e57ee9c1865fba5a2" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "pair" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "fees-collector", + "itertools", + "multiversx-sc", + "pausable", + "permissions_module", + "simple-lock", + "token_send", +] + +[[package]] +name = "pair-wasm" +version = "0.0.0" +dependencies = [ + "multiversx-sc-wasm-adapter", + "pair", +] + +[[package]] +name = "pausable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", + "permissions_module", +] + +[[package]] +name = "permissions_module" +version = "0.0.0" +dependencies = [ + "bitflags", + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "proc-macro2" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "token_send" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "week-timekeeping" +version = "0.0.0" +dependencies = [ + "common-types", + "multiversx-sc", +] + +[[package]] +name = "weekly-rewards-splitting" +version = "0.0.0" +dependencies = [ + "common-types", + "energy-query", + "math", + "multiversx-sc", + "unwrappable", + "week-timekeeping", +] + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/dex/pair/wasm/Cargo.toml b/dex/pair/wasm/Cargo.toml index 0248e4fd5..a14d2dab9 100644 --- a/dex/pair/wasm/Cargo.toml +++ b/dex/pair/wasm/Cargo.toml @@ -19,6 +19,7 @@ opt-level = "z" lto = true debug = false panic = "abort" +overflow-checks = false [dependencies.pair] path = ".." diff --git a/dex/pair/wasm/src/lib.rs b/dex/pair/wasm/src/lib.rs index 76f992c76..57339355b 100644 --- a/dex/pair/wasm/src/lib.rs +++ b/dex/pair/wasm/src/lib.rs @@ -10,9 +10,7 @@ // Total number of exported functions: 57 #![no_std] - -// Configuration that works with rustc < 1.73.0. -// TODO: Recommended rustc version: 1.73.0 or newer. +#![allow(internal_features)] #![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); diff --git a/dex/price-discovery/wasm/Cargo.lock b/dex/price-discovery/wasm/Cargo.lock new file mode 100644 index 000000000..358220a08 --- /dev/null +++ b/dex/price-discovery/wasm/Cargo.lock @@ -0,0 +1,372 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "locking_module" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", + "simple-lock", +] + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +dependencies = [ + "bitflags", + "hashbrown", + "hex-literal 0.4.1", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19908153158c03df4582af08f47c0eb39fb52a7dff4736b301a66acbbb9955d3" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b03b43f9cad320992f54ed162de2ed63e3ec83ed01361e57ee9c1865fba5a2" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "price-discovery" +version = "0.0.0" +dependencies = [ + "hex-literal 0.3.4", + "locking_module", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "price-discovery-wasm" +version = "0.0.0" +dependencies = [ + "multiversx-sc-wasm-adapter", + "price-discovery", +] + +[[package]] +name = "proc-macro2" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/dex/price-discovery/wasm/Cargo.toml b/dex/price-discovery/wasm/Cargo.toml index 8063eaf78..2e0c1a962 100644 --- a/dex/price-discovery/wasm/Cargo.toml +++ b/dex/price-discovery/wasm/Cargo.toml @@ -19,6 +19,7 @@ opt-level = "z" lto = true debug = false panic = "abort" +overflow-checks = false [dependencies.price-discovery] path = ".." diff --git a/dex/price-discovery/wasm/src/lib.rs b/dex/price-discovery/wasm/src/lib.rs index ddaaf9b4c..c29196d8a 100644 --- a/dex/price-discovery/wasm/src/lib.rs +++ b/dex/price-discovery/wasm/src/lib.rs @@ -10,9 +10,7 @@ // Total number of exported functions: 30 #![no_std] - -// Configuration that works with rustc < 1.73.0. -// TODO: Recommended rustc version: 1.73.0 or newer. +#![allow(internal_features)] #![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); diff --git a/dex/proxy-deployer/wasm/Cargo.lock b/dex/proxy-deployer/wasm/Cargo.lock new file mode 100644 index 000000000..574bef2cf --- /dev/null +++ b/dex/proxy-deployer/wasm/Cargo.lock @@ -0,0 +1,615 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "common-types" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "config" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "contexts" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "farm_token", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "rewards", + "token_merge_helper", + "token_send", +] + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "energy-query" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", +] + +[[package]] +name = "events" +version = "0.0.0" +dependencies = [ + "common_structs", + "contexts", + "multiversx-sc", +] + +[[package]] +name = "farm" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "energy-query", + "events", + "farm-boosted-yields", + "farm_base_impl", + "farm_token", + "fixed-supply-token", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pair", + "pausable", + "permissions_module", + "rewards", + "sc_whitelist_module", + "token_send", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm-boosted-yields" +version = "0.0.0" +dependencies = [ + "common-types", + "config", + "energy-query", + "multiversx-sc", + "pausable", + "permissions_module", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm_base_impl" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "events", + "farm_token", + "fixed-supply-token", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "rewards", + "token_merge_helper", + "token_send", + "utils", +] + +[[package]] +name = "farm_token" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "fees-collector" +version = "0.0.0" +dependencies = [ + "common-types", + "common_errors", + "energy-factory", + "energy-query", + "locking_module", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "locking_module" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", + "simple-lock", +] + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +dependencies = [ + "bitflags", + "hashbrown", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19908153158c03df4582af08f47c0eb39fb52a7dff4736b301a66acbbb9955d3" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b03b43f9cad320992f54ed162de2ed63e3ec83ed01361e57ee9c1865fba5a2" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "pair" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "fees-collector", + "itertools", + "multiversx-sc", + "pausable", + "permissions_module", + "simple-lock", + "token_send", +] + +[[package]] +name = "pausable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", + "permissions_module", +] + +[[package]] +name = "permissions_module" +version = "0.0.0" +dependencies = [ + "bitflags", + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "proc-macro2" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "proxy-deployer" +version = "0.0.0" +dependencies = [ + "config", + "farm", + "farm_token", + "multiversx-sc", + "pausable", +] + +[[package]] +name = "proxy-deployer-wasm" +version = "0.0.0" +dependencies = [ + "multiversx-sc-wasm-adapter", + "proxy-deployer", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "rewards" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "farm_token", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "token_merge_helper" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "token_send" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "week-timekeeping" +version = "0.0.0" +dependencies = [ + "common-types", + "multiversx-sc", +] + +[[package]] +name = "weekly-rewards-splitting" +version = "0.0.0" +dependencies = [ + "common-types", + "energy-query", + "math", + "multiversx-sc", + "unwrappable", + "week-timekeeping", +] + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/dex/proxy-deployer/wasm/Cargo.toml b/dex/proxy-deployer/wasm/Cargo.toml index 1c32d76eb..a12cd2152 100644 --- a/dex/proxy-deployer/wasm/Cargo.toml +++ b/dex/proxy-deployer/wasm/Cargo.toml @@ -19,6 +19,7 @@ opt-level = "z" lto = true debug = false panic = "abort" +overflow-checks = false [dependencies.proxy-deployer] path = ".." diff --git a/dex/proxy-deployer/wasm/src/lib.rs b/dex/proxy-deployer/wasm/src/lib.rs index a74ccdddd..b8f3493f8 100644 --- a/dex/proxy-deployer/wasm/src/lib.rs +++ b/dex/proxy-deployer/wasm/src/lib.rs @@ -10,9 +10,7 @@ // Total number of exported functions: 7 #![no_std] - -// Configuration that works with rustc < 1.73.0. -// TODO: Recommended rustc version: 1.73.0 or newer. +#![allow(internal_features)] #![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); diff --git a/dex/router/wasm/Cargo.lock b/dex/router/wasm/Cargo.lock new file mode 100644 index 000000000..d6f7cf730 --- /dev/null +++ b/dex/router/wasm/Cargo.lock @@ -0,0 +1,477 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "common-types" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "energy-query" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", +] + +[[package]] +name = "fees-collector" +version = "0.0.0" +dependencies = [ + "common-types", + "common_errors", + "energy-factory", + "energy-query", + "locking_module", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "locking_module" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", + "simple-lock", +] + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +dependencies = [ + "bitflags", + "hashbrown", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19908153158c03df4582af08f47c0eb39fb52a7dff4736b301a66acbbb9955d3" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b03b43f9cad320992f54ed162de2ed63e3ec83ed01361e57ee9c1865fba5a2" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "pair" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "fees-collector", + "itertools", + "multiversx-sc", + "pausable", + "permissions_module", + "simple-lock", + "token_send", +] + +[[package]] +name = "pausable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", + "permissions_module", +] + +[[package]] +name = "permissions_module" +version = "0.0.0" +dependencies = [ + "bitflags", + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "proc-macro2" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "router" +version = "0.0.0" +dependencies = [ + "locking_module", + "multiversx-sc", + "pair", + "pausable", + "simple-lock", + "token_send", +] + +[[package]] +name = "router-wasm" +version = "0.0.0" +dependencies = [ + "multiversx-sc-wasm-adapter", + "router", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "token_send" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "week-timekeeping" +version = "0.0.0" +dependencies = [ + "common-types", + "multiversx-sc", +] + +[[package]] +name = "weekly-rewards-splitting" +version = "0.0.0" +dependencies = [ + "common-types", + "energy-query", + "math", + "multiversx-sc", + "unwrappable", + "week-timekeeping", +] + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/dex/router/wasm/Cargo.toml b/dex/router/wasm/Cargo.toml index 9f2585560..e2c69a8e3 100644 --- a/dex/router/wasm/Cargo.toml +++ b/dex/router/wasm/Cargo.toml @@ -19,6 +19,7 @@ opt-level = "z" lto = true debug = false panic = "abort" +overflow-checks = false [dependencies.router] path = ".." diff --git a/dex/router/wasm/src/lib.rs b/dex/router/wasm/src/lib.rs index ac06c8060..c277c4367 100644 --- a/dex/router/wasm/src/lib.rs +++ b/dex/router/wasm/src/lib.rs @@ -10,9 +10,7 @@ // Total number of exported functions: 34 #![no_std] - -// Configuration that works with rustc < 1.73.0. -// TODO: Recommended rustc version: 1.73.0 or newer. +#![allow(internal_features)] #![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); diff --git a/energy-integration/energy-factory-mock/wasm/Cargo.lock b/energy-integration/energy-factory-mock/wasm/Cargo.lock new file mode 100644 index 000000000..a328781fd --- /dev/null +++ b/energy-integration/energy-factory-mock/wasm/Cargo.lock @@ -0,0 +1,363 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "energy-factory-mock" +version = "0.0.0" +dependencies = [ + "energy-query", + "multiversx-sc", +] + +[[package]] +name = "energy-factory-mock-wasm" +version = "0.0.0" +dependencies = [ + "energy-factory-mock", + "multiversx-sc-wasm-adapter", +] + +[[package]] +name = "energy-query" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +dependencies = [ + "bitflags", + "hashbrown", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19908153158c03df4582af08f47c0eb39fb52a7dff4736b301a66acbbb9955d3" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b03b43f9cad320992f54ed162de2ed63e3ec83ed01361e57ee9c1865fba5a2" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "proc-macro2" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/energy-integration/energy-factory-mock/wasm/Cargo.toml b/energy-integration/energy-factory-mock/wasm/Cargo.toml index 6974d9fc0..ebb38914a 100644 --- a/energy-integration/energy-factory-mock/wasm/Cargo.toml +++ b/energy-integration/energy-factory-mock/wasm/Cargo.toml @@ -19,6 +19,7 @@ opt-level = "z" lto = true debug = false panic = "abort" +overflow-checks = false [dependencies.energy-factory-mock] path = ".." diff --git a/energy-integration/energy-factory-mock/wasm/src/lib.rs b/energy-integration/energy-factory-mock/wasm/src/lib.rs index 4ac2e4094..c52b88848 100644 --- a/energy-integration/energy-factory-mock/wasm/src/lib.rs +++ b/energy-integration/energy-factory-mock/wasm/src/lib.rs @@ -10,9 +10,7 @@ // Total number of exported functions: 6 #![no_std] - -// Configuration that works with rustc < 1.73.0. -// TODO: Recommended rustc version: 1.73.0 or newer. +#![allow(internal_features)] #![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); diff --git a/energy-integration/energy-update/wasm/Cargo.lock b/energy-integration/energy-update/wasm/Cargo.lock new file mode 100644 index 000000000..d7581da0c --- /dev/null +++ b/energy-integration/energy-update/wasm/Cargo.lock @@ -0,0 +1,614 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "common-types" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "config" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "contexts" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "farm_token", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "rewards", + "token_merge_helper", + "token_send", +] + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "energy-query" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", +] + +[[package]] +name = "energy-update" +version = "0.0.0" +dependencies = [ + "farm", + "multiversx-sc", + "multiversx-sc-modules", + "weekly-rewards-splitting", +] + +[[package]] +name = "energy-update-wasm" +version = "0.0.0" +dependencies = [ + "energy-update", + "multiversx-sc-wasm-adapter", +] + +[[package]] +name = "events" +version = "0.0.0" +dependencies = [ + "common_structs", + "contexts", + "multiversx-sc", +] + +[[package]] +name = "farm" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "energy-query", + "events", + "farm-boosted-yields", + "farm_base_impl", + "farm_token", + "fixed-supply-token", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pair", + "pausable", + "permissions_module", + "rewards", + "sc_whitelist_module", + "token_send", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm-boosted-yields" +version = "0.0.0" +dependencies = [ + "common-types", + "config", + "energy-query", + "multiversx-sc", + "pausable", + "permissions_module", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm_base_impl" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "events", + "farm_token", + "fixed-supply-token", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "rewards", + "token_merge_helper", + "token_send", + "utils", +] + +[[package]] +name = "farm_token" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "fees-collector" +version = "0.0.0" +dependencies = [ + "common-types", + "common_errors", + "energy-factory", + "energy-query", + "locking_module", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "locking_module" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", + "simple-lock", +] + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +dependencies = [ + "bitflags", + "hashbrown", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19908153158c03df4582af08f47c0eb39fb52a7dff4736b301a66acbbb9955d3" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b03b43f9cad320992f54ed162de2ed63e3ec83ed01361e57ee9c1865fba5a2" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "pair" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "fees-collector", + "itertools", + "multiversx-sc", + "pausable", + "permissions_module", + "simple-lock", + "token_send", +] + +[[package]] +name = "pausable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", + "permissions_module", +] + +[[package]] +name = "permissions_module" +version = "0.0.0" +dependencies = [ + "bitflags", + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "proc-macro2" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "rewards" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "farm_token", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "token_merge_helper" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "token_send" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "week-timekeeping" +version = "0.0.0" +dependencies = [ + "common-types", + "multiversx-sc", +] + +[[package]] +name = "weekly-rewards-splitting" +version = "0.0.0" +dependencies = [ + "common-types", + "energy-query", + "math", + "multiversx-sc", + "unwrappable", + "week-timekeeping", +] + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/energy-integration/energy-update/wasm/Cargo.toml b/energy-integration/energy-update/wasm/Cargo.toml index d5ba7b533..c05d11a8f 100644 --- a/energy-integration/energy-update/wasm/Cargo.toml +++ b/energy-integration/energy-update/wasm/Cargo.toml @@ -19,6 +19,7 @@ opt-level = "z" lto = true debug = false panic = "abort" +overflow-checks = false [dependencies.energy-update] path = ".." diff --git a/energy-integration/energy-update/wasm/src/lib.rs b/energy-integration/energy-update/wasm/src/lib.rs index 7200d8146..b4de939ec 100644 --- a/energy-integration/energy-update/wasm/src/lib.rs +++ b/energy-integration/energy-update/wasm/src/lib.rs @@ -10,9 +10,7 @@ // Total number of exported functions: 4 #![no_std] - -// Configuration that works with rustc < 1.73.0. -// TODO: Recommended rustc version: 1.73.0 or newer. +#![allow(internal_features)] #![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); diff --git a/energy-integration/fees-collector/wasm/Cargo.lock b/energy-integration/fees-collector/wasm/Cargo.lock new file mode 100644 index 000000000..a07685f8d --- /dev/null +++ b/energy-integration/fees-collector/wasm/Cargo.lock @@ -0,0 +1,409 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "common-types" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "energy-query" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", +] + +[[package]] +name = "fees-collector" +version = "0.0.0" +dependencies = [ + "common-types", + "common_errors", + "energy-factory", + "energy-query", + "locking_module", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "fees-collector-wasm" +version = "0.0.0" +dependencies = [ + "fees-collector", + "multiversx-sc-wasm-adapter", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "locking_module" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", + "simple-lock", +] + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +dependencies = [ + "bitflags", + "hashbrown", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19908153158c03df4582af08f47c0eb39fb52a7dff4736b301a66acbbb9955d3" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b03b43f9cad320992f54ed162de2ed63e3ec83ed01361e57ee9c1865fba5a2" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "proc-macro2" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "week-timekeeping" +version = "0.0.0" +dependencies = [ + "common-types", + "multiversx-sc", +] + +[[package]] +name = "weekly-rewards-splitting" +version = "0.0.0" +dependencies = [ + "common-types", + "energy-query", + "math", + "multiversx-sc", + "unwrappable", + "week-timekeeping", +] + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/energy-integration/fees-collector/wasm/Cargo.toml b/energy-integration/fees-collector/wasm/Cargo.toml index 531c606d8..3e5656621 100644 --- a/energy-integration/fees-collector/wasm/Cargo.toml +++ b/energy-integration/fees-collector/wasm/Cargo.toml @@ -19,6 +19,7 @@ opt-level = "z" lto = true debug = false panic = "abort" +overflow-checks = false [dependencies.fees-collector] path = ".." diff --git a/energy-integration/fees-collector/wasm/src/lib.rs b/energy-integration/fees-collector/wasm/src/lib.rs index f8d4ac038..75812bfb1 100644 --- a/energy-integration/fees-collector/wasm/src/lib.rs +++ b/energy-integration/fees-collector/wasm/src/lib.rs @@ -10,9 +10,7 @@ // Total number of exported functions: 41 #![no_std] - -// Configuration that works with rustc < 1.73.0. -// TODO: Recommended rustc version: 1.73.0 or newer. +#![allow(internal_features)] #![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); diff --git a/energy-integration/governance-v2/wasm/Cargo.lock b/energy-integration/governance-v2/wasm/Cargo.lock new file mode 100644 index 000000000..6a12b763a --- /dev/null +++ b/energy-integration/governance-v2/wasm/Cargo.lock @@ -0,0 +1,429 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "common-types" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "energy-query" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", +] + +[[package]] +name = "fees-collector" +version = "0.0.0" +dependencies = [ + "common-types", + "common_errors", + "energy-factory", + "energy-query", + "locking_module", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "governance-v2" +version = "0.0.0" +dependencies = [ + "energy-query", + "fees-collector", + "multiversx-sc", + "permissions_module", + "weekly-rewards-splitting", +] + +[[package]] +name = "governance-v2-wasm" +version = "0.0.0" +dependencies = [ + "governance-v2", + "multiversx-sc-wasm-adapter", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "locking_module" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", + "simple-lock", +] + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +dependencies = [ + "bitflags", + "hashbrown", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19908153158c03df4582af08f47c0eb39fb52a7dff4736b301a66acbbb9955d3" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b03b43f9cad320992f54ed162de2ed63e3ec83ed01361e57ee9c1865fba5a2" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "permissions_module" +version = "0.0.0" +dependencies = [ + "bitflags", + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "proc-macro2" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "week-timekeeping" +version = "0.0.0" +dependencies = [ + "common-types", + "multiversx-sc", +] + +[[package]] +name = "weekly-rewards-splitting" +version = "0.0.0" +dependencies = [ + "common-types", + "energy-query", + "math", + "multiversx-sc", + "unwrappable", + "week-timekeeping", +] + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/energy-integration/governance-v2/wasm/Cargo.toml b/energy-integration/governance-v2/wasm/Cargo.toml index 59b888d93..1529af7a9 100644 --- a/energy-integration/governance-v2/wasm/Cargo.toml +++ b/energy-integration/governance-v2/wasm/Cargo.toml @@ -19,6 +19,7 @@ opt-level = "z" lto = true debug = false panic = "abort" +overflow-checks = false [dependencies.governance-v2] path = ".." diff --git a/energy-integration/governance-v2/wasm/src/lib.rs b/energy-integration/governance-v2/wasm/src/lib.rs index dfcfc2d47..d3c597f9f 100644 --- a/energy-integration/governance-v2/wasm/src/lib.rs +++ b/energy-integration/governance-v2/wasm/src/lib.rs @@ -10,9 +10,7 @@ // Total number of exported functions: 31 #![no_std] - -// Configuration that works with rustc < 1.73.0. -// TODO: Recommended rustc version: 1.73.0 or newer. +#![allow(internal_features)] #![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); diff --git a/farm-staking/farm-staking-proxy/wasm/Cargo.lock b/farm-staking/farm-staking-proxy/wasm/Cargo.lock new file mode 100644 index 000000000..69e2d0409 --- /dev/null +++ b/farm-staking/farm-staking-proxy/wasm/Cargo.lock @@ -0,0 +1,695 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "common-types" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "config" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "contexts" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "farm_token", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "rewards", + "token_merge_helper", + "token_send", +] + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "energy-query" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", +] + +[[package]] +name = "events" +version = "0.0.0" +dependencies = [ + "common_structs", + "contexts", + "multiversx-sc", +] + +[[package]] +name = "farm" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "energy-query", + "events", + "farm-boosted-yields", + "farm_base_impl", + "farm_token", + "fixed-supply-token", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pair", + "pausable", + "permissions_module", + "rewards", + "sc_whitelist_module", + "token_send", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm-boosted-yields" +version = "0.0.0" +dependencies = [ + "common-types", + "config", + "energy-query", + "multiversx-sc", + "pausable", + "permissions_module", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm-staking" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "energy-factory", + "energy-query", + "events", + "farm", + "farm-boosted-yields", + "farm_base_impl", + "farm_token", + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pair", + "pausable", + "permissions_module", + "rewards", + "sc_whitelist_module", + "token_send", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm-staking-proxy" +version = "0.0.0" +dependencies = [ + "common_structs", + "config", + "energy-query", + "farm", + "farm-staking", + "farm-with-locked-rewards", + "fixed-supply-token", + "hex-literal 0.3.4", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pair", + "pausable", + "rewards", + "sc_whitelist_module", + "token_send", + "unwrappable", + "utils", +] + +[[package]] +name = "farm-staking-proxy-wasm" +version = "0.0.0" +dependencies = [ + "farm-staking-proxy", + "multiversx-sc-wasm-adapter", +] + +[[package]] +name = "farm-with-locked-rewards" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "energy-factory", + "energy-query", + "events", + "farm", + "farm-boosted-yields", + "farm_base_impl", + "farm_token", + "fixed-supply-token", + "locking_module", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "rewards", + "sc_whitelist_module", + "token_send", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm_base_impl" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "events", + "farm_token", + "fixed-supply-token", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "rewards", + "token_merge_helper", + "token_send", + "utils", +] + +[[package]] +name = "farm_token" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "fees-collector" +version = "0.0.0" +dependencies = [ + "common-types", + "common_errors", + "energy-factory", + "energy-query", + "locking_module", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "locking_module" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", + "simple-lock", +] + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +dependencies = [ + "bitflags", + "hashbrown", + "hex-literal 0.4.1", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19908153158c03df4582af08f47c0eb39fb52a7dff4736b301a66acbbb9955d3" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b03b43f9cad320992f54ed162de2ed63e3ec83ed01361e57ee9c1865fba5a2" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "pair" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "fees-collector", + "itertools", + "multiversx-sc", + "pausable", + "permissions_module", + "simple-lock", + "token_send", +] + +[[package]] +name = "pausable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", + "permissions_module", +] + +[[package]] +name = "permissions_module" +version = "0.0.0" +dependencies = [ + "bitflags", + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "proc-macro2" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "rewards" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "farm_token", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "token_merge_helper" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "token_send" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "week-timekeeping" +version = "0.0.0" +dependencies = [ + "common-types", + "multiversx-sc", +] + +[[package]] +name = "weekly-rewards-splitting" +version = "0.0.0" +dependencies = [ + "common-types", + "energy-query", + "math", + "multiversx-sc", + "unwrappable", + "week-timekeeping", +] + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/farm-staking/farm-staking-proxy/wasm/Cargo.toml b/farm-staking/farm-staking-proxy/wasm/Cargo.toml index 784aea80d..7f2bf7dc2 100644 --- a/farm-staking/farm-staking-proxy/wasm/Cargo.toml +++ b/farm-staking/farm-staking-proxy/wasm/Cargo.toml @@ -19,6 +19,7 @@ opt-level = "z" lto = true debug = false panic = "abort" +overflow-checks = false [dependencies.farm-staking-proxy] path = ".." diff --git a/farm-staking/farm-staking-proxy/wasm/src/lib.rs b/farm-staking/farm-staking-proxy/wasm/src/lib.rs index 93272496c..ee8a50b10 100644 --- a/farm-staking/farm-staking-proxy/wasm/src/lib.rs +++ b/farm-staking/farm-staking-proxy/wasm/src/lib.rs @@ -10,9 +10,7 @@ // Total number of exported functions: 20 #![no_std] - -// Configuration that works with rustc < 1.73.0. -// TODO: Recommended rustc version: 1.73.0 or newer. +#![allow(internal_features)] #![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); diff --git a/farm-staking/farm-staking/wasm/Cargo.lock b/farm-staking/farm-staking/wasm/Cargo.lock new file mode 100644 index 000000000..45ce016fa --- /dev/null +++ b/farm-staking/farm-staking/wasm/Cargo.lock @@ -0,0 +1,635 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "common-types" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "config" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "contexts" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "farm_token", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "rewards", + "token_merge_helper", + "token_send", +] + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "energy-query" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", +] + +[[package]] +name = "events" +version = "0.0.0" +dependencies = [ + "common_structs", + "contexts", + "multiversx-sc", +] + +[[package]] +name = "farm" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "energy-query", + "events", + "farm-boosted-yields", + "farm_base_impl", + "farm_token", + "fixed-supply-token", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pair", + "pausable", + "permissions_module", + "rewards", + "sc_whitelist_module", + "token_send", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm-boosted-yields" +version = "0.0.0" +dependencies = [ + "common-types", + "config", + "energy-query", + "multiversx-sc", + "pausable", + "permissions_module", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm-staking" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "energy-factory", + "energy-query", + "events", + "farm", + "farm-boosted-yields", + "farm_base_impl", + "farm_token", + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pair", + "pausable", + "permissions_module", + "rewards", + "sc_whitelist_module", + "token_send", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm-staking-wasm" +version = "0.0.0" +dependencies = [ + "farm-staking", + "multiversx-sc-wasm-adapter", +] + +[[package]] +name = "farm_base_impl" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "events", + "farm_token", + "fixed-supply-token", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "rewards", + "token_merge_helper", + "token_send", + "utils", +] + +[[package]] +name = "farm_token" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "fees-collector" +version = "0.0.0" +dependencies = [ + "common-types", + "common_errors", + "energy-factory", + "energy-query", + "locking_module", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "locking_module" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", + "simple-lock", +] + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +dependencies = [ + "bitflags", + "hashbrown", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19908153158c03df4582af08f47c0eb39fb52a7dff4736b301a66acbbb9955d3" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b03b43f9cad320992f54ed162de2ed63e3ec83ed01361e57ee9c1865fba5a2" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "pair" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "fees-collector", + "itertools", + "multiversx-sc", + "pausable", + "permissions_module", + "simple-lock", + "token_send", +] + +[[package]] +name = "pausable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", + "permissions_module", +] + +[[package]] +name = "permissions_module" +version = "0.0.0" +dependencies = [ + "bitflags", + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "proc-macro2" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "rewards" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "farm_token", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "token_merge_helper" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "token_send" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "week-timekeeping" +version = "0.0.0" +dependencies = [ + "common-types", + "multiversx-sc", +] + +[[package]] +name = "weekly-rewards-splitting" +version = "0.0.0" +dependencies = [ + "common-types", + "energy-query", + "math", + "multiversx-sc", + "unwrappable", + "week-timekeeping", +] + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/farm-staking/farm-staking/wasm/Cargo.toml b/farm-staking/farm-staking/wasm/Cargo.toml index f4a5c2c4b..3f2d8608c 100644 --- a/farm-staking/farm-staking/wasm/Cargo.toml +++ b/farm-staking/farm-staking/wasm/Cargo.toml @@ -19,6 +19,7 @@ opt-level = "z" lto = true debug = false panic = "abort" +overflow-checks = false [dependencies.farm-staking] path = ".." diff --git a/farm-staking/farm-staking/wasm/src/lib.rs b/farm-staking/farm-staking/wasm/src/lib.rs index 1baf98ce9..c05cf46e5 100644 --- a/farm-staking/farm-staking/wasm/src/lib.rs +++ b/farm-staking/farm-staking/wasm/src/lib.rs @@ -10,9 +10,7 @@ // Total number of exported functions: 72 #![no_std] - -// Configuration that works with rustc < 1.73.0. -// TODO: Recommended rustc version: 1.73.0 or newer. +#![allow(internal_features)] #![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); diff --git a/farm-staking/metabonding-staking/wasm/Cargo.lock b/farm-staking/metabonding-staking/wasm/Cargo.lock new file mode 100644 index 000000000..d629bca2b --- /dev/null +++ b/farm-staking/metabonding-staking/wasm/Cargo.lock @@ -0,0 +1,456 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if 1.0.0", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "factory" +version = "0.0.0" +dependencies = [ + "arrayvec", + "common_errors", + "common_structs", + "energy-factory", + "itertools", + "multiversx-sc", + "multiversx-sc-modules", + "token_merge_helper", + "token_send", + "wee_alloc", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "libc" +version = "0.2.151" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "memory_units" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "metabonding-staking" +version = "0.0.0" +dependencies = [ + "factory", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "metabonding-staking-wasm" +version = "0.0.0" +dependencies = [ + "metabonding-staking", + "multiversx-sc-wasm-adapter", +] + +[[package]] +name = "multiversx-sc" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +dependencies = [ + "bitflags", + "hashbrown", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19908153158c03df4582af08f47c0eb39fb52a7dff4736b301a66acbbb9955d3" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b03b43f9cad320992f54ed162de2ed63e3ec83ed01361e57ee9c1865fba5a2" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "proc-macro2" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "token_merge_helper" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "token_send" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wee_alloc" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" +dependencies = [ + "cfg-if 0.1.10", + "libc", + "memory_units", + "winapi", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/farm-staking/metabonding-staking/wasm/Cargo.toml b/farm-staking/metabonding-staking/wasm/Cargo.toml index 58d42713a..c0a6380da 100644 --- a/farm-staking/metabonding-staking/wasm/Cargo.toml +++ b/farm-staking/metabonding-staking/wasm/Cargo.toml @@ -19,6 +19,7 @@ opt-level = "z" lto = true debug = false panic = "abort" +overflow-checks = false [dependencies.metabonding-staking] path = ".." diff --git a/farm-staking/metabonding-staking/wasm/src/lib.rs b/farm-staking/metabonding-staking/wasm/src/lib.rs index 8e1fcaad3..b8e948d22 100644 --- a/farm-staking/metabonding-staking/wasm/src/lib.rs +++ b/farm-staking/metabonding-staking/wasm/src/lib.rs @@ -10,9 +10,7 @@ // Total number of exported functions: 13 #![no_std] - -// Configuration that works with rustc < 1.73.0. -// TODO: Recommended rustc version: 1.73.0 or newer. +#![allow(internal_features)] #![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); diff --git a/locked-asset/distribution/wasm/Cargo.lock b/locked-asset/distribution/wasm/Cargo.lock new file mode 100644 index 000000000..ae7c5f92e --- /dev/null +++ b/locked-asset/distribution/wasm/Cargo.lock @@ -0,0 +1,456 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if 1.0.0", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "distribution" +version = "0.0.0" +dependencies = [ + "common_structs", + "factory", + "multiversx-sc", +] + +[[package]] +name = "distribution-wasm" +version = "0.0.0" +dependencies = [ + "distribution", + "multiversx-sc-wasm-adapter", +] + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "factory" +version = "0.0.0" +dependencies = [ + "arrayvec", + "common_errors", + "common_structs", + "energy-factory", + "itertools", + "multiversx-sc", + "multiversx-sc-modules", + "token_merge_helper", + "token_send", + "wee_alloc", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "libc" +version = "0.2.151" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "memory_units" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +dependencies = [ + "bitflags", + "hashbrown", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19908153158c03df4582af08f47c0eb39fb52a7dff4736b301a66acbbb9955d3" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b03b43f9cad320992f54ed162de2ed63e3ec83ed01361e57ee9c1865fba5a2" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "proc-macro2" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "token_merge_helper" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "token_send" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wee_alloc" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" +dependencies = [ + "cfg-if 0.1.10", + "libc", + "memory_units", + "winapi", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/locked-asset/distribution/wasm/Cargo.toml b/locked-asset/distribution/wasm/Cargo.toml index f24f2d30b..6a9fb07f9 100644 --- a/locked-asset/distribution/wasm/Cargo.toml +++ b/locked-asset/distribution/wasm/Cargo.toml @@ -19,6 +19,7 @@ opt-level = "z" lto = true debug = false panic = "abort" +overflow-checks = false [dependencies.distribution] path = ".." diff --git a/locked-asset/distribution/wasm/src/lib.rs b/locked-asset/distribution/wasm/src/lib.rs index a6757be7e..87c728bb7 100644 --- a/locked-asset/distribution/wasm/src/lib.rs +++ b/locked-asset/distribution/wasm/src/lib.rs @@ -10,9 +10,7 @@ // Total number of exported functions: 18 #![no_std] - -// Configuration that works with rustc < 1.73.0. -// TODO: Recommended rustc version: 1.73.0 or newer. +#![allow(internal_features)] #![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); diff --git a/locked-asset/energy-factory/wasm/Cargo.lock b/locked-asset/energy-factory/wasm/Cargo.lock new file mode 100644 index 000000000..b9295a3d9 --- /dev/null +++ b/locked-asset/energy-factory/wasm/Cargo.lock @@ -0,0 +1,347 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "energy-factory-wasm" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc-wasm-adapter", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +dependencies = [ + "bitflags", + "hashbrown", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19908153158c03df4582af08f47c0eb39fb52a7dff4736b301a66acbbb9955d3" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b03b43f9cad320992f54ed162de2ed63e3ec83ed01361e57ee9c1865fba5a2" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "proc-macro2" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/locked-asset/energy-factory/wasm/Cargo.toml b/locked-asset/energy-factory/wasm/Cargo.toml index c6497dd76..2262d519e 100644 --- a/locked-asset/energy-factory/wasm/Cargo.toml +++ b/locked-asset/energy-factory/wasm/Cargo.toml @@ -19,6 +19,7 @@ opt-level = "z" lto = true debug = false panic = "abort" +overflow-checks = false [dependencies.energy-factory] path = ".." diff --git a/locked-asset/energy-factory/wasm/src/lib.rs b/locked-asset/energy-factory/wasm/src/lib.rs index a96da35ba..7393a9e97 100644 --- a/locked-asset/energy-factory/wasm/src/lib.rs +++ b/locked-asset/energy-factory/wasm/src/lib.rs @@ -10,9 +10,7 @@ // Total number of exported functions: 36 #![no_std] - -// Configuration that works with rustc < 1.73.0. -// TODO: Recommended rustc version: 1.73.0 or newer. +#![allow(internal_features)] #![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); diff --git a/locked-asset/factory/wasm/Cargo.lock b/locked-asset/factory/wasm/Cargo.lock new file mode 100644 index 000000000..f84ffb23b --- /dev/null +++ b/locked-asset/factory/wasm/Cargo.lock @@ -0,0 +1,447 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if 1.0.0", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "factory" +version = "0.0.0" +dependencies = [ + "arrayvec", + "common_errors", + "common_structs", + "energy-factory", + "itertools", + "multiversx-sc", + "multiversx-sc-modules", + "token_merge_helper", + "token_send", + "wee_alloc", +] + +[[package]] +name = "factory-wasm" +version = "0.0.0" +dependencies = [ + "factory", + "multiversx-sc-wasm-adapter", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "libc" +version = "0.2.151" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "memory_units" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +dependencies = [ + "bitflags", + "hashbrown", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19908153158c03df4582af08f47c0eb39fb52a7dff4736b301a66acbbb9955d3" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b03b43f9cad320992f54ed162de2ed63e3ec83ed01361e57ee9c1865fba5a2" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "proc-macro2" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "token_merge_helper" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "token_send" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wee_alloc" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" +dependencies = [ + "cfg-if 0.1.10", + "libc", + "memory_units", + "winapi", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/locked-asset/factory/wasm/Cargo.toml b/locked-asset/factory/wasm/Cargo.toml index 981cad91d..5eef2375f 100644 --- a/locked-asset/factory/wasm/Cargo.toml +++ b/locked-asset/factory/wasm/Cargo.toml @@ -19,6 +19,7 @@ opt-level = "z" lto = true debug = false panic = "abort" +overflow-checks = false [dependencies.factory] path = ".." diff --git a/locked-asset/factory/wasm/src/lib.rs b/locked-asset/factory/wasm/src/lib.rs index 2cfab5356..7ad9e4ac0 100644 --- a/locked-asset/factory/wasm/src/lib.rs +++ b/locked-asset/factory/wasm/src/lib.rs @@ -10,9 +10,7 @@ // Total number of exported functions: 27 #![no_std] - -// Configuration that works with rustc < 1.73.0. -// TODO: Recommended rustc version: 1.73.0 or newer. +#![allow(internal_features)] #![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); diff --git a/locked-asset/lkmex-transfer/wasm/Cargo.lock b/locked-asset/lkmex-transfer/wasm/Cargo.lock new file mode 100644 index 000000000..c91018040 --- /dev/null +++ b/locked-asset/lkmex-transfer/wasm/Cargo.lock @@ -0,0 +1,378 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "energy-query" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "lkmex-transfer" +version = "0.0.0" +dependencies = [ + "common_structs", + "energy-factory", + "energy-query", + "legacy_token_decode_module", + "multiversx-sc", + "permissions_module", + "simple-lock", + "utils", +] + +[[package]] +name = "lkmex-transfer-wasm" +version = "0.0.0" +dependencies = [ + "lkmex-transfer", + "multiversx-sc-wasm-adapter", +] + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +dependencies = [ + "bitflags", + "hashbrown", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19908153158c03df4582af08f47c0eb39fb52a7dff4736b301a66acbbb9955d3" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b03b43f9cad320992f54ed162de2ed63e3ec83ed01361e57ee9c1865fba5a2" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "permissions_module" +version = "0.0.0" +dependencies = [ + "bitflags", + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "proc-macro2" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/locked-asset/lkmex-transfer/wasm/Cargo.toml b/locked-asset/lkmex-transfer/wasm/Cargo.toml index 985ca4ec1..ee219ca64 100644 --- a/locked-asset/lkmex-transfer/wasm/Cargo.toml +++ b/locked-asset/lkmex-transfer/wasm/Cargo.toml @@ -19,6 +19,7 @@ opt-level = "z" lto = true debug = false panic = "abort" +overflow-checks = false [dependencies.lkmex-transfer] path = ".." diff --git a/locked-asset/lkmex-transfer/wasm/src/lib.rs b/locked-asset/lkmex-transfer/wasm/src/lib.rs index 4cd5ab561..6df953b3e 100644 --- a/locked-asset/lkmex-transfer/wasm/src/lib.rs +++ b/locked-asset/lkmex-transfer/wasm/src/lib.rs @@ -10,9 +10,7 @@ // Total number of exported functions: 14 #![no_std] - -// Configuration that works with rustc < 1.73.0. -// TODO: Recommended rustc version: 1.73.0 or newer. +#![allow(internal_features)] #![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); diff --git a/locked-asset/locked-token-wrapper/wasm/Cargo.lock b/locked-asset/locked-token-wrapper/wasm/Cargo.lock new file mode 100644 index 000000000..cb009ea7d --- /dev/null +++ b/locked-asset/locked-token-wrapper/wasm/Cargo.lock @@ -0,0 +1,402 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "energy-factory-mock" +version = "0.0.0" +dependencies = [ + "energy-query", + "multiversx-sc", +] + +[[package]] +name = "energy-query" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "lkmex-transfer" +version = "0.0.0" +dependencies = [ + "common_structs", + "energy-factory", + "energy-query", + "legacy_token_decode_module", + "multiversx-sc", + "permissions_module", + "simple-lock", + "utils", +] + +[[package]] +name = "locked-token-wrapper" +version = "0.0.0" +dependencies = [ + "common_structs", + "energy-factory", + "energy-factory-mock", + "energy-query", + "legacy_token_decode_module", + "lkmex-transfer", + "multiversx-sc", + "multiversx-sc-modules", + "simple-lock", + "utils", +] + +[[package]] +name = "locked-token-wrapper-wasm" +version = "0.0.0" +dependencies = [ + "locked-token-wrapper", + "multiversx-sc-wasm-adapter", +] + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +dependencies = [ + "bitflags", + "hashbrown", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19908153158c03df4582af08f47c0eb39fb52a7dff4736b301a66acbbb9955d3" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b03b43f9cad320992f54ed162de2ed63e3ec83ed01361e57ee9c1865fba5a2" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "permissions_module" +version = "0.0.0" +dependencies = [ + "bitflags", + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "proc-macro2" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/locked-asset/locked-token-wrapper/wasm/Cargo.toml b/locked-asset/locked-token-wrapper/wasm/Cargo.toml index 1d58fc660..41a6c6061 100644 --- a/locked-asset/locked-token-wrapper/wasm/Cargo.toml +++ b/locked-asset/locked-token-wrapper/wasm/Cargo.toml @@ -19,6 +19,7 @@ opt-level = "z" lto = true debug = false panic = "abort" +overflow-checks = false [dependencies.locked-token-wrapper] path = ".." diff --git a/locked-asset/locked-token-wrapper/wasm/src/lib.rs b/locked-asset/locked-token-wrapper/wasm/src/lib.rs index ad8d060c2..6c59af09c 100644 --- a/locked-asset/locked-token-wrapper/wasm/src/lib.rs +++ b/locked-asset/locked-token-wrapper/wasm/src/lib.rs @@ -10,9 +10,7 @@ // Total number of exported functions: 11 #![no_std] - -// Configuration that works with rustc < 1.73.0. -// TODO: Recommended rustc version: 1.73.0 or newer. +#![allow(internal_features)] #![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); diff --git a/locked-asset/proxy_dex/wasm/Cargo.lock b/locked-asset/proxy_dex/wasm/Cargo.lock new file mode 100644 index 000000000..c80d34596 --- /dev/null +++ b/locked-asset/proxy_dex/wasm/Cargo.lock @@ -0,0 +1,658 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "common-types" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "config" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "contexts" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "farm_token", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "rewards", + "token_merge_helper", + "token_send", +] + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "energy-query" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", +] + +[[package]] +name = "events" +version = "0.0.0" +dependencies = [ + "common_structs", + "contexts", + "multiversx-sc", +] + +[[package]] +name = "farm" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "energy-query", + "events", + "farm-boosted-yields", + "farm_base_impl", + "farm_token", + "fixed-supply-token", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pair", + "pausable", + "permissions_module", + "rewards", + "sc_whitelist_module", + "token_send", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm-boosted-yields" +version = "0.0.0" +dependencies = [ + "common-types", + "config", + "energy-query", + "multiversx-sc", + "pausable", + "permissions_module", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm-with-locked-rewards" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "energy-factory", + "energy-query", + "events", + "farm", + "farm-boosted-yields", + "farm_base_impl", + "farm_token", + "fixed-supply-token", + "locking_module", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "rewards", + "sc_whitelist_module", + "token_send", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm_base_impl" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "events", + "farm_token", + "fixed-supply-token", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "rewards", + "token_merge_helper", + "token_send", + "utils", +] + +[[package]] +name = "farm_token" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "fees-collector" +version = "0.0.0" +dependencies = [ + "common-types", + "common_errors", + "energy-factory", + "energy-query", + "locking_module", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "locking_module" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", + "simple-lock", +] + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +dependencies = [ + "bitflags", + "hashbrown", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19908153158c03df4582af08f47c0eb39fb52a7dff4736b301a66acbbb9955d3" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b03b43f9cad320992f54ed162de2ed63e3ec83ed01361e57ee9c1865fba5a2" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "pair" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "fees-collector", + "itertools", + "multiversx-sc", + "pausable", + "permissions_module", + "simple-lock", + "token_send", +] + +[[package]] +name = "pausable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", + "permissions_module", +] + +[[package]] +name = "permissions_module" +version = "0.0.0" +dependencies = [ + "bitflags", + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "proc-macro2" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "proxy_dex" +version = "0.0.0" +dependencies = [ + "common_structs", + "energy-factory", + "energy-query", + "farm", + "farm-with-locked-rewards", + "fixed-supply-token", + "itertools", + "legacy_token_decode_module", + "locking_module", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pair", + "sc_whitelist_module", + "simple-lock", + "token_merge_helper", + "token_send", + "utils", +] + +[[package]] +name = "proxy_dex-wasm" +version = "0.0.0" +dependencies = [ + "multiversx-sc-wasm-adapter", + "proxy_dex", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "rewards" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "farm_token", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "token_merge_helper" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "token_send" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "week-timekeeping" +version = "0.0.0" +dependencies = [ + "common-types", + "multiversx-sc", +] + +[[package]] +name = "weekly-rewards-splitting" +version = "0.0.0" +dependencies = [ + "common-types", + "energy-query", + "math", + "multiversx-sc", + "unwrappable", + "week-timekeeping", +] + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/locked-asset/proxy_dex/wasm/Cargo.toml b/locked-asset/proxy_dex/wasm/Cargo.toml index 66b8df41b..13e9c1afd 100644 --- a/locked-asset/proxy_dex/wasm/Cargo.toml +++ b/locked-asset/proxy_dex/wasm/Cargo.toml @@ -19,6 +19,7 @@ opt-level = "z" lto = true debug = false panic = "abort" +overflow-checks = false [dependencies.proxy_dex] path = ".." diff --git a/locked-asset/proxy_dex/wasm/src/lib.rs b/locked-asset/proxy_dex/wasm/src/lib.rs index 8fc9b2c67..29b3ab709 100644 --- a/locked-asset/proxy_dex/wasm/src/lib.rs +++ b/locked-asset/proxy_dex/wasm/src/lib.rs @@ -10,9 +10,7 @@ // Total number of exported functions: 33 #![no_std] - -// Configuration that works with rustc < 1.73.0. -// TODO: Recommended rustc version: 1.73.0 or newer. +#![allow(internal_features)] #![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); diff --git a/locked-asset/simple-lock-whitelist/wasm/Cargo.lock b/locked-asset/simple-lock-whitelist/wasm/Cargo.lock new file mode 100644 index 000000000..e8a814fff --- /dev/null +++ b/locked-asset/simple-lock-whitelist/wasm/Cargo.lock @@ -0,0 +1,317 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +dependencies = [ + "bitflags", + "hashbrown", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19908153158c03df4582af08f47c0eb39fb52a7dff4736b301a66acbbb9955d3" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b03b43f9cad320992f54ed162de2ed63e3ec83ed01361e57ee9c1865fba5a2" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "proc-macro2" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "simple-lock-whitelist" +version = "0.0.0" +dependencies = [ + "multiversx-sc", + "multiversx-sc-modules", + "simple-lock", + "utils", +] + +[[package]] +name = "simple-lock-whitelist-wasm" +version = "0.0.0" +dependencies = [ + "multiversx-sc-wasm-adapter", + "simple-lock-whitelist", +] + +[[package]] +name = "smallvec" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/locked-asset/simple-lock-whitelist/wasm/Cargo.toml b/locked-asset/simple-lock-whitelist/wasm/Cargo.toml index 7a4d66d89..9ad07950d 100644 --- a/locked-asset/simple-lock-whitelist/wasm/Cargo.toml +++ b/locked-asset/simple-lock-whitelist/wasm/Cargo.toml @@ -19,6 +19,7 @@ opt-level = "z" lto = true debug = false panic = "abort" +overflow-checks = false [dependencies.simple-lock-whitelist] path = ".." diff --git a/locked-asset/simple-lock-whitelist/wasm/src/lib.rs b/locked-asset/simple-lock-whitelist/wasm/src/lib.rs index 440806734..d82101ff8 100644 --- a/locked-asset/simple-lock-whitelist/wasm/src/lib.rs +++ b/locked-asset/simple-lock-whitelist/wasm/src/lib.rs @@ -10,9 +10,7 @@ // Total number of exported functions: 27 #![no_std] - -// Configuration that works with rustc < 1.73.0. -// TODO: Recommended rustc version: 1.73.0 or newer. +#![allow(internal_features)] #![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); diff --git a/locked-asset/simple-lock/wasm/Cargo.lock b/locked-asset/simple-lock/wasm/Cargo.lock new file mode 100644 index 000000000..8cada7e64 --- /dev/null +++ b/locked-asset/simple-lock/wasm/Cargo.lock @@ -0,0 +1,297 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +dependencies = [ + "bitflags", + "hashbrown", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19908153158c03df4582af08f47c0eb39fb52a7dff4736b301a66acbbb9955d3" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b03b43f9cad320992f54ed162de2ed63e3ec83ed01361e57ee9c1865fba5a2" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "proc-macro2" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "simple-lock-wasm" +version = "0.0.0" +dependencies = [ + "multiversx-sc-wasm-adapter", + "simple-lock", +] + +[[package]] +name = "smallvec" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/locked-asset/simple-lock/wasm/Cargo.toml b/locked-asset/simple-lock/wasm/Cargo.toml index 091897d1b..1c3883676 100644 --- a/locked-asset/simple-lock/wasm/Cargo.toml +++ b/locked-asset/simple-lock/wasm/Cargo.toml @@ -19,6 +19,7 @@ opt-level = "z" lto = true debug = false panic = "abort" +overflow-checks = false [dependencies.simple-lock] path = ".." diff --git a/locked-asset/simple-lock/wasm/src/lib.rs b/locked-asset/simple-lock/wasm/src/lib.rs index 0d610b3bc..4e1b87c7d 100644 --- a/locked-asset/simple-lock/wasm/src/lib.rs +++ b/locked-asset/simple-lock/wasm/src/lib.rs @@ -10,9 +10,7 @@ // Total number of exported functions: 22 #![no_std] - -// Configuration that works with rustc < 1.73.0. -// TODO: Recommended rustc version: 1.73.0 or newer. +#![allow(internal_features)] #![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); diff --git a/locked-asset/token-unstake/wasm/Cargo.lock b/locked-asset/token-unstake/wasm/Cargo.lock new file mode 100644 index 000000000..fa34f81c3 --- /dev/null +++ b/locked-asset/token-unstake/wasm/Cargo.lock @@ -0,0 +1,384 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "common-types" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "energy-query" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +dependencies = [ + "bitflags", + "hashbrown", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19908153158c03df4582af08f47c0eb39fb52a7dff4736b301a66acbbb9955d3" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b03b43f9cad320992f54ed162de2ed63e3ec83ed01361e57ee9c1865fba5a2" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "proc-macro2" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "token-unstake" +version = "0.0.0" +dependencies = [ + "common_structs", + "energy-factory", + "energy-query", + "mergeable", + "multiversx-sc", + "simple-lock", + "utils", + "week-timekeeping", +] + +[[package]] +name = "token-unstake-wasm" +version = "0.0.0" +dependencies = [ + "multiversx-sc-wasm-adapter", + "token-unstake", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "week-timekeeping" +version = "0.0.0" +dependencies = [ + "common-types", + "multiversx-sc", +] + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/locked-asset/token-unstake/wasm/Cargo.toml b/locked-asset/token-unstake/wasm/Cargo.toml index 45e8e43be..38875a352 100644 --- a/locked-asset/token-unstake/wasm/Cargo.toml +++ b/locked-asset/token-unstake/wasm/Cargo.toml @@ -19,6 +19,7 @@ opt-level = "z" lto = true debug = false panic = "abort" +overflow-checks = false [dependencies.token-unstake] path = ".." diff --git a/locked-asset/token-unstake/wasm/src/lib.rs b/locked-asset/token-unstake/wasm/src/lib.rs index b46a23840..396d02ba0 100644 --- a/locked-asset/token-unstake/wasm/src/lib.rs +++ b/locked-asset/token-unstake/wasm/src/lib.rs @@ -10,9 +10,7 @@ // Total number of exported functions: 13 #![no_std] - -// Configuration that works with rustc < 1.73.0. -// TODO: Recommended rustc version: 1.73.0 or newer. +#![allow(internal_features)] #![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); diff --git a/pause-all/wasm/Cargo.lock b/pause-all/wasm/Cargo.lock new file mode 100644 index 000000000..4752182b8 --- /dev/null +++ b/pause-all/wasm/Cargo.lock @@ -0,0 +1,282 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "multiversx-sc" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +dependencies = [ + "bitflags", + "hashbrown", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19908153158c03df4582af08f47c0eb39fb52a7dff4736b301a66acbbb9955d3" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b03b43f9cad320992f54ed162de2ed63e3ec83ed01361e57ee9c1865fba5a2" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.45.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "pausable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", + "permissions_module", +] + +[[package]] +name = "pause-all" +version = "0.0.0" +dependencies = [ + "multiversx-sc", + "multiversx-sc-modules", + "pausable", +] + +[[package]] +name = "pause-all-wasm" +version = "0.0.0" +dependencies = [ + "multiversx-sc-wasm-adapter", + "pause-all", +] + +[[package]] +name = "permissions_module" +version = "0.0.0" +dependencies = [ + "bitflags", + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "proc-macro2" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "smallvec" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/pause-all/wasm/Cargo.toml b/pause-all/wasm/Cargo.toml index 54d6f7ab0..f2dc3107e 100644 --- a/pause-all/wasm/Cargo.toml +++ b/pause-all/wasm/Cargo.toml @@ -19,6 +19,7 @@ opt-level = "z" lto = true debug = false panic = "abort" +overflow-checks = false [dependencies.pause-all] path = ".." diff --git a/pause-all/wasm/src/lib.rs b/pause-all/wasm/src/lib.rs index d8a4c88c3..2302b1e6a 100644 --- a/pause-all/wasm/src/lib.rs +++ b/pause-all/wasm/src/lib.rs @@ -10,9 +10,7 @@ // Total number of exported functions: 10 #![no_std] - -// Configuration that works with rustc < 1.73.0. -// TODO: Recommended rustc version: 1.73.0 or newer. +#![allow(internal_features)] #![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); From d352c9bb19b0949d262c9b99fe4deaf27fdca3c9 Mon Sep 17 00:00:00 2001 From: ovidiuolteanu Date: Fri, 5 Jan 2024 17:44:32 +0200 Subject: [PATCH 147/213] update actions for latest rust version --- .github/workflows/actions.yml | 4 ++-- .github/workflows/release.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index a5b84de9a..7e078b76a 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -20,9 +20,9 @@ permissions: jobs: contracts: name: Contracts - uses: multiversx/mx-sc-actions/.github/workflows/contracts.yml@v2.3.3 + uses: multiversx/mx-sc-actions/.github/workflows/contracts.yml@v2.3.5 with: - rust-toolchain: nightly-2023-05-26 + rust-toolchain: nightly-2023-12-11 vmtools-version: v1.4.60 secrets: token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 34bccc0cd..a19b5ed98 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,7 +9,7 @@ permissions: jobs: build: - uses: multiversx/mx-sc-actions/.github/workflows/reproducible-build.yml@v2.3.3 + uses: multiversx/mx-sc-actions/.github/workflows/reproducible-build.yml@v2.3.5 with: - image_tag: v5.3.0 + image_tag: v6.0.0 attach_to_existing_release: true From 6a45832542d493a843e6ddde5e9d3b9f2a8001b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Fri, 12 Jan 2024 11:35:42 +0200 Subject: [PATCH 148/213] LkMEX Transfer: Add energy fix --- locked-asset/lkmex-transfer/src/energy_transfer.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/locked-asset/lkmex-transfer/src/energy_transfer.rs b/locked-asset/lkmex-transfer/src/energy_transfer.rs index bd974f46a..008517e80 100644 --- a/locked-asset/lkmex-transfer/src/energy_transfer.rs +++ b/locked-asset/lkmex-transfer/src/energy_transfer.rs @@ -53,6 +53,7 @@ pub trait EnergyTransferModule: let epoch_diff = current_epoch - attributes.unlock_epoch; let simulated_deplete_amount = &token.amount * epoch_diff; energy.remove_energy_raw(BigUint::zero(), simulated_deplete_amount); + energy.add_energy_raw(token.amount, BigInt::zero()); } } From a118af93ad2abdf8a4e33e064e81e5930aaf2503 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Fri, 12 Jan 2024 16:03:49 +0200 Subject: [PATCH 149/213] LkMEX Transfer: Test for Add energy fix --- .../tests/lkmex_transfer_tests.rs | 197 ++++++++++++++++++ 1 file changed, 197 insertions(+) diff --git a/locked-asset/lkmex-transfer/tests/lkmex_transfer_tests.rs b/locked-asset/lkmex-transfer/tests/lkmex_transfer_tests.rs index 9ec46ebc2..a0890af44 100644 --- a/locked-asset/lkmex-transfer/tests/lkmex_transfer_tests.rs +++ b/locked-asset/lkmex-transfer/tests/lkmex_transfer_tests.rs @@ -621,3 +621,200 @@ fn cancel_transfer_test() { }) .assert_ok(); } + +#[test] +fn transfer_locked_token_after_unlock_period_test() { + let rust_zero = rust_biguint!(0); + let mut b_mock = BlockchainStateWrapper::new(); + + let user_addr = b_mock.create_user_account(&rust_zero); + let claimer_addr = b_mock.create_user_account(&rust_zero); + let owner_addr = b_mock.create_user_account(&rust_zero); + let transfer_sc_wrapper = b_mock.create_sc_account( + &rust_zero, + Some(&owner_addr), + lkmex_transfer::contract_obj, + "Some path", + ); + let factory_sc_wrapper = b_mock.create_sc_account( + &rust_zero, + Some(&owner_addr), + energy_factory::contract_obj, + "Some other path", + ); + + b_mock.set_block_epoch(5); + + // Setup transfer SC + b_mock + .execute_tx(&owner_addr, &transfer_sc_wrapper, &rust_zero, |sc| { + sc.init( + managed_address!(factory_sc_wrapper.address_ref()), + managed_token_id!(LOCKED_TOKEN_ID), + 4, + EPOCHS_IN_YEAR, + ); + }) + .assert_ok(); + + b_mock.set_esdt_local_roles( + transfer_sc_wrapper.address_ref(), + LOCKED_TOKEN_ID, + &[EsdtLocalRole::Transfer], + ); + + // setup energy factory SC + b_mock + .execute_tx(&owner_addr, &factory_sc_wrapper, &rust_zero, |sc| { + let mut lock_options = MultiValueEncoded::new(); + for (option, penalty) in LOCK_OPTIONS.iter().zip(PENALTY_PERCENTAGES.iter()) { + lock_options.push((*option, *penalty).into()); + } + + // sc addresses don't matter here, we don't test that part + sc.init( + managed_token_id!(BASE_ASSET_TOKEN_ID), + managed_token_id!(LEGACY_LOCKED_TOKEN_ID), + managed_address!(transfer_sc_wrapper.address_ref()), + 0, + lock_options, + ); + + sc.locked_token() + .set_token_id(managed_token_id!(LOCKED_TOKEN_ID)); + sc.token_transfer_whitelist() + .add(&managed_address!(transfer_sc_wrapper.address_ref())); + sc.set_paused(false); + }) + .assert_ok(); + + b_mock.set_esdt_local_roles( + factory_sc_wrapper.address_ref(), + BASE_ASSET_TOKEN_ID, + &[EsdtLocalRole::Mint, EsdtLocalRole::Burn], + ); + b_mock.set_esdt_local_roles( + factory_sc_wrapper.address_ref(), + LOCKED_TOKEN_ID, + &[ + EsdtLocalRole::NftCreate, + EsdtLocalRole::NftAddQuantity, + EsdtLocalRole::NftBurn, + EsdtLocalRole::Transfer, + ], + ); + b_mock.set_esdt_local_roles( + factory_sc_wrapper.address_ref(), + LEGACY_LOCKED_TOKEN_ID, + &[EsdtLocalRole::NftBurn], + ); + + // setup user balance + + b_mock.set_esdt_balance( + &user_addr, + BASE_ASSET_TOKEN_ID, + &rust_biguint!(USER_BALANCE), + ); + + // lock tokens + b_mock + .execute_esdt_transfer( + &user_addr, + &factory_sc_wrapper, + BASE_ASSET_TOKEN_ID, + 0, + &rust_biguint!(USER_BALANCE), + |sc| { + sc.lock_tokens_endpoint(LOCK_OPTIONS[0], OptionalValue::None); + + let unlock_epoch = sc.unlock_epoch_to_start_of_month(5 + LOCK_OPTIONS[0]); + let lock_epochs = unlock_epoch - 5; + let expected_energy_amount = + BigInt::from(USER_BALANCE as i64) * BigInt::from(lock_epochs as i64); + let expected_energy = + Energy::new(expected_energy_amount, 5, managed_biguint!(USER_BALANCE)); + let actual_energy = sc.user_energy(&managed_address!(&user_addr)).get(); + assert_eq!(expected_energy, actual_energy); + }, + ) + .assert_ok(); + + // transfer half of the LKMEX to other user + b_mock + .execute_esdt_transfer( + &user_addr, + &transfer_sc_wrapper, + LOCKED_TOKEN_ID, + 1, + &rust_biguint!(USER_BALANCE / 2), + |sc| { + sc.lock_funds(managed_address!(&claimer_addr)); + }, + ) + .assert_ok(); + + // check first user energy after transfer + b_mock + .execute_query(&factory_sc_wrapper, |sc| { + let unlock_epoch = sc.unlock_epoch_to_start_of_month(5 + LOCK_OPTIONS[0]); + let lock_epochs = unlock_epoch - 5; + let expected_energy_amount = + BigInt::from((USER_BALANCE / 2) as i64) * BigInt::from(lock_epochs as i64); + let expected_energy = Energy::new( + expected_energy_amount, + 5, + managed_biguint!(USER_BALANCE / 2), + ); + let actual_energy = sc.user_energy(&managed_address!(&user_addr)).get(); + assert_eq!(expected_energy, actual_energy); + }) + .assert_ok(); + + let current_epoch = EPOCHS_IN_YEAR + 3; + // pass 5 epochs + b_mock.set_block_epoch(current_epoch); + + // second user claim + b_mock + .execute_tx(&claimer_addr, &transfer_sc_wrapper, &rust_zero, |sc| { + sc.withdraw(managed_address!(&user_addr)); + }) + .assert_ok(); + + // check first user energy + b_mock + .execute_query(&factory_sc_wrapper, |sc| { + let unlock_epoch = sc.unlock_epoch_to_start_of_month(5 + LOCK_OPTIONS[0]); + let lock_epochs = unlock_epoch as i64 - current_epoch as i64; + let expected_energy_amount = + BigInt::from((USER_BALANCE / 2) as i64) * BigInt::from(lock_epochs as i64); + let expected_energy = Energy::new( + expected_energy_amount, + current_epoch, + managed_biguint!(USER_BALANCE / 2), + ); + + let actual_energy = sc.user_energy(&managed_address!(&claimer_addr)).get(); + assert_eq!(expected_energy, actual_energy); + }) + .assert_ok(); + + // check second user energy + b_mock + .execute_query(&factory_sc_wrapper, |sc| { + let unlock_epoch = sc.unlock_epoch_to_start_of_month(5 + LOCK_OPTIONS[0]); + let lock_epochs = unlock_epoch as i64 - current_epoch as i64; + let expected_energy_amount = + BigInt::from((USER_BALANCE / 2) as i64) * BigInt::from(lock_epochs as i64); + let expected_energy = Energy::new( + expected_energy_amount, + current_epoch, + managed_biguint!(USER_BALANCE / 2), + ); + + let actual_energy = sc.user_energy(&managed_address!(&claimer_addr)).get(); + assert_eq!(expected_energy, actual_energy); + }) + .assert_ok(); +} From fdc93bed330c941acf266aa7d1149e484bff0ffc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Fri, 12 Jan 2024 16:10:26 +0200 Subject: [PATCH 150/213] clippy fixes --- locked-asset/lkmex-transfer/tests/lkmex_transfer_tests.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locked-asset/lkmex-transfer/tests/lkmex_transfer_tests.rs b/locked-asset/lkmex-transfer/tests/lkmex_transfer_tests.rs index a0890af44..e1c9dce95 100644 --- a/locked-asset/lkmex-transfer/tests/lkmex_transfer_tests.rs +++ b/locked-asset/lkmex-transfer/tests/lkmex_transfer_tests.rs @@ -788,7 +788,7 @@ fn transfer_locked_token_after_unlock_period_test() { let unlock_epoch = sc.unlock_epoch_to_start_of_month(5 + LOCK_OPTIONS[0]); let lock_epochs = unlock_epoch as i64 - current_epoch as i64; let expected_energy_amount = - BigInt::from((USER_BALANCE / 2) as i64) * BigInt::from(lock_epochs as i64); + BigInt::from((USER_BALANCE / 2) as i64) * BigInt::from(lock_epochs); let expected_energy = Energy::new( expected_energy_amount, current_epoch, @@ -806,7 +806,7 @@ fn transfer_locked_token_after_unlock_period_test() { let unlock_epoch = sc.unlock_epoch_to_start_of_month(5 + LOCK_OPTIONS[0]); let lock_epochs = unlock_epoch as i64 - current_epoch as i64; let expected_energy_amount = - BigInt::from((USER_BALANCE / 2) as i64) * BigInt::from(lock_epochs as i64); + BigInt::from((USER_BALANCE / 2) as i64) * BigInt::from(lock_epochs); let expected_energy = Energy::new( expected_energy_amount, current_epoch, From 0c7f45e74d9b39ccdf27588ed6bf0a19dbc501cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Tue, 16 Jan 2024 17:08:15 +0200 Subject: [PATCH 151/213] Framework upgrade 0.46.1 --- common/common_errors/Cargo.toml | 2 +- common/common_structs/Cargo.toml | 2 +- common/modules/farm/config/Cargo.toml | 2 +- common/modules/farm/contexts/Cargo.toml | 4 +- common/modules/farm/events/Cargo.toml | 2 +- common/modules/farm/farm_base_impl/Cargo.toml | 6 +- common/modules/farm/farm_token/Cargo.toml | 4 +- .../modules/farm/farm_token_merge/Cargo.toml | 8 +- common/modules/farm/rewards/Cargo.toml | 4 +- .../legacy_token_decode_module/Cargo.toml | 2 +- common/modules/locking_module/Cargo.toml | 2 +- common/modules/math/Cargo.toml | 2 +- common/modules/pausable/Cargo.toml | 2 +- common/modules/permissions_module/Cargo.toml | 2 +- common/modules/sc_whitelist_module/Cargo.toml | 2 +- common/modules/token_merge_helper/Cargo.toml | 2 +- common/modules/token_send/Cargo.toml | 2 +- common/modules/utils/Cargo.toml | 2 +- common/traits/fixed-supply-token/Cargo.toml | 2 +- common/traits/mergeable/Cargo.toml | 2 +- common/traits/unwrappable/Cargo.toml | 2 +- dex/Cargo.toml | 6 +- dex/farm-with-locked-rewards/Cargo.toml | 6 +- dex/farm-with-locked-rewards/meta/Cargo.toml | 2 +- dex/farm-with-locked-rewards/wasm/Cargo.lock | 83 ++---------------- dex/farm-with-locked-rewards/wasm/Cargo.toml | 2 +- dex/farm/Cargo.toml | 6 +- dex/farm/meta/Cargo.toml | 2 +- dex/farm/wasm/Cargo.lock | 83 ++---------------- dex/farm/wasm/Cargo.toml | 2 +- dex/fuzz/Cargo.toml | 4 +- dex/governance/Cargo.toml | 4 +- dex/governance/meta/Cargo.toml | 2 +- dex/governance/wasm/Cargo.lock | 79 ++--------------- dex/governance/wasm/Cargo.toml | 2 +- dex/pair-mock/Cargo.toml | 4 +- dex/pair-mock/meta/Cargo.toml | 2 +- dex/pair-mock/wasm/Cargo.lock | 79 ++--------------- dex/pair-mock/wasm/Cargo.toml | 2 +- dex/pair/Cargo.toml | 4 +- dex/pair/meta/Cargo.toml | 2 +- dex/pair/wasm-pair-full/Cargo.lock | 83 ++---------------- dex/pair/wasm-pair-full/Cargo.toml | 2 +- dex/pair/wasm-safe-price-view/Cargo.lock | 83 ++---------------- dex/pair/wasm-safe-price-view/Cargo.toml | 2 +- dex/pair/wasm/Cargo.lock | 83 ++---------------- dex/pair/wasm/Cargo.toml | 2 +- dex/price-discovery/Cargo.toml | 6 +- dex/price-discovery/meta/Cargo.toml | 2 +- dex/price-discovery/wasm/Cargo.lock | 83 ++---------------- dex/price-discovery/wasm/Cargo.toml | 2 +- dex/proxy-deployer/Cargo.toml | 4 +- dex/proxy-deployer/meta/Cargo.toml | 2 +- dex/proxy-deployer/wasm/Cargo.lock | 83 ++---------------- dex/proxy-deployer/wasm/Cargo.toml | 2 +- dex/router/Cargo.toml | 4 +- dex/router/meta/Cargo.toml | 2 +- dex/router/wasm/Cargo.lock | 83 ++---------------- dex/router/wasm/Cargo.toml | 2 +- .../common-modules/energy-query/Cargo.toml | 2 +- .../week-timekeeping/Cargo.toml | 2 +- .../weekly-rewards-splitting/Cargo.toml | 2 +- energy-integration/common-types/Cargo.toml | 2 +- .../energy-factory-mock/Cargo.toml | 4 +- .../energy-factory-mock/meta/Cargo.toml | 2 +- .../energy-factory-mock/wasm/Cargo.lock | 83 ++---------------- .../energy-factory-mock/wasm/Cargo.toml | 2 +- energy-integration/energy-update/Cargo.toml | 6 +- .../energy-update/meta/Cargo.toml | 2 +- .../energy-update/wasm/Cargo.lock | 83 ++---------------- .../energy-update/wasm/Cargo.toml | 2 +- .../farm-boosted-yields/Cargo.toml | 2 +- energy-integration/fees-collector/Cargo.toml | 6 +- .../fees-collector/meta/Cargo.toml | 2 +- .../fees-collector/wasm/Cargo.lock | 83 ++---------------- .../fees-collector/wasm/Cargo.toml | 2 +- energy-integration/governance-v2/Cargo.toml | 4 +- .../governance-v2/meta/Cargo.toml | 2 +- .../governance-v2/wasm/Cargo.lock | 83 ++---------------- .../governance-v2/wasm/Cargo.toml | 2 +- farm-staking/farm-staking-proxy/Cargo.toml | 6 +- .../farm-staking-proxy/meta/Cargo.toml | 2 +- .../farm-staking-proxy/wasm/Cargo.lock | 83 ++---------------- .../farm-staking-proxy/wasm/Cargo.toml | 2 +- farm-staking/farm-staking/Cargo.toml | 6 +- farm-staking/farm-staking/meta/Cargo.toml | 2 +- farm-staking/farm-staking/wasm/Cargo.lock | 83 ++---------------- farm-staking/farm-staking/wasm/Cargo.toml | 2 +- farm-staking/metabonding-staking/Cargo.toml | 6 +- .../metabonding-staking/meta/Cargo.toml | 2 +- .../metabonding-staking/wasm/Cargo.lock | 85 ++----------------- .../metabonding-staking/wasm/Cargo.toml | 2 +- locked-asset/Cargo.toml | 6 +- locked-asset/distribution/Cargo.toml | 4 +- locked-asset/distribution/meta/Cargo.toml | 2 +- locked-asset/distribution/wasm/Cargo.lock | 85 ++----------------- locked-asset/distribution/wasm/Cargo.toml | 2 +- locked-asset/energy-factory/Cargo.toml | 6 +- locked-asset/energy-factory/meta/Cargo.toml | 2 +- locked-asset/energy-factory/wasm/Cargo.lock | 83 ++---------------- locked-asset/energy-factory/wasm/Cargo.toml | 2 +- locked-asset/factory/Cargo.toml | 6 +- locked-asset/factory/meta/Cargo.toml | 2 +- locked-asset/factory/wasm/Cargo.lock | 85 ++----------------- locked-asset/factory/wasm/Cargo.toml | 2 +- locked-asset/lkmex-transfer/Cargo.toml | 6 +- locked-asset/lkmex-transfer/meta/Cargo.toml | 2 +- locked-asset/lkmex-transfer/wasm/Cargo.lock | 83 ++---------------- locked-asset/lkmex-transfer/wasm/Cargo.toml | 2 +- locked-asset/locked-token-wrapper/Cargo.toml | 6 +- .../locked-token-wrapper/meta/Cargo.toml | 2 +- .../locked-token-wrapper/wasm/Cargo.lock | 83 ++---------------- .../locked-token-wrapper/wasm/Cargo.toml | 2 +- locked-asset/proxy_dex/Cargo.toml | 6 +- locked-asset/proxy_dex/meta/Cargo.toml | 2 +- locked-asset/proxy_dex/wasm/Cargo.lock | 83 ++---------------- locked-asset/proxy_dex/wasm/Cargo.toml | 2 +- locked-asset/simple-lock-whitelist/Cargo.toml | 6 +- .../simple-lock-whitelist/meta/Cargo.toml | 2 +- .../simple-lock-whitelist/wasm/Cargo.lock | 83 ++---------------- .../simple-lock-whitelist/wasm/Cargo.toml | 2 +- locked-asset/simple-lock/Cargo.toml | 6 +- locked-asset/simple-lock/meta/Cargo.toml | 2 +- locked-asset/simple-lock/wasm/Cargo.lock | 83 ++---------------- locked-asset/simple-lock/wasm/Cargo.toml | 2 +- locked-asset/token-unstake/Cargo.toml | 6 +- locked-asset/token-unstake/meta/Cargo.toml | 2 +- locked-asset/token-unstake/wasm/Cargo.lock | 83 ++---------------- locked-asset/token-unstake/wasm/Cargo.toml | 2 +- pause-all/Cargo.toml | 6 +- pause-all/meta/Cargo.toml | 2 +- pause-all/wasm/Cargo.lock | 83 ++---------------- pause-all/wasm/Cargo.toml | 2 +- 133 files changed, 378 insertions(+), 2183 deletions(-) diff --git a/common/common_errors/Cargo.toml b/common/common_errors/Cargo.toml index 533491ee0..c61a89e80 100644 --- a/common/common_errors/Cargo.toml +++ b/common/common_errors/Cargo.toml @@ -8,5 +8,5 @@ edition = "2021" path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/common_structs/Cargo.toml b/common/common_structs/Cargo.toml index ae9425ff9..8e5655f12 100644 --- a/common/common_structs/Cargo.toml +++ b/common/common_structs/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.mergeable] diff --git a/common/modules/farm/config/Cargo.toml b/common/modules/farm/config/Cargo.toml index 99faae217..b5de657af 100644 --- a/common/modules/farm/config/Cargo.toml +++ b/common/modules/farm/config/Cargo.toml @@ -23,5 +23,5 @@ path = "../../pausable" path = "../../permissions_module" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/farm/contexts/Cargo.toml b/common/modules/farm/contexts/Cargo.toml index 3c1bb6649..b61c7a7cb 100644 --- a/common/modules/farm/contexts/Cargo.toml +++ b/common/modules/farm/contexts/Cargo.toml @@ -35,8 +35,8 @@ path = "../../pausable" path = "../../permissions_module" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.45.2" +version = "=0.46.1" diff --git a/common/modules/farm/events/Cargo.toml b/common/modules/farm/events/Cargo.toml index 244a8e514..f69904d95 100644 --- a/common/modules/farm/events/Cargo.toml +++ b/common/modules/farm/events/Cargo.toml @@ -14,5 +14,5 @@ path = "../../../common_structs" path = "../contexts" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/farm/farm_base_impl/Cargo.toml b/common/modules/farm/farm_base_impl/Cargo.toml index 79013c05c..7ac538eff 100644 --- a/common/modules/farm/farm_base_impl/Cargo.toml +++ b/common/modules/farm/farm_base_impl/Cargo.toml @@ -50,11 +50,11 @@ path = "../../../traits/mergeable" path = "../../../traits/fixed-supply-token" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.45.2" +version = "=0.46.1" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.2" +version = "=0.46.1" diff --git a/common/modules/farm/farm_token/Cargo.toml b/common/modules/farm/farm_token/Cargo.toml index 24154dfe6..64834bd68 100644 --- a/common/modules/farm/farm_token/Cargo.toml +++ b/common/modules/farm/farm_token/Cargo.toml @@ -26,8 +26,8 @@ path = "../../pausable" path = "../../permissions_module" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.45.2" +version = "=0.46.1" diff --git a/common/modules/farm/farm_token_merge/Cargo.toml b/common/modules/farm/farm_token_merge/Cargo.toml index 395d15072..4df9540e8 100644 --- a/common/modules/farm/farm_token_merge/Cargo.toml +++ b/common/modules/farm/farm_token_merge/Cargo.toml @@ -6,6 +6,7 @@ edition = "2021" [lib] path = "src/lib.rs" + [dependencies.common_structs] path = "../../../common_structs" @@ -22,8 +23,11 @@ path = "../../token_merge_helper" path = "../farm_token" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.45.2" +version = "=0.46.1" + +[workspace] +members = ["."] diff --git a/common/modules/farm/rewards/Cargo.toml b/common/modules/farm/rewards/Cargo.toml index 606e04ef9..68d37f46d 100644 --- a/common/modules/farm/rewards/Cargo.toml +++ b/common/modules/farm/rewards/Cargo.toml @@ -29,8 +29,8 @@ path = "../../pausable" path = "../../permissions_module" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.45.2" +version = "=0.46.1" diff --git a/common/modules/legacy_token_decode_module/Cargo.toml b/common/modules/legacy_token_decode_module/Cargo.toml index 636a9418d..124b2ec02 100644 --- a/common/modules/legacy_token_decode_module/Cargo.toml +++ b/common/modules/legacy_token_decode_module/Cargo.toml @@ -8,7 +8,7 @@ edition = "2018" path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.common_structs] diff --git a/common/modules/locking_module/Cargo.toml b/common/modules/locking_module/Cargo.toml index 8976ebabd..660635a24 100644 --- a/common/modules/locking_module/Cargo.toml +++ b/common/modules/locking_module/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.simple-lock] diff --git a/common/modules/math/Cargo.toml b/common/modules/math/Cargo.toml index fc1b4014f..5f1f99325 100644 --- a/common/modules/math/Cargo.toml +++ b/common/modules/math/Cargo.toml @@ -8,5 +8,5 @@ edition = "2021" path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/pausable/Cargo.toml b/common/modules/pausable/Cargo.toml index 2fa1fdf6b..2f258161b 100644 --- a/common/modules/pausable/Cargo.toml +++ b/common/modules/pausable/Cargo.toml @@ -11,5 +11,5 @@ path = "src/pausable.rs" path = "../permissions_module" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/permissions_module/Cargo.toml b/common/modules/permissions_module/Cargo.toml index e5e960814..fdc8d7d2e 100644 --- a/common/modules/permissions_module/Cargo.toml +++ b/common/modules/permissions_module/Cargo.toml @@ -17,5 +17,5 @@ bitflags = "2.4.1" path = "../../common_errors" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/sc_whitelist_module/Cargo.toml b/common/modules/sc_whitelist_module/Cargo.toml index df68e6dcd..978cd6a89 100644 --- a/common/modules/sc_whitelist_module/Cargo.toml +++ b/common/modules/sc_whitelist_module/Cargo.toml @@ -11,5 +11,5 @@ path = "src/sc_whitelist_module.rs" path = "../../common_errors" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/token_merge_helper/Cargo.toml b/common/modules/token_merge_helper/Cargo.toml index 626ed6bad..c337a5996 100644 --- a/common/modules/token_merge_helper/Cargo.toml +++ b/common/modules/token_merge_helper/Cargo.toml @@ -11,5 +11,5 @@ path = "src/lib.rs" path = "../../common_errors" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/token_send/Cargo.toml b/common/modules/token_send/Cargo.toml index 4b70a5293..28b005064 100644 --- a/common/modules/token_send/Cargo.toml +++ b/common/modules/token_send/Cargo.toml @@ -14,5 +14,5 @@ path = "../../common_structs" path = "../../common_errors" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/utils/Cargo.toml b/common/modules/utils/Cargo.toml index 2c64b0ef7..a18635d6e 100644 --- a/common/modules/utils/Cargo.toml +++ b/common/modules/utils/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.common_structs] diff --git a/common/traits/fixed-supply-token/Cargo.toml b/common/traits/fixed-supply-token/Cargo.toml index b4e0386ec..eafd9fe32 100644 --- a/common/traits/fixed-supply-token/Cargo.toml +++ b/common/traits/fixed-supply-token/Cargo.toml @@ -8,4 +8,4 @@ edition = "2021" path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" diff --git a/common/traits/mergeable/Cargo.toml b/common/traits/mergeable/Cargo.toml index 5de5b862a..4800de5ca 100644 --- a/common/traits/mergeable/Cargo.toml +++ b/common/traits/mergeable/Cargo.toml @@ -8,5 +8,5 @@ edition = "2021" path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/traits/unwrappable/Cargo.toml b/common/traits/unwrappable/Cargo.toml index 4801e658e..9ba6e7e73 100644 --- a/common/traits/unwrappable/Cargo.toml +++ b/common/traits/unwrappable/Cargo.toml @@ -8,5 +8,5 @@ edition = "2021" path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] diff --git a/dex/Cargo.toml b/dex/Cargo.toml index 8d22ce26f..62d9161bf 100644 --- a/dex/Cargo.toml +++ b/dex/Cargo.toml @@ -5,17 +5,17 @@ edition = "2021" publish = false [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-modules] -version = "=0.45.2" +version = "=0.46.1" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.2" +version = "=0.46.1" [dev-dependencies.config] path = "../common/modules/farm/config" diff --git a/dex/farm-with-locked-rewards/Cargo.toml b/dex/farm-with-locked-rewards/Cargo.toml index c681b9a26..c19480688 100644 --- a/dex/farm-with-locked-rewards/Cargo.toml +++ b/dex/farm-with-locked-rewards/Cargo.toml @@ -75,17 +75,17 @@ path = "../../locked-asset/energy-factory" path = "../../energy-integration/common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.45.2" +version = "=0.46.1" [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.2" +version = "=0.46.1" [dev-dependencies.simple-lock] path = "../../locked-asset/simple-lock" diff --git a/dex/farm-with-locked-rewards/meta/Cargo.toml b/dex/farm-with-locked-rewards/meta/Cargo.toml index 108fc94d7..47476c339 100644 --- a/dex/farm-with-locked-rewards/meta/Cargo.toml +++ b/dex/farm-with-locked-rewards/meta/Cargo.toml @@ -9,5 +9,5 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.2" +version = "0.46.1" default-features = false diff --git a/dex/farm-with-locked-rewards/wasm/Cargo.lock b/dex/farm-with-locked-rewards/wasm/Cargo.lock index 9d6c35eb4..08bedbfb4 100644 --- a/dex/farm-with-locked-rewards/wasm/Cargo.lock +++ b/dex/farm-with-locked-rewards/wasm/Cargo.lock @@ -2,24 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "ahash" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - [[package]] name = "arrayvec" version = "0.7.4" @@ -38,12 +20,6 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - [[package]] name = "common-types" version = "0.0.0" @@ -284,16 +260,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - [[package]] name = "hex" version = "0.4.3" @@ -349,12 +315,11 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +checksum = "6c94b173dc5ff0e157f767275fe6b7a1b4d2ad343bef7b66cd22a6353e016b93" dependencies = [ "bitflags", - "hashbrown", "hex-literal", "multiversx-sc-codec", "multiversx-sc-derive", @@ -385,9 +350,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +checksum = "3b78945957036c281ad6ee21bb5120dcefa2017688adf43ec94e3e7c982efb09" dependencies = [ "hex", "proc-macro2", @@ -398,18 +363,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +checksum = "c63ffaba95e630ff75981e2f5f50da64f523219b52f484234c66f3adc248885f" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +checksum = "9579f40c00da56a5a68e010ff851fa48ac7b9c6a16ad4314795cb32d889d9e78" dependencies = [ "multiversx-sc", ] @@ -432,12 +397,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - [[package]] name = "pair" version = "0.0.0" @@ -587,12 +546,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -612,23 +565,3 @@ dependencies = [ "unwrappable", "week-timekeeping", ] - -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/dex/farm-with-locked-rewards/wasm/Cargo.toml b/dex/farm-with-locked-rewards/wasm/Cargo.toml index b5c12e892..369d8346f 100644 --- a/dex/farm-with-locked-rewards/wasm/Cargo.toml +++ b/dex/farm-with-locked-rewards/wasm/Cargo.toml @@ -25,7 +25,7 @@ overflow-checks = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.2" +version = "=0.46.1" [workspace] members = ["."] diff --git a/dex/farm/Cargo.toml b/dex/farm/Cargo.toml index 78a83310c..517a35cae 100644 --- a/dex/farm/Cargo.toml +++ b/dex/farm/Cargo.toml @@ -69,11 +69,11 @@ path = "../../energy-integration/common-modules/weekly-rewards-splitting" path = "../../energy-integration/common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.45.2" +version = "=0.46.1" [dev-dependencies] num-bigint = "0.4.2" @@ -82,7 +82,7 @@ num-bigint = "0.4.2" path = "../../energy-integration/energy-update" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.2" +version = "=0.46.1" [dev-dependencies.energy-factory-mock] path = "../../energy-integration/energy-factory-mock" diff --git a/dex/farm/meta/Cargo.toml b/dex/farm/meta/Cargo.toml index 51e69c1f8..d6abd09e7 100644 --- a/dex/farm/meta/Cargo.toml +++ b/dex/farm/meta/Cargo.toml @@ -9,5 +9,5 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.2" +version = "0.46.1" default-features = false diff --git a/dex/farm/wasm/Cargo.lock b/dex/farm/wasm/Cargo.lock index 96ca800f9..d844f59f7 100644 --- a/dex/farm/wasm/Cargo.lock +++ b/dex/farm/wasm/Cargo.lock @@ -2,24 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "ahash" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - [[package]] name = "arrayvec" version = "0.7.4" @@ -38,12 +20,6 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - [[package]] name = "common-types" version = "0.0.0" @@ -254,16 +230,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - [[package]] name = "hex" version = "0.4.3" @@ -319,12 +285,11 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +checksum = "6c94b173dc5ff0e157f767275fe6b7a1b4d2ad343bef7b66cd22a6353e016b93" dependencies = [ "bitflags", - "hashbrown", "hex-literal", "multiversx-sc-codec", "multiversx-sc-derive", @@ -355,9 +320,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +checksum = "3b78945957036c281ad6ee21bb5120dcefa2017688adf43ec94e3e7c982efb09" dependencies = [ "hex", "proc-macro2", @@ -368,18 +333,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +checksum = "c63ffaba95e630ff75981e2f5f50da64f523219b52f484234c66f3adc248885f" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +checksum = "9579f40c00da56a5a68e010ff851fa48ac7b9c6a16ad4314795cb32d889d9e78" dependencies = [ "multiversx-sc", ] @@ -402,12 +367,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - [[package]] name = "pair" version = "0.0.0" @@ -557,12 +516,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -582,23 +535,3 @@ dependencies = [ "unwrappable", "week-timekeeping", ] - -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/dex/farm/wasm/Cargo.toml b/dex/farm/wasm/Cargo.toml index 44656dfc4..26ce2670b 100644 --- a/dex/farm/wasm/Cargo.toml +++ b/dex/farm/wasm/Cargo.toml @@ -25,7 +25,7 @@ overflow-checks = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.2" +version = "=0.46.1" [workspace] members = ["."] diff --git a/dex/fuzz/Cargo.toml b/dex/fuzz/Cargo.toml index 9aa8097a1..57800c37f 100644 --- a/dex/fuzz/Cargo.toml +++ b/dex/fuzz/Cargo.toml @@ -12,11 +12,11 @@ num-bigint = "0.4.2" rand = "0.8.4" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-scenario] -version = "=0.45.2" +version = "=0.46.1" [dependencies.pausable] path = "../../common/modules/pausable" diff --git a/dex/governance/Cargo.toml b/dex/governance/Cargo.toml index b224ca25f..74d9f2849 100644 --- a/dex/governance/Cargo.toml +++ b/dex/governance/Cargo.toml @@ -9,14 +9,14 @@ publish = false path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.2" +version = "=0.46.1" [dev-dependencies.pair-mock] path = "../pair-mock" diff --git a/dex/governance/meta/Cargo.toml b/dex/governance/meta/Cargo.toml index ad90459d6..b692c9007 100644 --- a/dex/governance/meta/Cargo.toml +++ b/dex/governance/meta/Cargo.toml @@ -11,5 +11,5 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.2" +version = "0.46.1" default-features = false diff --git a/dex/governance/wasm/Cargo.lock b/dex/governance/wasm/Cargo.lock index 7a7db0dd1..30ca50940 100644 --- a/dex/governance/wasm/Cargo.lock +++ b/dex/governance/wasm/Cargo.lock @@ -2,24 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "ahash" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - [[package]] name = "arrayvec" version = "0.7.4" @@ -38,12 +20,6 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - [[package]] name = "endian-type" version = "0.1.2" @@ -65,16 +41,6 @@ dependencies = [ "multiversx-sc-wasm-adapter", ] -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - [[package]] name = "hex" version = "0.4.3" @@ -89,12 +55,11 @@ checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "multiversx-sc" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +checksum = "6c94b173dc5ff0e157f767275fe6b7a1b4d2ad343bef7b66cd22a6353e016b93" dependencies = [ "bitflags", - "hashbrown", "hex-literal", "multiversx-sc-codec", "multiversx-sc-derive", @@ -125,9 +90,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +checksum = "3b78945957036c281ad6ee21bb5120dcefa2017688adf43ec94e3e7c982efb09" dependencies = [ "hex", "proc-macro2", @@ -138,9 +103,9 @@ dependencies = [ [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +checksum = "9579f40c00da56a5a68e010ff851fa48ac7b9c6a16ad4314795cb32d889d9e78" dependencies = [ "multiversx-sc", ] @@ -163,12 +128,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - [[package]] name = "proc-macro2" version = "1.0.75" @@ -219,29 +178,3 @@ name = "unicode-ident" version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/dex/governance/wasm/Cargo.toml b/dex/governance/wasm/Cargo.toml index 798cb3472..905950d0e 100644 --- a/dex/governance/wasm/Cargo.toml +++ b/dex/governance/wasm/Cargo.toml @@ -25,7 +25,7 @@ overflow-checks = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.2" +version = "=0.46.1" [workspace] members = ["."] diff --git a/dex/pair-mock/Cargo.toml b/dex/pair-mock/Cargo.toml index ab530b3cb..bc58d1089 100644 --- a/dex/pair-mock/Cargo.toml +++ b/dex/pair-mock/Cargo.toml @@ -12,7 +12,7 @@ path = "src/pair.rs" path = "../../common/common_errors" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.itertools] @@ -20,4 +20,4 @@ version = "0.10.1" default-features = false [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.2" +version = "=0.46.1" diff --git a/dex/pair-mock/meta/Cargo.toml b/dex/pair-mock/meta/Cargo.toml index 788d25b8c..673a8fc84 100644 --- a/dex/pair-mock/meta/Cargo.toml +++ b/dex/pair-mock/meta/Cargo.toml @@ -11,5 +11,5 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.2" +version = "0.46.1" default-features = false diff --git a/dex/pair-mock/wasm/Cargo.lock b/dex/pair-mock/wasm/Cargo.lock index d095e3103..6311e01de 100644 --- a/dex/pair-mock/wasm/Cargo.lock +++ b/dex/pair-mock/wasm/Cargo.lock @@ -2,24 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "ahash" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - [[package]] name = "arrayvec" version = "0.7.4" @@ -38,12 +20,6 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - [[package]] name = "common_errors" version = "0.0.0" @@ -63,16 +39,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - [[package]] name = "hex" version = "0.4.3" @@ -96,12 +62,11 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +checksum = "6c94b173dc5ff0e157f767275fe6b7a1b4d2ad343bef7b66cd22a6353e016b93" dependencies = [ "bitflags", - "hashbrown", "hex-literal", "multiversx-sc-codec", "multiversx-sc-derive", @@ -132,9 +97,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +checksum = "3b78945957036c281ad6ee21bb5120dcefa2017688adf43ec94e3e7c982efb09" dependencies = [ "hex", "proc-macro2", @@ -145,9 +110,9 @@ dependencies = [ [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +checksum = "9579f40c00da56a5a68e010ff851fa48ac7b9c6a16ad4314795cb32d889d9e78" dependencies = [ "multiversx-sc", ] @@ -170,12 +135,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - [[package]] name = "pair-mock" version = "0.0.0" @@ -243,29 +202,3 @@ name = "unicode-ident" version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/dex/pair-mock/wasm/Cargo.toml b/dex/pair-mock/wasm/Cargo.toml index c364b2ca3..9bf537c94 100644 --- a/dex/pair-mock/wasm/Cargo.toml +++ b/dex/pair-mock/wasm/Cargo.toml @@ -25,7 +25,7 @@ overflow-checks = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.2" +version = "=0.46.1" [workspace] members = ["."] diff --git a/dex/pair/Cargo.toml b/dex/pair/Cargo.toml index c60efb4f0..9c2412b29 100644 --- a/dex/pair/Cargo.toml +++ b/dex/pair/Cargo.toml @@ -34,11 +34,11 @@ version = "0.10.1" default-features = false [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.2" +version = "=0.46.1" diff --git a/dex/pair/meta/Cargo.toml b/dex/pair/meta/Cargo.toml index ab18428df..b07218ea1 100644 --- a/dex/pair/meta/Cargo.toml +++ b/dex/pair/meta/Cargo.toml @@ -9,5 +9,5 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.2" +version = "0.46.1" default-features = false diff --git a/dex/pair/wasm-pair-full/Cargo.lock b/dex/pair/wasm-pair-full/Cargo.lock index 7e0ef3cc8..2cc5bc171 100644 --- a/dex/pair/wasm-pair-full/Cargo.lock +++ b/dex/pair/wasm-pair-full/Cargo.lock @@ -2,24 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "ahash" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - [[package]] name = "arrayvec" version = "0.7.4" @@ -38,12 +20,6 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - [[package]] name = "common-types" version = "0.0.0" @@ -130,16 +106,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - [[package]] name = "hex" version = "0.4.3" @@ -195,12 +161,11 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +checksum = "6c94b173dc5ff0e157f767275fe6b7a1b4d2ad343bef7b66cd22a6353e016b93" dependencies = [ "bitflags", - "hashbrown", "hex-literal", "multiversx-sc-codec", "multiversx-sc-derive", @@ -231,9 +196,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +checksum = "3b78945957036c281ad6ee21bb5120dcefa2017688adf43ec94e3e7c982efb09" dependencies = [ "hex", "proc-macro2", @@ -244,18 +209,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +checksum = "c63ffaba95e630ff75981e2f5f50da64f523219b52f484234c66f3adc248885f" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +checksum = "9579f40c00da56a5a68e010ff851fa48ac7b9c6a16ad4314795cb32d889d9e78" dependencies = [ "multiversx-sc", ] @@ -278,12 +243,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - [[package]] name = "pair" version = "0.0.0" @@ -418,12 +377,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -443,23 +396,3 @@ dependencies = [ "unwrappable", "week-timekeeping", ] - -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/dex/pair/wasm-pair-full/Cargo.toml b/dex/pair/wasm-pair-full/Cargo.toml index 663627bb6..5fc0f4b76 100644 --- a/dex/pair/wasm-pair-full/Cargo.toml +++ b/dex/pair/wasm-pair-full/Cargo.toml @@ -25,7 +25,7 @@ overflow-checks = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.2" +version = "=0.46.1" [workspace] members = ["."] diff --git a/dex/pair/wasm-safe-price-view/Cargo.lock b/dex/pair/wasm-safe-price-view/Cargo.lock index 68927fa3f..01ffaeeab 100644 --- a/dex/pair/wasm-safe-price-view/Cargo.lock +++ b/dex/pair/wasm-safe-price-view/Cargo.lock @@ -2,24 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "ahash" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - [[package]] name = "arrayvec" version = "0.7.4" @@ -38,12 +20,6 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - [[package]] name = "common-types" version = "0.0.0" @@ -130,16 +106,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - [[package]] name = "hex" version = "0.4.3" @@ -195,12 +161,11 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +checksum = "6c94b173dc5ff0e157f767275fe6b7a1b4d2ad343bef7b66cd22a6353e016b93" dependencies = [ "bitflags", - "hashbrown", "hex-literal", "multiversx-sc-codec", "multiversx-sc-derive", @@ -231,9 +196,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +checksum = "3b78945957036c281ad6ee21bb5120dcefa2017688adf43ec94e3e7c982efb09" dependencies = [ "hex", "proc-macro2", @@ -244,18 +209,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +checksum = "c63ffaba95e630ff75981e2f5f50da64f523219b52f484234c66f3adc248885f" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +checksum = "9579f40c00da56a5a68e010ff851fa48ac7b9c6a16ad4314795cb32d889d9e78" dependencies = [ "multiversx-sc", ] @@ -278,12 +243,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - [[package]] name = "pair" version = "0.0.0" @@ -418,12 +377,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -443,23 +396,3 @@ dependencies = [ "unwrappable", "week-timekeeping", ] - -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/dex/pair/wasm-safe-price-view/Cargo.toml b/dex/pair/wasm-safe-price-view/Cargo.toml index 3f6bc15d1..28c1d40a9 100644 --- a/dex/pair/wasm-safe-price-view/Cargo.toml +++ b/dex/pair/wasm-safe-price-view/Cargo.toml @@ -25,7 +25,7 @@ overflow-checks = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.2" +version = "=0.46.1" [workspace] members = ["."] diff --git a/dex/pair/wasm/Cargo.lock b/dex/pair/wasm/Cargo.lock index 3d31934f0..e10e905d3 100644 --- a/dex/pair/wasm/Cargo.lock +++ b/dex/pair/wasm/Cargo.lock @@ -2,24 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "ahash" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - [[package]] name = "arrayvec" version = "0.7.4" @@ -38,12 +20,6 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - [[package]] name = "common-types" version = "0.0.0" @@ -130,16 +106,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - [[package]] name = "hex" version = "0.4.3" @@ -195,12 +161,11 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +checksum = "6c94b173dc5ff0e157f767275fe6b7a1b4d2ad343bef7b66cd22a6353e016b93" dependencies = [ "bitflags", - "hashbrown", "hex-literal", "multiversx-sc-codec", "multiversx-sc-derive", @@ -231,9 +196,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +checksum = "3b78945957036c281ad6ee21bb5120dcefa2017688adf43ec94e3e7c982efb09" dependencies = [ "hex", "proc-macro2", @@ -244,18 +209,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +checksum = "c63ffaba95e630ff75981e2f5f50da64f523219b52f484234c66f3adc248885f" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +checksum = "9579f40c00da56a5a68e010ff851fa48ac7b9c6a16ad4314795cb32d889d9e78" dependencies = [ "multiversx-sc", ] @@ -278,12 +243,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - [[package]] name = "pair" version = "0.0.0" @@ -418,12 +377,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -443,23 +396,3 @@ dependencies = [ "unwrappable", "week-timekeeping", ] - -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/dex/pair/wasm/Cargo.toml b/dex/pair/wasm/Cargo.toml index a14d2dab9..7e096d156 100644 --- a/dex/pair/wasm/Cargo.toml +++ b/dex/pair/wasm/Cargo.toml @@ -25,7 +25,7 @@ overflow-checks = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.2" +version = "=0.46.1" [workspace] members = ["."] diff --git a/dex/price-discovery/Cargo.toml b/dex/price-discovery/Cargo.toml index 8c8f6c2ff..51aa316e3 100644 --- a/dex/price-discovery/Cargo.toml +++ b/dex/price-discovery/Cargo.toml @@ -12,11 +12,11 @@ path = "src/lib.rs" hex-literal = "0.3.1" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.45.2" +version = "=0.46.1" [dependencies.locking_module] path = "../../common/modules/locking_module" @@ -30,4 +30,4 @@ hex = "0.4" path = "../../locked-asset/simple-lock" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.2" +version = "=0.46.1" diff --git a/dex/price-discovery/meta/Cargo.toml b/dex/price-discovery/meta/Cargo.toml index 4a20900e1..176823d06 100644 --- a/dex/price-discovery/meta/Cargo.toml +++ b/dex/price-discovery/meta/Cargo.toml @@ -9,5 +9,5 @@ authors = ["Dorin Iancu "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.2" +version = "0.46.1" default-features = false diff --git a/dex/price-discovery/wasm/Cargo.lock b/dex/price-discovery/wasm/Cargo.lock index 358220a08..fbcb7ca84 100644 --- a/dex/price-discovery/wasm/Cargo.lock +++ b/dex/price-discovery/wasm/Cargo.lock @@ -2,24 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "ahash" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - [[package]] name = "arrayvec" version = "0.7.4" @@ -38,12 +20,6 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - [[package]] name = "common_errors" version = "0.0.0" @@ -91,16 +67,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - [[package]] name = "hex" version = "0.4.3" @@ -153,12 +119,11 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +checksum = "6c94b173dc5ff0e157f767275fe6b7a1b4d2ad343bef7b66cd22a6353e016b93" dependencies = [ "bitflags", - "hashbrown", "hex-literal 0.4.1", "multiversx-sc-codec", "multiversx-sc-derive", @@ -189,9 +154,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +checksum = "3b78945957036c281ad6ee21bb5120dcefa2017688adf43ec94e3e7c982efb09" dependencies = [ "hex", "proc-macro2", @@ -202,18 +167,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +checksum = "c63ffaba95e630ff75981e2f5f50da64f523219b52f484234c66f3adc248885f" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +checksum = "9579f40c00da56a5a68e010ff851fa48ac7b9c6a16ad4314795cb32d889d9e78" dependencies = [ "multiversx-sc", ] @@ -236,12 +201,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - [[package]] name = "price-discovery" version = "0.0.0" @@ -344,29 +303,3 @@ dependencies = [ "mergeable", "multiversx-sc", ] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/dex/price-discovery/wasm/Cargo.toml b/dex/price-discovery/wasm/Cargo.toml index 2e0c1a962..04885bcda 100644 --- a/dex/price-discovery/wasm/Cargo.toml +++ b/dex/price-discovery/wasm/Cargo.toml @@ -25,7 +25,7 @@ overflow-checks = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.2" +version = "=0.46.1" [workspace] members = ["."] diff --git a/dex/proxy-deployer/Cargo.toml b/dex/proxy-deployer/Cargo.toml index 171be109a..f5c3b8955 100644 --- a/dex/proxy-deployer/Cargo.toml +++ b/dex/proxy-deployer/Cargo.toml @@ -21,11 +21,11 @@ path = "../../common/modules/farm/config" path = "../../common/modules/farm/farm_token" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.2" +version = "=0.46.1" diff --git a/dex/proxy-deployer/meta/Cargo.toml b/dex/proxy-deployer/meta/Cargo.toml index b4d612a03..629fddbdf 100644 --- a/dex/proxy-deployer/meta/Cargo.toml +++ b/dex/proxy-deployer/meta/Cargo.toml @@ -11,5 +11,5 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.2" +version = "0.46.1" default-features = false diff --git a/dex/proxy-deployer/wasm/Cargo.lock b/dex/proxy-deployer/wasm/Cargo.lock index 574bef2cf..db98ddd5b 100644 --- a/dex/proxy-deployer/wasm/Cargo.lock +++ b/dex/proxy-deployer/wasm/Cargo.lock @@ -2,24 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "ahash" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - [[package]] name = "arrayvec" version = "0.7.4" @@ -38,12 +20,6 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - [[package]] name = "common-types" version = "0.0.0" @@ -246,16 +222,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - [[package]] name = "hex" version = "0.4.3" @@ -311,12 +277,11 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +checksum = "6c94b173dc5ff0e157f767275fe6b7a1b4d2ad343bef7b66cd22a6353e016b93" dependencies = [ "bitflags", - "hashbrown", "hex-literal", "multiversx-sc-codec", "multiversx-sc-derive", @@ -347,9 +312,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +checksum = "3b78945957036c281ad6ee21bb5120dcefa2017688adf43ec94e3e7c982efb09" dependencies = [ "hex", "proc-macro2", @@ -360,18 +325,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +checksum = "c63ffaba95e630ff75981e2f5f50da64f523219b52f484234c66f3adc248885f" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +checksum = "9579f40c00da56a5a68e010ff851fa48ac7b9c6a16ad4314795cb32d889d9e78" dependencies = [ "multiversx-sc", ] @@ -394,12 +359,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - [[package]] name = "pair" version = "0.0.0" @@ -568,12 +527,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -593,23 +546,3 @@ dependencies = [ "unwrappable", "week-timekeeping", ] - -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/dex/proxy-deployer/wasm/Cargo.toml b/dex/proxy-deployer/wasm/Cargo.toml index a12cd2152..97ada3a24 100644 --- a/dex/proxy-deployer/wasm/Cargo.toml +++ b/dex/proxy-deployer/wasm/Cargo.toml @@ -25,7 +25,7 @@ overflow-checks = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.2" +version = "=0.46.1" [workspace] members = ["."] diff --git a/dex/router/Cargo.toml b/dex/router/Cargo.toml index b96ecd5d2..cc3698241 100644 --- a/dex/router/Cargo.toml +++ b/dex/router/Cargo.toml @@ -15,7 +15,7 @@ path = "../../common/modules/token_send" path = "../../common/modules/pausable" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.pair] @@ -28,4 +28,4 @@ path = "../../common/modules/locking_module" path = "../../locked-asset/simple-lock" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.2" +version = "=0.46.1" diff --git a/dex/router/meta/Cargo.toml b/dex/router/meta/Cargo.toml index 1b850b06c..c5deaf0be 100644 --- a/dex/router/meta/Cargo.toml +++ b/dex/router/meta/Cargo.toml @@ -9,5 +9,5 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.2" +version = "0.46.1" default-features = false diff --git a/dex/router/wasm/Cargo.lock b/dex/router/wasm/Cargo.lock index d6f7cf730..3edc82d36 100644 --- a/dex/router/wasm/Cargo.lock +++ b/dex/router/wasm/Cargo.lock @@ -2,24 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "ahash" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - [[package]] name = "arrayvec" version = "0.7.4" @@ -38,12 +20,6 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - [[package]] name = "common-types" version = "0.0.0" @@ -130,16 +106,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - [[package]] name = "hex" version = "0.4.3" @@ -195,12 +161,11 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +checksum = "6c94b173dc5ff0e157f767275fe6b7a1b4d2ad343bef7b66cd22a6353e016b93" dependencies = [ "bitflags", - "hashbrown", "hex-literal", "multiversx-sc-codec", "multiversx-sc-derive", @@ -231,9 +196,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +checksum = "3b78945957036c281ad6ee21bb5120dcefa2017688adf43ec94e3e7c982efb09" dependencies = [ "hex", "proc-macro2", @@ -244,18 +209,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +checksum = "c63ffaba95e630ff75981e2f5f50da64f523219b52f484234c66f3adc248885f" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +checksum = "9579f40c00da56a5a68e010ff851fa48ac7b9c6a16ad4314795cb32d889d9e78" dependencies = [ "multiversx-sc", ] @@ -278,12 +243,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - [[package]] name = "pair" version = "0.0.0" @@ -430,12 +389,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -455,23 +408,3 @@ dependencies = [ "unwrappable", "week-timekeeping", ] - -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/dex/router/wasm/Cargo.toml b/dex/router/wasm/Cargo.toml index e2c69a8e3..dc895383b 100644 --- a/dex/router/wasm/Cargo.toml +++ b/dex/router/wasm/Cargo.toml @@ -25,7 +25,7 @@ overflow-checks = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.2" +version = "=0.46.1" [workspace] members = ["."] diff --git a/energy-integration/common-modules/energy-query/Cargo.toml b/energy-integration/common-modules/energy-query/Cargo.toml index 193d37066..429ddafe2 100644 --- a/energy-integration/common-modules/energy-query/Cargo.toml +++ b/energy-integration/common-modules/energy-query/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.energy-factory] diff --git a/energy-integration/common-modules/week-timekeeping/Cargo.toml b/energy-integration/common-modules/week-timekeeping/Cargo.toml index f79f7f244..32e16b01e 100644 --- a/energy-integration/common-modules/week-timekeeping/Cargo.toml +++ b/energy-integration/common-modules/week-timekeeping/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.common-types] diff --git a/energy-integration/common-modules/weekly-rewards-splitting/Cargo.toml b/energy-integration/common-modules/weekly-rewards-splitting/Cargo.toml index a48598c22..0603f0084 100644 --- a/energy-integration/common-modules/weekly-rewards-splitting/Cargo.toml +++ b/energy-integration/common-modules/weekly-rewards-splitting/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.energy-query] diff --git a/energy-integration/common-types/Cargo.toml b/energy-integration/common-types/Cargo.toml index 5a10a67ab..b2ba8bc79 100644 --- a/energy-integration/common-types/Cargo.toml +++ b/energy-integration/common-types/Cargo.toml @@ -8,5 +8,5 @@ edition = "2021" path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] diff --git a/energy-integration/energy-factory-mock/Cargo.toml b/energy-integration/energy-factory-mock/Cargo.toml index 5e6be1508..6e246e8fb 100644 --- a/energy-integration/energy-factory-mock/Cargo.toml +++ b/energy-integration/energy-factory-mock/Cargo.toml @@ -12,8 +12,8 @@ path = "src/lib.rs" path = "../common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.2" +version = "=0.46.1" diff --git a/energy-integration/energy-factory-mock/meta/Cargo.toml b/energy-integration/energy-factory-mock/meta/Cargo.toml index 1ec8801fe..94241670d 100644 --- a/energy-integration/energy-factory-mock/meta/Cargo.toml +++ b/energy-integration/energy-factory-mock/meta/Cargo.toml @@ -11,5 +11,5 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.2" +version = "0.46.1" default-features = false diff --git a/energy-integration/energy-factory-mock/wasm/Cargo.lock b/energy-integration/energy-factory-mock/wasm/Cargo.lock index a328781fd..0693d6d5f 100644 --- a/energy-integration/energy-factory-mock/wasm/Cargo.lock +++ b/energy-integration/energy-factory-mock/wasm/Cargo.lock @@ -2,24 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "ahash" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - [[package]] name = "arrayvec" version = "0.7.4" @@ -38,12 +20,6 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - [[package]] name = "common_errors" version = "0.0.0" @@ -115,16 +91,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - [[package]] name = "hex" version = "0.4.3" @@ -162,12 +128,11 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +checksum = "6c94b173dc5ff0e157f767275fe6b7a1b4d2ad343bef7b66cd22a6353e016b93" dependencies = [ "bitflags", - "hashbrown", "hex-literal", "multiversx-sc-codec", "multiversx-sc-derive", @@ -198,9 +163,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +checksum = "3b78945957036c281ad6ee21bb5120dcefa2017688adf43ec94e3e7c982efb09" dependencies = [ "hex", "proc-macro2", @@ -211,18 +176,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +checksum = "c63ffaba95e630ff75981e2f5f50da64f523219b52f484234c66f3adc248885f" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +checksum = "9579f40c00da56a5a68e010ff851fa48ac7b9c6a16ad4314795cb32d889d9e78" dependencies = [ "multiversx-sc", ] @@ -245,12 +210,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - [[package]] name = "proc-macro2" version = "1.0.75" @@ -335,29 +294,3 @@ dependencies = [ "mergeable", "multiversx-sc", ] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/energy-integration/energy-factory-mock/wasm/Cargo.toml b/energy-integration/energy-factory-mock/wasm/Cargo.toml index ebb38914a..426c4c9f0 100644 --- a/energy-integration/energy-factory-mock/wasm/Cargo.toml +++ b/energy-integration/energy-factory-mock/wasm/Cargo.toml @@ -25,7 +25,7 @@ overflow-checks = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.2" +version = "=0.46.1" [workspace] members = ["."] diff --git a/energy-integration/energy-update/Cargo.toml b/energy-integration/energy-update/Cargo.toml index b7d6a7d54..01489f0d7 100644 --- a/energy-integration/energy-update/Cargo.toml +++ b/energy-integration/energy-update/Cargo.toml @@ -9,11 +9,11 @@ publish = false path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.45.2" +version = "=0.46.1" [dependencies.farm] path = "../../dex/farm" @@ -25,4 +25,4 @@ path = "../common-modules/weekly-rewards-splitting" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.2" +version = "=0.46.1" diff --git a/energy-integration/energy-update/meta/Cargo.toml b/energy-integration/energy-update/meta/Cargo.toml index fdd5be171..aa816ac82 100644 --- a/energy-integration/energy-update/meta/Cargo.toml +++ b/energy-integration/energy-update/meta/Cargo.toml @@ -11,5 +11,5 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.2" +version = "0.46.1" default-features = false diff --git a/energy-integration/energy-update/wasm/Cargo.lock b/energy-integration/energy-update/wasm/Cargo.lock index d7581da0c..dc15e967f 100644 --- a/energy-integration/energy-update/wasm/Cargo.lock +++ b/energy-integration/energy-update/wasm/Cargo.lock @@ -2,24 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "ahash" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - [[package]] name = "arrayvec" version = "0.7.4" @@ -38,12 +20,6 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - [[package]] name = "common-types" version = "0.0.0" @@ -264,16 +240,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - [[package]] name = "hex" version = "0.4.3" @@ -329,12 +295,11 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +checksum = "6c94b173dc5ff0e157f767275fe6b7a1b4d2ad343bef7b66cd22a6353e016b93" dependencies = [ "bitflags", - "hashbrown", "hex-literal", "multiversx-sc-codec", "multiversx-sc-derive", @@ -365,9 +330,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +checksum = "3b78945957036c281ad6ee21bb5120dcefa2017688adf43ec94e3e7c982efb09" dependencies = [ "hex", "proc-macro2", @@ -378,18 +343,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +checksum = "c63ffaba95e630ff75981e2f5f50da64f523219b52f484234c66f3adc248885f" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +checksum = "9579f40c00da56a5a68e010ff851fa48ac7b9c6a16ad4314795cb32d889d9e78" dependencies = [ "multiversx-sc", ] @@ -412,12 +377,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - [[package]] name = "pair" version = "0.0.0" @@ -567,12 +526,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -592,23 +545,3 @@ dependencies = [ "unwrappable", "week-timekeeping", ] - -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/energy-integration/energy-update/wasm/Cargo.toml b/energy-integration/energy-update/wasm/Cargo.toml index c05d11a8f..399b3a678 100644 --- a/energy-integration/energy-update/wasm/Cargo.toml +++ b/energy-integration/energy-update/wasm/Cargo.toml @@ -25,7 +25,7 @@ overflow-checks = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.2" +version = "=0.46.1" [workspace] members = ["."] diff --git a/energy-integration/farm-boosted-yields/Cargo.toml b/energy-integration/farm-boosted-yields/Cargo.toml index f83469191..5a75c8b80 100644 --- a/energy-integration/farm-boosted-yields/Cargo.toml +++ b/energy-integration/farm-boosted-yields/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.config] diff --git a/energy-integration/fees-collector/Cargo.toml b/energy-integration/fees-collector/Cargo.toml index 67398c493..1b233b7f6 100644 --- a/energy-integration/fees-collector/Cargo.toml +++ b/energy-integration/fees-collector/Cargo.toml @@ -9,11 +9,11 @@ publish = false path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.45.2" +version = "=0.46.1" [dependencies.energy-query] path = "../common-modules/energy-query" @@ -49,7 +49,7 @@ path = "../../common/common_errors" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.2" +version = "=0.46.1" [dev-dependencies.sc_whitelist_module] path = "../../common/modules/sc_whitelist_module" diff --git a/energy-integration/fees-collector/meta/Cargo.toml b/energy-integration/fees-collector/meta/Cargo.toml index 28958a4c9..c91986348 100644 --- a/energy-integration/fees-collector/meta/Cargo.toml +++ b/energy-integration/fees-collector/meta/Cargo.toml @@ -11,5 +11,5 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.2" +version = "0.46.1" default-features = false diff --git a/energy-integration/fees-collector/wasm/Cargo.lock b/energy-integration/fees-collector/wasm/Cargo.lock index a07685f8d..d31ccf2dc 100644 --- a/energy-integration/fees-collector/wasm/Cargo.lock +++ b/energy-integration/fees-collector/wasm/Cargo.lock @@ -2,24 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "ahash" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - [[package]] name = "arrayvec" version = "0.7.4" @@ -38,12 +20,6 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - [[package]] name = "common-types" version = "0.0.0" @@ -132,16 +108,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - [[package]] name = "hex" version = "0.4.3" @@ -188,12 +154,11 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +checksum = "6c94b173dc5ff0e157f767275fe6b7a1b4d2ad343bef7b66cd22a6353e016b93" dependencies = [ "bitflags", - "hashbrown", "hex-literal", "multiversx-sc-codec", "multiversx-sc-derive", @@ -224,9 +189,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +checksum = "3b78945957036c281ad6ee21bb5120dcefa2017688adf43ec94e3e7c982efb09" dependencies = [ "hex", "proc-macro2", @@ -237,18 +202,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +checksum = "c63ffaba95e630ff75981e2f5f50da64f523219b52f484234c66f3adc248885f" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +checksum = "9579f40c00da56a5a68e010ff851fa48ac7b9c6a16ad4314795cb32d889d9e78" dependencies = [ "multiversx-sc", ] @@ -271,12 +236,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - [[package]] name = "proc-macro2" version = "1.0.75" @@ -362,12 +321,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -387,23 +340,3 @@ dependencies = [ "unwrappable", "week-timekeeping", ] - -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/energy-integration/fees-collector/wasm/Cargo.toml b/energy-integration/fees-collector/wasm/Cargo.toml index 3e5656621..67ff1cdc8 100644 --- a/energy-integration/fees-collector/wasm/Cargo.toml +++ b/energy-integration/fees-collector/wasm/Cargo.toml @@ -25,7 +25,7 @@ overflow-checks = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.2" +version = "=0.46.1" [workspace] members = ["."] diff --git a/energy-integration/governance-v2/Cargo.toml b/energy-integration/governance-v2/Cargo.toml index 5ba76fc54..1b190cd64 100644 --- a/energy-integration/governance-v2/Cargo.toml +++ b/energy-integration/governance-v2/Cargo.toml @@ -12,7 +12,7 @@ path = "src/lib.rs" path = "../common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.permissions_module] @@ -28,7 +28,7 @@ path = "../common-modules/weekly-rewards-splitting" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.2" +version = "=0.46.1" [dev-dependencies.energy-factory-mock] path = "../energy-factory-mock" diff --git a/energy-integration/governance-v2/meta/Cargo.toml b/energy-integration/governance-v2/meta/Cargo.toml index 44a2c08c1..ca5a80d29 100644 --- a/energy-integration/governance-v2/meta/Cargo.toml +++ b/energy-integration/governance-v2/meta/Cargo.toml @@ -11,5 +11,5 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.2" +version = "0.46.1" default-features = false diff --git a/energy-integration/governance-v2/wasm/Cargo.lock b/energy-integration/governance-v2/wasm/Cargo.lock index 6a12b763a..71cf78cfd 100644 --- a/energy-integration/governance-v2/wasm/Cargo.lock +++ b/energy-integration/governance-v2/wasm/Cargo.lock @@ -2,24 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "ahash" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - [[package]] name = "arrayvec" version = "0.7.4" @@ -38,12 +20,6 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - [[package]] name = "common-types" version = "0.0.0" @@ -143,16 +119,6 @@ dependencies = [ "multiversx-sc-wasm-adapter", ] -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - [[package]] name = "hex" version = "0.4.3" @@ -199,12 +165,11 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +checksum = "6c94b173dc5ff0e157f767275fe6b7a1b4d2ad343bef7b66cd22a6353e016b93" dependencies = [ "bitflags", - "hashbrown", "hex-literal", "multiversx-sc-codec", "multiversx-sc-derive", @@ -235,9 +200,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +checksum = "3b78945957036c281ad6ee21bb5120dcefa2017688adf43ec94e3e7c982efb09" dependencies = [ "hex", "proc-macro2", @@ -248,18 +213,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +checksum = "c63ffaba95e630ff75981e2f5f50da64f523219b52f484234c66f3adc248885f" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +checksum = "9579f40c00da56a5a68e010ff851fa48ac7b9c6a16ad4314795cb32d889d9e78" dependencies = [ "multiversx-sc", ] @@ -282,12 +247,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - [[package]] name = "permissions_module" version = "0.0.0" @@ -382,12 +341,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -407,23 +360,3 @@ dependencies = [ "unwrappable", "week-timekeeping", ] - -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/energy-integration/governance-v2/wasm/Cargo.toml b/energy-integration/governance-v2/wasm/Cargo.toml index 1529af7a9..02189aabe 100644 --- a/energy-integration/governance-v2/wasm/Cargo.toml +++ b/energy-integration/governance-v2/wasm/Cargo.toml @@ -25,7 +25,7 @@ overflow-checks = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.2" +version = "=0.46.1" [workspace] members = ["."] diff --git a/farm-staking/farm-staking-proxy/Cargo.toml b/farm-staking/farm-staking-proxy/Cargo.toml index e724d1e43..7e986d221 100644 --- a/farm-staking/farm-staking-proxy/Cargo.toml +++ b/farm-staking/farm-staking-proxy/Cargo.toml @@ -12,11 +12,11 @@ path = "src/lib.rs" hex-literal = "0.3.1" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.45.2" +version = "=0.46.1" [dependencies.farm] path = "../../dex/farm" @@ -67,7 +67,7 @@ path = "../../energy-integration/common-modules/energy-query" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.2" +version = "=0.46.1" [dev-dependencies.farm_token] path = "../../common/modules/farm/farm_token" diff --git a/farm-staking/farm-staking-proxy/meta/Cargo.toml b/farm-staking/farm-staking-proxy/meta/Cargo.toml index dc41bf009..404e23810 100644 --- a/farm-staking/farm-staking-proxy/meta/Cargo.toml +++ b/farm-staking/farm-staking-proxy/meta/Cargo.toml @@ -11,5 +11,5 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.2" +version = "0.46.1" default-features = false diff --git a/farm-staking/farm-staking-proxy/wasm/Cargo.lock b/farm-staking/farm-staking-proxy/wasm/Cargo.lock index 69e2d0409..e0060ea46 100644 --- a/farm-staking/farm-staking-proxy/wasm/Cargo.lock +++ b/farm-staking/farm-staking-proxy/wasm/Cargo.lock @@ -2,24 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "ahash" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - [[package]] name = "arrayvec" version = "0.7.4" @@ -38,12 +20,6 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - [[package]] name = "common-types" version = "0.0.0" @@ -339,16 +315,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - [[package]] name = "hex" version = "0.4.3" @@ -410,12 +376,11 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +checksum = "6c94b173dc5ff0e157f767275fe6b7a1b4d2ad343bef7b66cd22a6353e016b93" dependencies = [ "bitflags", - "hashbrown", "hex-literal 0.4.1", "multiversx-sc-codec", "multiversx-sc-derive", @@ -446,9 +411,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +checksum = "3b78945957036c281ad6ee21bb5120dcefa2017688adf43ec94e3e7c982efb09" dependencies = [ "hex", "proc-macro2", @@ -459,18 +424,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +checksum = "c63ffaba95e630ff75981e2f5f50da64f523219b52f484234c66f3adc248885f" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +checksum = "9579f40c00da56a5a68e010ff851fa48ac7b9c6a16ad4314795cb32d889d9e78" dependencies = [ "multiversx-sc", ] @@ -493,12 +458,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - [[package]] name = "pair" version = "0.0.0" @@ -648,12 +607,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -673,23 +626,3 @@ dependencies = [ "unwrappable", "week-timekeeping", ] - -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/farm-staking/farm-staking-proxy/wasm/Cargo.toml b/farm-staking/farm-staking-proxy/wasm/Cargo.toml index 7f2bf7dc2..b95744497 100644 --- a/farm-staking/farm-staking-proxy/wasm/Cargo.toml +++ b/farm-staking/farm-staking-proxy/wasm/Cargo.toml @@ -25,7 +25,7 @@ overflow-checks = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.2" +version = "=0.46.1" [workspace] members = ["."] diff --git a/farm-staking/farm-staking/Cargo.toml b/farm-staking/farm-staking/Cargo.toml index afc450bc6..c4db81ca1 100644 --- a/farm-staking/farm-staking/Cargo.toml +++ b/farm-staking/farm-staking/Cargo.toml @@ -78,14 +78,14 @@ path = "../../common/common_structs" path = "../../common/common_errors" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.45.2" +version = "=0.46.1" [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.2" +version = "=0.46.1" diff --git a/farm-staking/farm-staking/meta/Cargo.toml b/farm-staking/farm-staking/meta/Cargo.toml index c503cdf01..20d07fb79 100644 --- a/farm-staking/farm-staking/meta/Cargo.toml +++ b/farm-staking/farm-staking/meta/Cargo.toml @@ -9,5 +9,5 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.2" +version = "0.46.1" default-features = false diff --git a/farm-staking/farm-staking/wasm/Cargo.lock b/farm-staking/farm-staking/wasm/Cargo.lock index 45ce016fa..dce82eb7c 100644 --- a/farm-staking/farm-staking/wasm/Cargo.lock +++ b/farm-staking/farm-staking/wasm/Cargo.lock @@ -2,24 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "ahash" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - [[package]] name = "arrayvec" version = "0.7.4" @@ -38,12 +20,6 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - [[package]] name = "common-types" version = "0.0.0" @@ -285,16 +261,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - [[package]] name = "hex" version = "0.4.3" @@ -350,12 +316,11 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +checksum = "6c94b173dc5ff0e157f767275fe6b7a1b4d2ad343bef7b66cd22a6353e016b93" dependencies = [ "bitflags", - "hashbrown", "hex-literal", "multiversx-sc-codec", "multiversx-sc-derive", @@ -386,9 +351,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +checksum = "3b78945957036c281ad6ee21bb5120dcefa2017688adf43ec94e3e7c982efb09" dependencies = [ "hex", "proc-macro2", @@ -399,18 +364,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +checksum = "c63ffaba95e630ff75981e2f5f50da64f523219b52f484234c66f3adc248885f" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +checksum = "9579f40c00da56a5a68e010ff851fa48ac7b9c6a16ad4314795cb32d889d9e78" dependencies = [ "multiversx-sc", ] @@ -433,12 +398,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - [[package]] name = "pair" version = "0.0.0" @@ -588,12 +547,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -613,23 +566,3 @@ dependencies = [ "unwrappable", "week-timekeeping", ] - -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/farm-staking/farm-staking/wasm/Cargo.toml b/farm-staking/farm-staking/wasm/Cargo.toml index 3f2d8608c..0dbb347b9 100644 --- a/farm-staking/farm-staking/wasm/Cargo.toml +++ b/farm-staking/farm-staking/wasm/Cargo.toml @@ -25,7 +25,7 @@ overflow-checks = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.2" +version = "=0.46.1" [workspace] members = ["."] diff --git a/farm-staking/metabonding-staking/Cargo.toml b/farm-staking/metabonding-staking/Cargo.toml index b210e5089..de3c1ff97 100644 --- a/farm-staking/metabonding-staking/Cargo.toml +++ b/farm-staking/metabonding-staking/Cargo.toml @@ -9,11 +9,11 @@ publish = false path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.45.2" +version = "=0.46.1" [dependencies.factory] path = "../../locked-asset/factory" @@ -22,7 +22,7 @@ path = "../../locked-asset/factory" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.2" +version = "=0.46.1" [dev-dependencies.common_structs] path = "../../common/common_structs" diff --git a/farm-staking/metabonding-staking/meta/Cargo.toml b/farm-staking/metabonding-staking/meta/Cargo.toml index 713820f48..71df2c0ba 100644 --- a/farm-staking/metabonding-staking/meta/Cargo.toml +++ b/farm-staking/metabonding-staking/meta/Cargo.toml @@ -11,5 +11,5 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.2" +version = "0.46.1" default-features = false diff --git a/farm-staking/metabonding-staking/wasm/Cargo.lock b/farm-staking/metabonding-staking/wasm/Cargo.lock index d629bca2b..739fec429 100644 --- a/farm-staking/metabonding-staking/wasm/Cargo.lock +++ b/farm-staking/metabonding-staking/wasm/Cargo.lock @@ -2,24 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "ahash" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" -dependencies = [ - "cfg-if 1.0.0", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - [[package]] name = "arrayvec" version = "0.7.4" @@ -44,12 +26,6 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - [[package]] name = "common_errors" version = "0.0.0" @@ -119,16 +95,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - [[package]] name = "hex" version = "0.4.3" @@ -204,12 +170,11 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +checksum = "6c94b173dc5ff0e157f767275fe6b7a1b4d2ad343bef7b66cd22a6353e016b93" dependencies = [ "bitflags", - "hashbrown", "hex-literal", "multiversx-sc-codec", "multiversx-sc-derive", @@ -240,9 +205,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +checksum = "3b78945957036c281ad6ee21bb5120dcefa2017688adf43ec94e3e7c982efb09" dependencies = [ "hex", "proc-macro2", @@ -253,18 +218,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +checksum = "c63ffaba95e630ff75981e2f5f50da64f523219b52f484234c66f3adc248885f" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +checksum = "9579f40c00da56a5a68e010ff851fa48ac7b9c6a16ad4314795cb32d889d9e78" dependencies = [ "multiversx-sc", ] @@ -287,12 +252,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - [[package]] name = "proc-macro2" version = "1.0.75" @@ -395,19 +354,13 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - [[package]] name = "wee_alloc" version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "libc", "memory_units", "winapi", @@ -434,23 +387,3 @@ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/farm-staking/metabonding-staking/wasm/Cargo.toml b/farm-staking/metabonding-staking/wasm/Cargo.toml index c0a6380da..fe2a7c6c2 100644 --- a/farm-staking/metabonding-staking/wasm/Cargo.toml +++ b/farm-staking/metabonding-staking/wasm/Cargo.toml @@ -25,7 +25,7 @@ overflow-checks = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.2" +version = "=0.46.1" [workspace] members = ["."] diff --git a/locked-asset/Cargo.toml b/locked-asset/Cargo.toml index 7990a182e..d7ba66a4c 100644 --- a/locked-asset/Cargo.toml +++ b/locked-asset/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" publish = false [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.farm] @@ -50,7 +50,7 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-modules] -version = "=0.45.2" +version = "=0.46.1" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.2" +version = "=0.46.1" diff --git a/locked-asset/distribution/Cargo.toml b/locked-asset/distribution/Cargo.toml index 5abf471eb..3ebf0939b 100644 --- a/locked-asset/distribution/Cargo.toml +++ b/locked-asset/distribution/Cargo.toml @@ -14,8 +14,8 @@ path = "../../common/common_structs" path = "../factory" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.2" +version = "=0.46.1" diff --git a/locked-asset/distribution/meta/Cargo.toml b/locked-asset/distribution/meta/Cargo.toml index 447244a37..76c13747b 100644 --- a/locked-asset/distribution/meta/Cargo.toml +++ b/locked-asset/distribution/meta/Cargo.toml @@ -9,5 +9,5 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.2" +version = "0.46.1" default-features = false diff --git a/locked-asset/distribution/wasm/Cargo.lock b/locked-asset/distribution/wasm/Cargo.lock index ae7c5f92e..fce0d3ebe 100644 --- a/locked-asset/distribution/wasm/Cargo.lock +++ b/locked-asset/distribution/wasm/Cargo.lock @@ -2,24 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "ahash" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" -dependencies = [ - "cfg-if 1.0.0", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - [[package]] name = "arrayvec" version = "0.7.4" @@ -44,12 +26,6 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - [[package]] name = "common_errors" version = "0.0.0" @@ -136,16 +112,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - [[package]] name = "hex" version = "0.4.3" @@ -204,12 +170,11 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +checksum = "6c94b173dc5ff0e157f767275fe6b7a1b4d2ad343bef7b66cd22a6353e016b93" dependencies = [ "bitflags", - "hashbrown", "hex-literal", "multiversx-sc-codec", "multiversx-sc-derive", @@ -240,9 +205,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +checksum = "3b78945957036c281ad6ee21bb5120dcefa2017688adf43ec94e3e7c982efb09" dependencies = [ "hex", "proc-macro2", @@ -253,18 +218,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +checksum = "c63ffaba95e630ff75981e2f5f50da64f523219b52f484234c66f3adc248885f" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +checksum = "9579f40c00da56a5a68e010ff851fa48ac7b9c6a16ad4314795cb32d889d9e78" dependencies = [ "multiversx-sc", ] @@ -287,12 +252,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - [[package]] name = "proc-macro2" version = "1.0.75" @@ -395,19 +354,13 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - [[package]] name = "wee_alloc" version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "libc", "memory_units", "winapi", @@ -434,23 +387,3 @@ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/locked-asset/distribution/wasm/Cargo.toml b/locked-asset/distribution/wasm/Cargo.toml index 6a9fb07f9..f1cc0ae57 100644 --- a/locked-asset/distribution/wasm/Cargo.toml +++ b/locked-asset/distribution/wasm/Cargo.toml @@ -25,7 +25,7 @@ overflow-checks = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.2" +version = "=0.46.1" [workspace] members = ["."] diff --git a/locked-asset/energy-factory/Cargo.toml b/locked-asset/energy-factory/Cargo.toml index bd55671cc..74e3cbea9 100644 --- a/locked-asset/energy-factory/Cargo.toml +++ b/locked-asset/energy-factory/Cargo.toml @@ -33,11 +33,11 @@ path = "../../common/traits/unwrappable" path = "../../common/modules/legacy_token_decode_module" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.45.2" +version = "=0.46.1" [dev-dependencies] num-bigint = "0.4.2" @@ -45,4 +45,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.2" +version = "=0.46.1" diff --git a/locked-asset/energy-factory/meta/Cargo.toml b/locked-asset/energy-factory/meta/Cargo.toml index b16a22bce..6365191f0 100644 --- a/locked-asset/energy-factory/meta/Cargo.toml +++ b/locked-asset/energy-factory/meta/Cargo.toml @@ -11,5 +11,5 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.2" +version = "0.46.1" default-features = false diff --git a/locked-asset/energy-factory/wasm/Cargo.lock b/locked-asset/energy-factory/wasm/Cargo.lock index b9295a3d9..b7f42af38 100644 --- a/locked-asset/energy-factory/wasm/Cargo.lock +++ b/locked-asset/energy-factory/wasm/Cargo.lock @@ -2,24 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "ahash" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - [[package]] name = "arrayvec" version = "0.7.4" @@ -38,12 +20,6 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - [[package]] name = "common_errors" version = "0.0.0" @@ -99,16 +75,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - [[package]] name = "hex" version = "0.4.3" @@ -146,12 +112,11 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +checksum = "6c94b173dc5ff0e157f767275fe6b7a1b4d2ad343bef7b66cd22a6353e016b93" dependencies = [ "bitflags", - "hashbrown", "hex-literal", "multiversx-sc-codec", "multiversx-sc-derive", @@ -182,9 +147,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +checksum = "3b78945957036c281ad6ee21bb5120dcefa2017688adf43ec94e3e7c982efb09" dependencies = [ "hex", "proc-macro2", @@ -195,18 +160,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +checksum = "c63ffaba95e630ff75981e2f5f50da64f523219b52f484234c66f3adc248885f" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +checksum = "9579f40c00da56a5a68e010ff851fa48ac7b9c6a16ad4314795cb32d889d9e78" dependencies = [ "multiversx-sc", ] @@ -229,12 +194,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - [[package]] name = "proc-macro2" version = "1.0.75" @@ -319,29 +278,3 @@ dependencies = [ "mergeable", "multiversx-sc", ] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/locked-asset/energy-factory/wasm/Cargo.toml b/locked-asset/energy-factory/wasm/Cargo.toml index 2262d519e..944055b38 100644 --- a/locked-asset/energy-factory/wasm/Cargo.toml +++ b/locked-asset/energy-factory/wasm/Cargo.toml @@ -25,7 +25,7 @@ overflow-checks = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.2" +version = "=0.46.1" [workspace] members = ["."] diff --git a/locked-asset/factory/Cargo.toml b/locked-asset/factory/Cargo.toml index c6f56bb50..6996881d1 100644 --- a/locked-asset/factory/Cargo.toml +++ b/locked-asset/factory/Cargo.toml @@ -26,11 +26,11 @@ path = "../../common/modules/token_merge_helper" path = "../energy-factory" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.45.2" +version = "=0.46.1" [dependencies.arrayvec] version = "0.7.1" @@ -49,4 +49,4 @@ hex = "0.4" path = "../simple-lock" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.2" +version = "=0.46.1" diff --git a/locked-asset/factory/meta/Cargo.toml b/locked-asset/factory/meta/Cargo.toml index c5027e6d1..d81d3bb85 100644 --- a/locked-asset/factory/meta/Cargo.toml +++ b/locked-asset/factory/meta/Cargo.toml @@ -9,5 +9,5 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.2" +version = "0.46.1" default-features = false diff --git a/locked-asset/factory/wasm/Cargo.lock b/locked-asset/factory/wasm/Cargo.lock index f84ffb23b..39d478ef4 100644 --- a/locked-asset/factory/wasm/Cargo.lock +++ b/locked-asset/factory/wasm/Cargo.lock @@ -2,24 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "ahash" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" -dependencies = [ - "cfg-if 1.0.0", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - [[package]] name = "arrayvec" version = "0.7.4" @@ -44,12 +26,6 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - [[package]] name = "common_errors" version = "0.0.0" @@ -127,16 +103,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - [[package]] name = "hex" version = "0.4.3" @@ -195,12 +161,11 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +checksum = "6c94b173dc5ff0e157f767275fe6b7a1b4d2ad343bef7b66cd22a6353e016b93" dependencies = [ "bitflags", - "hashbrown", "hex-literal", "multiversx-sc-codec", "multiversx-sc-derive", @@ -231,9 +196,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +checksum = "3b78945957036c281ad6ee21bb5120dcefa2017688adf43ec94e3e7c982efb09" dependencies = [ "hex", "proc-macro2", @@ -244,18 +209,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +checksum = "c63ffaba95e630ff75981e2f5f50da64f523219b52f484234c66f3adc248885f" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +checksum = "9579f40c00da56a5a68e010ff851fa48ac7b9c6a16ad4314795cb32d889d9e78" dependencies = [ "multiversx-sc", ] @@ -278,12 +243,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - [[package]] name = "proc-macro2" version = "1.0.75" @@ -386,19 +345,13 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - [[package]] name = "wee_alloc" version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "libc", "memory_units", "winapi", @@ -425,23 +378,3 @@ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/locked-asset/factory/wasm/Cargo.toml b/locked-asset/factory/wasm/Cargo.toml index 5eef2375f..eb8c084a5 100644 --- a/locked-asset/factory/wasm/Cargo.toml +++ b/locked-asset/factory/wasm/Cargo.toml @@ -25,7 +25,7 @@ overflow-checks = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.2" +version = "=0.46.1" [workspace] members = ["."] diff --git a/locked-asset/lkmex-transfer/Cargo.toml b/locked-asset/lkmex-transfer/Cargo.toml index 28f501408..a6fb9ca95 100644 --- a/locked-asset/lkmex-transfer/Cargo.toml +++ b/locked-asset/lkmex-transfer/Cargo.toml @@ -30,14 +30,14 @@ path = "../energy-factory" path = "../../energy-integration/common-modules/energy-query" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.2" +version = "=0.46.1" [dev-dependencies.multiversx-sc-modules] -version = "=0.45.2" +version = "=0.46.1" diff --git a/locked-asset/lkmex-transfer/meta/Cargo.toml b/locked-asset/lkmex-transfer/meta/Cargo.toml index 390ebcc9c..e0c0588d1 100644 --- a/locked-asset/lkmex-transfer/meta/Cargo.toml +++ b/locked-asset/lkmex-transfer/meta/Cargo.toml @@ -9,5 +9,5 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.2" +version = "0.46.1" default-features = false diff --git a/locked-asset/lkmex-transfer/wasm/Cargo.lock b/locked-asset/lkmex-transfer/wasm/Cargo.lock index c91018040..503d067d7 100644 --- a/locked-asset/lkmex-transfer/wasm/Cargo.lock +++ b/locked-asset/lkmex-transfer/wasm/Cargo.lock @@ -2,24 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "ahash" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - [[package]] name = "arrayvec" version = "0.7.4" @@ -38,12 +20,6 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - [[package]] name = "common_errors" version = "0.0.0" @@ -99,16 +75,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - [[package]] name = "hex" version = "0.4.3" @@ -168,12 +134,11 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +checksum = "6c94b173dc5ff0e157f767275fe6b7a1b4d2ad343bef7b66cd22a6353e016b93" dependencies = [ "bitflags", - "hashbrown", "hex-literal", "multiversx-sc-codec", "multiversx-sc-derive", @@ -204,9 +169,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +checksum = "3b78945957036c281ad6ee21bb5120dcefa2017688adf43ec94e3e7c982efb09" dependencies = [ "hex", "proc-macro2", @@ -217,18 +182,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +checksum = "c63ffaba95e630ff75981e2f5f50da64f523219b52f484234c66f3adc248885f" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +checksum = "9579f40c00da56a5a68e010ff851fa48ac7b9c6a16ad4314795cb32d889d9e78" dependencies = [ "multiversx-sc", ] @@ -251,12 +216,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - [[package]] name = "permissions_module" version = "0.0.0" @@ -350,29 +309,3 @@ dependencies = [ "mergeable", "multiversx-sc", ] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/locked-asset/lkmex-transfer/wasm/Cargo.toml b/locked-asset/lkmex-transfer/wasm/Cargo.toml index ee219ca64..dee74ceae 100644 --- a/locked-asset/lkmex-transfer/wasm/Cargo.toml +++ b/locked-asset/lkmex-transfer/wasm/Cargo.toml @@ -25,7 +25,7 @@ overflow-checks = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.2" +version = "=0.46.1" [workspace] members = ["."] diff --git a/locked-asset/locked-token-wrapper/Cargo.toml b/locked-asset/locked-token-wrapper/Cargo.toml index c71dcf00a..787914eeb 100644 --- a/locked-asset/locked-token-wrapper/Cargo.toml +++ b/locked-asset/locked-token-wrapper/Cargo.toml @@ -9,10 +9,10 @@ publish = false path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" [dependencies.multiversx-sc-modules] -version = "=0.45.2" +version = "=0.46.1" [dependencies.utils] path = "../../common/modules/utils" @@ -44,4 +44,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.2" +version = "=0.46.1" diff --git a/locked-asset/locked-token-wrapper/meta/Cargo.toml b/locked-asset/locked-token-wrapper/meta/Cargo.toml index 3ec2b3f73..6de0a4093 100644 --- a/locked-asset/locked-token-wrapper/meta/Cargo.toml +++ b/locked-asset/locked-token-wrapper/meta/Cargo.toml @@ -11,5 +11,5 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.2" +version = "0.46.1" default-features = false diff --git a/locked-asset/locked-token-wrapper/wasm/Cargo.lock b/locked-asset/locked-token-wrapper/wasm/Cargo.lock index cb009ea7d..eb6ca7c6e 100644 --- a/locked-asset/locked-token-wrapper/wasm/Cargo.lock +++ b/locked-asset/locked-token-wrapper/wasm/Cargo.lock @@ -2,24 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "ahash" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - [[package]] name = "arrayvec" version = "0.7.4" @@ -38,12 +20,6 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - [[package]] name = "common_errors" version = "0.0.0" @@ -107,16 +83,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - [[package]] name = "hex" version = "0.4.3" @@ -192,12 +158,11 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +checksum = "6c94b173dc5ff0e157f767275fe6b7a1b4d2ad343bef7b66cd22a6353e016b93" dependencies = [ "bitflags", - "hashbrown", "hex-literal", "multiversx-sc-codec", "multiversx-sc-derive", @@ -228,9 +193,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +checksum = "3b78945957036c281ad6ee21bb5120dcefa2017688adf43ec94e3e7c982efb09" dependencies = [ "hex", "proc-macro2", @@ -241,18 +206,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +checksum = "c63ffaba95e630ff75981e2f5f50da64f523219b52f484234c66f3adc248885f" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +checksum = "9579f40c00da56a5a68e010ff851fa48ac7b9c6a16ad4314795cb32d889d9e78" dependencies = [ "multiversx-sc", ] @@ -275,12 +240,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - [[package]] name = "permissions_module" version = "0.0.0" @@ -374,29 +333,3 @@ dependencies = [ "mergeable", "multiversx-sc", ] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/locked-asset/locked-token-wrapper/wasm/Cargo.toml b/locked-asset/locked-token-wrapper/wasm/Cargo.toml index 41a6c6061..0d10a2666 100644 --- a/locked-asset/locked-token-wrapper/wasm/Cargo.toml +++ b/locked-asset/locked-token-wrapper/wasm/Cargo.toml @@ -25,7 +25,7 @@ overflow-checks = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.2" +version = "=0.46.1" [workspace] members = ["."] diff --git a/locked-asset/proxy_dex/Cargo.toml b/locked-asset/proxy_dex/Cargo.toml index d25a5cd7c..5c52745d9 100644 --- a/locked-asset/proxy_dex/Cargo.toml +++ b/locked-asset/proxy_dex/Cargo.toml @@ -45,11 +45,11 @@ path = "../../common/traits/mergeable" path = "../../common/traits/fixed-supply-token" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.45.2" +version = "=0.46.1" [dependencies.energy-factory] path = "../energy-factory" @@ -69,7 +69,7 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.2" +version = "=0.46.1" [dev-dependencies.pausable] path = "../../common/modules/pausable" diff --git a/locked-asset/proxy_dex/meta/Cargo.toml b/locked-asset/proxy_dex/meta/Cargo.toml index 3854ed332..41fea1fc8 100644 --- a/locked-asset/proxy_dex/meta/Cargo.toml +++ b/locked-asset/proxy_dex/meta/Cargo.toml @@ -9,5 +9,5 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.2" +version = "0.46.1" default-features = false diff --git a/locked-asset/proxy_dex/wasm/Cargo.lock b/locked-asset/proxy_dex/wasm/Cargo.lock index c80d34596..2a639b9c3 100644 --- a/locked-asset/proxy_dex/wasm/Cargo.lock +++ b/locked-asset/proxy_dex/wasm/Cargo.lock @@ -2,24 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "ahash" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - [[package]] name = "arrayvec" version = "0.7.4" @@ -38,12 +20,6 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - [[package]] name = "common-types" version = "0.0.0" @@ -276,16 +252,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - [[package]] name = "hex" version = "0.4.3" @@ -341,12 +307,11 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +checksum = "6c94b173dc5ff0e157f767275fe6b7a1b4d2ad343bef7b66cd22a6353e016b93" dependencies = [ "bitflags", - "hashbrown", "hex-literal", "multiversx-sc-codec", "multiversx-sc-derive", @@ -377,9 +342,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +checksum = "3b78945957036c281ad6ee21bb5120dcefa2017688adf43ec94e3e7c982efb09" dependencies = [ "hex", "proc-macro2", @@ -390,18 +355,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +checksum = "c63ffaba95e630ff75981e2f5f50da64f523219b52f484234c66f3adc248885f" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +checksum = "9579f40c00da56a5a68e010ff851fa48ac7b9c6a16ad4314795cb32d889d9e78" dependencies = [ "multiversx-sc", ] @@ -424,12 +389,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - [[package]] name = "pair" version = "0.0.0" @@ -611,12 +570,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -636,23 +589,3 @@ dependencies = [ "unwrappable", "week-timekeeping", ] - -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/locked-asset/proxy_dex/wasm/Cargo.toml b/locked-asset/proxy_dex/wasm/Cargo.toml index 13e9c1afd..b0753d94f 100644 --- a/locked-asset/proxy_dex/wasm/Cargo.toml +++ b/locked-asset/proxy_dex/wasm/Cargo.toml @@ -25,7 +25,7 @@ overflow-checks = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.2" +version = "=0.46.1" [workspace] members = ["."] diff --git a/locked-asset/simple-lock-whitelist/Cargo.toml b/locked-asset/simple-lock-whitelist/Cargo.toml index fdaf54bdc..a8d637a5c 100644 --- a/locked-asset/simple-lock-whitelist/Cargo.toml +++ b/locked-asset/simple-lock-whitelist/Cargo.toml @@ -15,11 +15,11 @@ path = "../simple-lock" path = "../../common/modules/utils" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.45.2" +version = "=0.46.1" [dev-dependencies] num-bigint = "0.4.2" @@ -27,4 +27,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.2" +version = "=0.46.1" diff --git a/locked-asset/simple-lock-whitelist/meta/Cargo.toml b/locked-asset/simple-lock-whitelist/meta/Cargo.toml index 819edb911..8b95c8a50 100644 --- a/locked-asset/simple-lock-whitelist/meta/Cargo.toml +++ b/locked-asset/simple-lock-whitelist/meta/Cargo.toml @@ -9,5 +9,5 @@ authors = ["Dorin Iancu "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.2" +version = "0.46.1" default-features = false diff --git a/locked-asset/simple-lock-whitelist/wasm/Cargo.lock b/locked-asset/simple-lock-whitelist/wasm/Cargo.lock index e8a814fff..e6300116a 100644 --- a/locked-asset/simple-lock-whitelist/wasm/Cargo.lock +++ b/locked-asset/simple-lock-whitelist/wasm/Cargo.lock @@ -2,24 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "ahash" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - [[package]] name = "arrayvec" version = "0.7.4" @@ -38,12 +20,6 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - [[package]] name = "common_structs" version = "0.0.0" @@ -68,16 +44,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - [[package]] name = "hex" version = "0.4.3" @@ -106,12 +72,11 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +checksum = "6c94b173dc5ff0e157f767275fe6b7a1b4d2ad343bef7b66cd22a6353e016b93" dependencies = [ "bitflags", - "hashbrown", "hex-literal", "multiversx-sc-codec", "multiversx-sc-derive", @@ -142,9 +107,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +checksum = "3b78945957036c281ad6ee21bb5120dcefa2017688adf43ec94e3e7c982efb09" dependencies = [ "hex", "proc-macro2", @@ -155,18 +120,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +checksum = "c63ffaba95e630ff75981e2f5f50da64f523219b52f484234c66f3adc248885f" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +checksum = "9579f40c00da56a5a68e010ff851fa48ac7b9c6a16ad4314795cb32d889d9e78" dependencies = [ "multiversx-sc", ] @@ -189,12 +154,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - [[package]] name = "proc-macro2" version = "1.0.75" @@ -289,29 +248,3 @@ dependencies = [ "mergeable", "multiversx-sc", ] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/locked-asset/simple-lock-whitelist/wasm/Cargo.toml b/locked-asset/simple-lock-whitelist/wasm/Cargo.toml index 9ad07950d..068857df3 100644 --- a/locked-asset/simple-lock-whitelist/wasm/Cargo.toml +++ b/locked-asset/simple-lock-whitelist/wasm/Cargo.toml @@ -25,7 +25,7 @@ overflow-checks = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.2" +version = "=0.46.1" [workspace] members = ["."] diff --git a/locked-asset/simple-lock/Cargo.toml b/locked-asset/simple-lock/Cargo.toml index a31f8d814..8f6b5bd1d 100644 --- a/locked-asset/simple-lock/Cargo.toml +++ b/locked-asset/simple-lock/Cargo.toml @@ -9,11 +9,11 @@ publish = false path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.45.2" +version = "=0.46.1" [dependencies.common_structs] path = "../../common/common_structs" @@ -24,4 +24,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.2" +version = "=0.46.1" diff --git a/locked-asset/simple-lock/meta/Cargo.toml b/locked-asset/simple-lock/meta/Cargo.toml index 4321eba25..889dce931 100644 --- a/locked-asset/simple-lock/meta/Cargo.toml +++ b/locked-asset/simple-lock/meta/Cargo.toml @@ -9,5 +9,5 @@ authors = ["Dorin Iancu "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.2" +version = "0.46.1" default-features = false diff --git a/locked-asset/simple-lock/wasm/Cargo.lock b/locked-asset/simple-lock/wasm/Cargo.lock index 8cada7e64..e5957696c 100644 --- a/locked-asset/simple-lock/wasm/Cargo.lock +++ b/locked-asset/simple-lock/wasm/Cargo.lock @@ -2,24 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "ahash" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - [[package]] name = "arrayvec" version = "0.7.4" @@ -38,12 +20,6 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - [[package]] name = "common_structs" version = "0.0.0" @@ -68,16 +44,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - [[package]] name = "hex" version = "0.4.3" @@ -106,12 +72,11 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +checksum = "6c94b173dc5ff0e157f767275fe6b7a1b4d2ad343bef7b66cd22a6353e016b93" dependencies = [ "bitflags", - "hashbrown", "hex-literal", "multiversx-sc-codec", "multiversx-sc-derive", @@ -142,9 +107,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +checksum = "3b78945957036c281ad6ee21bb5120dcefa2017688adf43ec94e3e7c982efb09" dependencies = [ "hex", "proc-macro2", @@ -155,18 +120,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +checksum = "c63ffaba95e630ff75981e2f5f50da64f523219b52f484234c66f3adc248885f" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +checksum = "9579f40c00da56a5a68e010ff851fa48ac7b9c6a16ad4314795cb32d889d9e78" dependencies = [ "multiversx-sc", ] @@ -189,12 +154,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - [[package]] name = "proc-macro2" version = "1.0.75" @@ -269,29 +228,3 @@ version = "0.0.0" dependencies = [ "multiversx-sc", ] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/locked-asset/simple-lock/wasm/Cargo.toml b/locked-asset/simple-lock/wasm/Cargo.toml index 1c3883676..cc2cf0244 100644 --- a/locked-asset/simple-lock/wasm/Cargo.toml +++ b/locked-asset/simple-lock/wasm/Cargo.toml @@ -25,7 +25,7 @@ overflow-checks = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.2" +version = "=0.46.1" [workspace] members = ["."] diff --git a/locked-asset/token-unstake/Cargo.toml b/locked-asset/token-unstake/Cargo.toml index ae26ec3ea..da727566e 100644 --- a/locked-asset/token-unstake/Cargo.toml +++ b/locked-asset/token-unstake/Cargo.toml @@ -9,7 +9,7 @@ publish = false path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.mergeable] @@ -39,7 +39,7 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.2" +version = "=0.46.1" [dev-dependencies.multiversx-sc-modules] -version = "=0.45.2" +version = "=0.46.1" diff --git a/locked-asset/token-unstake/meta/Cargo.toml b/locked-asset/token-unstake/meta/Cargo.toml index afe467638..fb4914c3d 100644 --- a/locked-asset/token-unstake/meta/Cargo.toml +++ b/locked-asset/token-unstake/meta/Cargo.toml @@ -9,5 +9,5 @@ publish = false path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.2" +version = "0.46.1" default-features = false diff --git a/locked-asset/token-unstake/wasm/Cargo.lock b/locked-asset/token-unstake/wasm/Cargo.lock index fa34f81c3..d74f133fa 100644 --- a/locked-asset/token-unstake/wasm/Cargo.lock +++ b/locked-asset/token-unstake/wasm/Cargo.lock @@ -2,24 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "ahash" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - [[package]] name = "arrayvec" version = "0.7.4" @@ -38,12 +20,6 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - [[package]] name = "common-types" version = "0.0.0" @@ -106,16 +82,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - [[package]] name = "hex" version = "0.4.3" @@ -153,12 +119,11 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +checksum = "6c94b173dc5ff0e157f767275fe6b7a1b4d2ad343bef7b66cd22a6353e016b93" dependencies = [ "bitflags", - "hashbrown", "hex-literal", "multiversx-sc-codec", "multiversx-sc-derive", @@ -189,9 +154,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +checksum = "3b78945957036c281ad6ee21bb5120dcefa2017688adf43ec94e3e7c982efb09" dependencies = [ "hex", "proc-macro2", @@ -202,18 +167,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +checksum = "c63ffaba95e630ff75981e2f5f50da64f523219b52f484234c66f3adc248885f" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +checksum = "9579f40c00da56a5a68e010ff851fa48ac7b9c6a16ad4314795cb32d889d9e78" dependencies = [ "multiversx-sc", ] @@ -236,12 +201,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - [[package]] name = "proc-macro2" version = "1.0.75" @@ -349,12 +308,6 @@ dependencies = [ "multiversx-sc", ] -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - [[package]] name = "week-timekeeping" version = "0.0.0" @@ -362,23 +315,3 @@ dependencies = [ "common-types", "multiversx-sc", ] - -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/locked-asset/token-unstake/wasm/Cargo.toml b/locked-asset/token-unstake/wasm/Cargo.toml index 38875a352..f3e21bb9b 100644 --- a/locked-asset/token-unstake/wasm/Cargo.toml +++ b/locked-asset/token-unstake/wasm/Cargo.toml @@ -25,7 +25,7 @@ overflow-checks = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.2" +version = "=0.46.1" [workspace] members = ["."] diff --git a/pause-all/Cargo.toml b/pause-all/Cargo.toml index 97c036824..30046978d 100644 --- a/pause-all/Cargo.toml +++ b/pause-all/Cargo.toml @@ -12,14 +12,14 @@ path = "src/lib.rs" path = "../common/modules/pausable" [dependencies.multiversx-sc] -version = "=0.45.2" +version = "=0.46.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.45.2" +version = "=0.46.1" [dev-dependencies.multiversx-sc-scenario] -version = "=0.45.2" +version = "=0.46.1" [dev-dependencies.farm] path = "../dex/farm" diff --git a/pause-all/meta/Cargo.toml b/pause-all/meta/Cargo.toml index c31e82073..f6be6643e 100644 --- a/pause-all/meta/Cargo.toml +++ b/pause-all/meta/Cargo.toml @@ -11,5 +11,5 @@ authors = ["MultiversX "] path = ".." [dependencies.multiversx-sc-meta] -version = "0.45.2" +version = "0.46.1" default-features = false diff --git a/pause-all/wasm/Cargo.lock b/pause-all/wasm/Cargo.lock index 4752182b8..d1b8021d6 100644 --- a/pause-all/wasm/Cargo.lock +++ b/pause-all/wasm/Cargo.lock @@ -2,24 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "ahash" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - -[[package]] -name = "allocator-api2" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" - [[package]] name = "arrayvec" version = "0.7.4" @@ -38,12 +20,6 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - [[package]] name = "common_errors" version = "0.0.0" @@ -57,16 +33,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -dependencies = [ - "ahash", - "allocator-api2", -] - [[package]] name = "hex" version = "0.4.3" @@ -81,12 +47,11 @@ checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "multiversx-sc" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2bdb196b3ff2b9f8c744ec2e026c22c8e02bc91e5c6ed09951415c47fef6b8" +checksum = "6c94b173dc5ff0e157f767275fe6b7a1b4d2ad343bef7b66cd22a6353e016b93" dependencies = [ "bitflags", - "hashbrown", "hex-literal", "multiversx-sc-codec", "multiversx-sc-derive", @@ -117,9 +82,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e60b5dce707f61376f74d713218f75326121d9f6a5f09a3a63de7aea2a92be9" +checksum = "3b78945957036c281ad6ee21bb5120dcefa2017688adf43ec94e3e7c982efb09" dependencies = [ "hex", "proc-macro2", @@ -130,18 +95,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5833f8bc88104357d38a8952d2a16c3e66080e2e512c0e7001c0c003006c475" +checksum = "c63ffaba95e630ff75981e2f5f50da64f523219b52f484234c66f3adc248885f" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.45.2" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4299660d5413d9f120bfddda8105b1f9d28f0345a72f53e5dc90732c4983e45" +checksum = "9579f40c00da56a5a68e010ff851fa48ac7b9c6a16ad4314795cb32d889d9e78" dependencies = [ "multiversx-sc", ] @@ -164,12 +129,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - [[package]] name = "pausable" version = "0.0.0" @@ -254,29 +213,3 @@ name = "unicode-ident" version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "zerocopy" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/pause-all/wasm/Cargo.toml b/pause-all/wasm/Cargo.toml index f2dc3107e..ccffee39c 100644 --- a/pause-all/wasm/Cargo.toml +++ b/pause-all/wasm/Cargo.toml @@ -25,7 +25,7 @@ overflow-checks = false path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.45.2" +version = "=0.46.1" [workspace] members = ["."] From c0310130e3a20aa8045405482b913eacea3775dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Mon, 22 Jan 2024 09:33:20 +0200 Subject: [PATCH 152/213] Add withdraw functionality for metastaking rewards --- .../farm-staking/src/custom_rewards.rs | 19 ++++++++++++++ farm-staking/farm-staking/src/lib.rs | 2 +- .../tests/farm_staking_setup/mod.rs | 25 +++++++++++++++++++ .../farm-staking/tests/farm_staking_test.rs | 22 ++++++++++++++-- 4 files changed, 65 insertions(+), 3 deletions(-) diff --git a/farm-staking/farm-staking/src/custom_rewards.rs b/farm-staking/farm-staking/src/custom_rewards.rs index de7fd29a0..8e4d538dc 100644 --- a/farm-staking/farm-staking/src/custom_rewards.rs +++ b/farm-staking/farm-staking/src/custom_rewards.rs @@ -43,6 +43,25 @@ pub trait CustomRewardsModule: self.reward_capacity().update(|r| *r += payment_amount); } + #[payable("*")] + #[endpoint(withdrawRewards)] + fn withdraw_rewards(&self, withdraw_amount: BigUint) { + self.require_caller_has_admin_permissions(); + + self.reward_capacity().update(|rewards| { + require!( + *rewards >= withdraw_amount, + "Not enough rewards to withdraw" + ); + + *rewards -= withdraw_amount.clone() + }); + + let caller = self.blockchain().get_caller(); + let reward_token_id = self.reward_token_id().get(); + self.send_tokens_non_zero(&caller, &reward_token_id, 0, &withdraw_amount); + } + #[endpoint(endProduceRewards)] fn end_produce_rewards(&self) { self.require_caller_has_admin_permissions(); diff --git a/farm-staking/farm-staking/src/lib.rs b/farm-staking/farm-staking/src/lib.rs index 33f5bbd1a..ac1f23727 100644 --- a/farm-staking/farm-staking/src/lib.rs +++ b/farm-staking/farm-staking/src/lib.rs @@ -123,7 +123,7 @@ pub trait FarmStaking: (merged_farm_token, boosted_rewards_payment).into() } - + #[view(calculateRewardsForGivenPosition)] fn calculate_rewards_for_given_position( &self, diff --git a/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs b/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs index 51841149f..2a1109add 100644 --- a/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs +++ b/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs @@ -416,6 +416,18 @@ where .assert_ok(); } + pub fn check_rewards_capacity(&mut self, expected_farm_token_supply: u64) { + self.b_mock + .execute_query(&self.farm_wrapper, |sc| { + let actual_farm_supply = sc.reward_capacity().get(); + assert_eq!( + managed_biguint!(expected_farm_token_supply), + actual_farm_supply + ); + }) + .assert_ok(); + } + pub fn allow_external_claim_rewards(&mut self, user: &Address) { self.b_mock .execute_tx(user, &self.farm_wrapper, &rust_biguint!(0), |sc| { @@ -490,4 +502,17 @@ where ) .assert_ok(); } + + pub fn withdraw_rewards(&mut self, withdraw_amount: &RustBigUint) { + self.b_mock + .execute_tx( + &self.owner_address, + &self.farm_wrapper, + &rust_biguint!(0), + |sc| { + sc.withdraw_rewards(withdraw_amount.into()); + }, + ) + .assert_ok(); + } } diff --git a/farm-staking/farm-staking/tests/farm_staking_test.rs b/farm-staking/farm-staking/tests/farm_staking_test.rs index ed0925510..6de87b547 100644 --- a/farm-staking/farm-staking/tests/farm_staking_test.rs +++ b/farm-staking/farm-staking/tests/farm_staking_test.rs @@ -1,10 +1,12 @@ #![allow(deprecated)] -use multiversx_sc_scenario::{rust_biguint, whitebox_legacy::TxTokenTransfer, DebugApi}; +use multiversx_sc_scenario::{ + managed_address, rust_biguint, whitebox_legacy::TxTokenTransfer, DebugApi, +}; pub mod farm_staking_setup; use farm_staking::{ - custom_rewards::{BLOCKS_IN_YEAR, MAX_PERCENT}, + custom_rewards::{CustomRewardsModule, BLOCKS_IN_YEAR, MAX_PERCENT}, token_attributes::UnbondSftAttributes, }; use farm_staking_setup::*; @@ -231,3 +233,19 @@ fn test_unbond() { USER_TOTAL_RIDE_TOKENS + expected_rewards, ); } + +#[test] +fn test_withdraw_rewards() { + DebugApi::dummy(); + let mut farm_setup = + FarmStakingSetup::new(farm_staking::contract_obj, energy_factory::contract_obj); + + let initial_rewards_capacity = 1_000_000_000_000u64; + farm_setup.check_rewards_capacity(initial_rewards_capacity); + + let withdraw_amount = rust_biguint!(TOTAL_REWARDS_AMOUNT); + farm_setup.withdraw_rewards(&withdraw_amount); + + let final_rewards_capacity = 0u64; + farm_setup.check_rewards_capacity(final_rewards_capacity); +} From de9708d45fd3a8d8fc458c8449d70e61d419e765 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Mon, 22 Jan 2024 11:49:43 +0200 Subject: [PATCH 153/213] clippy fixes --- farm-staking/farm-staking/tests/farm_staking_test.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/farm-staking/farm-staking/tests/farm_staking_test.rs b/farm-staking/farm-staking/tests/farm_staking_test.rs index 6de87b547..c0bdfb803 100644 --- a/farm-staking/farm-staking/tests/farm_staking_test.rs +++ b/farm-staking/farm-staking/tests/farm_staking_test.rs @@ -1,12 +1,12 @@ #![allow(deprecated)] use multiversx_sc_scenario::{ - managed_address, rust_biguint, whitebox_legacy::TxTokenTransfer, DebugApi, + rust_biguint, whitebox_legacy::TxTokenTransfer, DebugApi, }; pub mod farm_staking_setup; use farm_staking::{ - custom_rewards::{CustomRewardsModule, BLOCKS_IN_YEAR, MAX_PERCENT}, + custom_rewards::{BLOCKS_IN_YEAR, MAX_PERCENT}, token_attributes::UnbondSftAttributes, }; use farm_staking_setup::*; From 68f6a9b260a914acb69beb3cb6399a66484c2de0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Mon, 22 Jan 2024 19:18:51 +0200 Subject: [PATCH 154/213] Simple lock: Add endpoints that breaks farm exit_farm_locked_token_to_tokens - will break farm into lp and lp into initial tokens --- locked-asset/simple-lock/src/proxy_farm.rs | 75 +++++++++++++++++++++- locked-asset/simple-lock/src/proxy_lp.rs | 22 +++++-- 2 files changed, 92 insertions(+), 5 deletions(-) diff --git a/locked-asset/simple-lock/src/proxy_farm.rs b/locked-asset/simple-lock/src/proxy_farm.rs index c6ab28659..9fd4e906b 100644 --- a/locked-asset/simple-lock/src/proxy_farm.rs +++ b/locked-asset/simple-lock/src/proxy_farm.rs @@ -1,7 +1,10 @@ multiversx_sc::imports!(); multiversx_sc::derive_imports!(); -use crate::{error_messages::*, proxy_lp::LpProxyTokenAttributes}; +use crate::{ + error_messages::*, + proxy_lp::{LpProxyTokenAttributes, RemoveLiquidityThroughProxyResultType}, +}; #[derive( TypeAbi, TopEncode, TopDecode, NestedEncode, NestedDecode, PartialEq, Debug, Clone, Copy, @@ -248,6 +251,76 @@ pub trait ProxyFarmModule: (lp_proxy_token_payment, exit_farm_result.reward_tokens).into() } + /// Exit a farm previously entered through `enterFarmLockedToken`. + /// + /// Expected payment: FARM_PROXY tokens + /// + /// Output Payments: + /// - original tokens + /// - farm reward tokens + #[payable("*")] + #[endpoint(exitFarmLockedTokenToTokens)] + fn exit_farm_locked_token_to_tokens( + &self, + first_token_min_amount_out: BigUint, + second_token_min_amont_out: BigUint, + ) -> RemoveLiquidityThroughProxyResultType { + let payment: EsdtTokenPayment = self.call_value().single_esdt(); + + let farm_proxy_token_attributes: FarmProxyTokenAttributes = + self.validate_payment_and_get_farm_proxy_token_attributes(&payment); + + let farm_address = self.try_get_farm_address( + &farm_proxy_token_attributes.farming_token_id, + farm_proxy_token_attributes.farm_type, + ); + let caller = self.blockchain().get_caller(); + let exit_farm_result = self.call_farm_exit( + farm_address, + farm_proxy_token_attributes.farm_token_id, + farm_proxy_token_attributes.farm_token_nonce, + payment.amount, + caller.clone(), + ); + require!( + exit_farm_result.initial_farming_tokens.token_identifier + == farm_proxy_token_attributes.farming_token_id, + INVALID_PAYMENTS_RECEIVED_FROM_FARM_ERR_MSG + ); + + if exit_farm_result.reward_tokens.amount > 0 { + self.send().direct_esdt( + &caller, + &exit_farm_result.reward_tokens.token_identifier, + exit_farm_result.reward_tokens.token_nonce, + &exit_farm_result.reward_tokens.amount, + ); + } + + let remove_liquidity_result = self.remove_liquidity_locked_token_common( + exit_farm_result.initial_farming_tokens, + first_token_min_amount_out, + second_token_min_amont_out, + ); + + // let lp_proxy_token = self.lp_proxy_token(); + + // let lp_proxy_token_payment = EsdtTokenPayment::new( + // lp_proxy_token.get_token_id(), + // farm_proxy_token_attributes.farming_token_locked_nonce, + // exit_farm_result.initial_farming_tokens.amount, + // ); + // self.send().direct_esdt( + // &caller, + // &lp_proxy_token_payment.token_identifier, + // lp_proxy_token_payment.token_nonce, + // &lp_proxy_token_payment.amount, + // ); + + // (lp_proxy_token_payment, exit_farm_result.reward_tokens).into() + remove_liquidity_result + } + /// Claim rewards from a previously entered farm. /// The FARM_PROXY tokens are burned, and new ones are created. /// This is needed because every farm action changes the farm token nonce diff --git a/locked-asset/simple-lock/src/proxy_lp.rs b/locked-asset/simple-lock/src/proxy_lp.rs index 9d6e4e599..4f85130f6 100644 --- a/locked-asset/simple-lock/src/proxy_lp.rs +++ b/locked-asset/simple-lock/src/proxy_lp.rs @@ -236,12 +236,26 @@ pub trait ProxyLpModule: second_token_amount_min: BigUint, ) -> RemoveLiquidityThroughProxyResultType { let payment: EsdtTokenPayment = self.call_value().single_esdt(); + + self.remove_liquidity_locked_token_common( + payment, + first_token_amount_min, + second_token_amount_min, + ) + } + + fn remove_liquidity_locked_token_common( + &self, + input_payment: EsdtTokenPayment, + first_token_amount_min: BigUint, + second_token_amount_min: BigUint, + ) -> RemoveLiquidityThroughProxyResultType { let lp_proxy_token_mapper = self.lp_proxy_token(); - lp_proxy_token_mapper.require_same_token(&payment.token_identifier); + lp_proxy_token_mapper.require_same_token(&input_payment.token_identifier); let lp_proxy_token_attributes: LpProxyTokenAttributes = - lp_proxy_token_mapper.get_token_attributes(payment.token_nonce); - lp_proxy_token_mapper.nft_burn(payment.token_nonce, &payment.amount); + lp_proxy_token_mapper.get_token_attributes(input_payment.token_nonce); + lp_proxy_token_mapper.nft_burn(input_payment.token_nonce, &input_payment.amount); let lp_address = self .lp_address_for_token_pair( @@ -249,7 +263,7 @@ pub trait ProxyLpModule: &lp_proxy_token_attributes.second_token_id, ) .get(); - let lp_token_amount = payment.amount; + let lp_token_amount = input_payment.amount; let remove_liq_result = self.call_pair_remove_liquidity( lp_address, lp_proxy_token_attributes.lp_token_id, From 670a8a5fd33b548056193f7019542293fb8e0112 Mon Sep 17 00:00:00 2001 From: Dorin Marian Iancu Date: Thu, 25 Jan 2024 10:10:35 +0200 Subject: [PATCH 155/213] add initial liq --- dex/pair/src/lib.rs | 86 ++---------------- dex/pair/src/pair_actions/common_methods.rs | 11 +++ .../src/pair_actions/common_result_types.rs | 10 +++ dex/pair/src/pair_actions/initial_liq.rs | 87 +++++++++++++++++++ dex/pair/src/pair_actions/mod.rs | 3 + dex/pair/wasm-pair-full/src/lib.rs | 2 +- dex/pair/wasm/src/lib.rs | 2 +- dex/router/tests/router_test.rs | 2 +- .../src/external_contracts_interactions.rs | 5 +- .../proxy_dex/src/pair_interactions.rs | 5 +- 10 files changed, 128 insertions(+), 85 deletions(-) create mode 100644 dex/pair/src/pair_actions/common_methods.rs create mode 100644 dex/pair/src/pair_actions/common_result_types.rs create mode 100644 dex/pair/src/pair_actions/initial_liq.rs create mode 100644 dex/pair/src/pair_actions/mod.rs diff --git a/dex/pair/src/lib.rs b/dex/pair/src/lib.rs index 9b800e67a..2cd827740 100644 --- a/dex/pair/src/lib.rs +++ b/dex/pair/src/lib.rs @@ -11,6 +11,7 @@ mod events; pub mod fee; mod liquidity_pool; pub mod locking_wrapper; +pub mod pair_actions; pub mod safe_price; pub mod safe_price_view; @@ -18,23 +19,15 @@ use crate::contexts::add_liquidity::AddLiquidityContext; use crate::contexts::remove_liquidity::RemoveLiquidityContext; use crate::errors::*; -use common_errors::ERROR_PERMISSION_DENIED; use contexts::base::*; use contexts::swap::SwapContext; +use pair_actions::common_result_types::{ + AddLiquidityResultType, RemoveLiquidityResultType, SwapTokensFixedInputResultType, + SwapTokensFixedOutputResultType, +}; use pausable::State; use permissions_module::Permissions; -pub type AddLiquidityResultType = - MultiValue3, EsdtTokenPayment, EsdtTokenPayment>; - -pub type RemoveLiquidityResultType = - MultiValue2, EsdtTokenPayment>; - -pub type SwapTokensFixedInputResultType = EsdtTokenPayment; - -pub type SwapTokensFixedOutputResultType = - MultiValue2, EsdtTokenPayment>; - #[multiversx_sc::contract] pub trait Pair: amm::AmmModule @@ -49,6 +42,8 @@ pub trait Pair: + locking_wrapper::LockingWrapperModule + permissions_module::PermissionsModule + pausable::PausableModule + + pair_actions::initial_liq::InitialLiquidityModule + + pair_actions::common_methods::CommonMethodsModule { #[init] fn init( @@ -105,68 +100,6 @@ pub trait Pair: #[endpoint] fn upgrade(&self) {} - #[payable("*")] - #[endpoint(addInitialLiquidity)] - fn add_initial_liquidity(&self) -> AddLiquidityResultType { - let mut storage_cache = StorageCache::new(self); - let caller = self.blockchain().get_caller(); - - let opt_initial_liq_adder = self.initial_liquidity_adder().get(); - if let Some(initial_liq_adder) = opt_initial_liq_adder { - require!(caller == initial_liq_adder, ERROR_PERMISSION_DENIED); - } - - let [first_payment, second_payment] = self.call_value().multi_esdt(); - require!( - first_payment.token_identifier == storage_cache.first_token_id - && first_payment.amount > 0, - ERROR_BAD_PAYMENT_TOKENS - ); - require!( - second_payment.token_identifier == storage_cache.second_token_id - && second_payment.amount > 0, - ERROR_BAD_PAYMENT_TOKENS - ); - require!( - !self.is_state_active(storage_cache.contract_state), - ERROR_ACTIVE - ); - require!( - storage_cache.lp_token_supply == 0, - ERROR_INITIAL_LIQUIDITY_ALREADY_ADDED - ); - - let first_token_optimal_amount = &first_payment.amount; - let second_token_optimal_amount = &second_payment.amount; - let liq_added = self.pool_add_initial_liquidity( - first_token_optimal_amount, - second_token_optimal_amount, - &mut storage_cache, - ); - - self.send() - .esdt_local_mint(&storage_cache.lp_token_id, 0, &liq_added); - self.send() - .direct_esdt(&caller, &storage_cache.lp_token_id, 0, &liq_added); - - self.state().set(State::PartialActive); - - let add_liq_context = AddLiquidityContext { - first_payment: first_payment.clone(), - second_payment: second_payment.clone(), - first_token_amount_min: BigUint::from(1u32), - second_token_amount_min: BigUint::from(1u32), - first_token_optimal_amount: first_token_optimal_amount.clone(), - second_token_optimal_amount: second_token_optimal_amount.clone(), - liq_added, - }; - let output = self.build_add_initial_liq_results(&storage_cache, &add_liq_context); - - self.emit_add_liquidity_event(&storage_cache, add_liq_context); - - output - } - #[payable("*")] #[endpoint(addLiquidity)] fn add_liquidity( @@ -675,11 +608,6 @@ pub trait Pair: } } - #[inline] - fn is_state_active(&self, state: State) -> bool { - state == State::Active || state == State::PartialActive - } - #[inline] fn can_swap(&self, state: State) -> bool { state == State::Active diff --git a/dex/pair/src/pair_actions/common_methods.rs b/dex/pair/src/pair_actions/common_methods.rs new file mode 100644 index 000000000..5d145e9bc --- /dev/null +++ b/dex/pair/src/pair_actions/common_methods.rs @@ -0,0 +1,11 @@ +use pausable::State; + +multiversx_sc::imports!(); + +#[multiversx_sc::module] +pub trait CommonMethodsModule { + #[inline] + fn is_state_active(&self, state: State) -> bool { + state == State::Active || state == State::PartialActive + } +} diff --git a/dex/pair/src/pair_actions/common_result_types.rs b/dex/pair/src/pair_actions/common_result_types.rs new file mode 100644 index 000000000..7fb6407b0 --- /dev/null +++ b/dex/pair/src/pair_actions/common_result_types.rs @@ -0,0 +1,10 @@ +multiversx_sc::imports!(); + +pub type AddLiquidityResultType = + MultiValue3, EsdtTokenPayment, EsdtTokenPayment>; + +pub type RemoveLiquidityResultType = MultiValue2, EsdtTokenPayment>; + +pub type SwapTokensFixedInputResultType = EsdtTokenPayment; + +pub type SwapTokensFixedOutputResultType = MultiValue2, EsdtTokenPayment>; diff --git a/dex/pair/src/pair_actions/initial_liq.rs b/dex/pair/src/pair_actions/initial_liq.rs new file mode 100644 index 000000000..e98cbb61e --- /dev/null +++ b/dex/pair/src/pair_actions/initial_liq.rs @@ -0,0 +1,87 @@ +use common_errors::ERROR_PERMISSION_DENIED; +use pausable::State; + +use crate::{ + contexts::add_liquidity::AddLiquidityContext, StorageCache, ERROR_ACTIVE, + ERROR_BAD_PAYMENT_TOKENS, ERROR_INITIAL_LIQUIDITY_ALREADY_ADDED, +}; + +use super::common_result_types::AddLiquidityResultType; + +multiversx_sc::imports!(); + +#[multiversx_sc::module] +pub trait InitialLiquidityModule: + crate::liquidity_pool::LiquidityPoolModule + + crate::amm::AmmModule + + crate::contexts::output_builder::OutputBuilderModule + + crate::locking_wrapper::LockingWrapperModule + + crate::events::EventsModule + + crate::config::ConfigModule + + token_send::TokenSendModule + + permissions_module::PermissionsModule + + pausable::PausableModule + + super::common_methods::CommonMethodsModule +{ + #[payable("*")] + #[endpoint(addInitialLiquidity)] + fn add_initial_liquidity(&self) -> AddLiquidityResultType { + let mut storage_cache = StorageCache::new(self); + let caller = self.blockchain().get_caller(); + + let opt_initial_liq_adder = self.initial_liquidity_adder().get(); + if let Some(initial_liq_adder) = opt_initial_liq_adder { + require!(caller == initial_liq_adder, ERROR_PERMISSION_DENIED); + } + + let [first_payment, second_payment] = self.call_value().multi_esdt(); + require!( + first_payment.token_identifier == storage_cache.first_token_id + && first_payment.amount > 0, + ERROR_BAD_PAYMENT_TOKENS + ); + require!( + second_payment.token_identifier == storage_cache.second_token_id + && second_payment.amount > 0, + ERROR_BAD_PAYMENT_TOKENS + ); + require!( + !self.is_state_active(storage_cache.contract_state), + ERROR_ACTIVE + ); + require!( + storage_cache.lp_token_supply == 0, + ERROR_INITIAL_LIQUIDITY_ALREADY_ADDED + ); + + let first_token_optimal_amount = &first_payment.amount; + let second_token_optimal_amount = &second_payment.amount; + let liq_added = self.pool_add_initial_liquidity( + first_token_optimal_amount, + second_token_optimal_amount, + &mut storage_cache, + ); + + self.send() + .esdt_local_mint(&storage_cache.lp_token_id, 0, &liq_added); + self.send() + .direct_esdt(&caller, &storage_cache.lp_token_id, 0, &liq_added); + + self.state().set(State::PartialActive); + + let add_liq_context = AddLiquidityContext { + first_payment: first_payment.clone(), + second_payment: second_payment.clone(), + first_token_amount_min: BigUint::from(1u32), + second_token_amount_min: BigUint::from(1u32), + first_token_optimal_amount: first_token_optimal_amount.clone(), + second_token_optimal_amount: second_token_optimal_amount.clone(), + liq_added, + }; + let output = self.build_add_initial_liq_results(&storage_cache, &add_liq_context); + + self.emit_add_liquidity_event(&storage_cache, add_liq_context); + + output + } +} diff --git a/dex/pair/src/pair_actions/mod.rs b/dex/pair/src/pair_actions/mod.rs new file mode 100644 index 000000000..e05e00482 --- /dev/null +++ b/dex/pair/src/pair_actions/mod.rs @@ -0,0 +1,3 @@ +pub mod common_methods; +pub mod common_result_types; +pub mod initial_liq; diff --git a/dex/pair/wasm-pair-full/src/lib.rs b/dex/pair/wasm-pair-full/src/lib.rs index 17b626ecc..fe3d65503 100644 --- a/dex/pair/wasm-pair-full/src/lib.rs +++ b/dex/pair/wasm-pair-full/src/lib.rs @@ -21,7 +21,6 @@ multiversx_sc_wasm_adapter::endpoints! { ( init => init upgrade => upgrade - addInitialLiquidity => add_initial_liquidity addLiquidity => add_liquidity removeLiquidity => remove_liquidity removeLiquidityAndBuyBackAndBurnToken => remove_liquidity_and_burn_token @@ -75,6 +74,7 @@ multiversx_sc_wasm_adapter::endpoints! { pause => pause resume => resume getState => state + addInitialLiquidity => add_initial_liquidity getLpTokensSafePriceByDefaultOffset => get_lp_tokens_safe_price_by_default_offset getLpTokensSafePriceByRoundOffset => get_lp_tokens_safe_price_by_round_offset getLpTokensSafePriceByTimestampOffset => get_lp_tokens_safe_price_by_timestamp_offset diff --git a/dex/pair/wasm/src/lib.rs b/dex/pair/wasm/src/lib.rs index 57339355b..45f56c90d 100644 --- a/dex/pair/wasm/src/lib.rs +++ b/dex/pair/wasm/src/lib.rs @@ -21,7 +21,6 @@ multiversx_sc_wasm_adapter::endpoints! { ( init => init upgrade => upgrade - addInitialLiquidity => add_initial_liquidity addLiquidity => add_liquidity removeLiquidity => remove_liquidity removeLiquidityAndBuyBackAndBurnToken => remove_liquidity_and_burn_token @@ -75,6 +74,7 @@ multiversx_sc_wasm_adapter::endpoints! { pause => pause resume => resume getState => state + addInitialLiquidity => add_initial_liquidity ) } diff --git a/dex/router/tests/router_test.rs b/dex/router/tests/router_test.rs index b4b7ad010..cb5f1a78f 100644 --- a/dex/router/tests/router_test.rs +++ b/dex/router/tests/router_test.rs @@ -9,7 +9,7 @@ use multiversx_sc::{ MultiValueEncoded, }, }; -use pair::{config::ConfigModule, Pair}; +use pair::{config::ConfigModule, pair_actions::initial_liq::InitialLiquidityModule, Pair}; use pausable::{PausableModule, State}; use router::{ enable_swap_by_user::EnableSwapByUserModule, diff --git a/farm-staking/farm-staking-proxy/src/external_contracts_interactions.rs b/farm-staking/farm-staking-proxy/src/external_contracts_interactions.rs index 163ebb922..fce01d4fa 100644 --- a/farm-staking/farm-staking-proxy/src/external_contracts_interactions.rs +++ b/farm-staking/farm-staking-proxy/src/external_contracts_interactions.rs @@ -9,10 +9,11 @@ use farm_staking::{ unstake_farm::ProxyTrait as _, }; use farm_with_locked_rewards::ProxyTrait as _; -use pair::safe_price_view::ProxyTrait as _; +use pair::{ + pair_actions::common_result_types::RemoveLiquidityResultType, safe_price_view::ProxyTrait as _, +}; use crate::result_types::*; -use pair::RemoveLiquidityResultType; pub type SafePriceResult = MultiValue2, EsdtTokenPayment>; diff --git a/locked-asset/proxy_dex/src/pair_interactions.rs b/locked-asset/proxy_dex/src/pair_interactions.rs index 40b6b46a9..24cf27759 100644 --- a/locked-asset/proxy_dex/src/pair_interactions.rs +++ b/locked-asset/proxy_dex/src/pair_interactions.rs @@ -1,6 +1,9 @@ multiversx_sc::imports!(); -use pair::{AddLiquidityResultType, ProxyTrait as _, RemoveLiquidityResultType}; +use pair::{ + pair_actions::common_result_types::{AddLiquidityResultType, RemoveLiquidityResultType}, + ProxyTrait as _, +}; pub struct AddLiquidityResultWrapper { pub lp_tokens_received: EsdtTokenPayment, From 3b5df875c1f51c0f22e08bfc472c99e5751e7433 Mon Sep 17 00:00:00 2001 From: Dorin Marian Iancu Date: Thu, 25 Jan 2024 10:37:29 +0200 Subject: [PATCH 156/213] add liq --- dex/fuzz/src/fuzz_pair.rs | 2 +- dex/pair/src/lib.rs | 92 +------------- dex/pair/src/pair_actions/add_liq.rs | 114 ++++++++++++++++++ dex/pair/src/pair_actions/mod.rs | 1 + dex/pair/tests/pair_setup/mod.rs | 1 + dex/pair/wasm-pair-full/src/lib.rs | 2 +- dex/pair/wasm/src/lib.rs | 2 +- dex/router/tests/router_setup/mod.rs | 1 + .../mod.rs | 1 + .../proxy_dex/src/pair_interactions.rs | 5 +- 10 files changed, 126 insertions(+), 95 deletions(-) create mode 100644 dex/pair/src/pair_actions/add_liq.rs diff --git a/dex/fuzz/src/fuzz_pair.rs b/dex/fuzz/src/fuzz_pair.rs index 3ccc5031a..b9c1853e7 100644 --- a/dex/fuzz/src/fuzz_pair.rs +++ b/dex/fuzz/src/fuzz_pair.rs @@ -12,7 +12,7 @@ pub mod fuzz_pair_test { use rand::prelude::*; use crate::fuzz_data::fuzz_data_tests::*; - use pair::*; + use pair::{pair_actions::add_liq::AddLiquidityModule, *}; pub fn add_liquidity( fuzzer_data: &mut FuzzerData< diff --git a/dex/pair/src/lib.rs b/dex/pair/src/lib.rs index 2cd827740..3de95d572 100644 --- a/dex/pair/src/lib.rs +++ b/dex/pair/src/lib.rs @@ -15,7 +15,6 @@ pub mod pair_actions; pub mod safe_price; pub mod safe_price_view; -use crate::contexts::add_liquidity::AddLiquidityContext; use crate::contexts::remove_liquidity::RemoveLiquidityContext; use crate::errors::*; @@ -43,6 +42,7 @@ pub trait Pair: + permissions_module::PermissionsModule + pausable::PausableModule + pair_actions::initial_liq::InitialLiquidityModule + + pair_actions::add_liq::AddLiquidityModule + pair_actions::common_methods::CommonMethodsModule { #[init] @@ -100,96 +100,6 @@ pub trait Pair: #[endpoint] fn upgrade(&self) {} - #[payable("*")] - #[endpoint(addLiquidity)] - fn add_liquidity( - &self, - first_token_amount_min: BigUint, - second_token_amount_min: BigUint, - ) -> AddLiquidityResultType { - require!( - first_token_amount_min > 0 && second_token_amount_min > 0, - ERROR_INVALID_ARGS - ); - - let mut storage_cache = StorageCache::new(self); - let caller = self.blockchain().get_caller(); - - let [first_payment, second_payment] = self.call_value().multi_esdt(); - require!( - first_payment.token_identifier == storage_cache.first_token_id - && first_payment.amount > 0, - ERROR_BAD_PAYMENT_TOKENS - ); - require!( - second_payment.token_identifier == storage_cache.second_token_id - && second_payment.amount > 0, - ERROR_BAD_PAYMENT_TOKENS - ); - require!( - self.is_state_active(storage_cache.contract_state), - ERROR_NOT_ACTIVE - ); - require!( - storage_cache.lp_token_id.is_valid_esdt_identifier(), - ERROR_LP_TOKEN_NOT_ISSUED - ); - require!( - self.initial_liquidity_adder().get().is_none() || storage_cache.lp_token_supply != 0, - ERROR_INITIAL_LIQUIDITY_NOT_ADDED - ); - - self.update_safe_price( - &storage_cache.first_token_reserve, - &storage_cache.second_token_reserve, - ); - - let initial_k = self.calculate_k_constant( - &storage_cache.first_token_reserve, - &storage_cache.second_token_reserve, - ); - - let mut add_liq_context = AddLiquidityContext::new( - first_payment, - second_payment, - first_token_amount_min, - second_token_amount_min, - ); - self.set_optimal_amounts(&mut add_liq_context, &storage_cache); - - add_liq_context.liq_added = if storage_cache.lp_token_supply == 0u64 { - self.pool_add_initial_liquidity( - &add_liq_context.first_token_optimal_amount, - &add_liq_context.second_token_optimal_amount, - &mut storage_cache, - ) - } else { - self.pool_add_liquidity( - &add_liq_context.first_token_optimal_amount, - &add_liq_context.second_token_optimal_amount, - &mut storage_cache, - ) - }; - - let new_k = self.calculate_k_constant( - &storage_cache.first_token_reserve, - &storage_cache.second_token_reserve, - ); - require!(initial_k <= new_k, ERROR_K_INVARIANT_FAILED); - - self.send() - .esdt_local_mint(&storage_cache.lp_token_id, 0, &add_liq_context.liq_added); - - let output_payments = self.build_add_liq_output_payments(&storage_cache, &add_liq_context); - self.send_multiple_tokens_if_not_zero(&caller, &output_payments); - - let output = self.build_add_liq_results(&storage_cache, &add_liq_context); - - self.emit_add_liquidity_event(&storage_cache, add_liq_context); - - output - } - #[payable("*")] #[endpoint(removeLiquidity)] fn remove_liquidity( diff --git a/dex/pair/src/pair_actions/add_liq.rs b/dex/pair/src/pair_actions/add_liq.rs new file mode 100644 index 000000000..0878219a7 --- /dev/null +++ b/dex/pair/src/pair_actions/add_liq.rs @@ -0,0 +1,114 @@ +use crate::{ + contexts::add_liquidity::AddLiquidityContext, StorageCache, ERROR_BAD_PAYMENT_TOKENS, + ERROR_INITIAL_LIQUIDITY_NOT_ADDED, ERROR_INVALID_ARGS, ERROR_K_INVARIANT_FAILED, + ERROR_LP_TOKEN_NOT_ISSUED, ERROR_NOT_ACTIVE, +}; + +use super::common_result_types::AddLiquidityResultType; + +multiversx_sc::imports!(); + +#[multiversx_sc::module] +pub trait AddLiquidityModule: + crate::liquidity_pool::LiquidityPoolModule + + crate::amm::AmmModule + + crate::contexts::output_builder::OutputBuilderModule + + crate::locking_wrapper::LockingWrapperModule + + crate::events::EventsModule + + crate::safe_price::SafePriceModule + + crate::config::ConfigModule + + token_send::TokenSendModule + + permissions_module::PermissionsModule + + pausable::PausableModule + + super::common_methods::CommonMethodsModule +{ + #[payable("*")] + #[endpoint(addLiquidity)] + fn add_liquidity( + &self, + first_token_amount_min: BigUint, + second_token_amount_min: BigUint, + ) -> AddLiquidityResultType { + require!( + first_token_amount_min > 0 && second_token_amount_min > 0, + ERROR_INVALID_ARGS + ); + + let mut storage_cache = StorageCache::new(self); + let caller = self.blockchain().get_caller(); + + let [first_payment, second_payment] = self.call_value().multi_esdt(); + require!( + first_payment.token_identifier == storage_cache.first_token_id + && first_payment.amount > 0, + ERROR_BAD_PAYMENT_TOKENS + ); + require!( + second_payment.token_identifier == storage_cache.second_token_id + && second_payment.amount > 0, + ERROR_BAD_PAYMENT_TOKENS + ); + require!( + self.is_state_active(storage_cache.contract_state), + ERROR_NOT_ACTIVE + ); + require!( + storage_cache.lp_token_id.is_valid_esdt_identifier(), + ERROR_LP_TOKEN_NOT_ISSUED + ); + require!( + self.initial_liquidity_adder().get().is_none() || storage_cache.lp_token_supply != 0, + ERROR_INITIAL_LIQUIDITY_NOT_ADDED + ); + + self.update_safe_price( + &storage_cache.first_token_reserve, + &storage_cache.second_token_reserve, + ); + + let initial_k = self.calculate_k_constant( + &storage_cache.first_token_reserve, + &storage_cache.second_token_reserve, + ); + + let mut add_liq_context = AddLiquidityContext::new( + first_payment, + second_payment, + first_token_amount_min, + second_token_amount_min, + ); + self.set_optimal_amounts(&mut add_liq_context, &storage_cache); + + add_liq_context.liq_added = if storage_cache.lp_token_supply == 0u64 { + self.pool_add_initial_liquidity( + &add_liq_context.first_token_optimal_amount, + &add_liq_context.second_token_optimal_amount, + &mut storage_cache, + ) + } else { + self.pool_add_liquidity( + &add_liq_context.first_token_optimal_amount, + &add_liq_context.second_token_optimal_amount, + &mut storage_cache, + ) + }; + + let new_k = self.calculate_k_constant( + &storage_cache.first_token_reserve, + &storage_cache.second_token_reserve, + ); + require!(initial_k <= new_k, ERROR_K_INVARIANT_FAILED); + + self.send() + .esdt_local_mint(&storage_cache.lp_token_id, 0, &add_liq_context.liq_added); + + let output_payments = self.build_add_liq_output_payments(&storage_cache, &add_liq_context); + self.send_multiple_tokens_if_not_zero(&caller, &output_payments); + + let output = self.build_add_liq_results(&storage_cache, &add_liq_context); + + self.emit_add_liquidity_event(&storage_cache, add_liq_context); + + output + } +} diff --git a/dex/pair/src/pair_actions/mod.rs b/dex/pair/src/pair_actions/mod.rs index e05e00482..0d67ed85b 100644 --- a/dex/pair/src/pair_actions/mod.rs +++ b/dex/pair/src/pair_actions/mod.rs @@ -1,3 +1,4 @@ +pub mod add_liq; pub mod common_methods; pub mod common_result_types; pub mod initial_liq; diff --git a/dex/pair/tests/pair_setup/mod.rs b/dex/pair/tests/pair_setup/mod.rs index e7311eca5..d13f17d75 100644 --- a/dex/pair/tests/pair_setup/mod.rs +++ b/dex/pair/tests/pair_setup/mod.rs @@ -20,6 +20,7 @@ pub const USER_TOTAL_MEX_TOKENS: u64 = 5_000_000_000; pub const USER_TOTAL_WEGLD_TOKENS: u64 = 5_000_000_000; use pair::config::ConfigModule as PairConfigModule; +use pair::pair_actions::add_liq::AddLiquidityModule; use pair::safe_price_view::*; use pair::*; use pausable::{PausableModule, State}; diff --git a/dex/pair/wasm-pair-full/src/lib.rs b/dex/pair/wasm-pair-full/src/lib.rs index fe3d65503..df90222ae 100644 --- a/dex/pair/wasm-pair-full/src/lib.rs +++ b/dex/pair/wasm-pair-full/src/lib.rs @@ -21,7 +21,6 @@ multiversx_sc_wasm_adapter::endpoints! { ( init => init upgrade => upgrade - addLiquidity => add_liquidity removeLiquidity => remove_liquidity removeLiquidityAndBuyBackAndBurnToken => remove_liquidity_and_burn_token swapNoFeeAndForward => swap_no_fee @@ -75,6 +74,7 @@ multiversx_sc_wasm_adapter::endpoints! { resume => resume getState => state addInitialLiquidity => add_initial_liquidity + addLiquidity => add_liquidity getLpTokensSafePriceByDefaultOffset => get_lp_tokens_safe_price_by_default_offset getLpTokensSafePriceByRoundOffset => get_lp_tokens_safe_price_by_round_offset getLpTokensSafePriceByTimestampOffset => get_lp_tokens_safe_price_by_timestamp_offset diff --git a/dex/pair/wasm/src/lib.rs b/dex/pair/wasm/src/lib.rs index 45f56c90d..b2bfec007 100644 --- a/dex/pair/wasm/src/lib.rs +++ b/dex/pair/wasm/src/lib.rs @@ -21,7 +21,6 @@ multiversx_sc_wasm_adapter::endpoints! { ( init => init upgrade => upgrade - addLiquidity => add_liquidity removeLiquidity => remove_liquidity removeLiquidityAndBuyBackAndBurnToken => remove_liquidity_and_burn_token swapNoFeeAndForward => swap_no_fee @@ -75,6 +74,7 @@ multiversx_sc_wasm_adapter::endpoints! { resume => resume getState => state addInitialLiquidity => add_initial_liquidity + addLiquidity => add_liquidity ) } diff --git a/dex/router/tests/router_setup/mod.rs b/dex/router/tests/router_setup/mod.rs index 54f6330a3..7b2969361 100644 --- a/dex/router/tests/router_setup/mod.rs +++ b/dex/router/tests/router_setup/mod.rs @@ -28,6 +28,7 @@ pub const USER_CUSTOM_TOKEN_BALANCE: u64 = 1_000_000_000; pub const USER_USDC_BALANCE: u64 = 1_000_000; use pair::config::*; +use pair::pair_actions::add_liq::AddLiquidityModule; use pair::*; use pausable::{PausableModule, State}; use router::factory::*; diff --git a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_external_contracts/mod.rs b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_external_contracts/mod.rs index 95c734663..d223bf9f1 100644 --- a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_external_contracts/mod.rs +++ b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_external_contracts/mod.rs @@ -12,6 +12,7 @@ use multiversx_sc_scenario::whitebox_legacy::TxTokenTransfer; use multiversx_sc_scenario::{ managed_address, managed_biguint, managed_token_id, rust_biguint, whitebox_legacy::*, DebugApi, }; +use pair::pair_actions::add_liq::AddLiquidityModule; use simple_lock::locked_token::LockedTokenModule; use farm::exit_penalty::ExitPenaltyModule; diff --git a/locked-asset/proxy_dex/src/pair_interactions.rs b/locked-asset/proxy_dex/src/pair_interactions.rs index 24cf27759..ce4fdf7a0 100644 --- a/locked-asset/proxy_dex/src/pair_interactions.rs +++ b/locked-asset/proxy_dex/src/pair_interactions.rs @@ -1,7 +1,10 @@ multiversx_sc::imports!(); use pair::{ - pair_actions::common_result_types::{AddLiquidityResultType, RemoveLiquidityResultType}, + pair_actions::{ + add_liq::ProxyTrait as _, + common_result_types::{AddLiquidityResultType, RemoveLiquidityResultType}, + }, ProxyTrait as _, }; From 8f8075ae32e459f53790c6ded0e09498729f1233 Mon Sep 17 00:00:00 2001 From: Dorin Marian Iancu Date: Thu, 25 Jan 2024 10:45:26 +0200 Subject: [PATCH 157/213] remove liq --- dex/farm/src/exit_penalty.rs | 1 + dex/fuzz/src/fuzz_pair.rs | 5 +- dex/pair/src/lib.rs | 121 +-------------- dex/pair/src/pair_actions/mod.rs | 1 + dex/pair/src/pair_actions/remove_liq.rs | 140 ++++++++++++++++++ dex/pair/wasm-pair-full/src/lib.rs | 4 +- dex/pair/wasm/src/lib.rs | 4 +- .../src/external_contracts_interactions.rs | 3 +- .../mod.rs | 1 + .../proxy_dex/src/pair_interactions.rs | 10 +- 10 files changed, 158 insertions(+), 132 deletions(-) create mode 100644 dex/pair/src/pair_actions/remove_liq.rs diff --git a/dex/farm/src/exit_penalty.rs b/dex/farm/src/exit_penalty.rs index 388a8b1f2..e8905fade 100644 --- a/dex/farm/src/exit_penalty.rs +++ b/dex/farm/src/exit_penalty.rs @@ -2,6 +2,7 @@ multiversx_sc::imports!(); use common_errors::ERROR_PARAMETERS; use common_structs::Epoch; +use pair::pair_actions::remove_liq::ProxyTrait as _; pub const MAX_PERCENT: u64 = 10_000; pub const DEFAULT_PENALTY_PERCENT: u64 = 100; diff --git a/dex/fuzz/src/fuzz_pair.rs b/dex/fuzz/src/fuzz_pair.rs index b9c1853e7..480eed510 100644 --- a/dex/fuzz/src/fuzz_pair.rs +++ b/dex/fuzz/src/fuzz_pair.rs @@ -12,7 +12,10 @@ pub mod fuzz_pair_test { use rand::prelude::*; use crate::fuzz_data::fuzz_data_tests::*; - use pair::{pair_actions::add_liq::AddLiquidityModule, *}; + use pair::{ + pair_actions::{add_liq::AddLiquidityModule, remove_liq::RemoveLiquidityModule}, + *, + }; pub fn add_liquidity( fuzzer_data: &mut FuzzerData< diff --git a/dex/pair/src/lib.rs b/dex/pair/src/lib.rs index 3de95d572..021f61d6f 100644 --- a/dex/pair/src/lib.rs +++ b/dex/pair/src/lib.rs @@ -15,7 +15,6 @@ pub mod pair_actions; pub mod safe_price; pub mod safe_price_view; -use crate::contexts::remove_liquidity::RemoveLiquidityContext; use crate::errors::*; use contexts::base::*; @@ -43,6 +42,7 @@ pub trait Pair: + pausable::PausableModule + pair_actions::initial_liq::InitialLiquidityModule + pair_actions::add_liq::AddLiquidityModule + + pair_actions::remove_liq::RemoveLiquidityModule + pair_actions::common_methods::CommonMethodsModule { #[init] @@ -100,125 +100,6 @@ pub trait Pair: #[endpoint] fn upgrade(&self) {} - #[payable("*")] - #[endpoint(removeLiquidity)] - fn remove_liquidity( - &self, - first_token_amount_min: BigUint, - second_token_amount_min: BigUint, - ) -> RemoveLiquidityResultType { - require!( - first_token_amount_min > 0 && second_token_amount_min > 0, - ERROR_INVALID_ARGS - ); - - let mut storage_cache = StorageCache::new(self); - let caller = self.blockchain().get_caller(); - let payment = self.call_value().single_esdt(); - - require!( - self.is_state_active(storage_cache.contract_state), - ERROR_NOT_ACTIVE - ); - require!( - storage_cache.lp_token_id.is_valid_esdt_identifier(), - ERROR_LP_TOKEN_NOT_ISSUED - ); - require!( - payment.token_identifier == storage_cache.lp_token_id && payment.amount > 0, - ERROR_BAD_PAYMENT_TOKENS - ); - - self.update_safe_price( - &storage_cache.first_token_reserve, - &storage_cache.second_token_reserve, - ); - - let initial_k = self.calculate_k_constant( - &storage_cache.first_token_reserve, - &storage_cache.second_token_reserve, - ); - - let mut remove_liq_context = RemoveLiquidityContext::new( - payment.amount, - first_token_amount_min, - second_token_amount_min, - ); - self.pool_remove_liquidity(&mut remove_liq_context, &mut storage_cache); - - let new_k = self.calculate_k_constant( - &storage_cache.first_token_reserve, - &storage_cache.second_token_reserve, - ); - require!(new_k <= initial_k, ERROR_K_INVARIANT_FAILED); - - self.burn( - &storage_cache.lp_token_id, - &remove_liq_context.lp_token_payment_amount, - ); - - let output_payments = - self.build_remove_liq_output_payments(&storage_cache, &remove_liq_context); - self.send_multiple_tokens_if_not_zero(&caller, &output_payments); - - self.emit_remove_liquidity_event(&storage_cache, remove_liq_context); - - self.build_remove_liq_results(output_payments) - } - - #[payable("*")] - #[endpoint(removeLiquidityAndBuyBackAndBurnToken)] - fn remove_liquidity_and_burn_token(&self, token_to_buyback_and_burn: TokenIdentifier) { - let mut storage_cache = StorageCache::new(self); - let caller = self.blockchain().get_caller(); - let payment = self.call_value().single_esdt(); - - require!(self.whitelist().contains(&caller), ERROR_NOT_WHITELISTED); - require!( - storage_cache.lp_token_id.is_valid_esdt_identifier(), - ERROR_LP_TOKEN_NOT_ISSUED - ); - require!( - payment.token_identifier == storage_cache.lp_token_id && payment.amount > 0, - ERROR_BAD_PAYMENT_TOKENS - ); - - self.update_safe_price( - &storage_cache.first_token_reserve, - &storage_cache.second_token_reserve, - ); - - let mut remove_liq_context = - RemoveLiquidityContext::new(payment.amount, BigUint::from(1u64), BigUint::from(1u64)); - self.pool_remove_liquidity(&mut remove_liq_context, &mut storage_cache); - - self.burn( - &storage_cache.lp_token_id, - &remove_liq_context.lp_token_payment_amount, - ); - - let dest_address = ManagedAddress::zero(); - let first_token_id = storage_cache.first_token_id.clone(); - self.send_fee_slice( - &mut storage_cache, - SwapTokensOrder::PoolOrder, - &first_token_id, - &remove_liq_context.first_token_amount_removed, - &dest_address, - &token_to_buyback_and_burn, - ); - - let second_token_id = storage_cache.second_token_id.clone(); - self.send_fee_slice( - &mut storage_cache, - SwapTokensOrder::ReverseOrder, - &second_token_id, - &remove_liq_context.second_token_amount_removed, - &dest_address, - &token_to_buyback_and_burn, - ); - } - #[payable("*")] #[endpoint(swapNoFeeAndForward)] fn swap_no_fee(&self, token_out: TokenIdentifier, destination_address: ManagedAddress) { diff --git a/dex/pair/src/pair_actions/mod.rs b/dex/pair/src/pair_actions/mod.rs index 0d67ed85b..13495c791 100644 --- a/dex/pair/src/pair_actions/mod.rs +++ b/dex/pair/src/pair_actions/mod.rs @@ -2,3 +2,4 @@ pub mod add_liq; pub mod common_methods; pub mod common_result_types; pub mod initial_liq; +pub mod remove_liq; diff --git a/dex/pair/src/pair_actions/remove_liq.rs b/dex/pair/src/pair_actions/remove_liq.rs new file mode 100644 index 000000000..a1f234226 --- /dev/null +++ b/dex/pair/src/pair_actions/remove_liq.rs @@ -0,0 +1,140 @@ +use crate::{contexts::remove_liquidity::RemoveLiquidityContext, StorageCache, SwapTokensOrder, ERROR_BAD_PAYMENT_TOKENS, ERROR_INVALID_ARGS, ERROR_K_INVARIANT_FAILED, ERROR_LP_TOKEN_NOT_ISSUED, ERROR_NOT_ACTIVE, ERROR_NOT_WHITELISTED}; + +use super::common_result_types::RemoveLiquidityResultType; + +multiversx_sc::imports!(); + +#[multiversx_sc::module] +pub trait RemoveLiquidityModule: + crate::liquidity_pool::LiquidityPoolModule + + crate::amm::AmmModule + + crate::contexts::output_builder::OutputBuilderModule + + crate::locking_wrapper::LockingWrapperModule + + crate::events::EventsModule + + crate::safe_price::SafePriceModule + + crate::fee::FeeModule + + crate::config::ConfigModule + + token_send::TokenSendModule + + permissions_module::PermissionsModule + + pausable::PausableModule + + super::common_methods::CommonMethodsModule +{ + #[payable("*")] + #[endpoint(removeLiquidity)] + fn remove_liquidity( + &self, + first_token_amount_min: BigUint, + second_token_amount_min: BigUint, + ) -> RemoveLiquidityResultType { + require!( + first_token_amount_min > 0 && second_token_amount_min > 0, + ERROR_INVALID_ARGS + ); + + let mut storage_cache = StorageCache::new(self); + let caller = self.blockchain().get_caller(); + let payment = self.call_value().single_esdt(); + + require!( + self.is_state_active(storage_cache.contract_state), + ERROR_NOT_ACTIVE + ); + require!( + storage_cache.lp_token_id.is_valid_esdt_identifier(), + ERROR_LP_TOKEN_NOT_ISSUED + ); + require!( + payment.token_identifier == storage_cache.lp_token_id && payment.amount > 0, + ERROR_BAD_PAYMENT_TOKENS + ); + + self.update_safe_price( + &storage_cache.first_token_reserve, + &storage_cache.second_token_reserve, + ); + + let initial_k = self.calculate_k_constant( + &storage_cache.first_token_reserve, + &storage_cache.second_token_reserve, + ); + + let mut remove_liq_context = RemoveLiquidityContext::new( + payment.amount, + first_token_amount_min, + second_token_amount_min, + ); + self.pool_remove_liquidity(&mut remove_liq_context, &mut storage_cache); + + let new_k = self.calculate_k_constant( + &storage_cache.first_token_reserve, + &storage_cache.second_token_reserve, + ); + require!(new_k <= initial_k, ERROR_K_INVARIANT_FAILED); + + self.burn( + &storage_cache.lp_token_id, + &remove_liq_context.lp_token_payment_amount, + ); + + let output_payments = + self.build_remove_liq_output_payments(&storage_cache, &remove_liq_context); + self.send_multiple_tokens_if_not_zero(&caller, &output_payments); + + self.emit_remove_liquidity_event(&storage_cache, remove_liq_context); + + self.build_remove_liq_results(output_payments) + } + + #[payable("*")] + #[endpoint(removeLiquidityAndBuyBackAndBurnToken)] + fn remove_liquidity_and_burn_token(&self, token_to_buyback_and_burn: TokenIdentifier) { + let mut storage_cache = StorageCache::new(self); + let caller = self.blockchain().get_caller(); + let payment = self.call_value().single_esdt(); + + require!(self.whitelist().contains(&caller), ERROR_NOT_WHITELISTED); + require!( + storage_cache.lp_token_id.is_valid_esdt_identifier(), + ERROR_LP_TOKEN_NOT_ISSUED + ); + require!( + payment.token_identifier == storage_cache.lp_token_id && payment.amount > 0, + ERROR_BAD_PAYMENT_TOKENS + ); + + self.update_safe_price( + &storage_cache.first_token_reserve, + &storage_cache.second_token_reserve, + ); + + let mut remove_liq_context = + RemoveLiquidityContext::new(payment.amount, BigUint::from(1u64), BigUint::from(1u64)); + self.pool_remove_liquidity(&mut remove_liq_context, &mut storage_cache); + + self.burn( + &storage_cache.lp_token_id, + &remove_liq_context.lp_token_payment_amount, + ); + + let dest_address = ManagedAddress::zero(); + let first_token_id = storage_cache.first_token_id.clone(); + self.send_fee_slice( + &mut storage_cache, + SwapTokensOrder::PoolOrder, + &first_token_id, + &remove_liq_context.first_token_amount_removed, + &dest_address, + &token_to_buyback_and_burn, + ); + + let second_token_id = storage_cache.second_token_id.clone(); + self.send_fee_slice( + &mut storage_cache, + SwapTokensOrder::ReverseOrder, + &second_token_id, + &remove_liq_context.second_token_amount_removed, + &dest_address, + &token_to_buyback_and_burn, + ); + } +} diff --git a/dex/pair/wasm-pair-full/src/lib.rs b/dex/pair/wasm-pair-full/src/lib.rs index df90222ae..b08a363d5 100644 --- a/dex/pair/wasm-pair-full/src/lib.rs +++ b/dex/pair/wasm-pair-full/src/lib.rs @@ -21,8 +21,6 @@ multiversx_sc_wasm_adapter::endpoints! { ( init => init upgrade => upgrade - removeLiquidity => remove_liquidity - removeLiquidityAndBuyBackAndBurnToken => remove_liquidity_and_burn_token swapNoFeeAndForward => swap_no_fee swapTokensFixedInput => swap_tokens_fixed_input swapTokensFixedOutput => swap_tokens_fixed_output @@ -75,6 +73,8 @@ multiversx_sc_wasm_adapter::endpoints! { getState => state addInitialLiquidity => add_initial_liquidity addLiquidity => add_liquidity + removeLiquidity => remove_liquidity + removeLiquidityAndBuyBackAndBurnToken => remove_liquidity_and_burn_token getLpTokensSafePriceByDefaultOffset => get_lp_tokens_safe_price_by_default_offset getLpTokensSafePriceByRoundOffset => get_lp_tokens_safe_price_by_round_offset getLpTokensSafePriceByTimestampOffset => get_lp_tokens_safe_price_by_timestamp_offset diff --git a/dex/pair/wasm/src/lib.rs b/dex/pair/wasm/src/lib.rs index b2bfec007..b711412a3 100644 --- a/dex/pair/wasm/src/lib.rs +++ b/dex/pair/wasm/src/lib.rs @@ -21,8 +21,6 @@ multiversx_sc_wasm_adapter::endpoints! { ( init => init upgrade => upgrade - removeLiquidity => remove_liquidity - removeLiquidityAndBuyBackAndBurnToken => remove_liquidity_and_burn_token swapNoFeeAndForward => swap_no_fee swapTokensFixedInput => swap_tokens_fixed_input swapTokensFixedOutput => swap_tokens_fixed_output @@ -75,6 +73,8 @@ multiversx_sc_wasm_adapter::endpoints! { getState => state addInitialLiquidity => add_initial_liquidity addLiquidity => add_liquidity + removeLiquidity => remove_liquidity + removeLiquidityAndBuyBackAndBurnToken => remove_liquidity_and_burn_token ) } diff --git a/farm-staking/farm-staking-proxy/src/external_contracts_interactions.rs b/farm-staking/farm-staking-proxy/src/external_contracts_interactions.rs index fce01d4fa..f8048d66b 100644 --- a/farm-staking/farm-staking-proxy/src/external_contracts_interactions.rs +++ b/farm-staking/farm-staking-proxy/src/external_contracts_interactions.rs @@ -10,7 +10,8 @@ use farm_staking::{ }; use farm_with_locked_rewards::ProxyTrait as _; use pair::{ - pair_actions::common_result_types::RemoveLiquidityResultType, safe_price_view::ProxyTrait as _, + pair_actions::{common_result_types::RemoveLiquidityResultType, remove_liq::ProxyTrait as _}, + safe_price_view::ProxyTrait as _, }; use crate::result_types::*; diff --git a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_external_contracts/mod.rs b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_external_contracts/mod.rs index d223bf9f1..327897bfb 100644 --- a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_external_contracts/mod.rs +++ b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_external_contracts/mod.rs @@ -13,6 +13,7 @@ use multiversx_sc_scenario::{ managed_address, managed_biguint, managed_token_id, rust_biguint, whitebox_legacy::*, DebugApi, }; use pair::pair_actions::add_liq::AddLiquidityModule; +use pair::pair_actions::remove_liq::RemoveLiquidityModule; use simple_lock::locked_token::LockedTokenModule; use farm::exit_penalty::ExitPenaltyModule; diff --git a/locked-asset/proxy_dex/src/pair_interactions.rs b/locked-asset/proxy_dex/src/pair_interactions.rs index ce4fdf7a0..7e959a4e1 100644 --- a/locked-asset/proxy_dex/src/pair_interactions.rs +++ b/locked-asset/proxy_dex/src/pair_interactions.rs @@ -1,11 +1,9 @@ multiversx_sc::imports!(); -use pair::{ - pair_actions::{ - add_liq::ProxyTrait as _, - common_result_types::{AddLiquidityResultType, RemoveLiquidityResultType}, - }, - ProxyTrait as _, +use pair::pair_actions::{ + add_liq::ProxyTrait as _, + common_result_types::{AddLiquidityResultType, RemoveLiquidityResultType}, + remove_liq::ProxyTrait as _, }; pub struct AddLiquidityResultWrapper { From a9016e57384654765ab7f3b6d66e5a984dc03a07 Mon Sep 17 00:00:00 2001 From: Dorin Marian Iancu Date: Thu, 25 Jan 2024 10:50:55 +0200 Subject: [PATCH 158/213] swap --- dex/fuzz/src/fuzz_pair.rs | 5 +- dex/pair/src/lib.rs | 259 +----------------- dex/pair/src/pair_actions/common_methods.rs | 5 + dex/pair/src/pair_actions/mod.rs | 1 + dex/pair/src/pair_actions/swap.rs | 277 ++++++++++++++++++++ dex/pair/tests/pair_rs_test.rs | 6 +- dex/pair/tests/pair_setup/mod.rs | 1 + dex/pair/wasm-pair-full/src/lib.rs | 6 +- dex/pair/wasm/src/lib.rs | 6 +- dex/router/src/multi_pair_swap.rs | 4 +- 10 files changed, 299 insertions(+), 271 deletions(-) create mode 100644 dex/pair/src/pair_actions/swap.rs diff --git a/dex/fuzz/src/fuzz_pair.rs b/dex/fuzz/src/fuzz_pair.rs index 480eed510..cd22614cb 100644 --- a/dex/fuzz/src/fuzz_pair.rs +++ b/dex/fuzz/src/fuzz_pair.rs @@ -12,9 +12,8 @@ pub mod fuzz_pair_test { use rand::prelude::*; use crate::fuzz_data::fuzz_data_tests::*; - use pair::{ - pair_actions::{add_liq::AddLiquidityModule, remove_liq::RemoveLiquidityModule}, - *, + use pair::pair_actions::{ + add_liq::AddLiquidityModule, remove_liq::RemoveLiquidityModule, swap::SwapModule, }; pub fn add_liquidity( diff --git a/dex/pair/src/lib.rs b/dex/pair/src/lib.rs index 021f61d6f..b4dd4a3cf 100644 --- a/dex/pair/src/lib.rs +++ b/dex/pair/src/lib.rs @@ -18,7 +18,6 @@ pub mod safe_price_view; use crate::errors::*; use contexts::base::*; -use contexts::swap::SwapContext; use pair_actions::common_result_types::{ AddLiquidityResultType, RemoveLiquidityResultType, SwapTokensFixedInputResultType, SwapTokensFixedOutputResultType, @@ -43,6 +42,7 @@ pub trait Pair: + pair_actions::initial_liq::InitialLiquidityModule + pair_actions::add_liq::AddLiquidityModule + pair_actions::remove_liq::RemoveLiquidityModule + + pair_actions::swap::SwapModule + pair_actions::common_methods::CommonMethodsModule { #[init] @@ -100,191 +100,6 @@ pub trait Pair: #[endpoint] fn upgrade(&self) {} - #[payable("*")] - #[endpoint(swapNoFeeAndForward)] - fn swap_no_fee(&self, token_out: TokenIdentifier, destination_address: ManagedAddress) { - let caller = self.blockchain().get_caller(); - require!(self.whitelist().contains(&caller), ERROR_NOT_WHITELISTED); - - let mut storage_cache = StorageCache::new(self); - let (token_in, _, amount_in) = self.call_value().single_esdt().into_tuple(); - let swap_tokens_order = storage_cache.get_swap_tokens_order(&token_in, &token_out); - - require!( - self.can_swap(storage_cache.contract_state), - ERROR_SWAP_NOT_ENABLED - ); - - self.update_safe_price( - &storage_cache.first_token_reserve, - &storage_cache.second_token_reserve, - ); - - let initial_k = self.calculate_k_constant( - &storage_cache.first_token_reserve, - &storage_cache.second_token_reserve, - ); - - let mut swap_context = SwapContext::new( - token_in, - amount_in.clone(), - token_out, - BigUint::from(1u32), - swap_tokens_order, - ); - swap_context.final_input_amount = amount_in; - - let amount_out = self.swap_safe_no_fee( - &mut storage_cache, - swap_context.swap_tokens_order, - &swap_context.final_input_amount, - ); - require!(amount_out > 0u64, ERROR_ZERO_AMOUNT); - - swap_context.final_output_amount = amount_out; - - let new_k = self.calculate_k_constant( - &storage_cache.first_token_reserve, - &storage_cache.second_token_reserve, - ); - require!(initial_k <= new_k, ERROR_K_INVARIANT_FAILED); - - self.burn( - &swap_context.output_token_id, - &swap_context.final_output_amount, - ); - - self.emit_swap_no_fee_and_forward_event(swap_context, destination_address); - } - - #[payable("*")] - #[endpoint(swapTokensFixedInput)] - fn swap_tokens_fixed_input( - &self, - token_out: TokenIdentifier, - amount_out_min: BigUint, - ) -> SwapTokensFixedInputResultType { - require!(amount_out_min > 0, ERROR_INVALID_ARGS); - - let mut storage_cache = StorageCache::new(self); - let (token_in, _, amount_in) = self.call_value().single_esdt().into_tuple(); - let swap_tokens_order = storage_cache.get_swap_tokens_order(&token_in, &token_out); - - require!( - self.can_swap(storage_cache.contract_state), - ERROR_SWAP_NOT_ENABLED - ); - - let reserve_out = storage_cache.get_mut_reserve_out(swap_tokens_order); - require!(*reserve_out > amount_out_min, ERROR_NOT_ENOUGH_RESERVE); - - self.update_safe_price( - &storage_cache.first_token_reserve, - &storage_cache.second_token_reserve, - ); - - let initial_k = self.calculate_k_constant( - &storage_cache.first_token_reserve, - &storage_cache.second_token_reserve, - ); - - let mut swap_context = SwapContext::new( - token_in, - amount_in, - token_out, - amount_out_min, - swap_tokens_order, - ); - self.perform_swap_fixed_input(&mut swap_context, &mut storage_cache); - - let new_k = self.calculate_k_constant( - &storage_cache.first_token_reserve, - &storage_cache.second_token_reserve, - ); - require!(initial_k <= new_k, ERROR_K_INVARIANT_FAILED); - - if swap_context.fee_amount > 0 { - self.send_fee( - &mut storage_cache, - swap_context.swap_tokens_order, - &swap_context.input_token_id, - &swap_context.fee_amount, - ); - } - - let caller = self.blockchain().get_caller(); - let output_payments = self.build_swap_output_payments(&swap_context); - self.send_multiple_tokens_if_not_zero(&caller, &output_payments); - - self.emit_swap_event(&storage_cache, swap_context); - - self.build_swap_fixed_input_results(output_payments) - } - - #[payable("*")] - #[endpoint(swapTokensFixedOutput)] - fn swap_tokens_fixed_output( - &self, - token_out: TokenIdentifier, - amount_out: BigUint, - ) -> SwapTokensFixedOutputResultType { - require!(amount_out > 0, ERROR_INVALID_ARGS); - - let mut storage_cache = StorageCache::new(self); - let (token_in, _, amount_in_max) = self.call_value().single_esdt().into_tuple(); - let swap_tokens_order = storage_cache.get_swap_tokens_order(&token_in, &token_out); - - require!( - self.can_swap(storage_cache.contract_state), - ERROR_SWAP_NOT_ENABLED - ); - - let reserve_out = storage_cache.get_mut_reserve_out(swap_tokens_order); - require!(*reserve_out > amount_out, ERROR_NOT_ENOUGH_RESERVE); - - self.update_safe_price( - &storage_cache.first_token_reserve, - &storage_cache.second_token_reserve, - ); - - let initial_k = self.calculate_k_constant( - &storage_cache.first_token_reserve, - &storage_cache.second_token_reserve, - ); - - let mut swap_context = SwapContext::new( - token_in, - amount_in_max, - token_out, - amount_out, - swap_tokens_order, - ); - self.perform_swap_fixed_output(&mut swap_context, &mut storage_cache); - - let new_k = self.calculate_k_constant( - &storage_cache.first_token_reserve, - &storage_cache.second_token_reserve, - ); - require!(initial_k <= new_k, ERROR_K_INVARIANT_FAILED); - - if swap_context.fee_amount > 0 { - self.send_fee( - &mut storage_cache, - swap_context.swap_tokens_order, - &swap_context.input_token_id, - &swap_context.fee_amount, - ); - } - - let caller = self.blockchain().get_caller(); - let output_payments = self.build_swap_output_payments(&swap_context); - self.send_multiple_tokens_if_not_zero(&caller, &output_payments); - - self.emit_swap_event(&storage_cache, swap_context); - - self.build_swap_fixed_output_results(output_payments) - } - #[endpoint(setLpTokenIdentifier)] fn set_lp_token_identifier(&self, token_identifier: TokenIdentifier) { self.require_caller_has_owner_permissions(); @@ -398,76 +213,4 @@ pub trait Pair: sc_panic!(ERROR_UNKNOWN_TOKEN); } } - - #[inline] - fn can_swap(&self, state: State) -> bool { - state == State::Active - } - - fn perform_swap_fixed_input( - &self, - context: &mut SwapContext, - storage_cache: &mut StorageCache, - ) { - context.final_input_amount = context.input_token_amount.clone(); - - let reserve_in = storage_cache.get_reserve_in(context.swap_tokens_order); - let reserve_out = storage_cache.get_reserve_out(context.swap_tokens_order); - - let amount_out_optimal = - self.get_amount_out(&context.input_token_amount, reserve_in, reserve_out); - require!( - amount_out_optimal >= context.output_token_amount, - ERROR_SLIPPAGE_EXCEEDED - ); - require!(*reserve_out > amount_out_optimal, ERROR_NOT_ENOUGH_RESERVE); - require!(amount_out_optimal != 0u64, ERROR_ZERO_AMOUNT); - - context.final_output_amount = amount_out_optimal; - - let mut amount_in_after_fee = context.input_token_amount.clone(); - if self.is_fee_enabled() { - let fee_amount = self.get_special_fee_from_input(&amount_in_after_fee); - amount_in_after_fee -= &fee_amount; - - context.fee_amount = fee_amount; - } - - *storage_cache.get_mut_reserve_in(context.swap_tokens_order) += amount_in_after_fee; - *storage_cache.get_mut_reserve_out(context.swap_tokens_order) -= - &context.final_output_amount; - } - - fn perform_swap_fixed_output( - &self, - context: &mut SwapContext, - storage_cache: &mut StorageCache, - ) { - context.final_output_amount = context.output_token_amount.clone(); - - let reserve_in = storage_cache.get_reserve_in(context.swap_tokens_order); - let reserve_out = storage_cache.get_reserve_out(context.swap_tokens_order); - - let amount_in_optimal = - self.get_amount_in(&context.output_token_amount, reserve_in, reserve_out); - require!( - amount_in_optimal <= context.input_token_amount, - ERROR_SLIPPAGE_EXCEEDED - ); - require!(amount_in_optimal != 0, ERROR_ZERO_AMOUNT); - - context.final_input_amount = amount_in_optimal.clone(); - - let mut amount_in_optimal_after_fee = amount_in_optimal; - if self.is_fee_enabled() { - let fee_amount = self.get_special_fee_from_input(&amount_in_optimal_after_fee); - amount_in_optimal_after_fee -= &fee_amount; - - context.fee_amount = fee_amount; - } - - *storage_cache.get_mut_reserve_in(context.swap_tokens_order) += amount_in_optimal_after_fee; - *storage_cache.get_mut_reserve_out(context.swap_tokens_order) -= - &context.final_output_amount; - } } diff --git a/dex/pair/src/pair_actions/common_methods.rs b/dex/pair/src/pair_actions/common_methods.rs index 5d145e9bc..8839a85d5 100644 --- a/dex/pair/src/pair_actions/common_methods.rs +++ b/dex/pair/src/pair_actions/common_methods.rs @@ -8,4 +8,9 @@ pub trait CommonMethodsModule { fn is_state_active(&self, state: State) -> bool { state == State::Active || state == State::PartialActive } + + #[inline] + fn can_swap(&self, state: State) -> bool { + state == State::Active + } } diff --git a/dex/pair/src/pair_actions/mod.rs b/dex/pair/src/pair_actions/mod.rs index 13495c791..1b4c36ed1 100644 --- a/dex/pair/src/pair_actions/mod.rs +++ b/dex/pair/src/pair_actions/mod.rs @@ -3,3 +3,4 @@ pub mod common_methods; pub mod common_result_types; pub mod initial_liq; pub mod remove_liq; +pub mod swap; diff --git a/dex/pair/src/pair_actions/swap.rs b/dex/pair/src/pair_actions/swap.rs new file mode 100644 index 000000000..6e028bad0 --- /dev/null +++ b/dex/pair/src/pair_actions/swap.rs @@ -0,0 +1,277 @@ +use crate::{ + contexts::swap::SwapContext, StorageCache, ERROR_INVALID_ARGS, ERROR_K_INVARIANT_FAILED, + ERROR_NOT_ENOUGH_RESERVE, ERROR_NOT_WHITELISTED, ERROR_SLIPPAGE_EXCEEDED, + ERROR_SWAP_NOT_ENABLED, ERROR_ZERO_AMOUNT, +}; + +use super::common_result_types::{SwapTokensFixedInputResultType, SwapTokensFixedOutputResultType}; + +multiversx_sc::imports!(); + +#[multiversx_sc::module] +pub trait SwapModule: + crate::liquidity_pool::LiquidityPoolModule + + crate::amm::AmmModule + + crate::contexts::output_builder::OutputBuilderModule + + crate::locking_wrapper::LockingWrapperModule + + crate::events::EventsModule + + crate::safe_price::SafePriceModule + + crate::fee::FeeModule + + crate::config::ConfigModule + + token_send::TokenSendModule + + permissions_module::PermissionsModule + + pausable::PausableModule + + super::common_methods::CommonMethodsModule +{ + #[payable("*")] + #[endpoint(swapNoFeeAndForward)] + fn swap_no_fee(&self, token_out: TokenIdentifier, destination_address: ManagedAddress) { + let caller = self.blockchain().get_caller(); + require!(self.whitelist().contains(&caller), ERROR_NOT_WHITELISTED); + + let mut storage_cache = StorageCache::new(self); + let (token_in, _, amount_in) = self.call_value().single_esdt().into_tuple(); + let swap_tokens_order = storage_cache.get_swap_tokens_order(&token_in, &token_out); + + require!( + self.can_swap(storage_cache.contract_state), + ERROR_SWAP_NOT_ENABLED + ); + + self.update_safe_price( + &storage_cache.first_token_reserve, + &storage_cache.second_token_reserve, + ); + + let initial_k = self.calculate_k_constant( + &storage_cache.first_token_reserve, + &storage_cache.second_token_reserve, + ); + + let mut swap_context = SwapContext::new( + token_in, + amount_in.clone(), + token_out, + BigUint::from(1u32), + swap_tokens_order, + ); + swap_context.final_input_amount = amount_in; + + let amount_out = self.swap_safe_no_fee( + &mut storage_cache, + swap_context.swap_tokens_order, + &swap_context.final_input_amount, + ); + require!(amount_out > 0u64, ERROR_ZERO_AMOUNT); + + swap_context.final_output_amount = amount_out; + + let new_k = self.calculate_k_constant( + &storage_cache.first_token_reserve, + &storage_cache.second_token_reserve, + ); + require!(initial_k <= new_k, ERROR_K_INVARIANT_FAILED); + + self.burn( + &swap_context.output_token_id, + &swap_context.final_output_amount, + ); + + self.emit_swap_no_fee_and_forward_event(swap_context, destination_address); + } + + #[payable("*")] + #[endpoint(swapTokensFixedInput)] + fn swap_tokens_fixed_input( + &self, + token_out: TokenIdentifier, + amount_out_min: BigUint, + ) -> SwapTokensFixedInputResultType { + require!(amount_out_min > 0, ERROR_INVALID_ARGS); + + let mut storage_cache = StorageCache::new(self); + let (token_in, _, amount_in) = self.call_value().single_esdt().into_tuple(); + let swap_tokens_order = storage_cache.get_swap_tokens_order(&token_in, &token_out); + + require!( + self.can_swap(storage_cache.contract_state), + ERROR_SWAP_NOT_ENABLED + ); + + let reserve_out = storage_cache.get_mut_reserve_out(swap_tokens_order); + require!(*reserve_out > amount_out_min, ERROR_NOT_ENOUGH_RESERVE); + + self.update_safe_price( + &storage_cache.first_token_reserve, + &storage_cache.second_token_reserve, + ); + + let initial_k = self.calculate_k_constant( + &storage_cache.first_token_reserve, + &storage_cache.second_token_reserve, + ); + + let mut swap_context = SwapContext::new( + token_in, + amount_in, + token_out, + amount_out_min, + swap_tokens_order, + ); + self.perform_swap_fixed_input(&mut swap_context, &mut storage_cache); + + let new_k = self.calculate_k_constant( + &storage_cache.first_token_reserve, + &storage_cache.second_token_reserve, + ); + require!(initial_k <= new_k, ERROR_K_INVARIANT_FAILED); + + if swap_context.fee_amount > 0 { + self.send_fee( + &mut storage_cache, + swap_context.swap_tokens_order, + &swap_context.input_token_id, + &swap_context.fee_amount, + ); + } + + let caller = self.blockchain().get_caller(); + let output_payments = self.build_swap_output_payments(&swap_context); + self.send_multiple_tokens_if_not_zero(&caller, &output_payments); + + self.emit_swap_event(&storage_cache, swap_context); + + self.build_swap_fixed_input_results(output_payments) + } + + #[payable("*")] + #[endpoint(swapTokensFixedOutput)] + fn swap_tokens_fixed_output( + &self, + token_out: TokenIdentifier, + amount_out: BigUint, + ) -> SwapTokensFixedOutputResultType { + require!(amount_out > 0, ERROR_INVALID_ARGS); + + let mut storage_cache = StorageCache::new(self); + let (token_in, _, amount_in_max) = self.call_value().single_esdt().into_tuple(); + let swap_tokens_order = storage_cache.get_swap_tokens_order(&token_in, &token_out); + + require!( + self.can_swap(storage_cache.contract_state), + ERROR_SWAP_NOT_ENABLED + ); + + let reserve_out = storage_cache.get_mut_reserve_out(swap_tokens_order); + require!(*reserve_out > amount_out, ERROR_NOT_ENOUGH_RESERVE); + + self.update_safe_price( + &storage_cache.first_token_reserve, + &storage_cache.second_token_reserve, + ); + + let initial_k = self.calculate_k_constant( + &storage_cache.first_token_reserve, + &storage_cache.second_token_reserve, + ); + + let mut swap_context = SwapContext::new( + token_in, + amount_in_max, + token_out, + amount_out, + swap_tokens_order, + ); + self.perform_swap_fixed_output(&mut swap_context, &mut storage_cache); + + let new_k = self.calculate_k_constant( + &storage_cache.first_token_reserve, + &storage_cache.second_token_reserve, + ); + require!(initial_k <= new_k, ERROR_K_INVARIANT_FAILED); + + if swap_context.fee_amount > 0 { + self.send_fee( + &mut storage_cache, + swap_context.swap_tokens_order, + &swap_context.input_token_id, + &swap_context.fee_amount, + ); + } + + let caller = self.blockchain().get_caller(); + let output_payments = self.build_swap_output_payments(&swap_context); + self.send_multiple_tokens_if_not_zero(&caller, &output_payments); + + self.emit_swap_event(&storage_cache, swap_context); + + self.build_swap_fixed_output_results(output_payments) + } + + fn perform_swap_fixed_input( + &self, + context: &mut SwapContext, + storage_cache: &mut StorageCache, + ) { + context.final_input_amount = context.input_token_amount.clone(); + + let reserve_in = storage_cache.get_reserve_in(context.swap_tokens_order); + let reserve_out = storage_cache.get_reserve_out(context.swap_tokens_order); + + let amount_out_optimal = + self.get_amount_out(&context.input_token_amount, reserve_in, reserve_out); + require!( + amount_out_optimal >= context.output_token_amount, + ERROR_SLIPPAGE_EXCEEDED + ); + require!(*reserve_out > amount_out_optimal, ERROR_NOT_ENOUGH_RESERVE); + require!(amount_out_optimal != 0u64, ERROR_ZERO_AMOUNT); + + context.final_output_amount = amount_out_optimal; + + let mut amount_in_after_fee = context.input_token_amount.clone(); + if self.is_fee_enabled() { + let fee_amount = self.get_special_fee_from_input(&amount_in_after_fee); + amount_in_after_fee -= &fee_amount; + + context.fee_amount = fee_amount; + } + + *storage_cache.get_mut_reserve_in(context.swap_tokens_order) += amount_in_after_fee; + *storage_cache.get_mut_reserve_out(context.swap_tokens_order) -= + &context.final_output_amount; + } + + fn perform_swap_fixed_output( + &self, + context: &mut SwapContext, + storage_cache: &mut StorageCache, + ) { + context.final_output_amount = context.output_token_amount.clone(); + + let reserve_in = storage_cache.get_reserve_in(context.swap_tokens_order); + let reserve_out = storage_cache.get_reserve_out(context.swap_tokens_order); + + let amount_in_optimal = + self.get_amount_in(&context.output_token_amount, reserve_in, reserve_out); + require!( + amount_in_optimal <= context.input_token_amount, + ERROR_SLIPPAGE_EXCEEDED + ); + require!(amount_in_optimal != 0, ERROR_ZERO_AMOUNT); + + context.final_input_amount = amount_in_optimal.clone(); + + let mut amount_in_optimal_after_fee = amount_in_optimal; + if self.is_fee_enabled() { + let fee_amount = self.get_special_fee_from_input(&amount_in_optimal_after_fee); + amount_in_optimal_after_fee -= &fee_amount; + + context.fee_amount = fee_amount; + } + + *storage_cache.get_mut_reserve_in(context.swap_tokens_order) += amount_in_optimal_after_fee; + *storage_cache.get_mut_reserve_out(context.swap_tokens_order) -= + &context.final_output_amount; + } +} diff --git a/dex/pair/tests/pair_rs_test.rs b/dex/pair/tests/pair_rs_test.rs index eb90a88f6..5ff6fbce9 100644 --- a/dex/pair/tests/pair_rs_test.rs +++ b/dex/pair/tests/pair_rs_test.rs @@ -13,8 +13,10 @@ use multiversx_sc_scenario::{ managed_address, managed_biguint, managed_token_id, managed_token_id_wrapped, rust_biguint, whitebox_legacy::TxTokenTransfer, DebugApi, }; -// use pair::safe_price::MAX_OBSERVATIONS; -use pair::{config::MAX_PERCENTAGE, fee::FeeModule, locking_wrapper::LockingWrapperModule, Pair}; +use pair::{ + config::MAX_PERCENTAGE, fee::FeeModule, locking_wrapper::LockingWrapperModule, + pair_actions::swap::SwapModule, +}; use pair_setup::*; use simple_lock::{ locked_token::{LockedTokenAttributes, LockedTokenModule}, diff --git a/dex/pair/tests/pair_setup/mod.rs b/dex/pair/tests/pair_setup/mod.rs index d13f17d75..5ca0fcd84 100644 --- a/dex/pair/tests/pair_setup/mod.rs +++ b/dex/pair/tests/pair_setup/mod.rs @@ -21,6 +21,7 @@ pub const USER_TOTAL_WEGLD_TOKENS: u64 = 5_000_000_000; use pair::config::ConfigModule as PairConfigModule; use pair::pair_actions::add_liq::AddLiquidityModule; +use pair::pair_actions::swap::SwapModule; use pair::safe_price_view::*; use pair::*; use pausable::{PausableModule, State}; diff --git a/dex/pair/wasm-pair-full/src/lib.rs b/dex/pair/wasm-pair-full/src/lib.rs index b08a363d5..ea7c4e8d2 100644 --- a/dex/pair/wasm-pair-full/src/lib.rs +++ b/dex/pair/wasm-pair-full/src/lib.rs @@ -21,9 +21,6 @@ multiversx_sc_wasm_adapter::endpoints! { ( init => init upgrade => upgrade - swapNoFeeAndForward => swap_no_fee - swapTokensFixedInput => swap_tokens_fixed_input - swapTokensFixedOutput => swap_tokens_fixed_output setLpTokenIdentifier => set_lp_token_identifier getTokensForGivenPosition => get_tokens_for_given_position getReservesAndTotalSupply => get_reserves_and_total_supply @@ -75,6 +72,9 @@ multiversx_sc_wasm_adapter::endpoints! { addLiquidity => add_liquidity removeLiquidity => remove_liquidity removeLiquidityAndBuyBackAndBurnToken => remove_liquidity_and_burn_token + swapNoFeeAndForward => swap_no_fee + swapTokensFixedInput => swap_tokens_fixed_input + swapTokensFixedOutput => swap_tokens_fixed_output getLpTokensSafePriceByDefaultOffset => get_lp_tokens_safe_price_by_default_offset getLpTokensSafePriceByRoundOffset => get_lp_tokens_safe_price_by_round_offset getLpTokensSafePriceByTimestampOffset => get_lp_tokens_safe_price_by_timestamp_offset diff --git a/dex/pair/wasm/src/lib.rs b/dex/pair/wasm/src/lib.rs index b711412a3..268a50e9c 100644 --- a/dex/pair/wasm/src/lib.rs +++ b/dex/pair/wasm/src/lib.rs @@ -21,9 +21,6 @@ multiversx_sc_wasm_adapter::endpoints! { ( init => init upgrade => upgrade - swapNoFeeAndForward => swap_no_fee - swapTokensFixedInput => swap_tokens_fixed_input - swapTokensFixedOutput => swap_tokens_fixed_output setLpTokenIdentifier => set_lp_token_identifier getTokensForGivenPosition => get_tokens_for_given_position getReservesAndTotalSupply => get_reserves_and_total_supply @@ -75,6 +72,9 @@ multiversx_sc_wasm_adapter::endpoints! { addLiquidity => add_liquidity removeLiquidity => remove_liquidity removeLiquidityAndBuyBackAndBurnToken => remove_liquidity_and_burn_token + swapNoFeeAndForward => swap_no_fee + swapTokensFixedInput => swap_tokens_fixed_input + swapTokensFixedOutput => swap_tokens_fixed_output ) } diff --git a/dex/router/src/multi_pair_swap.rs b/dex/router/src/multi_pair_swap.rs index e537beed9..3b0f73620 100644 --- a/dex/router/src/multi_pair_swap.rs +++ b/dex/router/src/multi_pair_swap.rs @@ -1,9 +1,9 @@ multiversx_sc::imports!(); multiversx_sc::derive_imports!(); -use super::factory; +use pair::pair_actions::swap::ProxyTrait as _; -use pair::ProxyTrait as _; +use super::factory; type SwapOperationType = MultiValue4, ManagedBuffer, TokenIdentifier, BigUint>; From 7b683db451d85c3d9a82593ace3cc3fc893c93cc Mon Sep 17 00:00:00 2001 From: Dorin Marian Iancu Date: Thu, 25 Jan 2024 10:53:28 +0200 Subject: [PATCH 159/213] views --- dex/pair/src/lib.rs | 95 +--------------------- dex/pair/src/pair_actions/mod.rs | 1 + dex/pair/src/pair_actions/views.rs | 113 ++++++++++++++++++++++++++ dex/pair/wasm-pair-full/src/lib.rs | 10 +-- dex/pair/wasm/src/lib.rs | 10 +-- dex/router/src/enable_swap_by_user.rs | 2 +- 6 files changed, 126 insertions(+), 105 deletions(-) create mode 100644 dex/pair/src/pair_actions/views.rs diff --git a/dex/pair/src/lib.rs b/dex/pair/src/lib.rs index b4dd4a3cf..9da3d5067 100644 --- a/dex/pair/src/lib.rs +++ b/dex/pair/src/lib.rs @@ -43,6 +43,7 @@ pub trait Pair: + pair_actions::add_liq::AddLiquidityModule + pair_actions::remove_liq::RemoveLiquidityModule + pair_actions::swap::SwapModule + + pair_actions::views::ViewsModule + pair_actions::common_methods::CommonMethodsModule { #[init] @@ -119,98 +120,4 @@ pub trait Pair: ); self.lp_token_identifier().set(&token_identifier); } - - #[view(getTokensForGivenPosition)] - fn get_tokens_for_given_position( - &self, - liquidity: BigUint, - ) -> MultiValue2, EsdtTokenPayment> { - self.get_both_tokens_for_given_position(liquidity) - } - - #[view(getReservesAndTotalSupply)] - fn get_reserves_and_total_supply(&self) -> MultiValue3 { - let first_token_id = self.first_token_id().get(); - let second_token_id = self.second_token_id().get(); - let first_token_reserve = self.pair_reserve(&first_token_id).get(); - let second_token_reserve = self.pair_reserve(&second_token_id).get(); - let total_supply = self.lp_token_supply().get(); - (first_token_reserve, second_token_reserve, total_supply).into() - } - - #[view(getAmountOut)] - fn get_amount_out_view(&self, token_in: TokenIdentifier, amount_in: BigUint) -> BigUint { - require!(amount_in > 0u64, ERROR_ZERO_AMOUNT); - - let first_token_id = self.first_token_id().get(); - let second_token_id = self.second_token_id().get(); - let first_token_reserve = self.pair_reserve(&first_token_id).get(); - let second_token_reserve = self.pair_reserve(&second_token_id).get(); - - if token_in == first_token_id { - require!(second_token_reserve > 0u64, ERROR_NOT_ENOUGH_RESERVE); - let amount_out = - self.get_amount_out(&amount_in, &first_token_reserve, &second_token_reserve); - require!(second_token_reserve > amount_out, ERROR_NOT_ENOUGH_RESERVE); - amount_out - } else if token_in == second_token_id { - require!(first_token_reserve > 0u64, ERROR_NOT_ENOUGH_RESERVE); - let amount_out = - self.get_amount_out(&amount_in, &second_token_reserve, &first_token_reserve); - require!(first_token_reserve > amount_out, ERROR_NOT_ENOUGH_RESERVE); - amount_out - } else { - sc_panic!(ERROR_UNKNOWN_TOKEN); - } - } - - #[view(getAmountIn)] - fn get_amount_in_view(&self, token_wanted: TokenIdentifier, amount_wanted: BigUint) -> BigUint { - require!(amount_wanted > 0u64, ERROR_ZERO_AMOUNT); - - let first_token_id = self.first_token_id().get(); - let second_token_id = self.second_token_id().get(); - let first_token_reserve = self.pair_reserve(&first_token_id).get(); - let second_token_reserve = self.pair_reserve(&second_token_id).get(); - - if token_wanted == first_token_id { - require!( - first_token_reserve > amount_wanted, - ERROR_NOT_ENOUGH_RESERVE - ); - - self.get_amount_in(&amount_wanted, &second_token_reserve, &first_token_reserve) - } else if token_wanted == second_token_id { - require!( - second_token_reserve > amount_wanted, - ERROR_NOT_ENOUGH_RESERVE - ); - - self.get_amount_in(&amount_wanted, &first_token_reserve, &second_token_reserve) - } else { - sc_panic!(ERROR_UNKNOWN_TOKEN); - } - } - - #[view(getEquivalent)] - fn get_equivalent(&self, token_in: TokenIdentifier, amount_in: BigUint) -> BigUint { - require!(amount_in > 0u64, ERROR_ZERO_AMOUNT); - let zero = BigUint::zero(); - - let first_token_id = self.first_token_id().get(); - let second_token_id = self.second_token_id().get(); - let first_token_reserve = self.pair_reserve(&first_token_id).get(); - let second_token_reserve = self.pair_reserve(&second_token_id).get(); - if first_token_reserve == 0u64 || second_token_reserve == 0u64 { - return zero; - } - - if token_in == first_token_id { - self.quote(&amount_in, &first_token_reserve, &second_token_reserve) - } else if token_in == second_token_id { - self.quote(&amount_in, &second_token_reserve, &first_token_reserve) - } else { - sc_panic!(ERROR_UNKNOWN_TOKEN); - } - } } diff --git a/dex/pair/src/pair_actions/mod.rs b/dex/pair/src/pair_actions/mod.rs index 1b4c36ed1..277650055 100644 --- a/dex/pair/src/pair_actions/mod.rs +++ b/dex/pair/src/pair_actions/mod.rs @@ -4,3 +4,4 @@ pub mod common_result_types; pub mod initial_liq; pub mod remove_liq; pub mod swap; +pub mod views; diff --git a/dex/pair/src/pair_actions/views.rs b/dex/pair/src/pair_actions/views.rs new file mode 100644 index 000000000..878b3bd5e --- /dev/null +++ b/dex/pair/src/pair_actions/views.rs @@ -0,0 +1,113 @@ +use crate::{ERROR_NOT_ENOUGH_RESERVE, ERROR_UNKNOWN_TOKEN, ERROR_ZERO_AMOUNT}; + +multiversx_sc::imports!(); + +#[multiversx_sc::module] +pub trait ViewsModule: + crate::liquidity_pool::LiquidityPoolModule + + crate::amm::AmmModule + + crate::contexts::output_builder::OutputBuilderModule + + crate::locking_wrapper::LockingWrapperModule + + crate::events::EventsModule + + crate::safe_price::SafePriceModule + + crate::fee::FeeModule + + crate::config::ConfigModule + + token_send::TokenSendModule + + permissions_module::PermissionsModule + + pausable::PausableModule + + super::common_methods::CommonMethodsModule +{ + #[view(getTokensForGivenPosition)] + fn get_tokens_for_given_position( + &self, + liquidity: BigUint, + ) -> MultiValue2, EsdtTokenPayment> { + self.get_both_tokens_for_given_position(liquidity) + } + + #[view(getReservesAndTotalSupply)] + fn get_reserves_and_total_supply(&self) -> MultiValue3 { + let first_token_id = self.first_token_id().get(); + let second_token_id = self.second_token_id().get(); + let first_token_reserve = self.pair_reserve(&first_token_id).get(); + let second_token_reserve = self.pair_reserve(&second_token_id).get(); + let total_supply = self.lp_token_supply().get(); + (first_token_reserve, second_token_reserve, total_supply).into() + } + + #[view(getAmountOut)] + fn get_amount_out_view(&self, token_in: TokenIdentifier, amount_in: BigUint) -> BigUint { + require!(amount_in > 0u64, ERROR_ZERO_AMOUNT); + + let first_token_id = self.first_token_id().get(); + let second_token_id = self.second_token_id().get(); + let first_token_reserve = self.pair_reserve(&first_token_id).get(); + let second_token_reserve = self.pair_reserve(&second_token_id).get(); + + if token_in == first_token_id { + require!(second_token_reserve > 0u64, ERROR_NOT_ENOUGH_RESERVE); + let amount_out = + self.get_amount_out(&amount_in, &first_token_reserve, &second_token_reserve); + require!(second_token_reserve > amount_out, ERROR_NOT_ENOUGH_RESERVE); + amount_out + } else if token_in == second_token_id { + require!(first_token_reserve > 0u64, ERROR_NOT_ENOUGH_RESERVE); + let amount_out = + self.get_amount_out(&amount_in, &second_token_reserve, &first_token_reserve); + require!(first_token_reserve > amount_out, ERROR_NOT_ENOUGH_RESERVE); + amount_out + } else { + sc_panic!(ERROR_UNKNOWN_TOKEN); + } + } + + #[view(getAmountIn)] + fn get_amount_in_view(&self, token_wanted: TokenIdentifier, amount_wanted: BigUint) -> BigUint { + require!(amount_wanted > 0u64, ERROR_ZERO_AMOUNT); + + let first_token_id = self.first_token_id().get(); + let second_token_id = self.second_token_id().get(); + let first_token_reserve = self.pair_reserve(&first_token_id).get(); + let second_token_reserve = self.pair_reserve(&second_token_id).get(); + + if token_wanted == first_token_id { + require!( + first_token_reserve > amount_wanted, + ERROR_NOT_ENOUGH_RESERVE + ); + + self.get_amount_in(&amount_wanted, &second_token_reserve, &first_token_reserve) + } else if token_wanted == second_token_id { + require!( + second_token_reserve > amount_wanted, + ERROR_NOT_ENOUGH_RESERVE + ); + + self.get_amount_in(&amount_wanted, &first_token_reserve, &second_token_reserve) + } else { + sc_panic!(ERROR_UNKNOWN_TOKEN); + } + } + + #[view(getEquivalent)] + fn get_equivalent(&self, token_in: TokenIdentifier, amount_in: BigUint) -> BigUint { + require!(amount_in > 0u64, ERROR_ZERO_AMOUNT); + let zero = BigUint::zero(); + + let first_token_id = self.first_token_id().get(); + let second_token_id = self.second_token_id().get(); + let first_token_reserve = self.pair_reserve(&first_token_id).get(); + let second_token_reserve = self.pair_reserve(&second_token_id).get(); + if first_token_reserve == 0u64 || second_token_reserve == 0u64 { + return zero; + } + + if token_in == first_token_id { + self.quote(&amount_in, &first_token_reserve, &second_token_reserve) + } else if token_in == second_token_id { + self.quote(&amount_in, &second_token_reserve, &first_token_reserve) + } else { + sc_panic!(ERROR_UNKNOWN_TOKEN); + } + } +} diff --git a/dex/pair/wasm-pair-full/src/lib.rs b/dex/pair/wasm-pair-full/src/lib.rs index ea7c4e8d2..149c4a91b 100644 --- a/dex/pair/wasm-pair-full/src/lib.rs +++ b/dex/pair/wasm-pair-full/src/lib.rs @@ -22,11 +22,6 @@ multiversx_sc_wasm_adapter::endpoints! { init => init upgrade => upgrade setLpTokenIdentifier => set_lp_token_identifier - getTokensForGivenPosition => get_tokens_for_given_position - getReservesAndTotalSupply => get_reserves_and_total_supply - getAmountOut => get_amount_out_view - getAmountIn => get_amount_in_view - getEquivalent => get_equivalent getFeeState => is_fee_enabled whitelist => whitelist_endpoint removeWhitelist => remove_whitelist @@ -75,6 +70,11 @@ multiversx_sc_wasm_adapter::endpoints! { swapNoFeeAndForward => swap_no_fee swapTokensFixedInput => swap_tokens_fixed_input swapTokensFixedOutput => swap_tokens_fixed_output + getTokensForGivenPosition => get_tokens_for_given_position + getReservesAndTotalSupply => get_reserves_and_total_supply + getAmountOut => get_amount_out_view + getAmountIn => get_amount_in_view + getEquivalent => get_equivalent getLpTokensSafePriceByDefaultOffset => get_lp_tokens_safe_price_by_default_offset getLpTokensSafePriceByRoundOffset => get_lp_tokens_safe_price_by_round_offset getLpTokensSafePriceByTimestampOffset => get_lp_tokens_safe_price_by_timestamp_offset diff --git a/dex/pair/wasm/src/lib.rs b/dex/pair/wasm/src/lib.rs index 268a50e9c..82a357b8a 100644 --- a/dex/pair/wasm/src/lib.rs +++ b/dex/pair/wasm/src/lib.rs @@ -22,11 +22,6 @@ multiversx_sc_wasm_adapter::endpoints! { init => init upgrade => upgrade setLpTokenIdentifier => set_lp_token_identifier - getTokensForGivenPosition => get_tokens_for_given_position - getReservesAndTotalSupply => get_reserves_and_total_supply - getAmountOut => get_amount_out_view - getAmountIn => get_amount_in_view - getEquivalent => get_equivalent getFeeState => is_fee_enabled whitelist => whitelist_endpoint removeWhitelist => remove_whitelist @@ -75,6 +70,11 @@ multiversx_sc_wasm_adapter::endpoints! { swapNoFeeAndForward => swap_no_fee swapTokensFixedInput => swap_tokens_fixed_input swapTokensFixedOutput => swap_tokens_fixed_output + getTokensForGivenPosition => get_tokens_for_given_position + getReservesAndTotalSupply => get_reserves_and_total_supply + getAmountOut => get_amount_out_view + getAmountIn => get_amount_in_view + getEquivalent => get_equivalent ) } diff --git a/dex/router/src/enable_swap_by_user.rs b/dex/router/src/enable_swap_by_user.rs index eec3f4d02..f1857403e 100644 --- a/dex/router/src/enable_swap_by_user.rs +++ b/dex/router/src/enable_swap_by_user.rs @@ -1,7 +1,7 @@ multiversx_sc::imports!(); multiversx_sc::derive_imports!(); -use pair::config::ProxyTrait as _; +use pair::{config::ProxyTrait as _, pair_actions::views::ProxyTrait as _}; use pausable::{ProxyTrait as _, State}; use simple_lock::locked_token::LockedTokenAttributes; From 489f715e9e2e6fc6d6830bafb5eec3a6e2ca838c Mon Sep 17 00:00:00 2001 From: Dorin Marian Iancu Date: Thu, 25 Jan 2024 10:55:48 +0200 Subject: [PATCH 160/213] fmt --- dex/pair/src/liquidity_pool.rs | 16 ++++++++-------- dex/pair/src/pair_actions/remove_liq.rs | 6 +++++- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/dex/pair/src/liquidity_pool.rs b/dex/pair/src/liquidity_pool.rs index 5e292e199..4797772e3 100644 --- a/dex/pair/src/liquidity_pool.rs +++ b/dex/pair/src/liquidity_pool.rs @@ -154,14 +154,14 @@ pub trait LiquidityPoolModule: context.first_token_optimal_amount = first_token_amount_optimal; context.second_token_optimal_amount = second_token_amount_desired.clone(); } - require!( - context.first_token_optimal_amount >= context.first_token_amount_min, - ERROR_INSUFFICIENT_FIRST_TOKEN - ); - require!( - context.second_token_optimal_amount >= context.second_token_amount_min, - ERROR_INSUFFICIENT_SECOND_TOKEN - ); + require!( + context.first_token_optimal_amount >= context.first_token_amount_min, + ERROR_INSUFFICIENT_FIRST_TOKEN + ); + require!( + context.second_token_optimal_amount >= context.second_token_amount_min, + ERROR_INSUFFICIENT_SECOND_TOKEN + ); } fn get_token_for_given_position( diff --git a/dex/pair/src/pair_actions/remove_liq.rs b/dex/pair/src/pair_actions/remove_liq.rs index a1f234226..898d99ccf 100644 --- a/dex/pair/src/pair_actions/remove_liq.rs +++ b/dex/pair/src/pair_actions/remove_liq.rs @@ -1,4 +1,8 @@ -use crate::{contexts::remove_liquidity::RemoveLiquidityContext, StorageCache, SwapTokensOrder, ERROR_BAD_PAYMENT_TOKENS, ERROR_INVALID_ARGS, ERROR_K_INVARIANT_FAILED, ERROR_LP_TOKEN_NOT_ISSUED, ERROR_NOT_ACTIVE, ERROR_NOT_WHITELISTED}; +use crate::{ + contexts::remove_liquidity::RemoveLiquidityContext, StorageCache, SwapTokensOrder, + ERROR_BAD_PAYMENT_TOKENS, ERROR_INVALID_ARGS, ERROR_K_INVARIANT_FAILED, + ERROR_LP_TOKEN_NOT_ISSUED, ERROR_NOT_ACTIVE, ERROR_NOT_WHITELISTED, +}; use super::common_result_types::RemoveLiquidityResultType; From f331e61e4f9e20e93f24fad7d8f269a6c9496512 Mon Sep 17 00:00:00 2001 From: Dorin Marian Iancu Date: Thu, 25 Jan 2024 12:27:43 +0200 Subject: [PATCH 161/213] hooks definition --- common/modules/utils/src/lib.rs | 4 ++ dex/pair/Cargo.toml | 3 ++ dex/pair/src/lib.rs | 8 ++++ dex/pair/src/pair_hooks/banned_address.rs | 34 ++++++++++++++++ dex/pair/src/pair_hooks/call_hook.rs | 47 +++++++++++++++++++++++ dex/pair/src/pair_hooks/change_hooks.rs | 43 +++++++++++++++++++++ dex/pair/src/pair_hooks/hook_type.rs | 23 +++++++++++ dex/pair/src/pair_hooks/mod.rs | 4 ++ dex/pair/wasm-pair-full/Cargo.lock | 1 + dex/pair/wasm-pair-full/src/lib.rs | 8 +++- dex/pair/wasm-safe-price-view/Cargo.lock | 1 + dex/pair/wasm/Cargo.lock | 1 + dex/pair/wasm/src/lib.rs | 8 +++- 13 files changed, 181 insertions(+), 4 deletions(-) create mode 100644 dex/pair/src/pair_hooks/banned_address.rs create mode 100644 dex/pair/src/pair_hooks/call_hook.rs create mode 100644 dex/pair/src/pair_hooks/change_hooks.rs create mode 100644 dex/pair/src/pair_hooks/hook_type.rs create mode 100644 dex/pair/src/pair_hooks/mod.rs diff --git a/common/modules/utils/src/lib.rs b/common/modules/utils/src/lib.rs index 31d384146..990b88329 100644 --- a/common/modules/utils/src/lib.rs +++ b/common/modules/utils/src/lib.rs @@ -126,4 +126,8 @@ pub trait UtilsModule { "Invalid SC address" ); } + + fn require_not_empty_buffer(&self, buffer: &ManagedBuffer) { + require!(!buffer.is_empty(), "Empty buffer"); + } } diff --git a/dex/pair/Cargo.toml b/dex/pair/Cargo.toml index 9c2412b29..457fb8d8f 100644 --- a/dex/pair/Cargo.toml +++ b/dex/pair/Cargo.toml @@ -29,6 +29,9 @@ path = "../../locked-asset/simple-lock" [dependencies.fees-collector] path = "../../energy-integration/fees-collector" +[dependencies.utils] +path = "../../common/modules/utils" + [dependencies.itertools] version = "0.10.1" default-features = false diff --git a/dex/pair/src/lib.rs b/dex/pair/src/lib.rs index 9da3d5067..8d4d909f8 100644 --- a/dex/pair/src/lib.rs +++ b/dex/pair/src/lib.rs @@ -12,6 +12,7 @@ pub mod fee; mod liquidity_pool; pub mod locking_wrapper; pub mod pair_actions; +pub mod pair_hooks; pub mod safe_price; pub mod safe_price_view; @@ -45,6 +46,10 @@ pub trait Pair: + pair_actions::swap::SwapModule + pair_actions::views::ViewsModule + pair_actions::common_methods::CommonMethodsModule + + pair_hooks::banned_address::BannedAddressModule + + pair_hooks::change_hooks::ChangeHooksModule + + pair_hooks::call_hook::CallHookModule + + utils::UtilsModule { #[init] fn init( @@ -96,6 +101,9 @@ pub trait Pair: ); self.add_permissions_for_all(admins, Permissions::ADMIN); }; + + let sc_address = self.blockchain().get_sc_address(); + self.banned_addresses().add(&sc_address); } #[endpoint] diff --git a/dex/pair/src/pair_hooks/banned_address.rs b/dex/pair/src/pair_hooks/banned_address.rs new file mode 100644 index 000000000..e806b5d0c --- /dev/null +++ b/dex/pair/src/pair_hooks/banned_address.rs @@ -0,0 +1,34 @@ +multiversx_sc::imports!(); + +#[multiversx_sc::module] +pub trait BannedAddressModule: permissions_module::PermissionsModule { + #[endpoint(addBannedAddress)] + fn add_banned_address(&self, addresses: MultiValueEncoded) { + self.require_caller_has_owner_or_admin_permissions(); + + let mapper = self.banned_addresses(); + for address in addresses { + mapper.add(&address); + } + } + + #[endpoint(removeBannedAddress)] + fn remove_banned_address(&self, addresses: MultiValueEncoded) { + self.require_caller_has_owner_or_admin_permissions(); + + let mapper = self.banned_addresses(); + for address in addresses { + mapper.remove(&address); + } + } + + fn require_not_banned_address(&self, address: &ManagedAddress) { + require!( + !self.banned_addresses().contains(address), + "Cannot add hook for this address" + ); + } + + #[storage_mapper("bannedAddresses")] + fn banned_addresses(&self) -> WhitelistMapper; +} diff --git a/dex/pair/src/pair_hooks/call_hook.rs b/dex/pair/src/pair_hooks/call_hook.rs new file mode 100644 index 000000000..1cae35c9b --- /dev/null +++ b/dex/pair/src/pair_hooks/call_hook.rs @@ -0,0 +1,47 @@ +use common_structs::PaymentsVec; + +use super::hook_type::{Hook, HookType}; + +multiversx_sc::imports!(); + +#[multiversx_sc::module] +pub trait CallHookModule { + fn call_hook( + &self, + hook_type: HookType, + caller: ManagedAddress, + input_payments: PaymentsVec, + args: ManagedVec, + ) -> PaymentsVec { + let hooks = self.hooks(hook_type).get(); + if hooks.is_empty() { + return input_payments; + } + + let mut call_args = ManagedArgBuffer::new(); + call_args.push_arg(caller); + + for arg in &args { + call_args.push_arg(arg); + } + + let mut output_payments = input_payments; + for hook in &hooks { + let (_, back_transfers) = + ContractCallNoPayment::<_, MultiValueEncoded>::new( + hook.dest_address, + hook.endpoint_name, + ) + .with_raw_arguments(call_args.clone()) + .with_multi_token_transfer(output_payments) + .execute_on_dest_context_with_back_transfers::>(); + + output_payments = back_transfers.esdt_payments; + } + + output_payments + } + + #[storage_mapper("hooks")] + fn hooks(&self, hook_type: HookType) -> SingleValueMapper>>; +} diff --git a/dex/pair/src/pair_hooks/change_hooks.rs b/dex/pair/src/pair_hooks/change_hooks.rs new file mode 100644 index 000000000..39d444c9c --- /dev/null +++ b/dex/pair/src/pair_hooks/change_hooks.rs @@ -0,0 +1,43 @@ +use super::hook_type::{Hook, HookType}; + +multiversx_sc::imports!(); + +#[multiversx_sc::module] +pub trait ChangeHooksModule: + super::call_hook::CallHookModule + + super::banned_address::BannedAddressModule + + permissions_module::PermissionsModule + + utils::UtilsModule +{ + #[endpoint(addHook)] + fn add_hook(&self, hook_type: HookType, to: ManagedAddress, endpoint_name: ManagedBuffer) { + self.require_caller_has_owner_or_admin_permissions(); + self.require_not_banned_address(&to); + self.require_sc_address(&to); + self.require_not_empty_buffer(&endpoint_name); + + self.hooks(hook_type).update(|hooks| { + hooks.push(Hook { + dest_address: to, + endpoint_name, + }) + }); + } + + #[endpoint(removeHook)] + fn remove_hook(&self, hook_type: HookType, to: ManagedAddress, endpoint_name: ManagedBuffer) { + self.require_caller_has_owner_or_admin_permissions(); + + self.hooks(hook_type).update(|hooks| { + let opt_index = hooks.find(&Hook { + dest_address: to, + endpoint_name, + }); + + require!(opt_index.is_some(), "Item not found"); + + let index = unsafe { opt_index.unwrap_unchecked() }; + hooks.remove(index); + }) + } +} diff --git a/dex/pair/src/pair_hooks/hook_type.rs b/dex/pair/src/pair_hooks/hook_type.rs new file mode 100644 index 000000000..f18a84496 --- /dev/null +++ b/dex/pair/src/pair_hooks/hook_type.rs @@ -0,0 +1,23 @@ +multiversx_sc::imports!(); +multiversx_sc::derive_imports!(); + +#[derive(TypeAbi, TopEncode, TopDecode, NestedEncode, NestedDecode, Clone, Copy)] +pub enum HookType { + // can't be done, execute_on_dest does not work on init + _BeforeInitialize, + _AfterInitialize, + BeforeAddInitialLiq, + AfterAddInitialLiq, + BeforeAddLiq, + AfterAddLiq, + BeforeRemoveLiq, + AfterRemoveLiq, + BeforeSwap, + AfterSwap, +} + +#[derive(TypeAbi, TopEncode, TopDecode, NestedEncode, NestedDecode, ManagedVecItem, PartialEq)] +pub struct Hook { + pub dest_address: ManagedAddress, + pub endpoint_name: ManagedBuffer, +} diff --git a/dex/pair/src/pair_hooks/mod.rs b/dex/pair/src/pair_hooks/mod.rs new file mode 100644 index 000000000..db189828b --- /dev/null +++ b/dex/pair/src/pair_hooks/mod.rs @@ -0,0 +1,4 @@ +pub mod banned_address; +pub mod call_hook; +pub mod change_hooks; +pub mod hook_type; diff --git a/dex/pair/wasm-pair-full/Cargo.lock b/dex/pair/wasm-pair-full/Cargo.lock index 2cc5bc171..77c4e33e1 100644 --- a/dex/pair/wasm-pair-full/Cargo.lock +++ b/dex/pair/wasm-pair-full/Cargo.lock @@ -256,6 +256,7 @@ dependencies = [ "permissions_module", "simple-lock", "token_send", + "utils", ] [[package]] diff --git a/dex/pair/wasm-pair-full/src/lib.rs b/dex/pair/wasm-pair-full/src/lib.rs index 149c4a91b..de0788bb7 100644 --- a/dex/pair/wasm-pair-full/src/lib.rs +++ b/dex/pair/wasm-pair-full/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 64 +// Endpoints: 68 // Async Callback (empty): 1 -// Total number of exported functions: 66 +// Total number of exported functions: 70 #![no_std] #![allow(internal_features)] @@ -75,6 +75,10 @@ multiversx_sc_wasm_adapter::endpoints! { getAmountOut => get_amount_out_view getAmountIn => get_amount_in_view getEquivalent => get_equivalent + addBannedAddress => add_banned_address + removeBannedAddress => remove_banned_address + addHook => add_hook + removeHook => remove_hook getLpTokensSafePriceByDefaultOffset => get_lp_tokens_safe_price_by_default_offset getLpTokensSafePriceByRoundOffset => get_lp_tokens_safe_price_by_round_offset getLpTokensSafePriceByTimestampOffset => get_lp_tokens_safe_price_by_timestamp_offset diff --git a/dex/pair/wasm-safe-price-view/Cargo.lock b/dex/pair/wasm-safe-price-view/Cargo.lock index 01ffaeeab..48471aad0 100644 --- a/dex/pair/wasm-safe-price-view/Cargo.lock +++ b/dex/pair/wasm-safe-price-view/Cargo.lock @@ -256,6 +256,7 @@ dependencies = [ "permissions_module", "simple-lock", "token_send", + "utils", ] [[package]] diff --git a/dex/pair/wasm/Cargo.lock b/dex/pair/wasm/Cargo.lock index e10e905d3..c1f2406db 100644 --- a/dex/pair/wasm/Cargo.lock +++ b/dex/pair/wasm/Cargo.lock @@ -256,6 +256,7 @@ dependencies = [ "permissions_module", "simple-lock", "token_send", + "utils", ] [[package]] diff --git a/dex/pair/wasm/src/lib.rs b/dex/pair/wasm/src/lib.rs index 82a357b8a..88e3bc52e 100644 --- a/dex/pair/wasm/src/lib.rs +++ b/dex/pair/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 55 +// Endpoints: 59 // Async Callback (empty): 1 -// Total number of exported functions: 57 +// Total number of exported functions: 61 #![no_std] #![allow(internal_features)] @@ -75,6 +75,10 @@ multiversx_sc_wasm_adapter::endpoints! { getAmountOut => get_amount_out_view getAmountIn => get_amount_in_view getEquivalent => get_equivalent + addBannedAddress => add_banned_address + removeBannedAddress => remove_banned_address + addHook => add_hook + removeHook => remove_hook ) } From 29f098a0ab392ccfcdeb58cceecbe4f21546312c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Fri, 26 Jan 2024 13:01:04 +0200 Subject: [PATCH 162/213] Destroy farm in simple-lock --- .../simple-lock/src/lp_interactions.rs | 22 ++++++ locked-asset/simple-lock/src/proxy_farm.rs | 67 +++++++++---------- locked-asset/simple-lock/src/proxy_lp.rs | 11 ++- locked-asset/simple-lock/wasm/src/lib.rs | 5 +- 4 files changed, 67 insertions(+), 38 deletions(-) diff --git a/locked-asset/simple-lock/src/lp_interactions.rs b/locked-asset/simple-lock/src/lp_interactions.rs index 4229cca53..86e229a3f 100644 --- a/locked-asset/simple-lock/src/lp_interactions.rs +++ b/locked-asset/simple-lock/src/lp_interactions.rs @@ -123,6 +123,28 @@ pub trait LpInteractionsModule { } } + fn call_pair_remove_liquidity_simple( + &self, + lp_address: ManagedAddress, + lp_token_id: TokenIdentifier, + lp_token_amount: BigUint, + first_token_amount_min: BigUint, + second_token_amount_min: BigUint, + ) -> RemoveLiquidityResultWrapper { + let lp_payments_out: RemoveLiquidityResultType = self + .lp_proxy(lp_address) + .remove_liquidity(first_token_amount_min, second_token_amount_min) + .with_esdt_transfer((lp_token_id, 0, lp_token_amount)) + .execute_on_dest_context(); + + let (first_token_payment_out, second_token_payment_out) = lp_payments_out.into_tuple(); + + RemoveLiquidityResultWrapper { + first_token_payment_out, + second_token_payment_out, + } + } + #[proxy] fn lp_proxy(&self, sc_address: ManagedAddress) -> lp_proxy::Proxy; } diff --git a/locked-asset/simple-lock/src/proxy_farm.rs b/locked-asset/simple-lock/src/proxy_farm.rs index 9fd4e906b..d380179ec 100644 --- a/locked-asset/simple-lock/src/proxy_farm.rs +++ b/locked-asset/simple-lock/src/proxy_farm.rs @@ -1,10 +1,9 @@ multiversx_sc::imports!(); multiversx_sc::derive_imports!(); -use crate::{ - error_messages::*, - proxy_lp::{LpProxyTokenAttributes, RemoveLiquidityThroughProxyResultType}, -}; +use multiversx_sc_modules::transfer_role_proxy::PaymentsVec; + +use crate::{error_messages::*, proxy_lp::LpProxyTokenAttributes}; #[derive( TypeAbi, TopEncode, TopDecode, NestedEncode, NestedDecode, PartialEq, Debug, Clone, Copy, @@ -251,20 +250,20 @@ pub trait ProxyFarmModule: (lp_proxy_token_payment, exit_farm_result.reward_tokens).into() } - /// Exit a farm previously entered through `enterFarmLockedToken`. + /// Destroy a farm to the original tokens. /// - /// Expected payment: FARM_PROXY tokens + /// Expected payment: Original tokens tokens /// /// Output Payments: /// - original tokens /// - farm reward tokens #[payable("*")] - #[endpoint(exitFarmLockedTokenToTokens)] - fn exit_farm_locked_token_to_tokens( + #[endpoint(destroyFarmLockedTokens)] + fn destroy_farm_locked_tokens( &self, first_token_min_amount_out: BigUint, - second_token_min_amont_out: BigUint, - ) -> RemoveLiquidityThroughProxyResultType { + second_token_min_amount_out: BigUint, + ) -> ExitFarmThroughProxyResultType { let payment: EsdtTokenPayment = self.call_value().single_esdt(); let farm_proxy_token_attributes: FarmProxyTokenAttributes = @@ -288,37 +287,35 @@ pub trait ProxyFarmModule: INVALID_PAYMENTS_RECEIVED_FROM_FARM_ERR_MSG ); + let mut output_payments = PaymentsVec::new(); if exit_farm_result.reward_tokens.amount > 0 { - self.send().direct_esdt( - &caller, - &exit_farm_result.reward_tokens.token_identifier, - exit_farm_result.reward_tokens.token_nonce, - &exit_farm_result.reward_tokens.amount, - ); + output_payments.push(exit_farm_result.reward_tokens); } - let remove_liquidity_result = self.remove_liquidity_locked_token_common( - exit_farm_result.initial_farming_tokens, + let initial_farming_tokens = exit_farm_result.initial_farming_tokens; + + let lp_address = self + .lp_address_for_lp(&initial_farming_tokens.token_identifier) + .get(); + + let remove_liq_result = self.call_pair_remove_liquidity_simple( + lp_address, + initial_farming_tokens.token_identifier, + initial_farming_tokens.amount, first_token_min_amount_out, - second_token_min_amont_out, + second_token_min_amount_out, ); - // let lp_proxy_token = self.lp_proxy_token(); - - // let lp_proxy_token_payment = EsdtTokenPayment::new( - // lp_proxy_token.get_token_id(), - // farm_proxy_token_attributes.farming_token_locked_nonce, - // exit_farm_result.initial_farming_tokens.amount, - // ); - // self.send().direct_esdt( - // &caller, - // &lp_proxy_token_payment.token_identifier, - // lp_proxy_token_payment.token_nonce, - // &lp_proxy_token_payment.amount, - // ); - - // (lp_proxy_token_payment, exit_farm_result.reward_tokens).into() - remove_liquidity_result + output_payments.push(remove_liq_result.first_token_payment_out.clone()); + output_payments.push(remove_liq_result.second_token_payment_out.clone()); + + let caller = self.blockchain().get_caller(); + self.send().direct_multi(&caller, &output_payments); + + ( + remove_liq_result.first_token_payment_out.clone(), + remove_liq_result.second_token_payment_out, + ).into() } /// Claim rewards from a previously entered farm. diff --git a/locked-asset/simple-lock/src/proxy_lp.rs b/locked-asset/simple-lock/src/proxy_lp.rs index 4f85130f6..6987e9913 100644 --- a/locked-asset/simple-lock/src/proxy_lp.rs +++ b/locked-asset/simple-lock/src/proxy_lp.rs @@ -165,7 +165,7 @@ pub trait ProxyLpModule: ); let add_liq_result = self.call_pair_add_liquidity( - lp_address, + lp_address.clone(), ref_first_payment_unlocked, ref_second_payment_unlocked, first_token_amount_min, @@ -184,6 +184,8 @@ pub trait ProxyLpModule: second_payment_unlocked_wrapper.status_before, ); + self.lp_address_for_lp(&add_liq_result.lp_tokens.token_identifier).set(lp_address); + let lp_token_name = add_liq_result .lp_tokens .token_identifier @@ -393,6 +395,13 @@ pub trait ProxyLpModule: second_token_id: &TokenIdentifier, ) -> SingleValueMapper; + + #[storage_mapper("lpAddressForLp")] + fn lp_address_for_lp( + &self, + lp: &TokenIdentifier, + ) -> SingleValueMapper; + #[view(getLpProxyTokenId)] #[storage_mapper("lpProxyTokenId")] fn lp_proxy_token(&self) -> NonFungibleTokenMapper; diff --git a/locked-asset/simple-lock/wasm/src/lib.rs b/locked-asset/simple-lock/wasm/src/lib.rs index 4e1b87c7d..ad1446ca6 100644 --- a/locked-asset/simple-lock/wasm/src/lib.rs +++ b/locked-asset/simple-lock/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 20 +// Endpoints: 21 // Async Callback: 1 -// Total number of exported functions: 22 +// Total number of exported functions: 23 #![no_std] #![allow(internal_features)] @@ -37,6 +37,7 @@ multiversx_sc_wasm_adapter::endpoints! { removeFarmFromWhitelist => remove_farm_from_whitelist enterFarmLockedToken => enter_farm_locked_token exitFarmLockedToken => exit_farm_locked_token + destroyFarmLockedTokens => destroy_farm_locked_tokens farmClaimRewardsLockedToken => farm_claim_rewards_locked_token getKnownFarms => known_farms getFarmProxyTokenId => farm_proxy_token From 8c7a2707286d8a10bc225f5254bcbd8081287980 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Fri, 26 Jan 2024 13:01:29 +0200 Subject: [PATCH 163/213] Simple lock whitelist --- locked-asset/simple-lock-whitelist/wasm/src/lib.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/locked-asset/simple-lock-whitelist/wasm/src/lib.rs b/locked-asset/simple-lock-whitelist/wasm/src/lib.rs index d82101ff8..ce5b64928 100644 --- a/locked-asset/simple-lock-whitelist/wasm/src/lib.rs +++ b/locked-asset/simple-lock-whitelist/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 25 +// Endpoints: 26 // Async Callback: 1 -// Total number of exported functions: 27 +// Total number of exported functions: 28 #![no_std] #![allow(internal_features)] @@ -42,6 +42,7 @@ multiversx_sc_wasm_adapter::endpoints! { removeFarmFromWhitelist => remove_farm_from_whitelist enterFarmLockedToken => enter_farm_locked_token exitFarmLockedToken => exit_farm_locked_token + destroyFarmLockedTokens => destroy_farm_locked_tokens farmClaimRewardsLockedToken => farm_claim_rewards_locked_token getKnownFarms => known_farms getFarmProxyTokenId => farm_proxy_token From 0fa9b7b40105fba8fa3510fdec404cc7cddf72a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Fri, 26 Jan 2024 13:01:45 +0200 Subject: [PATCH 164/213] Destroy farm in proxy-dex --- locked-asset/proxy_dex/src/proxy_farm.rs | 73 ++++++ locked-asset/proxy_dex/src/proxy_pair.rs | 41 +++- .../proxy_dex/tests/proxy_farm_test.rs | 222 ++++++++++++++++++ locked-asset/proxy_dex/wasm/src/lib.rs | 5 +- 4 files changed, 332 insertions(+), 9 deletions(-) diff --git a/locked-asset/proxy_dex/src/proxy_farm.rs b/locked-asset/proxy_dex/src/proxy_farm.rs index 1d15c7528..5e2789c0c 100644 --- a/locked-asset/proxy_dex/src/proxy_farm.rs +++ b/locked-asset/proxy_dex/src/proxy_farm.rs @@ -234,6 +234,79 @@ pub trait ProxyFarmModule: (initial_proxy_farming_tokens, exit_result.reward_tokens).into() } + #[payable("*")] + #[endpoint(destroyFarmProxy)] + fn destroy_farm_proxy( + &self, + farm_address: ManagedAddress, + first_token_amount_min: BigUint, + second_token_amount_min: BigUint, + opt_original_caller: OptionalValue, + ) -> MultiValueEncoded { + self.require_is_intermediated_farm(&farm_address); + self.require_wrapped_farm_token_id_not_empty(); + self.require_wrapped_lp_token_id_not_empty(); + + let wrapped_farm_token_mapper = self.wrapped_farm_token(); + let payment = self.call_value().single_esdt(); + wrapped_farm_token_mapper.require_same_token(&payment.token_identifier); + + let full_wrapped_farm_attributes: WrappedFarmTokenAttributes = self + .blockchain() + .get_token_attributes(&payment.token_identifier, payment.token_nonce); + + let wrapped_farm_attributes_for_exit: WrappedFarmTokenAttributes = + full_wrapped_farm_attributes.into_part(&payment.amount); + + let caller = self.blockchain().get_caller(); + let original_caller = self.get_orig_caller_from_opt(&caller, opt_original_caller); + + let exit_result = self.call_exit_farm( + original_caller.clone(), + farm_address.clone(), + wrapped_farm_attributes_for_exit.farm_token.clone(), + ); + + self.burn_if_base_asset(&exit_result.farming_tokens); + + let wrapped_farm_tokens_for_initial_tokens = WrappedFarmToken { + payment: payment.clone(), + attributes: wrapped_farm_attributes_for_exit.clone(), + }; + + let initial_proxy_farming_tokens = self + .handle_farm_penalty_and_get_output_proxy_farming_token( + &original_caller, + wrapped_farm_tokens_for_initial_tokens, + exit_result.farming_tokens.amount, + ); + + let pair_address = self.lp_address_for_lp(&exit_result.farming_tokens.token_identifier).get(); + + let mut output_payments = self.remove_liquidity_proxy_common( + initial_proxy_farming_tokens.clone(), + pair_address, + first_token_amount_min, + second_token_amount_min, + ); + + // Push farm rewards + output_payments.push(exit_result.reward_tokens.clone()); + + self.send_multiple_tokens_if_not_zero(&caller, &output_payments); + + + self.emit_exit_farm_proxy_event( + &original_caller, + &farm_address, + payment, + wrapped_farm_attributes_for_exit, + exit_result.reward_tokens.clone(), + ); + + output_payments.into() + } + fn handle_farm_penalty_and_get_output_proxy_farming_token( &self, caller: &ManagedAddress, diff --git a/locked-asset/proxy_dex/src/proxy_pair.rs b/locked-asset/proxy_dex/src/proxy_pair.rs index 1536f41cb..1f3a032ab 100644 --- a/locked-asset/proxy_dex/src/proxy_pair.rs +++ b/locked-asset/proxy_dex/src/proxy_pair.rs @@ -68,6 +68,8 @@ pub trait ProxyPairModule: second_payment.amount.clone() - &add_liq_result.second_token_leftover.amount }; + self.lp_address_for_lp(&add_liq_result.lp_tokens_received.token_identifier).set(pair_address.clone()); + let new_token_attributes = WrappedLpTokenAttributes { locked_tokens: locked_token_used, lp_token_id: add_liq_result.lp_tokens_received.token_identifier.clone(), @@ -143,12 +145,32 @@ pub trait ProxyPairModule: self.require_wrapped_lp_token_id_not_empty(); let payment = self.call_value().single_esdt(); + + let output_payments = self.remove_liquidity_proxy_common( + payment, + pair_address, + first_token_amount_min, + second_token_amount_min, + ); + let caller = self.blockchain().get_caller(); + self.send_multiple_tokens_if_not_zero(&caller, &output_payments); + + output_payments.into() + } + + fn remove_liquidity_proxy_common( + &self, + input_payment: EsdtTokenPayment, + pair_address: ManagedAddress, + first_token_amount_min: BigUint, + second_token_amount_min: BigUint, + ) -> ManagedVec { let wrapped_lp_mapper = self.wrapped_lp_token(); - wrapped_lp_mapper.require_same_token(&payment.token_identifier); + wrapped_lp_mapper.require_same_token(&input_payment.token_identifier); let caller = self.blockchain().get_caller(); let attributes: WrappedLpTokenAttributes = - self.get_attributes_as_part_of_fixed_supply(&payment, &wrapped_lp_mapper); + self.get_attributes_as_part_of_fixed_supply(&input_payment, &wrapped_lp_mapper); let remove_liq_result = self.call_remove_liquidity( pair_address.clone(), @@ -206,20 +228,18 @@ pub trait ProxyPairModule: let other_tokens = received_token_refs.other_token_ref.clone(); output_payments.push(other_tokens); - wrapped_lp_mapper.nft_burn(payment.token_nonce, &payment.amount); - - self.send_multiple_tokens_if_not_zero(&caller, &output_payments); + wrapped_lp_mapper.nft_burn(input_payment.token_nonce, &input_payment.amount); self.emit_remove_liquidity_proxy_event( &caller, &pair_address, - payment, + input_payment, attributes, remove_liq_result.first_token_received, remove_liq_result.second_token_received, ); - output_payments.into() + output_payments } #[payable("*")] @@ -278,4 +298,11 @@ pub trait ProxyPairModule: fn require_wrapped_lp_token_id_not_empty(&self) { require!(!self.wrapped_lp_token().is_empty(), "Empty token id"); } + + #[storage_mapper("lpAddressForLp")] + fn lp_address_for_lp( + &self, + lp: &TokenIdentifier, + ) -> SingleValueMapper; + } diff --git a/locked-asset/proxy_dex/tests/proxy_farm_test.rs b/locked-asset/proxy_dex/tests/proxy_farm_test.rs index 4dc879dba..1b998e493 100644 --- a/locked-asset/proxy_dex/tests/proxy_farm_test.rs +++ b/locked-asset/proxy_dex/tests/proxy_farm_test.rs @@ -1419,3 +1419,225 @@ fn increase_proxy_farm_proxy_lp_energy() { }), ); } + +#[test] +fn destroy_farm_locked_tokens_test() { + let mut setup = ProxySetup::new( + proxy_dex::contract_obj, + pair::contract_obj, + farm_with_locked_rewards::contract_obj, + energy_factory::contract_obj, + ); + + setup + .b_mock + .execute_tx( + &setup.owner, + &setup.farm_locked_wrapper, + &rust_biguint!(0), + |sc| { + sc.farming_token_id().set(&managed_token_id!(LP_TOKEN_ID)); + + // set produce rewards to false for easier calculation + sc.produce_rewards_enabled().set(false); + }, + ) + .assert_ok(); + + setup.b_mock.set_esdt_local_roles( + setup.farm_locked_wrapper.address_ref(), + LP_TOKEN_ID, + &[EsdtLocalRole::Burn], + ); + + let first_user = setup.first_user.clone(); + let locked_token_amount = rust_biguint!(1_000_000_000); + let other_token_amount = rust_biguint!(500_000_000); + let expected_lp_token_amount = rust_biguint!(499_999_000); + + // set the price to 1 EGLD = 2 MEX + let payments = vec![ + TxTokenTransfer { + token_identifier: LOCKED_TOKEN_ID.to_vec(), + nonce: 1, + value: locked_token_amount.clone(), + }, + TxTokenTransfer { + token_identifier: WEGLD_TOKEN_ID.to_vec(), + nonce: 0, + value: other_token_amount.clone(), + }, + ]; + + // add liquidity + let pair_addr = setup.pair_wrapper.address_ref().clone(); + setup + .b_mock + .execute_esdt_multi_transfer(&first_user, &setup.proxy_wrapper, &payments, |sc| { + sc.add_liquidity_proxy( + managed_address!(&pair_addr), + managed_biguint!(locked_token_amount.to_u64().unwrap()), + managed_biguint!(other_token_amount.to_u64().unwrap()), + ); + }) + .assert_ok(); + + setup.b_mock.check_nft_balance( + &first_user, + WRAPPED_LP_TOKEN_ID, + 1, + &expected_lp_token_amount, + Some(&WrappedLpTokenAttributes:: { + locked_tokens: EsdtTokenPayment { + token_identifier: managed_token_id!(LOCKED_TOKEN_ID), + token_nonce: 1, + amount: managed_biguint!(locked_token_amount.to_u64().unwrap()), + }, + lp_token_id: managed_token_id!(LP_TOKEN_ID), + lp_token_amount: managed_biguint!(expected_lp_token_amount.to_u64().unwrap()), + }), + ); + + let block_epoch = 1u64; + let user_balance = USER_BALANCE; + setup + .b_mock + .execute_query(&setup.simple_lock_wrapper, |sc| { + let unlock_epoch = LOCK_OPTIONS[0]; + let lock_epochs = unlock_epoch - block_epoch; + let expected_energy_amount = + BigInt::from((user_balance) as i64) * BigInt::from(lock_epochs as i64); + let expected_energy = Energy::new( + expected_energy_amount, + block_epoch, + managed_biguint!(user_balance), + ); + let actual_energy = sc.user_energy(&managed_address!(&first_user)).get(); + assert_eq!(expected_energy, actual_energy); + }) + .assert_ok(); + + let farm_locked_addr = setup.farm_locked_wrapper.address_ref().clone(); + + //////////////////////////////////////////// ENTER FARM ///////////////////////////////////// + + let mut current_epoch = 5; + setup.b_mock.set_block_epoch(current_epoch); + + setup + .b_mock + .execute_esdt_transfer( + &first_user, + &setup.proxy_wrapper, + WRAPPED_LP_TOKEN_ID, + 1, + &expected_lp_token_amount, + |sc| { + sc.enter_farm_proxy_endpoint( + managed_address!(&farm_locked_addr), + OptionalValue::None, + ); + }, + ) + .assert_ok(); + + let expected_energy = rust_biguint!(LOCK_OPTIONS[0] - current_epoch) * USER_BALANCE; + setup + .b_mock + .execute_query(&setup.simple_lock_wrapper, |sc| { + let managed_result = sc.get_energy_amount_for_user(managed_address!(&first_user)); + let result = to_rust_biguint(managed_result); + assert_eq!(result, expected_energy); + }) + .assert_ok(); + + // check user balance + setup.b_mock.check_nft_balance( + &first_user, + WRAPPED_FARM_TOKEN_ID, + 1, + &expected_lp_token_amount, + Some(&WrappedFarmTokenAttributes:: { + proxy_farming_token: EsdtTokenPayment { + token_identifier: managed_token_id!(WRAPPED_LP_TOKEN_ID), + token_nonce: 1, + amount: managed_biguint!(expected_lp_token_amount.to_u64().unwrap()), + }, + farm_token: EsdtTokenPayment { + token_identifier: managed_token_id!(FARM_LOCKED_TOKEN_ID), + token_nonce: 1, + amount: managed_biguint!(expected_lp_token_amount.to_u64().unwrap()), + }, + }), + ); + + // check proxy balance + setup + .b_mock + .check_nft_balance::>( + setup.proxy_wrapper.address_ref(), + FARM_LOCKED_TOKEN_ID, + 1, + &expected_lp_token_amount, + None, + ); + + // check farm balance + setup.b_mock.check_esdt_balance( + setup.farm_locked_wrapper.address_ref(), + LP_TOKEN_ID, + &expected_lp_token_amount, + ); + + current_epoch += 5; // applies penalty on exit + setup.b_mock.set_block_epoch(current_epoch); + setup.b_mock.set_block_nonce(100); + + ////////////////////////////////////////////// DESTROY FARM ///////////////////////////////////// + + // should be 500_000_000, but ends up so due to approximations + let removed_locked_token_amount = rust_biguint!(499_999_000); + // should be 250_000_000, but ends up so due to approximations + let removed_other_token_amount = rust_biguint!(249_999_500); + // exit with partial amount + setup + .b_mock + .execute_esdt_transfer( + &first_user, + &setup.proxy_wrapper, + WRAPPED_FARM_TOKEN_ID, + 1, + &(expected_lp_token_amount.clone() / rust_biguint!(2)), + |sc| { + let output_payments = sc.destroy_farm_proxy( + managed_address!(&farm_locked_addr), + managed_biguint!(1), + managed_biguint!(1), + OptionalValue::None, + ); + + let output_vec = output_payments.to_vec(); + + assert_eq!(output_payments.len(), 3); + assert_eq!( + output_vec.get(0).amount.to_u64().unwrap(), + removed_locked_token_amount.to_u64().unwrap() + ); + assert_eq!( + output_vec.get(1).amount.to_u64().unwrap(), + removed_other_token_amount.to_u64().unwrap() + ); + assert_eq!(output_vec.get(2).amount.to_u64().unwrap(), 0u64); + }, + ) + .assert_ok(); + + // check user received half of the farm tokens back, and another new wrapped LP token + setup.b_mock.check_nft_balance::( + &first_user, + WRAPPED_FARM_TOKEN_ID, + 1, + &(&expected_lp_token_amount / 2u64), + None, + ); +} diff --git a/locked-asset/proxy_dex/wasm/src/lib.rs b/locked-asset/proxy_dex/wasm/src/lib.rs index 29b3ab709..90c1ad26d 100644 --- a/locked-asset/proxy_dex/wasm/src/lib.rs +++ b/locked-asset/proxy_dex/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 31 +// Endpoints: 32 // Async Callback: 1 -// Total number of exported functions: 33 +// Total number of exported functions: 34 #![no_std] #![allow(internal_features)] @@ -42,6 +42,7 @@ multiversx_sc_wasm_adapter::endpoints! { increaseProxyPairTokenEnergy => increase_proxy_pair_token_energy_endpoint enterFarmProxy => enter_farm_proxy_endpoint exitFarmProxy => exit_farm_proxy + destroyFarmProxy => destroy_farm_proxy claimRewardsProxy => claim_rewards_proxy increaseProxyFarmTokenEnergy => increase_proxy_farm_token_energy_endpoint mergeWrappedFarmTokens => merge_wrapped_farm_tokens_endpoint From cec0aa8581c1e7688d43ef690456a952a6c452d5 Mon Sep 17 00:00:00 2001 From: Dorin Marian Iancu Date: Mon, 29 Jan 2024 12:15:52 +0200 Subject: [PATCH 165/213] implement all hooks --- dex/pair/src/contexts/output_builder.rs | 5 -- dex/pair/src/pair_actions/add_liq.rs | 46 +++++++++++-- dex/pair/src/pair_actions/initial_liq.rs | 34 ++++++++- dex/pair/src/pair_actions/remove_liq.rs | 33 +++++++-- dex/pair/src/pair_actions/swap.rs | 88 ++++++++++++++++++------ dex/pair/src/pair_hooks/call_hook.rs | 11 +++ 6 files changed, 180 insertions(+), 37 deletions(-) diff --git a/dex/pair/src/contexts/output_builder.rs b/dex/pair/src/contexts/output_builder.rs index ef719da40..88b160807 100644 --- a/dex/pair/src/contexts/output_builder.rs +++ b/dex/pair/src/contexts/output_builder.rs @@ -50,11 +50,6 @@ pub trait OutputBuilderModule: ) -> ManagedVec> { let mut payments: ManagedVec> = ManagedVec::new(); - payments.push(EsdtTokenPayment::new( - storage_cache.lp_token_id.clone(), - 0, - add_liq_context.liq_added.clone(), - )); payments.push(EsdtTokenPayment::new( storage_cache.first_token_id.clone(), 0, diff --git a/dex/pair/src/pair_actions/add_liq.rs b/dex/pair/src/pair_actions/add_liq.rs index 0878219a7..62a52b1b6 100644 --- a/dex/pair/src/pair_actions/add_liq.rs +++ b/dex/pair/src/pair_actions/add_liq.rs @@ -1,7 +1,7 @@ use crate::{ - contexts::add_liquidity::AddLiquidityContext, StorageCache, ERROR_BAD_PAYMENT_TOKENS, - ERROR_INITIAL_LIQUIDITY_NOT_ADDED, ERROR_INVALID_ARGS, ERROR_K_INVARIANT_FAILED, - ERROR_LP_TOKEN_NOT_ISSUED, ERROR_NOT_ACTIVE, + contexts::add_liquidity::AddLiquidityContext, pair_hooks::hook_type::HookType, StorageCache, + ERROR_BAD_PAYMENT_TOKENS, ERROR_INITIAL_LIQUIDITY_NOT_ADDED, ERROR_INVALID_ARGS, + ERROR_K_INVARIANT_FAILED, ERROR_LP_TOKEN_NOT_ISSUED, ERROR_NOT_ACTIVE, }; use super::common_result_types::AddLiquidityResultType; @@ -21,6 +21,10 @@ pub trait AddLiquidityModule: + permissions_module::PermissionsModule + pausable::PausableModule + super::common_methods::CommonMethodsModule + + crate::pair_hooks::banned_address::BannedAddressModule + + crate::pair_hooks::change_hooks::ChangeHooksModule + + crate::pair_hooks::call_hook::CallHookModule + + utils::UtilsModule { #[payable("*")] #[endpoint(addLiquidity)] @@ -61,6 +65,24 @@ pub trait AddLiquidityModule: ERROR_INITIAL_LIQUIDITY_NOT_ADDED ); + let mut payments_vec = ManagedVec::new(); + payments_vec.push(first_payment); + payments_vec.push(second_payment); + + let mut args = ManagedVec::new(); + self.encode_arg_to_vec(&first_token_amount_min, &mut args); + self.encode_arg_to_vec(&second_token_amount_min, &mut args); + + let (hook_type_before, hook_type_after) = if storage_cache.lp_token_supply == 0 { + (HookType::BeforeAddInitialLiq, HookType::AfterAddInitialLiq) + } else { + (HookType::BeforeAddLiq, HookType::AfterAddLiq) + }; + let payments_after_hook = + self.call_hook(hook_type_before, caller.clone(), payments_vec, args.clone()); + let first_payment = payments_after_hook.get(0); + let second_payment = payments_after_hook.get(1); + self.update_safe_price( &storage_cache.first_token_reserve, &storage_cache.second_token_reserve, @@ -102,7 +124,23 @@ pub trait AddLiquidityModule: self.send() .esdt_local_mint(&storage_cache.lp_token_id, 0, &add_liq_context.liq_added); - let output_payments = self.build_add_liq_output_payments(&storage_cache, &add_liq_context); + let mut lp_payment = EsdtTokenPayment::new( + storage_cache.lp_token_id.clone(), + 0, + add_liq_context.liq_added.clone(), + ); + let lp_payment_after_hook = self.call_hook( + hook_type_after, + caller.clone(), + ManagedVec::from_single_item(lp_payment), + args, + ); + lp_payment = lp_payment_after_hook.get(0); + + let mut output_payments = + self.build_add_liq_output_payments(&storage_cache, &add_liq_context); + output_payments.push(lp_payment); + self.send_multiple_tokens_if_not_zero(&caller, &output_payments); let output = self.build_add_liq_results(&storage_cache, &add_liq_context); diff --git a/dex/pair/src/pair_actions/initial_liq.rs b/dex/pair/src/pair_actions/initial_liq.rs index e98cbb61e..25a03db24 100644 --- a/dex/pair/src/pair_actions/initial_liq.rs +++ b/dex/pair/src/pair_actions/initial_liq.rs @@ -2,8 +2,8 @@ use common_errors::ERROR_PERMISSION_DENIED; use pausable::State; use crate::{ - contexts::add_liquidity::AddLiquidityContext, StorageCache, ERROR_ACTIVE, - ERROR_BAD_PAYMENT_TOKENS, ERROR_INITIAL_LIQUIDITY_ALREADY_ADDED, + contexts::add_liquidity::AddLiquidityContext, pair_hooks::hook_type::HookType, StorageCache, + ERROR_ACTIVE, ERROR_BAD_PAYMENT_TOKENS, ERROR_INITIAL_LIQUIDITY_ALREADY_ADDED, }; use super::common_result_types::AddLiquidityResultType; @@ -22,6 +22,10 @@ pub trait InitialLiquidityModule: + permissions_module::PermissionsModule + pausable::PausableModule + super::common_methods::CommonMethodsModule + + crate::pair_hooks::banned_address::BannedAddressModule + + crate::pair_hooks::change_hooks::ChangeHooksModule + + crate::pair_hooks::call_hook::CallHookModule + + utils::UtilsModule { #[payable("*")] #[endpoint(addInitialLiquidity)] @@ -54,6 +58,19 @@ pub trait InitialLiquidityModule: ERROR_INITIAL_LIQUIDITY_ALREADY_ADDED ); + let mut payments_vec = ManagedVec::new(); + payments_vec.push(first_payment); + payments_vec.push(second_payment); + + let payments_after_hook = self.call_hook( + HookType::BeforeAddInitialLiq, + caller.clone(), + payments_vec, + ManagedVec::new(), + ); + let first_payment = payments_after_hook.get(0); + let second_payment = payments_after_hook.get(1); + let first_token_optimal_amount = &first_payment.amount; let second_token_optimal_amount = &second_payment.amount; let liq_added = self.pool_add_initial_liquidity( @@ -64,8 +81,19 @@ pub trait InitialLiquidityModule: self.send() .esdt_local_mint(&storage_cache.lp_token_id, 0, &liq_added); + + let mut lp_payment = + EsdtTokenPayment::new(storage_cache.lp_token_id.clone(), 0, liq_added.clone()); + let lp_payment_after_hook = self.call_hook( + HookType::AfterAddInitialLiq, + caller.clone(), + ManagedVec::from_single_item(lp_payment), + ManagedVec::new(), + ); + lp_payment = lp_payment_after_hook.get(0); + self.send() - .direct_esdt(&caller, &storage_cache.lp_token_id, 0, &liq_added); + .direct_non_zero_esdt_payment(&caller, &lp_payment); self.state().set(State::PartialActive); diff --git a/dex/pair/src/pair_actions/remove_liq.rs b/dex/pair/src/pair_actions/remove_liq.rs index 898d99ccf..eab4bcc8b 100644 --- a/dex/pair/src/pair_actions/remove_liq.rs +++ b/dex/pair/src/pair_actions/remove_liq.rs @@ -1,7 +1,7 @@ use crate::{ - contexts::remove_liquidity::RemoveLiquidityContext, StorageCache, SwapTokensOrder, - ERROR_BAD_PAYMENT_TOKENS, ERROR_INVALID_ARGS, ERROR_K_INVARIANT_FAILED, - ERROR_LP_TOKEN_NOT_ISSUED, ERROR_NOT_ACTIVE, ERROR_NOT_WHITELISTED, + contexts::remove_liquidity::RemoveLiquidityContext, pair_hooks::hook_type::HookType, + StorageCache, SwapTokensOrder, ERROR_BAD_PAYMENT_TOKENS, ERROR_INVALID_ARGS, + ERROR_K_INVARIANT_FAILED, ERROR_LP_TOKEN_NOT_ISSUED, ERROR_NOT_ACTIVE, ERROR_NOT_WHITELISTED, }; use super::common_result_types::RemoveLiquidityResultType; @@ -22,6 +22,10 @@ pub trait RemoveLiquidityModule: + permissions_module::PermissionsModule + pausable::PausableModule + super::common_methods::CommonMethodsModule + + crate::pair_hooks::banned_address::BannedAddressModule + + crate::pair_hooks::change_hooks::ChangeHooksModule + + crate::pair_hooks::call_hook::CallHookModule + + utils::UtilsModule { #[payable("*")] #[endpoint(removeLiquidity)] @@ -62,6 +66,18 @@ pub trait RemoveLiquidityModule: &storage_cache.second_token_reserve, ); + let mut args = ManagedVec::new(); + self.encode_arg_to_vec(&first_token_amount_min, &mut args); + self.encode_arg_to_vec(&second_token_amount_min, &mut args); + + let payments_after_hook = self.call_hook( + HookType::BeforeRemoveLiq, + caller.clone(), + ManagedVec::from_single_item(payment), + args.clone(), + ); + let payment = payments_after_hook.get(0); + let mut remove_liq_context = RemoveLiquidityContext::new( payment.amount, first_token_amount_min, @@ -82,11 +98,18 @@ pub trait RemoveLiquidityModule: let output_payments = self.build_remove_liq_output_payments(&storage_cache, &remove_liq_context); - self.send_multiple_tokens_if_not_zero(&caller, &output_payments); + let output_payments_after_hook = self.call_hook( + HookType::AfterRemoveLiq, + caller.clone(), + output_payments, + args, + ); + + self.send_multiple_tokens_if_not_zero(&caller, &output_payments_after_hook); self.emit_remove_liquidity_event(&storage_cache, remove_liq_context); - self.build_remove_liq_results(output_payments) + self.build_remove_liq_results(output_payments_after_hook) } #[payable("*")] diff --git a/dex/pair/src/pair_actions/swap.rs b/dex/pair/src/pair_actions/swap.rs index 6e028bad0..579b1ff1f 100644 --- a/dex/pair/src/pair_actions/swap.rs +++ b/dex/pair/src/pair_actions/swap.rs @@ -1,12 +1,19 @@ use crate::{ - contexts::swap::SwapContext, StorageCache, ERROR_INVALID_ARGS, ERROR_K_INVARIANT_FAILED, - ERROR_NOT_ENOUGH_RESERVE, ERROR_NOT_WHITELISTED, ERROR_SLIPPAGE_EXCEEDED, - ERROR_SWAP_NOT_ENABLED, ERROR_ZERO_AMOUNT, + contexts::swap::SwapContext, pair_hooks::hook_type::HookType, StorageCache, ERROR_INVALID_ARGS, + ERROR_K_INVARIANT_FAILED, ERROR_NOT_ENOUGH_RESERVE, ERROR_NOT_WHITELISTED, + ERROR_SLIPPAGE_EXCEEDED, ERROR_SWAP_NOT_ENABLED, ERROR_ZERO_AMOUNT, }; use super::common_result_types::{SwapTokensFixedInputResultType, SwapTokensFixedOutputResultType}; multiversx_sc::imports!(); +multiversx_sc::derive_imports!(); + +#[derive(TypeAbi, TopEncode, TopDecode, NestedEncode, NestedDecode, Clone, Copy)] +pub enum SwapType { + FixedInput, + FixedOutput, +} #[multiversx_sc::module] pub trait SwapModule: @@ -22,6 +29,10 @@ pub trait SwapModule: + permissions_module::PermissionsModule + pausable::PausableModule + super::common_methods::CommonMethodsModule + + crate::pair_hooks::banned_address::BannedAddressModule + + crate::pair_hooks::change_hooks::ChangeHooksModule + + crate::pair_hooks::call_hook::CallHookModule + + utils::UtilsModule { #[payable("*")] #[endpoint(swapNoFeeAndForward)] @@ -30,8 +41,9 @@ pub trait SwapModule: require!(self.whitelist().contains(&caller), ERROR_NOT_WHITELISTED); let mut storage_cache = StorageCache::new(self); - let (token_in, _, amount_in) = self.call_value().single_esdt().into_tuple(); - let swap_tokens_order = storage_cache.get_swap_tokens_order(&token_in, &token_out); + let payment = self.call_value().single_esdt(); + let swap_tokens_order = + storage_cache.get_swap_tokens_order(&payment.token_identifier, &token_out); require!( self.can_swap(storage_cache.contract_state), @@ -49,13 +61,13 @@ pub trait SwapModule: ); let mut swap_context = SwapContext::new( - token_in, - amount_in.clone(), + payment.token_identifier, + payment.amount.clone(), token_out, BigUint::from(1u32), swap_tokens_order, ); - swap_context.final_input_amount = amount_in; + swap_context.final_input_amount = payment.amount; let amount_out = self.swap_safe_no_fee( &mut storage_cache, @@ -90,8 +102,10 @@ pub trait SwapModule: require!(amount_out_min > 0, ERROR_INVALID_ARGS); let mut storage_cache = StorageCache::new(self); - let (token_in, _, amount_in) = self.call_value().single_esdt().into_tuple(); - let swap_tokens_order = storage_cache.get_swap_tokens_order(&token_in, &token_out); + let caller = self.blockchain().get_caller(); + let payment = self.call_value().single_esdt(); + let swap_tokens_order = + storage_cache.get_swap_tokens_order(&payment.token_identifier, &token_out); require!( self.can_swap(storage_cache.contract_state), @@ -111,9 +125,22 @@ pub trait SwapModule: &storage_cache.second_token_reserve, ); + let mut args = ManagedVec::new(); + self.encode_arg_to_vec(&SwapType::FixedInput, &mut args); + self.encode_arg_to_vec(&token_out, &mut args); + self.encode_arg_to_vec(&amount_out_min, &mut args); + + let payments_after_hook = self.call_hook( + HookType::BeforeSwap, + caller.clone(), + ManagedVec::from_single_item(payment), + args.clone(), + ); + let payment = payments_after_hook.get(0); + let mut swap_context = SwapContext::new( - token_in, - amount_in, + payment.token_identifier, + payment.amount, token_out, amount_out_min, swap_tokens_order, @@ -137,11 +164,14 @@ pub trait SwapModule: let caller = self.blockchain().get_caller(); let output_payments = self.build_swap_output_payments(&swap_context); - self.send_multiple_tokens_if_not_zero(&caller, &output_payments); + let output_payments_after_hook = + self.call_hook(HookType::AfterSwap, caller.clone(), output_payments, args); + + self.send_multiple_tokens_if_not_zero(&caller, &output_payments_after_hook); self.emit_swap_event(&storage_cache, swap_context); - self.build_swap_fixed_input_results(output_payments) + self.build_swap_fixed_input_results(output_payments_after_hook) } #[payable("*")] @@ -154,8 +184,10 @@ pub trait SwapModule: require!(amount_out > 0, ERROR_INVALID_ARGS); let mut storage_cache = StorageCache::new(self); - let (token_in, _, amount_in_max) = self.call_value().single_esdt().into_tuple(); - let swap_tokens_order = storage_cache.get_swap_tokens_order(&token_in, &token_out); + let caller = self.blockchain().get_caller(); + let payment = self.call_value().single_esdt(); + let swap_tokens_order = + storage_cache.get_swap_tokens_order(&payment.token_identifier, &token_out); require!( self.can_swap(storage_cache.contract_state), @@ -175,9 +207,22 @@ pub trait SwapModule: &storage_cache.second_token_reserve, ); + let mut args = ManagedVec::new(); + self.encode_arg_to_vec(&SwapType::FixedOutput, &mut args); + self.encode_arg_to_vec(&token_out, &mut args); + self.encode_arg_to_vec(&amount_out, &mut args); + + let payments_after_hook = self.call_hook( + HookType::BeforeSwap, + caller.clone(), + ManagedVec::from_single_item(payment), + args.clone(), + ); + let payment = payments_after_hook.get(0); + let mut swap_context = SwapContext::new( - token_in, - amount_in_max, + payment.token_identifier, + payment.amount, token_out, amount_out, swap_tokens_order, @@ -201,11 +246,14 @@ pub trait SwapModule: let caller = self.blockchain().get_caller(); let output_payments = self.build_swap_output_payments(&swap_context); - self.send_multiple_tokens_if_not_zero(&caller, &output_payments); + let output_payments_after_hook = + self.call_hook(HookType::AfterSwap, caller.clone(), output_payments, args); + + self.send_multiple_tokens_if_not_zero(&caller, &output_payments_after_hook); self.emit_swap_event(&storage_cache, swap_context); - self.build_swap_fixed_output_results(output_payments) + self.build_swap_fixed_output_results(output_payments_after_hook) } fn perform_swap_fixed_input( diff --git a/dex/pair/src/pair_hooks/call_hook.rs b/dex/pair/src/pair_hooks/call_hook.rs index 1cae35c9b..ff9753991 100644 --- a/dex/pair/src/pair_hooks/call_hook.rs +++ b/dex/pair/src/pair_hooks/call_hook.rs @@ -18,6 +18,7 @@ pub trait CallHookModule { return input_payments; } + let payments_len = input_payments.len(); let mut call_args = ManagedArgBuffer::new(); call_args.push_arg(caller); @@ -37,11 +38,21 @@ pub trait CallHookModule { .execute_on_dest_context_with_back_transfers::>(); output_payments = back_transfers.esdt_payments; + require!( + output_payments.len() == payments_len, + "Wrong payments received from SC" + ); } output_payments } + fn encode_arg_to_vec(&self, arg: &T, vec: &mut ManagedVec) { + let mut encoded_value = ManagedBuffer::new(); + let _ = arg.top_encode(&mut encoded_value); + vec.push(encoded_value); + } + #[storage_mapper("hooks")] fn hooks(&self, hook_type: HookType) -> SingleValueMapper>>; } From b266f929d75653976a945d06093adde7c32bd453 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrei=20B=C4=83ncioiu?= Date: Mon, 29 Jan 2024 12:33:54 +0200 Subject: [PATCH 166/213] Use newer VM tools. --- .github/workflows/actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 7e078b76a..611894dd9 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -23,6 +23,6 @@ jobs: uses: multiversx/mx-sc-actions/.github/workflows/contracts.yml@v2.3.5 with: rust-toolchain: nightly-2023-12-11 - vmtools-version: v1.4.60 + vmtools-version: v1.5.24 secrets: token: ${{ secrets.GITHUB_TOKEN }} From 5b7d0ab55e0c8f9eb34f48d772d7b0d424f94672 Mon Sep 17 00:00:00 2001 From: Rebegea Dragos-Alexandru <42241923+dragos-rebegea@users.noreply.github.com> Date: Mon, 29 Jan 2024 15:25:24 +0200 Subject: [PATCH 167/213] feesCollectorAddress setter --- energy-integration/governance-v2/src/views.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/energy-integration/governance-v2/src/views.rs b/energy-integration/governance-v2/src/views.rs index 84b53c537..1f428c031 100644 --- a/energy-integration/governance-v2/src/views.rs +++ b/energy-integration/governance-v2/src/views.rs @@ -94,6 +94,12 @@ pub trait ViewsModule: self.is_valid_proposal_id(proposal_id) && !self.proposals().item_is_empty(proposal_id) } + #[only_owner] + #[endpoint(changeFeesCollectorAddress)] + fn change_voting_period_in_blocks(&self, new_value: ManagedAddress) { + self.fees_collector_address().set(new_value); + } + #[proxy] fn fees_collector_proxy(&self, sc_address: ManagedAddress) -> fees_collector::Proxy; From 3cf293b1cb453f74486ae9699f480c9062353822 Mon Sep 17 00:00:00 2001 From: Rebegea Dragos-Alexandru <42241923+dragos-rebegea@users.noreply.github.com> Date: Mon, 29 Jan 2024 15:27:16 +0200 Subject: [PATCH 168/213] fix function name --- energy-integration/governance-v2/src/views.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/energy-integration/governance-v2/src/views.rs b/energy-integration/governance-v2/src/views.rs index 1f428c031..ec748edd9 100644 --- a/energy-integration/governance-v2/src/views.rs +++ b/energy-integration/governance-v2/src/views.rs @@ -96,7 +96,7 @@ pub trait ViewsModule: #[only_owner] #[endpoint(changeFeesCollectorAddress)] - fn change_voting_period_in_blocks(&self, new_value: ManagedAddress) { + fn change_fees_collector_address(&self, new_value: ManagedAddress) { self.fees_collector_address().set(new_value); } From 2f52e1a00a05ebf00edf0369f7a01516c902d319 Mon Sep 17 00:00:00 2001 From: Dorin Marian Iancu Date: Tue, 30 Jan 2024 10:41:12 +0200 Subject: [PATCH 169/213] example hook impl --- Cargo.toml | 3 + dex/pair/src/pair_actions/add_liq.rs | 4 +- dex/pair/src/pair_actions/remove_liq.rs | 14 +- dex/pair/src/pair_actions/swap.rs | 15 +- dex/pair/src/pair_hooks/hook_type.rs | 65 +++ dex/sample-hooks/pair-hooks-sample/Cargo.toml | 21 + .../pair-hooks-sample/meta/Cargo.toml | 12 + .../pair-hooks-sample/meta/src/main.rs | 3 + .../pair-hooks-sample/multiversx.json | 3 + dex/sample-hooks/pair-hooks-sample/src/lib.rs | 140 ++++++ .../pair-hooks-sample/wasm/Cargo.lock | 407 ++++++++++++++++++ .../pair-hooks-sample/wasm/Cargo.toml | 31 ++ .../pair-hooks-sample/wasm/src/lib.rs | 28 ++ 13 files changed, 739 insertions(+), 7 deletions(-) create mode 100644 dex/sample-hooks/pair-hooks-sample/Cargo.toml create mode 100644 dex/sample-hooks/pair-hooks-sample/meta/Cargo.toml create mode 100644 dex/sample-hooks/pair-hooks-sample/meta/src/main.rs create mode 100644 dex/sample-hooks/pair-hooks-sample/multiversx.json create mode 100644 dex/sample-hooks/pair-hooks-sample/src/lib.rs create mode 100644 dex/sample-hooks/pair-hooks-sample/wasm/Cargo.lock create mode 100644 dex/sample-hooks/pair-hooks-sample/wasm/Cargo.toml create mode 100644 dex/sample-hooks/pair-hooks-sample/wasm/src/lib.rs diff --git a/Cargo.toml b/Cargo.toml index dbdd0d3ec..d3c9de76a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,6 +21,9 @@ members = [ "dex/pair-mock", "dex/pair-mock/meta", + "dex/sample-hooks/pair-hooks-sample", + "dex/sample-hooks/pair-hooks-sample/meta", + "energy-integration/energy-factory-mock", "energy-integration/energy-factory-mock/meta", "energy-integration/energy-update", diff --git a/dex/pair/src/pair_actions/add_liq.rs b/dex/pair/src/pair_actions/add_liq.rs index 62a52b1b6..a2372e5cc 100644 --- a/dex/pair/src/pair_actions/add_liq.rs +++ b/dex/pair/src/pair_actions/add_liq.rs @@ -79,7 +79,7 @@ pub trait AddLiquidityModule: (HookType::BeforeAddLiq, HookType::AfterAddLiq) }; let payments_after_hook = - self.call_hook(hook_type_before, caller.clone(), payments_vec, args.clone()); + self.call_hook(hook_type_before, caller.clone(), payments_vec, args); let first_payment = payments_after_hook.get(0); let second_payment = payments_after_hook.get(1); @@ -133,7 +133,7 @@ pub trait AddLiquidityModule: hook_type_after, caller.clone(), ManagedVec::from_single_item(lp_payment), - args, + ManagedVec::new(), ); lp_payment = lp_payment_after_hook.get(0); diff --git a/dex/pair/src/pair_actions/remove_liq.rs b/dex/pair/src/pair_actions/remove_liq.rs index eab4bcc8b..0a850488a 100644 --- a/dex/pair/src/pair_actions/remove_liq.rs +++ b/dex/pair/src/pair_actions/remove_liq.rs @@ -2,6 +2,7 @@ use crate::{ contexts::remove_liquidity::RemoveLiquidityContext, pair_hooks::hook_type::HookType, StorageCache, SwapTokensOrder, ERROR_BAD_PAYMENT_TOKENS, ERROR_INVALID_ARGS, ERROR_K_INVARIANT_FAILED, ERROR_LP_TOKEN_NOT_ISSUED, ERROR_NOT_ACTIVE, ERROR_NOT_WHITELISTED, + ERROR_SLIPPAGE_ON_REMOVE, }; use super::common_result_types::RemoveLiquidityResultType; @@ -74,7 +75,7 @@ pub trait RemoveLiquidityModule: HookType::BeforeRemoveLiq, caller.clone(), ManagedVec::from_single_item(payment), - args.clone(), + ManagedVec::new(), ); let payment = payments_after_hook.get(0); @@ -105,6 +106,17 @@ pub trait RemoveLiquidityModule: args, ); + let first_payment_after = output_payments_after_hook.get(0); + let second_payment_after = output_payments_after_hook.get(1); + require!( + first_payment_after.amount >= remove_liq_context.first_token_amount_min, + ERROR_SLIPPAGE_ON_REMOVE + ); + require!( + second_payment_after.amount >= remove_liq_context.second_token_amount_min, + ERROR_SLIPPAGE_ON_REMOVE + ); + self.send_multiple_tokens_if_not_zero(&caller, &output_payments_after_hook); self.emit_remove_liquidity_event(&storage_cache, remove_liq_context); diff --git a/dex/pair/src/pair_actions/swap.rs b/dex/pair/src/pair_actions/swap.rs index 579b1ff1f..dbf52911e 100644 --- a/dex/pair/src/pair_actions/swap.rs +++ b/dex/pair/src/pair_actions/swap.rs @@ -127,8 +127,6 @@ pub trait SwapModule: let mut args = ManagedVec::new(); self.encode_arg_to_vec(&SwapType::FixedInput, &mut args); - self.encode_arg_to_vec(&token_out, &mut args); - self.encode_arg_to_vec(&amount_out_min, &mut args); let payments_after_hook = self.call_hook( HookType::BeforeSwap, @@ -138,6 +136,9 @@ pub trait SwapModule: ); let payment = payments_after_hook.get(0); + self.encode_arg_to_vec(&token_out, &mut args); + self.encode_arg_to_vec(&amount_out_min, &mut args); + let mut swap_context = SwapContext::new( payment.token_identifier, payment.amount, @@ -167,6 +168,11 @@ pub trait SwapModule: let output_payments_after_hook = self.call_hook(HookType::AfterSwap, caller.clone(), output_payments, args); + require!( + output_payments_after_hook.get(0).amount >= swap_context.output_token_amount, + ERROR_SLIPPAGE_EXCEEDED + ); + self.send_multiple_tokens_if_not_zero(&caller, &output_payments_after_hook); self.emit_swap_event(&storage_cache, swap_context); @@ -209,8 +215,6 @@ pub trait SwapModule: let mut args = ManagedVec::new(); self.encode_arg_to_vec(&SwapType::FixedOutput, &mut args); - self.encode_arg_to_vec(&token_out, &mut args); - self.encode_arg_to_vec(&amount_out, &mut args); let payments_after_hook = self.call_hook( HookType::BeforeSwap, @@ -220,6 +224,9 @@ pub trait SwapModule: ); let payment = payments_after_hook.get(0); + self.encode_arg_to_vec(&token_out, &mut args); + self.encode_arg_to_vec(&amount_out, &mut args); + let mut swap_context = SwapContext::new( payment.token_identifier, payment.amount, diff --git a/dex/pair/src/pair_hooks/hook_type.rs b/dex/pair/src/pair_hooks/hook_type.rs index f18a84496..63c7ca67e 100644 --- a/dex/pair/src/pair_hooks/hook_type.rs +++ b/dex/pair/src/pair_hooks/hook_type.rs @@ -1,3 +1,5 @@ +use crate::pair_actions::swap::SwapType; + multiversx_sc::imports!(); multiversx_sc::derive_imports!(); @@ -21,3 +23,66 @@ pub struct Hook { pub dest_address: ManagedAddress, pub endpoint_name: ManagedBuffer, } + +pub trait PairHook { + type Sc: ContractBase; + + fn before_add_initial_liq( + sc: &Self::Sc, + first_payment: EsdtTokenPayment<::Api>, + second_payment: EsdtTokenPayment<::Api>, + original_caller: ManagedAddress<::Api>, + ); + + fn after_add_initial_liq( + sc: &Self::Sc, + lp_payment: EsdtTokenPayment<::Api>, + original_caller: ManagedAddress<::Api>, + ); + + fn before_add_liq( + sc: &Self::Sc, + first_payment: EsdtTokenPayment<::Api>, + second_payment: EsdtTokenPayment<::Api>, + original_caller: ManagedAddress<::Api>, + first_token_amount_min: BigUint<::Api>, + second_token_amount_min: BigUint<::Api>, + ); + + fn after_add_liq( + sc: &Self::Sc, + lp_payment: EsdtTokenPayment<::Api>, + original_caller: ManagedAddress<::Api>, + ); + + fn before_remove_liq( + sc: &Self::Sc, + lp_payment: EsdtTokenPayment<::Api>, + original_caller: ManagedAddress<::Api>, + ); + + fn after_remove_liq( + sc: &Self::Sc, + first_payment: EsdtTokenPayment<::Api>, + second_payment: EsdtTokenPayment<::Api>, + original_caller: ManagedAddress<::Api>, + first_token_amount_min: BigUint<::Api>, + second_token_amount_min: BigUint<::Api>, + ); + + fn before_swap( + sc: &Self::Sc, + payment: EsdtTokenPayment<::Api>, + original_caller: ManagedAddress<::Api>, + swap_type: SwapType, + ); + + fn after_swap( + sc: &Self::Sc, + payment: EsdtTokenPayment<::Api>, + original_caller: ManagedAddress<::Api>, + swap_type: SwapType, + token_out: TokenIdentifier<::Api>, + amount_out: BigUint<::Api>, + ); +} diff --git a/dex/sample-hooks/pair-hooks-sample/Cargo.toml b/dex/sample-hooks/pair-hooks-sample/Cargo.toml new file mode 100644 index 000000000..211b40099 --- /dev/null +++ b/dex/sample-hooks/pair-hooks-sample/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "pair-hooks-sample" +version = "0.0.0" +authors = ["you"] +edition = "2021" +publish = false + +[lib] +path = "src/lib.rs" + +[dependencies.multiversx-sc] +version = "=0.46.1" + +[dependencies.pair] +path = "../../pair" + +[dev-dependencies] +num-bigint = "0.4.2" + +[dev-dependencies.multiversx-sc-scenario] +version = "=0.46.1" diff --git a/dex/sample-hooks/pair-hooks-sample/meta/Cargo.toml b/dex/sample-hooks/pair-hooks-sample/meta/Cargo.toml new file mode 100644 index 000000000..06eda390c --- /dev/null +++ b/dex/sample-hooks/pair-hooks-sample/meta/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "pair-hooks-sample-meta" +version = "0.0.0" +edition = "2021" +publish = false + +[dependencies.pair-hooks-sample] +path = ".." + +[dependencies.multiversx-sc-meta] +version = "=0.46.1" +default-features = false diff --git a/dex/sample-hooks/pair-hooks-sample/meta/src/main.rs b/dex/sample-hooks/pair-hooks-sample/meta/src/main.rs new file mode 100644 index 000000000..956f28e39 --- /dev/null +++ b/dex/sample-hooks/pair-hooks-sample/meta/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + multiversx_sc_meta::cli_main::(); +} diff --git a/dex/sample-hooks/pair-hooks-sample/multiversx.json b/dex/sample-hooks/pair-hooks-sample/multiversx.json new file mode 100644 index 000000000..736553962 --- /dev/null +++ b/dex/sample-hooks/pair-hooks-sample/multiversx.json @@ -0,0 +1,3 @@ +{ + "language": "rust" +} \ No newline at end of file diff --git a/dex/sample-hooks/pair-hooks-sample/src/lib.rs b/dex/sample-hooks/pair-hooks-sample/src/lib.rs new file mode 100644 index 000000000..b76d0137e --- /dev/null +++ b/dex/sample-hooks/pair-hooks-sample/src/lib.rs @@ -0,0 +1,140 @@ +#![no_std] + +use core::marker::PhantomData; + +use pair::pair_hooks::hook_type::PairHook; + +multiversx_sc::imports!(); + +#[multiversx_sc::contract] +pub trait PairHooksSample { + #[init] + fn init(&self, known_pairs: MultiValueEncoded) { + let mapper = self.known_pairs(); + for pair in known_pairs { + mapper.add(&pair); + } + } + + #[payable("*")] + #[endpoint(beforeAddInitialLiqHook)] + fn before_add_initial_liq_hook(&self, original_caller: ManagedAddress) { + self.require_known_pair(); + + let [first_payment, second_payment] = self.call_value().multi_esdt(); + Wrapper::::before_add_initial_liq( + self, + first_payment, + second_payment, + original_caller, + ); + } + + #[payable("*")] + #[endpoint(afterAddInitialLiqHook)] + fn after_add_initial_liq_hook(&self, original_caller: ManagedAddress) { + self.require_known_pair(); + + let lp_payment = self.call_value().single_esdt(); + Wrapper::::after_add_initial_liq(self, lp_payment, original_caller); + } + + fn require_known_pair(&self) { + let caller = self.blockchain().get_caller(); + require!( + self.known_pairs().contains(&caller), + "Only known pairs may call this endpoint" + ); + } + + #[storage_mapper("knownPairs")] + fn known_pairs(&self) -> WhitelistMapper; +} + +pub struct Wrapper { + _phantom: PhantomData, +} + +impl PairHook for Wrapper { + type Sc = T; + + fn before_add_initial_liq( + sc: &Self::Sc, + first_payment: EsdtTokenPayment<::Api>, + second_payment: EsdtTokenPayment<::Api>, + _original_caller: ManagedAddress<::Api>, + ) { + let caller = sc.blockchain().get_caller(); + sc.send() + .direct_non_zero_esdt_payment(&caller, &first_payment); + sc.send() + .direct_non_zero_esdt_payment(&caller, &second_payment); + } + + fn after_add_initial_liq( + sc: &Self::Sc, + lp_payment: EsdtTokenPayment<::Api>, + _original_caller: ManagedAddress<::Api>, + ) { + let caller = sc.blockchain().get_caller(); + sc.send().direct_non_zero_esdt_payment(&caller, &lp_payment); + } + + fn before_add_liq( + _sc: &Self::Sc, + _first_payment: EsdtTokenPayment<::Api>, + _second_payment: EsdtTokenPayment<::Api>, + _original_caller: ManagedAddress<::Api>, + _first_token_amount_min: BigUint<::Api>, + _second_token_amount_min: BigUint<::Api>, + ) { + todo!() + } + + fn after_add_liq( + _sc: &Self::Sc, + _lp_payment: EsdtTokenPayment<::Api>, + _original_caller: ManagedAddress<::Api>, + ) { + todo!() + } + + fn before_remove_liq( + _sc: &Self::Sc, + _lp_payment: EsdtTokenPayment<::Api>, + _original_caller: ManagedAddress<::Api>, + ) { + todo!() + } + + fn after_remove_liq( + _sc: &Self::Sc, + _first_payment: EsdtTokenPayment<::Api>, + _second_payment: EsdtTokenPayment<::Api>, + _original_caller: ManagedAddress<::Api>, + _first_token_amount_min: BigUint<::Api>, + _second_token_amount_min: BigUint<::Api>, + ) { + todo!() + } + + fn before_swap( + _sc: &Self::Sc, + _payment: EsdtTokenPayment<::Api>, + _original_caller: ManagedAddress<::Api>, + _swap_type: pair::pair_actions::swap::SwapType, + ) { + todo!() + } + + fn after_swap( + _sc: &Self::Sc, + _payment: EsdtTokenPayment<::Api>, + _original_caller: ManagedAddress<::Api>, + _swap_type: pair::pair_actions::swap::SwapType, + _token_out: TokenIdentifier<::Api>, + _amount_out: BigUint<::Api>, + ) { + todo!() + } +} diff --git a/dex/sample-hooks/pair-hooks-sample/wasm/Cargo.lock b/dex/sample-hooks/pair-hooks-sample/wasm/Cargo.lock new file mode 100644 index 000000000..b4c6c24cc --- /dev/null +++ b/dex/sample-hooks/pair-hooks-sample/wasm/Cargo.lock @@ -0,0 +1,407 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bitflags" +version = "2.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" + +[[package]] +name = "common-types" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "energy-query" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", +] + +[[package]] +name = "fees-collector" +version = "0.0.0" +dependencies = [ + "common-types", + "common_errors", + "energy-factory", + "energy-query", + "locking_module", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "locking_module" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", + "simple-lock", +] + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.46.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c94b173dc5ff0e157f767275fe6b7a1b4d2ad343bef7b66cd22a6353e016b93" +dependencies = [ + "bitflags", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19908153158c03df4582af08f47c0eb39fb52a7dff4736b301a66acbbb9955d3" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b03b43f9cad320992f54ed162de2ed63e3ec83ed01361e57ee9c1865fba5a2" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.46.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b78945957036c281ad6ee21bb5120dcefa2017688adf43ec94e3e7c982efb09" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.46.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c63ffaba95e630ff75981e2f5f50da64f523219b52f484234c66f3adc248885f" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.46.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9579f40c00da56a5a68e010ff851fa48ac7b9c6a16ad4314795cb32d889d9e78" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "pair" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "fees-collector", + "itertools", + "multiversx-sc", + "pausable", + "permissions_module", + "simple-lock", + "token_send", + "utils", +] + +[[package]] +name = "pair-hooks-sample" +version = "0.0.0" +dependencies = [ + "multiversx-sc", + "pair", +] + +[[package]] +name = "pair-hooks-sample-wasm" +version = "0.0.0" +dependencies = [ + "multiversx-sc-wasm-adapter", + "pair-hooks-sample", +] + +[[package]] +name = "pausable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", + "permissions_module", +] + +[[package]] +name = "permissions_module" +version = "0.0.0" +dependencies = [ + "bitflags", + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "proc-macro2" +version = "1.0.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "token_send" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "week-timekeeping" +version = "0.0.0" +dependencies = [ + "common-types", + "multiversx-sc", +] + +[[package]] +name = "weekly-rewards-splitting" +version = "0.0.0" +dependencies = [ + "common-types", + "energy-query", + "math", + "multiversx-sc", + "unwrappable", + "week-timekeeping", +] diff --git a/dex/sample-hooks/pair-hooks-sample/wasm/Cargo.toml b/dex/sample-hooks/pair-hooks-sample/wasm/Cargo.toml new file mode 100644 index 000000000..9ce799efc --- /dev/null +++ b/dex/sample-hooks/pair-hooks-sample/wasm/Cargo.toml @@ -0,0 +1,31 @@ +# Code generated by the multiversx-sc build system. DO NOT EDIT. + +# ########################################## +# ############## AUTO-GENERATED ############# +# ########################################## + +[package] +name = "pair-hooks-sample-wasm" +version = "0.0.0" +edition = "2021" +publish = false + +[lib] +crate-type = ["cdylib"] + +[profile.release] +codegen-units = 1 +opt-level = "z" +lto = true +debug = false +panic = "abort" +overflow-checks = false + +[dependencies.pair-hooks-sample] +path = ".." + +[dependencies.multiversx-sc-wasm-adapter] +version = "=0.46.1" + +[workspace] +members = ["."] diff --git a/dex/sample-hooks/pair-hooks-sample/wasm/src/lib.rs b/dex/sample-hooks/pair-hooks-sample/wasm/src/lib.rs new file mode 100644 index 000000000..a059bba6b --- /dev/null +++ b/dex/sample-hooks/pair-hooks-sample/wasm/src/lib.rs @@ -0,0 +1,28 @@ +// Code generated by the multiversx-sc build system. DO NOT EDIT. + +//////////////////////////////////////////////////// +////////////////// AUTO-GENERATED ////////////////// +//////////////////////////////////////////////////// + +// Init: 1 +// Endpoints: 2 +// Async Callback (empty): 1 +// Total number of exported functions: 4 + +#![no_std] +#![allow(internal_features)] +#![feature(lang_items)] + +multiversx_sc_wasm_adapter::allocator!(); +multiversx_sc_wasm_adapter::panic_handler!(); + +multiversx_sc_wasm_adapter::endpoints! { + pair_hooks_sample + ( + init => init + beforeAddInitialLiqHook => before_add_initial_liq_hook + afterAddInitialLiqHook => after_add_initial_liq_hook + ) +} + +multiversx_sc_wasm_adapter::async_callback_empty! {} From b51868b0c0f8aa7649ad2e23023f64ab4cf447bd Mon Sep 17 00:00:00 2001 From: Dorin Marian Iancu Date: Mon, 5 Feb 2024 14:39:20 +0200 Subject: [PATCH 170/213] rip hooks --- Cargo.toml | 3 - dex/pair/src/lib.rs | 7 - dex/pair/src/pair_actions/add_liq.rs | 36 +- dex/pair/src/pair_actions/initial_liq.rs | 29 +- dex/pair/src/pair_actions/remove_liq.rs | 36 +- dex/pair/src/pair_actions/swap.rs | 53 +-- dex/pair/src/pair_hooks/banned_address.rs | 34 -- dex/pair/src/pair_hooks/call_hook.rs | 58 --- dex/pair/src/pair_hooks/change_hooks.rs | 43 -- dex/pair/src/pair_hooks/hook_type.rs | 88 ---- dex/pair/src/pair_hooks/mod.rs | 4 - dex/pair/wasm-pair-full/src/lib.rs | 8 +- dex/pair/wasm/src/lib.rs | 8 +- dex/sample-hooks/pair-hooks-sample/Cargo.toml | 21 - .../pair-hooks-sample/meta/Cargo.toml | 12 - .../pair-hooks-sample/meta/src/main.rs | 3 - .../pair-hooks-sample/multiversx.json | 3 - dex/sample-hooks/pair-hooks-sample/src/lib.rs | 140 ------ .../pair-hooks-sample/wasm/Cargo.lock | 407 ------------------ .../pair-hooks-sample/wasm/Cargo.toml | 31 -- .../pair-hooks-sample/wasm/src/lib.rs | 28 -- 21 files changed, 26 insertions(+), 1026 deletions(-) delete mode 100644 dex/pair/src/pair_hooks/banned_address.rs delete mode 100644 dex/pair/src/pair_hooks/call_hook.rs delete mode 100644 dex/pair/src/pair_hooks/change_hooks.rs delete mode 100644 dex/pair/src/pair_hooks/hook_type.rs delete mode 100644 dex/pair/src/pair_hooks/mod.rs delete mode 100644 dex/sample-hooks/pair-hooks-sample/Cargo.toml delete mode 100644 dex/sample-hooks/pair-hooks-sample/meta/Cargo.toml delete mode 100644 dex/sample-hooks/pair-hooks-sample/meta/src/main.rs delete mode 100644 dex/sample-hooks/pair-hooks-sample/multiversx.json delete mode 100644 dex/sample-hooks/pair-hooks-sample/src/lib.rs delete mode 100644 dex/sample-hooks/pair-hooks-sample/wasm/Cargo.lock delete mode 100644 dex/sample-hooks/pair-hooks-sample/wasm/Cargo.toml delete mode 100644 dex/sample-hooks/pair-hooks-sample/wasm/src/lib.rs diff --git a/Cargo.toml b/Cargo.toml index d3c9de76a..dbdd0d3ec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,9 +21,6 @@ members = [ "dex/pair-mock", "dex/pair-mock/meta", - "dex/sample-hooks/pair-hooks-sample", - "dex/sample-hooks/pair-hooks-sample/meta", - "energy-integration/energy-factory-mock", "energy-integration/energy-factory-mock/meta", "energy-integration/energy-update", diff --git a/dex/pair/src/lib.rs b/dex/pair/src/lib.rs index 8d4d909f8..98996e34a 100644 --- a/dex/pair/src/lib.rs +++ b/dex/pair/src/lib.rs @@ -12,7 +12,6 @@ pub mod fee; mod liquidity_pool; pub mod locking_wrapper; pub mod pair_actions; -pub mod pair_hooks; pub mod safe_price; pub mod safe_price_view; @@ -46,9 +45,6 @@ pub trait Pair: + pair_actions::swap::SwapModule + pair_actions::views::ViewsModule + pair_actions::common_methods::CommonMethodsModule - + pair_hooks::banned_address::BannedAddressModule - + pair_hooks::change_hooks::ChangeHooksModule - + pair_hooks::call_hook::CallHookModule + utils::UtilsModule { #[init] @@ -101,9 +97,6 @@ pub trait Pair: ); self.add_permissions_for_all(admins, Permissions::ADMIN); }; - - let sc_address = self.blockchain().get_sc_address(); - self.banned_addresses().add(&sc_address); } #[endpoint] diff --git a/dex/pair/src/pair_actions/add_liq.rs b/dex/pair/src/pair_actions/add_liq.rs index a2372e5cc..769e805f4 100644 --- a/dex/pair/src/pair_actions/add_liq.rs +++ b/dex/pair/src/pair_actions/add_liq.rs @@ -1,7 +1,7 @@ use crate::{ - contexts::add_liquidity::AddLiquidityContext, pair_hooks::hook_type::HookType, StorageCache, - ERROR_BAD_PAYMENT_TOKENS, ERROR_INITIAL_LIQUIDITY_NOT_ADDED, ERROR_INVALID_ARGS, - ERROR_K_INVARIANT_FAILED, ERROR_LP_TOKEN_NOT_ISSUED, ERROR_NOT_ACTIVE, + contexts::add_liquidity::AddLiquidityContext, StorageCache, ERROR_BAD_PAYMENT_TOKENS, + ERROR_INITIAL_LIQUIDITY_NOT_ADDED, ERROR_INVALID_ARGS, ERROR_K_INVARIANT_FAILED, + ERROR_LP_TOKEN_NOT_ISSUED, ERROR_NOT_ACTIVE, }; use super::common_result_types::AddLiquidityResultType; @@ -21,9 +21,6 @@ pub trait AddLiquidityModule: + permissions_module::PermissionsModule + pausable::PausableModule + super::common_methods::CommonMethodsModule - + crate::pair_hooks::banned_address::BannedAddressModule - + crate::pair_hooks::change_hooks::ChangeHooksModule - + crate::pair_hooks::call_hook::CallHookModule + utils::UtilsModule { #[payable("*")] @@ -65,24 +62,6 @@ pub trait AddLiquidityModule: ERROR_INITIAL_LIQUIDITY_NOT_ADDED ); - let mut payments_vec = ManagedVec::new(); - payments_vec.push(first_payment); - payments_vec.push(second_payment); - - let mut args = ManagedVec::new(); - self.encode_arg_to_vec(&first_token_amount_min, &mut args); - self.encode_arg_to_vec(&second_token_amount_min, &mut args); - - let (hook_type_before, hook_type_after) = if storage_cache.lp_token_supply == 0 { - (HookType::BeforeAddInitialLiq, HookType::AfterAddInitialLiq) - } else { - (HookType::BeforeAddLiq, HookType::AfterAddLiq) - }; - let payments_after_hook = - self.call_hook(hook_type_before, caller.clone(), payments_vec, args); - let first_payment = payments_after_hook.get(0); - let second_payment = payments_after_hook.get(1); - self.update_safe_price( &storage_cache.first_token_reserve, &storage_cache.second_token_reserve, @@ -124,18 +103,11 @@ pub trait AddLiquidityModule: self.send() .esdt_local_mint(&storage_cache.lp_token_id, 0, &add_liq_context.liq_added); - let mut lp_payment = EsdtTokenPayment::new( + let lp_payment = EsdtTokenPayment::new( storage_cache.lp_token_id.clone(), 0, add_liq_context.liq_added.clone(), ); - let lp_payment_after_hook = self.call_hook( - hook_type_after, - caller.clone(), - ManagedVec::from_single_item(lp_payment), - ManagedVec::new(), - ); - lp_payment = lp_payment_after_hook.get(0); let mut output_payments = self.build_add_liq_output_payments(&storage_cache, &add_liq_context); diff --git a/dex/pair/src/pair_actions/initial_liq.rs b/dex/pair/src/pair_actions/initial_liq.rs index 25a03db24..b418fec2a 100644 --- a/dex/pair/src/pair_actions/initial_liq.rs +++ b/dex/pair/src/pair_actions/initial_liq.rs @@ -2,8 +2,8 @@ use common_errors::ERROR_PERMISSION_DENIED; use pausable::State; use crate::{ - contexts::add_liquidity::AddLiquidityContext, pair_hooks::hook_type::HookType, StorageCache, - ERROR_ACTIVE, ERROR_BAD_PAYMENT_TOKENS, ERROR_INITIAL_LIQUIDITY_ALREADY_ADDED, + contexts::add_liquidity::AddLiquidityContext, StorageCache, ERROR_ACTIVE, + ERROR_BAD_PAYMENT_TOKENS, ERROR_INITIAL_LIQUIDITY_ALREADY_ADDED, }; use super::common_result_types::AddLiquidityResultType; @@ -22,9 +22,6 @@ pub trait InitialLiquidityModule: + permissions_module::PermissionsModule + pausable::PausableModule + super::common_methods::CommonMethodsModule - + crate::pair_hooks::banned_address::BannedAddressModule - + crate::pair_hooks::change_hooks::ChangeHooksModule - + crate::pair_hooks::call_hook::CallHookModule + utils::UtilsModule { #[payable("*")] @@ -58,19 +55,6 @@ pub trait InitialLiquidityModule: ERROR_INITIAL_LIQUIDITY_ALREADY_ADDED ); - let mut payments_vec = ManagedVec::new(); - payments_vec.push(first_payment); - payments_vec.push(second_payment); - - let payments_after_hook = self.call_hook( - HookType::BeforeAddInitialLiq, - caller.clone(), - payments_vec, - ManagedVec::new(), - ); - let first_payment = payments_after_hook.get(0); - let second_payment = payments_after_hook.get(1); - let first_token_optimal_amount = &first_payment.amount; let second_token_optimal_amount = &second_payment.amount; let liq_added = self.pool_add_initial_liquidity( @@ -82,15 +66,8 @@ pub trait InitialLiquidityModule: self.send() .esdt_local_mint(&storage_cache.lp_token_id, 0, &liq_added); - let mut lp_payment = + let lp_payment = EsdtTokenPayment::new(storage_cache.lp_token_id.clone(), 0, liq_added.clone()); - let lp_payment_after_hook = self.call_hook( - HookType::AfterAddInitialLiq, - caller.clone(), - ManagedVec::from_single_item(lp_payment), - ManagedVec::new(), - ); - lp_payment = lp_payment_after_hook.get(0); self.send() .direct_non_zero_esdt_payment(&caller, &lp_payment); diff --git a/dex/pair/src/pair_actions/remove_liq.rs b/dex/pair/src/pair_actions/remove_liq.rs index 0a850488a..5ee58d591 100644 --- a/dex/pair/src/pair_actions/remove_liq.rs +++ b/dex/pair/src/pair_actions/remove_liq.rs @@ -1,8 +1,7 @@ use crate::{ - contexts::remove_liquidity::RemoveLiquidityContext, pair_hooks::hook_type::HookType, - StorageCache, SwapTokensOrder, ERROR_BAD_PAYMENT_TOKENS, ERROR_INVALID_ARGS, - ERROR_K_INVARIANT_FAILED, ERROR_LP_TOKEN_NOT_ISSUED, ERROR_NOT_ACTIVE, ERROR_NOT_WHITELISTED, - ERROR_SLIPPAGE_ON_REMOVE, + contexts::remove_liquidity::RemoveLiquidityContext, StorageCache, SwapTokensOrder, + ERROR_BAD_PAYMENT_TOKENS, ERROR_INVALID_ARGS, ERROR_K_INVARIANT_FAILED, + ERROR_LP_TOKEN_NOT_ISSUED, ERROR_NOT_ACTIVE, ERROR_NOT_WHITELISTED, ERROR_SLIPPAGE_ON_REMOVE, }; use super::common_result_types::RemoveLiquidityResultType; @@ -23,9 +22,6 @@ pub trait RemoveLiquidityModule: + permissions_module::PermissionsModule + pausable::PausableModule + super::common_methods::CommonMethodsModule - + crate::pair_hooks::banned_address::BannedAddressModule - + crate::pair_hooks::change_hooks::ChangeHooksModule - + crate::pair_hooks::call_hook::CallHookModule + utils::UtilsModule { #[payable("*")] @@ -67,18 +63,6 @@ pub trait RemoveLiquidityModule: &storage_cache.second_token_reserve, ); - let mut args = ManagedVec::new(); - self.encode_arg_to_vec(&first_token_amount_min, &mut args); - self.encode_arg_to_vec(&second_token_amount_min, &mut args); - - let payments_after_hook = self.call_hook( - HookType::BeforeRemoveLiq, - caller.clone(), - ManagedVec::from_single_item(payment), - ManagedVec::new(), - ); - let payment = payments_after_hook.get(0); - let mut remove_liq_context = RemoveLiquidityContext::new( payment.amount, first_token_amount_min, @@ -99,15 +83,9 @@ pub trait RemoveLiquidityModule: let output_payments = self.build_remove_liq_output_payments(&storage_cache, &remove_liq_context); - let output_payments_after_hook = self.call_hook( - HookType::AfterRemoveLiq, - caller.clone(), - output_payments, - args, - ); - let first_payment_after = output_payments_after_hook.get(0); - let second_payment_after = output_payments_after_hook.get(1); + let first_payment_after = output_payments.get(0); + let second_payment_after = output_payments.get(1); require!( first_payment_after.amount >= remove_liq_context.first_token_amount_min, ERROR_SLIPPAGE_ON_REMOVE @@ -117,11 +95,11 @@ pub trait RemoveLiquidityModule: ERROR_SLIPPAGE_ON_REMOVE ); - self.send_multiple_tokens_if_not_zero(&caller, &output_payments_after_hook); + self.send_multiple_tokens_if_not_zero(&caller, &output_payments); self.emit_remove_liquidity_event(&storage_cache, remove_liq_context); - self.build_remove_liq_results(output_payments_after_hook) + self.build_remove_liq_results(output_payments) } #[payable("*")] diff --git a/dex/pair/src/pair_actions/swap.rs b/dex/pair/src/pair_actions/swap.rs index dbf52911e..f1ec88d94 100644 --- a/dex/pair/src/pair_actions/swap.rs +++ b/dex/pair/src/pair_actions/swap.rs @@ -1,7 +1,7 @@ use crate::{ - contexts::swap::SwapContext, pair_hooks::hook_type::HookType, StorageCache, ERROR_INVALID_ARGS, - ERROR_K_INVARIANT_FAILED, ERROR_NOT_ENOUGH_RESERVE, ERROR_NOT_WHITELISTED, - ERROR_SLIPPAGE_EXCEEDED, ERROR_SWAP_NOT_ENABLED, ERROR_ZERO_AMOUNT, + contexts::swap::SwapContext, StorageCache, ERROR_INVALID_ARGS, ERROR_K_INVARIANT_FAILED, + ERROR_NOT_ENOUGH_RESERVE, ERROR_NOT_WHITELISTED, ERROR_SLIPPAGE_EXCEEDED, + ERROR_SWAP_NOT_ENABLED, ERROR_ZERO_AMOUNT, }; use super::common_result_types::{SwapTokensFixedInputResultType, SwapTokensFixedOutputResultType}; @@ -29,9 +29,6 @@ pub trait SwapModule: + permissions_module::PermissionsModule + pausable::PausableModule + super::common_methods::CommonMethodsModule - + crate::pair_hooks::banned_address::BannedAddressModule - + crate::pair_hooks::change_hooks::ChangeHooksModule - + crate::pair_hooks::call_hook::CallHookModule + utils::UtilsModule { #[payable("*")] @@ -102,7 +99,6 @@ pub trait SwapModule: require!(amount_out_min > 0, ERROR_INVALID_ARGS); let mut storage_cache = StorageCache::new(self); - let caller = self.blockchain().get_caller(); let payment = self.call_value().single_esdt(); let swap_tokens_order = storage_cache.get_swap_tokens_order(&payment.token_identifier, &token_out); @@ -125,20 +121,6 @@ pub trait SwapModule: &storage_cache.second_token_reserve, ); - let mut args = ManagedVec::new(); - self.encode_arg_to_vec(&SwapType::FixedInput, &mut args); - - let payments_after_hook = self.call_hook( - HookType::BeforeSwap, - caller.clone(), - ManagedVec::from_single_item(payment), - args.clone(), - ); - let payment = payments_after_hook.get(0); - - self.encode_arg_to_vec(&token_out, &mut args); - self.encode_arg_to_vec(&amount_out_min, &mut args); - let mut swap_context = SwapContext::new( payment.token_identifier, payment.amount, @@ -165,19 +147,17 @@ pub trait SwapModule: let caller = self.blockchain().get_caller(); let output_payments = self.build_swap_output_payments(&swap_context); - let output_payments_after_hook = - self.call_hook(HookType::AfterSwap, caller.clone(), output_payments, args); require!( - output_payments_after_hook.get(0).amount >= swap_context.output_token_amount, + output_payments.get(0).amount >= swap_context.output_token_amount, ERROR_SLIPPAGE_EXCEEDED ); - self.send_multiple_tokens_if_not_zero(&caller, &output_payments_after_hook); + self.send_multiple_tokens_if_not_zero(&caller, &output_payments); self.emit_swap_event(&storage_cache, swap_context); - self.build_swap_fixed_input_results(output_payments_after_hook) + self.build_swap_fixed_input_results(output_payments) } #[payable("*")] @@ -190,7 +170,6 @@ pub trait SwapModule: require!(amount_out > 0, ERROR_INVALID_ARGS); let mut storage_cache = StorageCache::new(self); - let caller = self.blockchain().get_caller(); let payment = self.call_value().single_esdt(); let swap_tokens_order = storage_cache.get_swap_tokens_order(&payment.token_identifier, &token_out); @@ -213,20 +192,6 @@ pub trait SwapModule: &storage_cache.second_token_reserve, ); - let mut args = ManagedVec::new(); - self.encode_arg_to_vec(&SwapType::FixedOutput, &mut args); - - let payments_after_hook = self.call_hook( - HookType::BeforeSwap, - caller.clone(), - ManagedVec::from_single_item(payment), - args.clone(), - ); - let payment = payments_after_hook.get(0); - - self.encode_arg_to_vec(&token_out, &mut args); - self.encode_arg_to_vec(&amount_out, &mut args); - let mut swap_context = SwapContext::new( payment.token_identifier, payment.amount, @@ -253,14 +218,12 @@ pub trait SwapModule: let caller = self.blockchain().get_caller(); let output_payments = self.build_swap_output_payments(&swap_context); - let output_payments_after_hook = - self.call_hook(HookType::AfterSwap, caller.clone(), output_payments, args); - self.send_multiple_tokens_if_not_zero(&caller, &output_payments_after_hook); + self.send_multiple_tokens_if_not_zero(&caller, &output_payments); self.emit_swap_event(&storage_cache, swap_context); - self.build_swap_fixed_output_results(output_payments_after_hook) + self.build_swap_fixed_output_results(output_payments) } fn perform_swap_fixed_input( diff --git a/dex/pair/src/pair_hooks/banned_address.rs b/dex/pair/src/pair_hooks/banned_address.rs deleted file mode 100644 index e806b5d0c..000000000 --- a/dex/pair/src/pair_hooks/banned_address.rs +++ /dev/null @@ -1,34 +0,0 @@ -multiversx_sc::imports!(); - -#[multiversx_sc::module] -pub trait BannedAddressModule: permissions_module::PermissionsModule { - #[endpoint(addBannedAddress)] - fn add_banned_address(&self, addresses: MultiValueEncoded) { - self.require_caller_has_owner_or_admin_permissions(); - - let mapper = self.banned_addresses(); - for address in addresses { - mapper.add(&address); - } - } - - #[endpoint(removeBannedAddress)] - fn remove_banned_address(&self, addresses: MultiValueEncoded) { - self.require_caller_has_owner_or_admin_permissions(); - - let mapper = self.banned_addresses(); - for address in addresses { - mapper.remove(&address); - } - } - - fn require_not_banned_address(&self, address: &ManagedAddress) { - require!( - !self.banned_addresses().contains(address), - "Cannot add hook for this address" - ); - } - - #[storage_mapper("bannedAddresses")] - fn banned_addresses(&self) -> WhitelistMapper; -} diff --git a/dex/pair/src/pair_hooks/call_hook.rs b/dex/pair/src/pair_hooks/call_hook.rs deleted file mode 100644 index ff9753991..000000000 --- a/dex/pair/src/pair_hooks/call_hook.rs +++ /dev/null @@ -1,58 +0,0 @@ -use common_structs::PaymentsVec; - -use super::hook_type::{Hook, HookType}; - -multiversx_sc::imports!(); - -#[multiversx_sc::module] -pub trait CallHookModule { - fn call_hook( - &self, - hook_type: HookType, - caller: ManagedAddress, - input_payments: PaymentsVec, - args: ManagedVec, - ) -> PaymentsVec { - let hooks = self.hooks(hook_type).get(); - if hooks.is_empty() { - return input_payments; - } - - let payments_len = input_payments.len(); - let mut call_args = ManagedArgBuffer::new(); - call_args.push_arg(caller); - - for arg in &args { - call_args.push_arg(arg); - } - - let mut output_payments = input_payments; - for hook in &hooks { - let (_, back_transfers) = - ContractCallNoPayment::<_, MultiValueEncoded>::new( - hook.dest_address, - hook.endpoint_name, - ) - .with_raw_arguments(call_args.clone()) - .with_multi_token_transfer(output_payments) - .execute_on_dest_context_with_back_transfers::>(); - - output_payments = back_transfers.esdt_payments; - require!( - output_payments.len() == payments_len, - "Wrong payments received from SC" - ); - } - - output_payments - } - - fn encode_arg_to_vec(&self, arg: &T, vec: &mut ManagedVec) { - let mut encoded_value = ManagedBuffer::new(); - let _ = arg.top_encode(&mut encoded_value); - vec.push(encoded_value); - } - - #[storage_mapper("hooks")] - fn hooks(&self, hook_type: HookType) -> SingleValueMapper>>; -} diff --git a/dex/pair/src/pair_hooks/change_hooks.rs b/dex/pair/src/pair_hooks/change_hooks.rs deleted file mode 100644 index 39d444c9c..000000000 --- a/dex/pair/src/pair_hooks/change_hooks.rs +++ /dev/null @@ -1,43 +0,0 @@ -use super::hook_type::{Hook, HookType}; - -multiversx_sc::imports!(); - -#[multiversx_sc::module] -pub trait ChangeHooksModule: - super::call_hook::CallHookModule - + super::banned_address::BannedAddressModule - + permissions_module::PermissionsModule - + utils::UtilsModule -{ - #[endpoint(addHook)] - fn add_hook(&self, hook_type: HookType, to: ManagedAddress, endpoint_name: ManagedBuffer) { - self.require_caller_has_owner_or_admin_permissions(); - self.require_not_banned_address(&to); - self.require_sc_address(&to); - self.require_not_empty_buffer(&endpoint_name); - - self.hooks(hook_type).update(|hooks| { - hooks.push(Hook { - dest_address: to, - endpoint_name, - }) - }); - } - - #[endpoint(removeHook)] - fn remove_hook(&self, hook_type: HookType, to: ManagedAddress, endpoint_name: ManagedBuffer) { - self.require_caller_has_owner_or_admin_permissions(); - - self.hooks(hook_type).update(|hooks| { - let opt_index = hooks.find(&Hook { - dest_address: to, - endpoint_name, - }); - - require!(opt_index.is_some(), "Item not found"); - - let index = unsafe { opt_index.unwrap_unchecked() }; - hooks.remove(index); - }) - } -} diff --git a/dex/pair/src/pair_hooks/hook_type.rs b/dex/pair/src/pair_hooks/hook_type.rs deleted file mode 100644 index 63c7ca67e..000000000 --- a/dex/pair/src/pair_hooks/hook_type.rs +++ /dev/null @@ -1,88 +0,0 @@ -use crate::pair_actions::swap::SwapType; - -multiversx_sc::imports!(); -multiversx_sc::derive_imports!(); - -#[derive(TypeAbi, TopEncode, TopDecode, NestedEncode, NestedDecode, Clone, Copy)] -pub enum HookType { - // can't be done, execute_on_dest does not work on init - _BeforeInitialize, - _AfterInitialize, - BeforeAddInitialLiq, - AfterAddInitialLiq, - BeforeAddLiq, - AfterAddLiq, - BeforeRemoveLiq, - AfterRemoveLiq, - BeforeSwap, - AfterSwap, -} - -#[derive(TypeAbi, TopEncode, TopDecode, NestedEncode, NestedDecode, ManagedVecItem, PartialEq)] -pub struct Hook { - pub dest_address: ManagedAddress, - pub endpoint_name: ManagedBuffer, -} - -pub trait PairHook { - type Sc: ContractBase; - - fn before_add_initial_liq( - sc: &Self::Sc, - first_payment: EsdtTokenPayment<::Api>, - second_payment: EsdtTokenPayment<::Api>, - original_caller: ManagedAddress<::Api>, - ); - - fn after_add_initial_liq( - sc: &Self::Sc, - lp_payment: EsdtTokenPayment<::Api>, - original_caller: ManagedAddress<::Api>, - ); - - fn before_add_liq( - sc: &Self::Sc, - first_payment: EsdtTokenPayment<::Api>, - second_payment: EsdtTokenPayment<::Api>, - original_caller: ManagedAddress<::Api>, - first_token_amount_min: BigUint<::Api>, - second_token_amount_min: BigUint<::Api>, - ); - - fn after_add_liq( - sc: &Self::Sc, - lp_payment: EsdtTokenPayment<::Api>, - original_caller: ManagedAddress<::Api>, - ); - - fn before_remove_liq( - sc: &Self::Sc, - lp_payment: EsdtTokenPayment<::Api>, - original_caller: ManagedAddress<::Api>, - ); - - fn after_remove_liq( - sc: &Self::Sc, - first_payment: EsdtTokenPayment<::Api>, - second_payment: EsdtTokenPayment<::Api>, - original_caller: ManagedAddress<::Api>, - first_token_amount_min: BigUint<::Api>, - second_token_amount_min: BigUint<::Api>, - ); - - fn before_swap( - sc: &Self::Sc, - payment: EsdtTokenPayment<::Api>, - original_caller: ManagedAddress<::Api>, - swap_type: SwapType, - ); - - fn after_swap( - sc: &Self::Sc, - payment: EsdtTokenPayment<::Api>, - original_caller: ManagedAddress<::Api>, - swap_type: SwapType, - token_out: TokenIdentifier<::Api>, - amount_out: BigUint<::Api>, - ); -} diff --git a/dex/pair/src/pair_hooks/mod.rs b/dex/pair/src/pair_hooks/mod.rs deleted file mode 100644 index db189828b..000000000 --- a/dex/pair/src/pair_hooks/mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -pub mod banned_address; -pub mod call_hook; -pub mod change_hooks; -pub mod hook_type; diff --git a/dex/pair/wasm-pair-full/src/lib.rs b/dex/pair/wasm-pair-full/src/lib.rs index de0788bb7..149c4a91b 100644 --- a/dex/pair/wasm-pair-full/src/lib.rs +++ b/dex/pair/wasm-pair-full/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 68 +// Endpoints: 64 // Async Callback (empty): 1 -// Total number of exported functions: 70 +// Total number of exported functions: 66 #![no_std] #![allow(internal_features)] @@ -75,10 +75,6 @@ multiversx_sc_wasm_adapter::endpoints! { getAmountOut => get_amount_out_view getAmountIn => get_amount_in_view getEquivalent => get_equivalent - addBannedAddress => add_banned_address - removeBannedAddress => remove_banned_address - addHook => add_hook - removeHook => remove_hook getLpTokensSafePriceByDefaultOffset => get_lp_tokens_safe_price_by_default_offset getLpTokensSafePriceByRoundOffset => get_lp_tokens_safe_price_by_round_offset getLpTokensSafePriceByTimestampOffset => get_lp_tokens_safe_price_by_timestamp_offset diff --git a/dex/pair/wasm/src/lib.rs b/dex/pair/wasm/src/lib.rs index 88e3bc52e..82a357b8a 100644 --- a/dex/pair/wasm/src/lib.rs +++ b/dex/pair/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 59 +// Endpoints: 55 // Async Callback (empty): 1 -// Total number of exported functions: 61 +// Total number of exported functions: 57 #![no_std] #![allow(internal_features)] @@ -75,10 +75,6 @@ multiversx_sc_wasm_adapter::endpoints! { getAmountOut => get_amount_out_view getAmountIn => get_amount_in_view getEquivalent => get_equivalent - addBannedAddress => add_banned_address - removeBannedAddress => remove_banned_address - addHook => add_hook - removeHook => remove_hook ) } diff --git a/dex/sample-hooks/pair-hooks-sample/Cargo.toml b/dex/sample-hooks/pair-hooks-sample/Cargo.toml deleted file mode 100644 index 211b40099..000000000 --- a/dex/sample-hooks/pair-hooks-sample/Cargo.toml +++ /dev/null @@ -1,21 +0,0 @@ -[package] -name = "pair-hooks-sample" -version = "0.0.0" -authors = ["you"] -edition = "2021" -publish = false - -[lib] -path = "src/lib.rs" - -[dependencies.multiversx-sc] -version = "=0.46.1" - -[dependencies.pair] -path = "../../pair" - -[dev-dependencies] -num-bigint = "0.4.2" - -[dev-dependencies.multiversx-sc-scenario] -version = "=0.46.1" diff --git a/dex/sample-hooks/pair-hooks-sample/meta/Cargo.toml b/dex/sample-hooks/pair-hooks-sample/meta/Cargo.toml deleted file mode 100644 index 06eda390c..000000000 --- a/dex/sample-hooks/pair-hooks-sample/meta/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "pair-hooks-sample-meta" -version = "0.0.0" -edition = "2021" -publish = false - -[dependencies.pair-hooks-sample] -path = ".." - -[dependencies.multiversx-sc-meta] -version = "=0.46.1" -default-features = false diff --git a/dex/sample-hooks/pair-hooks-sample/meta/src/main.rs b/dex/sample-hooks/pair-hooks-sample/meta/src/main.rs deleted file mode 100644 index 956f28e39..000000000 --- a/dex/sample-hooks/pair-hooks-sample/meta/src/main.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - multiversx_sc_meta::cli_main::(); -} diff --git a/dex/sample-hooks/pair-hooks-sample/multiversx.json b/dex/sample-hooks/pair-hooks-sample/multiversx.json deleted file mode 100644 index 736553962..000000000 --- a/dex/sample-hooks/pair-hooks-sample/multiversx.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "language": "rust" -} \ No newline at end of file diff --git a/dex/sample-hooks/pair-hooks-sample/src/lib.rs b/dex/sample-hooks/pair-hooks-sample/src/lib.rs deleted file mode 100644 index b76d0137e..000000000 --- a/dex/sample-hooks/pair-hooks-sample/src/lib.rs +++ /dev/null @@ -1,140 +0,0 @@ -#![no_std] - -use core::marker::PhantomData; - -use pair::pair_hooks::hook_type::PairHook; - -multiversx_sc::imports!(); - -#[multiversx_sc::contract] -pub trait PairHooksSample { - #[init] - fn init(&self, known_pairs: MultiValueEncoded) { - let mapper = self.known_pairs(); - for pair in known_pairs { - mapper.add(&pair); - } - } - - #[payable("*")] - #[endpoint(beforeAddInitialLiqHook)] - fn before_add_initial_liq_hook(&self, original_caller: ManagedAddress) { - self.require_known_pair(); - - let [first_payment, second_payment] = self.call_value().multi_esdt(); - Wrapper::::before_add_initial_liq( - self, - first_payment, - second_payment, - original_caller, - ); - } - - #[payable("*")] - #[endpoint(afterAddInitialLiqHook)] - fn after_add_initial_liq_hook(&self, original_caller: ManagedAddress) { - self.require_known_pair(); - - let lp_payment = self.call_value().single_esdt(); - Wrapper::::after_add_initial_liq(self, lp_payment, original_caller); - } - - fn require_known_pair(&self) { - let caller = self.blockchain().get_caller(); - require!( - self.known_pairs().contains(&caller), - "Only known pairs may call this endpoint" - ); - } - - #[storage_mapper("knownPairs")] - fn known_pairs(&self) -> WhitelistMapper; -} - -pub struct Wrapper { - _phantom: PhantomData, -} - -impl PairHook for Wrapper { - type Sc = T; - - fn before_add_initial_liq( - sc: &Self::Sc, - first_payment: EsdtTokenPayment<::Api>, - second_payment: EsdtTokenPayment<::Api>, - _original_caller: ManagedAddress<::Api>, - ) { - let caller = sc.blockchain().get_caller(); - sc.send() - .direct_non_zero_esdt_payment(&caller, &first_payment); - sc.send() - .direct_non_zero_esdt_payment(&caller, &second_payment); - } - - fn after_add_initial_liq( - sc: &Self::Sc, - lp_payment: EsdtTokenPayment<::Api>, - _original_caller: ManagedAddress<::Api>, - ) { - let caller = sc.blockchain().get_caller(); - sc.send().direct_non_zero_esdt_payment(&caller, &lp_payment); - } - - fn before_add_liq( - _sc: &Self::Sc, - _first_payment: EsdtTokenPayment<::Api>, - _second_payment: EsdtTokenPayment<::Api>, - _original_caller: ManagedAddress<::Api>, - _first_token_amount_min: BigUint<::Api>, - _second_token_amount_min: BigUint<::Api>, - ) { - todo!() - } - - fn after_add_liq( - _sc: &Self::Sc, - _lp_payment: EsdtTokenPayment<::Api>, - _original_caller: ManagedAddress<::Api>, - ) { - todo!() - } - - fn before_remove_liq( - _sc: &Self::Sc, - _lp_payment: EsdtTokenPayment<::Api>, - _original_caller: ManagedAddress<::Api>, - ) { - todo!() - } - - fn after_remove_liq( - _sc: &Self::Sc, - _first_payment: EsdtTokenPayment<::Api>, - _second_payment: EsdtTokenPayment<::Api>, - _original_caller: ManagedAddress<::Api>, - _first_token_amount_min: BigUint<::Api>, - _second_token_amount_min: BigUint<::Api>, - ) { - todo!() - } - - fn before_swap( - _sc: &Self::Sc, - _payment: EsdtTokenPayment<::Api>, - _original_caller: ManagedAddress<::Api>, - _swap_type: pair::pair_actions::swap::SwapType, - ) { - todo!() - } - - fn after_swap( - _sc: &Self::Sc, - _payment: EsdtTokenPayment<::Api>, - _original_caller: ManagedAddress<::Api>, - _swap_type: pair::pair_actions::swap::SwapType, - _token_out: TokenIdentifier<::Api>, - _amount_out: BigUint<::Api>, - ) { - todo!() - } -} diff --git a/dex/sample-hooks/pair-hooks-sample/wasm/Cargo.lock b/dex/sample-hooks/pair-hooks-sample/wasm/Cargo.lock deleted file mode 100644 index b4c6c24cc..000000000 --- a/dex/sample-hooks/pair-hooks-sample/wasm/Cargo.lock +++ /dev/null @@ -1,407 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" - -[[package]] -name = "common-types" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "energy-query" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", -] - -[[package]] -name = "fees-collector" -version = "0.0.0" -dependencies = [ - "common-types", - "common_errors", - "energy-factory", - "energy-query", - "locking_module", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "locking_module" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", - "simple-lock", -] - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.46.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c94b173dc5ff0e157f767275fe6b7a1b4d2ad343bef7b66cd22a6353e016b93" -dependencies = [ - "bitflags", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19908153158c03df4582af08f47c0eb39fb52a7dff4736b301a66acbbb9955d3" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3b03b43f9cad320992f54ed162de2ed63e3ec83ed01361e57ee9c1865fba5a2" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.46.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b78945957036c281ad6ee21bb5120dcefa2017688adf43ec94e3e7c982efb09" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.46.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c63ffaba95e630ff75981e2f5f50da64f523219b52f484234c66f3adc248885f" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.46.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9579f40c00da56a5a68e010ff851fa48ac7b9c6a16ad4314795cb32d889d9e78" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "pair" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "fees-collector", - "itertools", - "multiversx-sc", - "pausable", - "permissions_module", - "simple-lock", - "token_send", - "utils", -] - -[[package]] -name = "pair-hooks-sample" -version = "0.0.0" -dependencies = [ - "multiversx-sc", - "pair", -] - -[[package]] -name = "pair-hooks-sample-wasm" -version = "0.0.0" -dependencies = [ - "multiversx-sc-wasm-adapter", - "pair-hooks-sample", -] - -[[package]] -name = "pausable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", - "permissions_module", -] - -[[package]] -name = "permissions_module" -version = "0.0.0" -dependencies = [ - "bitflags", - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "proc-macro2" -version = "1.0.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" - -[[package]] -name = "syn" -version = "2.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "token_send" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "week-timekeeping" -version = "0.0.0" -dependencies = [ - "common-types", - "multiversx-sc", -] - -[[package]] -name = "weekly-rewards-splitting" -version = "0.0.0" -dependencies = [ - "common-types", - "energy-query", - "math", - "multiversx-sc", - "unwrappable", - "week-timekeeping", -] diff --git a/dex/sample-hooks/pair-hooks-sample/wasm/Cargo.toml b/dex/sample-hooks/pair-hooks-sample/wasm/Cargo.toml deleted file mode 100644 index 9ce799efc..000000000 --- a/dex/sample-hooks/pair-hooks-sample/wasm/Cargo.toml +++ /dev/null @@ -1,31 +0,0 @@ -# Code generated by the multiversx-sc build system. DO NOT EDIT. - -# ########################################## -# ############## AUTO-GENERATED ############# -# ########################################## - -[package] -name = "pair-hooks-sample-wasm" -version = "0.0.0" -edition = "2021" -publish = false - -[lib] -crate-type = ["cdylib"] - -[profile.release] -codegen-units = 1 -opt-level = "z" -lto = true -debug = false -panic = "abort" -overflow-checks = false - -[dependencies.pair-hooks-sample] -path = ".." - -[dependencies.multiversx-sc-wasm-adapter] -version = "=0.46.1" - -[workspace] -members = ["."] diff --git a/dex/sample-hooks/pair-hooks-sample/wasm/src/lib.rs b/dex/sample-hooks/pair-hooks-sample/wasm/src/lib.rs deleted file mode 100644 index a059bba6b..000000000 --- a/dex/sample-hooks/pair-hooks-sample/wasm/src/lib.rs +++ /dev/null @@ -1,28 +0,0 @@ -// Code generated by the multiversx-sc build system. DO NOT EDIT. - -//////////////////////////////////////////////////// -////////////////// AUTO-GENERATED ////////////////// -//////////////////////////////////////////////////// - -// Init: 1 -// Endpoints: 2 -// Async Callback (empty): 1 -// Total number of exported functions: 4 - -#![no_std] -#![allow(internal_features)] -#![feature(lang_items)] - -multiversx_sc_wasm_adapter::allocator!(); -multiversx_sc_wasm_adapter::panic_handler!(); - -multiversx_sc_wasm_adapter::endpoints! { - pair_hooks_sample - ( - init => init - beforeAddInitialLiqHook => before_add_initial_liq_hook - afterAddInitialLiqHook => after_add_initial_liq_hook - ) -} - -multiversx_sc_wasm_adapter::async_callback_empty! {} From c4396752324c216579a06b9d1542deec781a2854 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Tue, 6 Feb 2024 12:54:54 +0200 Subject: [PATCH 171/213] metastakig: fix admins withdraw issue --- .../farm-staking/src/custom_rewards.rs | 5 ++- .../tests/farm_staking_setup/mod.rs | 15 ++++++++ .../farm-staking/tests/farm_staking_test.rs | 34 +++++++++++++++++-- 3 files changed, 50 insertions(+), 4 deletions(-) diff --git a/farm-staking/farm-staking/src/custom_rewards.rs b/farm-staking/farm-staking/src/custom_rewards.rs index 8e4d538dc..6df6eb187 100644 --- a/farm-staking/farm-staking/src/custom_rewards.rs +++ b/farm-staking/farm-staking/src/custom_rewards.rs @@ -10,6 +10,7 @@ use crate::base_impl_wrapper::FarmStakingWrapper; pub const MAX_PERCENT: u64 = 10_000; pub const BLOCKS_IN_YEAR: u64 = 31_536_000 / 6; // seconds_in_year / 6_seconds_per_block pub const MAX_MIN_UNBOND_EPOCHS: u64 = 30; +pub const WITHDRAW_AMOUNT_TOO_HIGH: &str = "Withdraw amount is higher than the remaining uncollected rewards!"; #[multiversx_sc::module] pub trait CustomRewardsModule: @@ -47,7 +48,9 @@ pub trait CustomRewardsModule: #[endpoint(withdrawRewards)] fn withdraw_rewards(&self, withdraw_amount: BigUint) { self.require_caller_has_admin_permissions(); - + + let remaining_uncolected_rewards = self.reward_capacity().get() - self.accumulated_rewards().get(); + require!(withdraw_amount < remaining_uncolected_rewards, WITHDRAW_AMOUNT_TOO_HIGH); self.reward_capacity().update(|rewards| { require!( *rewards >= withdraw_amount, diff --git a/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs b/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs index 2a1109add..0ba2b2bc5 100644 --- a/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs +++ b/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs @@ -43,6 +43,8 @@ pub const USER_REWARDS_ENERGY_CONST: u64 = 3; pub const USER_REWARDS_FARM_CONST: u64 = 2; pub const MIN_ENERGY_AMOUNT_FOR_BOOSTED_YIELDS: u64 = 1; pub const MIN_FARM_AMOUNT_FOR_BOOSTED_YIELDS: u64 = 1; +pub const WITHDRAW_AMOUNT_TOO_HIGH: &str = "Withdraw amount is higher than the remaining uncollected rewards!"; + pub struct FarmStakingSetup where @@ -515,4 +517,17 @@ where ) .assert_ok(); } + + pub fn withdraw_rewards_with_error(&mut self, withdraw_amount: &RustBigUint, expected_status: u64, expected_message: &str) { + self.b_mock + .execute_tx( + &self.owner_address, + &self.farm_wrapper, + &rust_biguint!(0), + |sc| { + sc.withdraw_rewards(withdraw_amount.into()); + }, + ) + .assert_error(expected_status, expected_message) + } } diff --git a/farm-staking/farm-staking/tests/farm_staking_test.rs b/farm-staking/farm-staking/tests/farm_staking_test.rs index c0bdfb803..dec70ca8a 100644 --- a/farm-staking/farm-staking/tests/farm_staking_test.rs +++ b/farm-staking/farm-staking/tests/farm_staking_test.rs @@ -1,8 +1,6 @@ #![allow(deprecated)] -use multiversx_sc_scenario::{ - rust_biguint, whitebox_legacy::TxTokenTransfer, DebugApi, -}; +use multiversx_sc_scenario::{rust_biguint, whitebox_legacy::TxTokenTransfer, DebugApi}; pub mod farm_staking_setup; use farm_staking::{ @@ -249,3 +247,33 @@ fn test_withdraw_rewards() { let final_rewards_capacity = 0u64; farm_setup.check_rewards_capacity(final_rewards_capacity); } + +#[test] +fn test_admin_cannot_withdraw_users_rewards() { + DebugApi::dummy(); + let mut farm_setup = + FarmStakingSetup::new(farm_staking::contract_obj, energy_factory::contract_obj); + + let initial_rewards_capacity = 1_000_000_000_000u64; + farm_setup.check_rewards_capacity(initial_rewards_capacity); + + let farm_in_amount = 100_000_000; + let expected_farm_token_nonce = 1; + farm_setup.stake_farm(farm_in_amount, &[], expected_farm_token_nonce, 0, 0); + farm_setup.check_farm_token_supply(farm_in_amount); + + farm_setup.set_block_epoch(5); + farm_setup.set_block_nonce(10); + + let withdraw_amount = rust_biguint!(TOTAL_REWARDS_AMOUNT); + farm_setup.withdraw_rewards_with_error(&withdraw_amount, 4, WITHDRAW_AMOUNT_TOO_HIGH); + + let expected_reward_token_out = 40; + + let withdraw_amount = rust_biguint!(TOTAL_REWARDS_AMOUNT) - rust_biguint!(expected_reward_token_out); + farm_setup.withdraw_rewards(&withdraw_amount); + + // Only the user's rewards will remain + let final_rewards_capacity = expected_reward_token_out; + farm_setup.check_rewards_capacity(final_rewards_capacity); +} From 4792a423cae6f40d7faa777d01d10392e75fc054 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Tue, 6 Feb 2024 13:11:21 +0200 Subject: [PATCH 172/213] Aggregate rewards in withdraw_rewards --- farm-staking/farm-staking/src/custom_rewards.rs | 14 ++++++++++---- .../farm-staking/tests/farm_staking_test.rs | 2 +- farm-staking/farm-staking/wasm/Cargo.lock | 1 + farm-staking/farm-staking/wasm/src/lib.rs | 5 +++-- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/farm-staking/farm-staking/src/custom_rewards.rs b/farm-staking/farm-staking/src/custom_rewards.rs index 6df6eb187..f62ec0cb7 100644 --- a/farm-staking/farm-staking/src/custom_rewards.rs +++ b/farm-staking/farm-staking/src/custom_rewards.rs @@ -48,10 +48,16 @@ pub trait CustomRewardsModule: #[endpoint(withdrawRewards)] fn withdraw_rewards(&self, withdraw_amount: BigUint) { self.require_caller_has_admin_permissions(); - - let remaining_uncolected_rewards = self.reward_capacity().get() - self.accumulated_rewards().get(); - require!(withdraw_amount < remaining_uncolected_rewards, WITHDRAW_AMOUNT_TOO_HIGH); - self.reward_capacity().update(|rewards| { + + let mut storage_cache = StorageCache::new(self); + FarmStakingWrapper::::generate_aggregated_rewards(self, &mut storage_cache); + + let reward_capacity_mapper = self.reward_capacity(); + let accumulated_rewards_mapper = self.accumulated_rewards(); + let remaining_rewards = reward_capacity_mapper.get() - accumulated_rewards_mapper.get(); + require!(withdraw_amount <= remaining_rewards, WITHDRAW_AMOUNT_TOO_HIGH); + + reward_capacity_mapper.update(|rewards| { require!( *rewards >= withdraw_amount, "Not enough rewards to withdraw" diff --git a/farm-staking/farm-staking/tests/farm_staking_test.rs b/farm-staking/farm-staking/tests/farm_staking_test.rs index dec70ca8a..a8a6abb3a 100644 --- a/farm-staking/farm-staking/tests/farm_staking_test.rs +++ b/farm-staking/farm-staking/tests/farm_staking_test.rs @@ -249,7 +249,7 @@ fn test_withdraw_rewards() { } #[test] -fn test_admin_cannot_withdraw_users_rewards() { +fn test_withdraw_after_produced_rewards() { DebugApi::dummy(); let mut farm_setup = FarmStakingSetup::new(farm_staking::contract_obj, energy_factory::contract_obj); diff --git a/farm-staking/farm-staking/wasm/Cargo.lock b/farm-staking/farm-staking/wasm/Cargo.lock index dce82eb7c..88d4b1bba 100644 --- a/farm-staking/farm-staking/wasm/Cargo.lock +++ b/farm-staking/farm-staking/wasm/Cargo.lock @@ -411,6 +411,7 @@ dependencies = [ "permissions_module", "simple-lock", "token_send", + "utils", ] [[package]] diff --git a/farm-staking/farm-staking/wasm/src/lib.rs b/farm-staking/farm-staking/wasm/src/lib.rs index c05cf46e5..02de33846 100644 --- a/farm-staking/farm-staking/wasm/src/lib.rs +++ b/farm-staking/farm-staking/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 70 +// Endpoints: 71 // Async Callback: 1 -// Total number of exported functions: 72 +// Total number of exported functions: 73 #![no_std] #![allow(internal_features)] @@ -24,6 +24,7 @@ multiversx_sc_wasm_adapter::endpoints! { mergeFarmTokens => merge_farm_tokens_endpoint calculateRewardsForGivenPosition => calculate_rewards_for_given_position topUpRewards => top_up_rewards + withdrawRewards => withdraw_rewards endProduceRewards => end_produce_rewards setPerBlockRewardAmount => set_per_block_rewards setMaxApr => set_max_apr From 016473d755e19c8b92e46b765754260154fdeba7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Tue, 6 Feb 2024 18:18:50 +0200 Subject: [PATCH 173/213] Destroy farm: pair_addr provided as parameter --- locked-asset/proxy_dex/src/proxy_farm.rs | 3 +-- locked-asset/proxy_dex/src/proxy_pair.rs | 9 --------- locked-asset/proxy_dex/tests/proxy_farm_test.rs | 1 + locked-asset/simple-lock/src/proxy_farm.rs | 7 ++----- locked-asset/simple-lock/src/proxy_lp.rs | 9 --------- 5 files changed, 4 insertions(+), 25 deletions(-) diff --git a/locked-asset/proxy_dex/src/proxy_farm.rs b/locked-asset/proxy_dex/src/proxy_farm.rs index 5e2789c0c..c67f2daf8 100644 --- a/locked-asset/proxy_dex/src/proxy_farm.rs +++ b/locked-asset/proxy_dex/src/proxy_farm.rs @@ -239,6 +239,7 @@ pub trait ProxyFarmModule: fn destroy_farm_proxy( &self, farm_address: ManagedAddress, + pair_address: ManagedAddress, first_token_amount_min: BigUint, second_token_amount_min: BigUint, opt_original_caller: OptionalValue, @@ -281,8 +282,6 @@ pub trait ProxyFarmModule: exit_result.farming_tokens.amount, ); - let pair_address = self.lp_address_for_lp(&exit_result.farming_tokens.token_identifier).get(); - let mut output_payments = self.remove_liquidity_proxy_common( initial_proxy_farming_tokens.clone(), pair_address, diff --git a/locked-asset/proxy_dex/src/proxy_pair.rs b/locked-asset/proxy_dex/src/proxy_pair.rs index 1f3a032ab..79542f06a 100644 --- a/locked-asset/proxy_dex/src/proxy_pair.rs +++ b/locked-asset/proxy_dex/src/proxy_pair.rs @@ -68,8 +68,6 @@ pub trait ProxyPairModule: second_payment.amount.clone() - &add_liq_result.second_token_leftover.amount }; - self.lp_address_for_lp(&add_liq_result.lp_tokens_received.token_identifier).set(pair_address.clone()); - let new_token_attributes = WrappedLpTokenAttributes { locked_tokens: locked_token_used, lp_token_id: add_liq_result.lp_tokens_received.token_identifier.clone(), @@ -298,11 +296,4 @@ pub trait ProxyPairModule: fn require_wrapped_lp_token_id_not_empty(&self) { require!(!self.wrapped_lp_token().is_empty(), "Empty token id"); } - - #[storage_mapper("lpAddressForLp")] - fn lp_address_for_lp( - &self, - lp: &TokenIdentifier, - ) -> SingleValueMapper; - } diff --git a/locked-asset/proxy_dex/tests/proxy_farm_test.rs b/locked-asset/proxy_dex/tests/proxy_farm_test.rs index 1b998e493..6a705f195 100644 --- a/locked-asset/proxy_dex/tests/proxy_farm_test.rs +++ b/locked-asset/proxy_dex/tests/proxy_farm_test.rs @@ -1611,6 +1611,7 @@ fn destroy_farm_locked_tokens_test() { |sc| { let output_payments = sc.destroy_farm_proxy( managed_address!(&farm_locked_addr), + managed_address!(&pair_addr), managed_biguint!(1), managed_biguint!(1), OptionalValue::None, diff --git a/locked-asset/simple-lock/src/proxy_farm.rs b/locked-asset/simple-lock/src/proxy_farm.rs index d380179ec..9d947b777 100644 --- a/locked-asset/simple-lock/src/proxy_farm.rs +++ b/locked-asset/simple-lock/src/proxy_farm.rs @@ -261,6 +261,7 @@ pub trait ProxyFarmModule: #[endpoint(destroyFarmLockedTokens)] fn destroy_farm_locked_tokens( &self, + pair_address: ManagedAddress, first_token_min_amount_out: BigUint, second_token_min_amount_out: BigUint, ) -> ExitFarmThroughProxyResultType { @@ -294,12 +295,8 @@ pub trait ProxyFarmModule: let initial_farming_tokens = exit_farm_result.initial_farming_tokens; - let lp_address = self - .lp_address_for_lp(&initial_farming_tokens.token_identifier) - .get(); - let remove_liq_result = self.call_pair_remove_liquidity_simple( - lp_address, + pair_address, initial_farming_tokens.token_identifier, initial_farming_tokens.amount, first_token_min_amount_out, diff --git a/locked-asset/simple-lock/src/proxy_lp.rs b/locked-asset/simple-lock/src/proxy_lp.rs index 6987e9913..ed16b65d1 100644 --- a/locked-asset/simple-lock/src/proxy_lp.rs +++ b/locked-asset/simple-lock/src/proxy_lp.rs @@ -184,8 +184,6 @@ pub trait ProxyLpModule: second_payment_unlocked_wrapper.status_before, ); - self.lp_address_for_lp(&add_liq_result.lp_tokens.token_identifier).set(lp_address); - let lp_token_name = add_liq_result .lp_tokens .token_identifier @@ -395,13 +393,6 @@ pub trait ProxyLpModule: second_token_id: &TokenIdentifier, ) -> SingleValueMapper; - - #[storage_mapper("lpAddressForLp")] - fn lp_address_for_lp( - &self, - lp: &TokenIdentifier, - ) -> SingleValueMapper; - #[view(getLpProxyTokenId)] #[storage_mapper("lpProxyTokenId")] fn lp_proxy_token(&self) -> NonFungibleTokenMapper; From 5c8f183e4591f77b4e110914895ac11c3861aebf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Tue, 6 Feb 2024 19:06:12 +0200 Subject: [PATCH 174/213] Simple-lock fix: destroy farm returns locked token --- locked-asset/simple-lock/src/proxy_farm.rs | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/locked-asset/simple-lock/src/proxy_farm.rs b/locked-asset/simple-lock/src/proxy_farm.rs index 9d947b777..707f73e68 100644 --- a/locked-asset/simple-lock/src/proxy_farm.rs +++ b/locked-asset/simple-lock/src/proxy_farm.rs @@ -261,7 +261,6 @@ pub trait ProxyFarmModule: #[endpoint(destroyFarmLockedTokens)] fn destroy_farm_locked_tokens( &self, - pair_address: ManagedAddress, first_token_min_amount_out: BigUint, second_token_min_amount_out: BigUint, ) -> ExitFarmThroughProxyResultType { @@ -295,24 +294,23 @@ pub trait ProxyFarmModule: let initial_farming_tokens = exit_farm_result.initial_farming_tokens; - let remove_liq_result = self.call_pair_remove_liquidity_simple( - pair_address, - initial_farming_tokens.token_identifier, - initial_farming_tokens.amount, + let (first_token_payment_out, second_token_payment_out) = self.remove_liquidity_locked_token_common( + initial_farming_tokens, first_token_min_amount_out, second_token_min_amount_out, - ); + ).into_tuple(); - output_payments.push(remove_liq_result.first_token_payment_out.clone()); - output_payments.push(remove_liq_result.second_token_payment_out.clone()); + output_payments.push(first_token_payment_out.clone()); + output_payments.push(second_token_payment_out.clone()); let caller = self.blockchain().get_caller(); self.send().direct_multi(&caller, &output_payments); ( - remove_liq_result.first_token_payment_out.clone(), - remove_liq_result.second_token_payment_out, - ).into() + first_token_payment_out, + second_token_payment_out, + ) + .into() } /// Claim rewards from a previously entered farm. From a250fb7c7cc783b4eb6f3a2221c57438544feca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Tue, 6 Feb 2024 19:10:16 +0200 Subject: [PATCH 175/213] Burn farm tokens for claim and destry endpoints --- locked-asset/proxy_dex/src/proxy_farm.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/locked-asset/proxy_dex/src/proxy_farm.rs b/locked-asset/proxy_dex/src/proxy_farm.rs index c67f2daf8..b642da727 100644 --- a/locked-asset/proxy_dex/src/proxy_farm.rs +++ b/locked-asset/proxy_dex/src/proxy_farm.rs @@ -289,12 +289,14 @@ pub trait ProxyFarmModule: second_token_amount_min, ); + // Burn farm token + wrapped_farm_token_mapper.nft_burn(payment.token_nonce, &payment.amount); + // Push farm rewards output_payments.push(exit_result.reward_tokens.clone()); self.send_multiple_tokens_if_not_zero(&caller, &output_payments); - self.emit_exit_farm_proxy_event( &original_caller, &farm_address, @@ -396,6 +398,9 @@ pub trait ProxyFarmModule: self.send_payment_non_zero(&caller, &new_wrapped_token); self.send_payment_non_zero(&caller, &claim_result.rewards); + // Burn farm token + wrapped_farm_token_mapper.nft_burn(payment.token_nonce, &payment.amount); + self.emit_claim_rewards_farm_proxy_event( &original_caller, &farm_address, From a60edcdc32d743ca3ec7a3c30874b5e6e505920b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Tue, 6 Feb 2024 19:20:19 +0200 Subject: [PATCH 176/213] simple-lock: Fix ExitFarmResultType --- locked-asset/simple-lock/src/farm_interactions.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locked-asset/simple-lock/src/farm_interactions.rs b/locked-asset/simple-lock/src/farm_interactions.rs index 4748f8ec5..2579a7531 100644 --- a/locked-asset/simple-lock/src/farm_interactions.rs +++ b/locked-asset/simple-lock/src/farm_interactions.rs @@ -6,7 +6,7 @@ multiversx_sc::derive_imports!(); type EnterFarmResultType = MultiValue2, EsdtTokenPayment>; type ExitFarmResultType = - MultiValue3, EsdtTokenPayment, EsdtTokenPayment>; + MultiValue2, EsdtTokenPayment>; type ClaimRewardsResultType = MultiValue2, EsdtTokenPayment>; From 1d02cacd1a6b2ddf0655d89f1e1a2633347948e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Tue, 6 Feb 2024 19:42:13 +0200 Subject: [PATCH 177/213] simple-lock/proxy-dex improvements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit simple-lock: Check Wrapped LP in destry test proxy-dex: Remove unnecesarry function Signed-off-by: Costin CarabaÈ™ --- .../proxy_dex/tests/proxy_farm_test.rs | 11 ++++++++-- .../simple-lock/src/lp_interactions.rs | 22 ------------------- 2 files changed, 9 insertions(+), 24 deletions(-) diff --git a/locked-asset/proxy_dex/tests/proxy_farm_test.rs b/locked-asset/proxy_dex/tests/proxy_farm_test.rs index 6a705f195..6166b97e8 100644 --- a/locked-asset/proxy_dex/tests/proxy_farm_test.rs +++ b/locked-asset/proxy_dex/tests/proxy_farm_test.rs @@ -1594,7 +1594,7 @@ fn destroy_farm_locked_tokens_test() { setup.b_mock.set_block_nonce(100); ////////////////////////////////////////////// DESTROY FARM ///////////////////////////////////// - + // should be 500_000_000, but ends up so due to approximations let removed_locked_token_amount = rust_biguint!(499_999_000); // should be 250_000_000, but ends up so due to approximations @@ -1633,7 +1633,6 @@ fn destroy_farm_locked_tokens_test() { ) .assert_ok(); - // check user received half of the farm tokens back, and another new wrapped LP token setup.b_mock.check_nft_balance::( &first_user, WRAPPED_FARM_TOKEN_ID, @@ -1641,4 +1640,12 @@ fn destroy_farm_locked_tokens_test() { &(&expected_lp_token_amount / 2u64), None, ); + + setup.b_mock.check_nft_balance::( + &first_user, + WRAPPED_LP_TOKEN_ID, + 1, + &rust_biguint!(0u64), + None, + ); } diff --git a/locked-asset/simple-lock/src/lp_interactions.rs b/locked-asset/simple-lock/src/lp_interactions.rs index 86e229a3f..4229cca53 100644 --- a/locked-asset/simple-lock/src/lp_interactions.rs +++ b/locked-asset/simple-lock/src/lp_interactions.rs @@ -123,28 +123,6 @@ pub trait LpInteractionsModule { } } - fn call_pair_remove_liquidity_simple( - &self, - lp_address: ManagedAddress, - lp_token_id: TokenIdentifier, - lp_token_amount: BigUint, - first_token_amount_min: BigUint, - second_token_amount_min: BigUint, - ) -> RemoveLiquidityResultWrapper { - let lp_payments_out: RemoveLiquidityResultType = self - .lp_proxy(lp_address) - .remove_liquidity(first_token_amount_min, second_token_amount_min) - .with_esdt_transfer((lp_token_id, 0, lp_token_amount)) - .execute_on_dest_context(); - - let (first_token_payment_out, second_token_payment_out) = lp_payments_out.into_tuple(); - - RemoveLiquidityResultWrapper { - first_token_payment_out, - second_token_payment_out, - } - } - #[proxy] fn lp_proxy(&self, sc_address: ManagedAddress) -> lp_proxy::Proxy; } From 466d78a91fee8c67a9a0f1140ae65c6bbd7fdac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Wed, 7 Feb 2024 15:39:55 +0200 Subject: [PATCH 178/213] Fix issues: Add Cargo.lock --- .gitignore | 4 - Cargo.lock | 3300 +++++++++++++++++ dex/farm-with-locked-rewards/wasm/Cargo.lock | 1 + dex/farm/wasm/Cargo.lock | 1 + dex/proxy-deployer/wasm/Cargo.lock | 1 + dex/router/wasm/Cargo.lock | 1 + .../energy-update/wasm/Cargo.lock | 1 + .../farm-staking-proxy/wasm/Cargo.lock | 1 + farm-staking/farm-staking/wasm/Cargo.lock | 1 + farm-staking/farm-staking/wasm/src/lib.rs | 5 +- locked-asset/proxy_dex/wasm/Cargo.lock | 1 + 11 files changed, 3311 insertions(+), 6 deletions(-) create mode 100644 Cargo.lock diff --git a/.gitignore b/.gitignore index e38735f03..66e657fad 100644 --- a/.gitignore +++ b/.gitignore @@ -2,10 +2,6 @@ # will have compiled files and executables **/target/ **/output/ -# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries -# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html -Cargo.lock -!**/wasm*/Cargo.lock # These are backup files generated by rustfmt **/*.rs.bk diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 000000000..a1d310c10 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,3300 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "Inflector" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" +dependencies = [ + "lazy_static", + "regex", +] + +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aho-corasick" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +dependencies = [ + "memchr", +] + +[[package]] +name = "anstream" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" + +[[package]] +name = "anstyle-parse" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + +[[package]] +name = "anyhow" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "backtrace" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if 1.0.0", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "bech32" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" + +[[package]] +name = "bip39" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f" +dependencies = [ + "bitcoin_hashes", + "rand", + "rand_core", + "serde", + "unicode-normalization", +] + +[[package]] +name = "bitcoin_hashes" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bstr" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c48f0051a4b4c5e0b6d365cd04af53aeaa209e3cc15ec2cdb69e73cc87fbd0dc" +dependencies = [ + "memchr", + "serde", +] + +[[package]] +name = "bumpalo" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" + +[[package]] +name = "cc" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clap" +version = "4.4.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.4.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" + +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + +[[package]] +name = "colored" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" +dependencies = [ + "lazy_static", + "windows-sys 0.48.0", +] + +[[package]] +name = "common-path" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2382f75942f4b3be3690fe4f86365e9c853c1587d6ee58212cebf6e2a9ccd101" + +[[package]] +name = "common-types" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "config" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "contexts" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "farm_token", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "rewards", + "token_merge_helper", + "token_send", +] + +[[package]] +name = "convert_case" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "copy_dir" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "543d1dd138ef086e2ff05e3a48cf9da045da2033d16f8538fd76b86cd49b2ca3" +dependencies = [ + "walkdir", +] + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" + +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "curve25519-dalek" +version = "4.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "platforms", + "rustc_version", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "der" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "dex-tests" +version = "0.0.0" +dependencies = [ + "common_structs", + "config", + "factory", + "farm", + "farm-boosted-yields", + "farm-staking", + "farm-staking-proxy", + "farm_token", + "fees-collector", + "governance", + "locking_module", + "multiversx-sc", + "multiversx-sc-modules", + "multiversx-sc-scenario", + "num-bigint", + "pair", + "pausable", + "rewards", + "router", + "simple-lock", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + +[[package]] +name = "distribution" +version = "0.0.0" +dependencies = [ + "common_structs", + "factory", + "multiversx-sc", + "multiversx-sc-scenario", +] + +[[package]] +name = "distribution-abi" +version = "0.0.0" +dependencies = [ + "distribution", + "multiversx-sc-meta", +] + +[[package]] +name = "distribution-tests" +version = "0.0.0" +dependencies = [ + "common_structs", + "distribution", + "energy-factory", + "factory", + "farm", + "fees-collector", + "hex", + "lkmex-transfer", + "multiversx-sc", + "multiversx-sc-modules", + "multiversx-sc-scenario", + "num-bigint", + "num-traits", + "pair", + "proxy_dex", + "router", + "simple-lock", + "token-unstake", +] + +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "pkcs8", + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" +dependencies = [ + "curve25519-dalek", + "ed25519", + "serde", + "sha2", + "subtle", + "zeroize", +] + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "encoding_rs" +version = "0.8.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "hex", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "multiversx-sc-scenario", + "num-bigint", + "num-traits", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "energy-factory-meta" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc-meta", +] + +[[package]] +name = "energy-factory-mock" +version = "0.0.0" +dependencies = [ + "energy-query", + "multiversx-sc", + "multiversx-sc-scenario", +] + +[[package]] +name = "energy-factory-mock-meta" +version = "0.0.0" +dependencies = [ + "energy-factory-mock", + "multiversx-sc-meta", +] + +[[package]] +name = "energy-query" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", +] + +[[package]] +name = "energy-update" +version = "0.0.0" +dependencies = [ + "farm", + "multiversx-sc", + "multiversx-sc-modules", + "multiversx-sc-scenario", + "num-bigint", + "weekly-rewards-splitting", +] + +[[package]] +name = "energy-update-meta" +version = "0.0.0" +dependencies = [ + "energy-update", + "multiversx-sc-meta", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "events" +version = "0.0.0" +dependencies = [ + "common_structs", + "contexts", + "multiversx-sc", +] + +[[package]] +name = "factory" +version = "0.0.0" +dependencies = [ + "arrayvec", + "common_errors", + "common_structs", + "energy-factory", + "hex", + "itertools 0.10.5", + "multiversx-sc", + "multiversx-sc-modules", + "multiversx-sc-scenario", + "num-bigint", + "num-traits", + "simple-lock", + "token_merge_helper", + "token_send", + "wee_alloc", +] + +[[package]] +name = "factory-abi" +version = "0.0.0" +dependencies = [ + "factory", + "multiversx-sc-meta", +] + +[[package]] +name = "farm" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "energy-factory-mock", + "energy-query", + "energy-update", + "events", + "farm-boosted-yields", + "farm_base_impl", + "farm_token", + "fixed-supply-token", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "multiversx-sc-scenario", + "num-bigint", + "pair", + "pausable", + "permissions_module", + "rewards", + "sc_whitelist_module", + "simple-lock", + "token_send", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm-abi" +version = "0.0.0" +dependencies = [ + "farm", + "multiversx-sc-meta", +] + +[[package]] +name = "farm-boosted-yields" +version = "0.0.0" +dependencies = [ + "common-types", + "config", + "energy-query", + "multiversx-sc", + "pausable", + "permissions_module", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm-staking" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "energy-factory", + "energy-query", + "events", + "farm", + "farm-boosted-yields", + "farm_base_impl", + "farm_token", + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "multiversx-sc-scenario", + "num-bigint", + "pair", + "pausable", + "permissions_module", + "rewards", + "sc_whitelist_module", + "token_send", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm-staking-abi" +version = "0.0.0" +dependencies = [ + "farm-staking", + "multiversx-sc-meta", +] + +[[package]] +name = "farm-staking-proxy" +version = "0.0.0" +dependencies = [ + "common_structs", + "config", + "energy-factory", + "energy-query", + "farm", + "farm-boosted-yields", + "farm-staking", + "farm-with-locked-rewards", + "farm_token", + "fixed-supply-token", + "hex-literal 0.3.4", + "locking_module", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "multiversx-sc-scenario", + "num-bigint", + "pair", + "pausable", + "rewards", + "sc_whitelist_module", + "simple-lock", + "token_send", + "unwrappable", + "utils", +] + +[[package]] +name = "farm-staking-proxy-meta" +version = "0.0.0" +dependencies = [ + "farm-staking-proxy", + "multiversx-sc-meta", +] + +[[package]] +name = "farm-with-locked-rewards" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "energy-factory", + "energy-query", + "events", + "farm", + "farm-boosted-yields", + "farm_base_impl", + "farm_token", + "fixed-supply-token", + "locking_module", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "multiversx-sc-scenario", + "num-bigint", + "pausable", + "permissions_module", + "rewards", + "sc_whitelist_module", + "simple-lock", + "token_send", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm-with-locked-rewards-meta" +version = "0.0.0" +dependencies = [ + "farm-with-locked-rewards", + "multiversx-sc-meta", +] + +[[package]] +name = "farm_base_impl" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "events", + "farm_token", + "fixed-supply-token", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "multiversx-sc-scenario", + "pausable", + "permissions_module", + "rewards", + "token_merge_helper", + "token_send", + "utils", +] + +[[package]] +name = "farm_token" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "fastrand" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" + +[[package]] +name = "fees-collector" +version = "0.0.0" +dependencies = [ + "common-types", + "common_errors", + "energy-factory", + "energy-query", + "locking_module", + "multiversx-sc", + "multiversx-sc-modules", + "multiversx-sc-scenario", + "num-bigint", + "sc_whitelist_module", + "simple-lock", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "fees-collector-meta" +version = "0.0.0" +dependencies = [ + "fees-collector", + "multiversx-sc-meta", +] + +[[package]] +name = "fiat-crypto" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1676f435fc1dadde4d03e43f5d62b259e1ce5f40bd4ffb21db2b42ebe59c1382" + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "flate2" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-io" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-core", + "futures-io", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "fuzz" +version = "0.0.0" +dependencies = [ + "common_structs", + "config", + "factory", + "farm", + "farm-staking", + "farm_token", + "multiversx-sc", + "multiversx-sc-scenario", + "num-bigint", + "pair", + "pair-mock", + "pausable", + "price-discovery", + "rand", + "rewards", + "router", + "simple-lock", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi", +] + +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" + +[[package]] +name = "globset" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" +dependencies = [ + "aho-corasick", + "bstr", + "log", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "governance" +version = "0.0.0" +dependencies = [ + "multiversx-sc", + "multiversx-sc-scenario", + "num-bigint", + "pair-mock", +] + +[[package]] +name = "governance-meta" +version = "0.0.0" +dependencies = [ + "governance", + "multiversx-sc-meta", +] + +[[package]] +name = "governance-v2" +version = "0.0.0" +dependencies = [ + "energy-factory-mock", + "energy-query", + "fees-collector", + "multiversx-sc", + "multiversx-sc-scenario", + "num-bigint", + "permissions_module", + "weekly-rewards-splitting", +] + +[[package]] +name = "governance-v2-meta" +version = "0.0.0" +dependencies = [ + "governance-v2", + "multiversx-sc-meta", +] + +[[package]] +name = "h2" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0c62115964e08cb8039170eb33c1d0e2388a256930279edca206fff675f82c3" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "http" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "0.14.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "ignore" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b46810df39e66e925525d6e38ce1e7f6e1d208f72dc39757880fcb66e2c58af1" +dependencies = [ + "crossbeam-deque", + "globset", + "log", + "memchr", + "regex-automata", + "same-file", + "walkdir", + "winapi-util", +] + +[[package]] +name = "indexmap" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "ipnet" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" + +[[package]] +name = "js-sys" +version = "0.3.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "libc" +version = "0.2.153" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" + +[[package]] +name = "linux-raw-sys" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" + +[[package]] +name = "lkmex-transfer" +version = "0.0.0" +dependencies = [ + "common_structs", + "energy-factory", + "energy-query", + "legacy_token_decode_module", + "multiversx-sc", + "multiversx-sc-modules", + "multiversx-sc-scenario", + "num-bigint", + "permissions_module", + "simple-lock", + "utils", +] + +[[package]] +name = "lkmex-transfer-abi" +version = "0.0.0" +dependencies = [ + "lkmex-transfer", + "multiversx-sc-meta", +] + +[[package]] +name = "lock_api" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "locked-token-wrapper" +version = "0.0.0" +dependencies = [ + "common_structs", + "energy-factory", + "energy-factory-mock", + "energy-query", + "hex", + "legacy_token_decode_module", + "lkmex-transfer", + "multiversx-sc", + "multiversx-sc-modules", + "multiversx-sc-scenario", + "num-bigint", + "num-traits", + "simple-lock", + "utils", +] + +[[package]] +name = "locked-token-wrapper-meta" +version = "0.0.0" +dependencies = [ + "locked-token-wrapper", + "multiversx-sc-meta", +] + +[[package]] +name = "locking_module" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", + "simple-lock", +] + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "memchr" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" + +[[package]] +name = "memory_units" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "metabonding-staking" +version = "0.0.0" +dependencies = [ + "common_structs", + "factory", + "multiversx-sc", + "multiversx-sc-modules", + "multiversx-sc-scenario", + "num-bigint", +] + +[[package]] +name = "metabonding-staking-meta" +version = "0.0.0" +dependencies = [ + "metabonding-staking", + "multiversx-sc-meta", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "miniz_oxide" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.48.0", +] + +[[package]] +name = "multiversx-chain-scenario-format" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dfc2b1dc76af14c24145672c2779474046ab44ef56bac82a58844328f4b4d2e" +dependencies = [ + "bech32", + "hex", + "num-bigint", + "num-traits", + "serde", + "serde_json", + "sha3", +] + +[[package]] +name = "multiversx-chain-vm" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75459864359798406a45a7bb2ed221d623b2e39484ec3e4ac6d23167bfc50b33" +dependencies = [ + "bitflags 2.4.2", + "ed25519-dalek", + "hex", + "hex-literal 0.4.1", + "itertools 0.12.1", + "multiversx-chain-vm-executor", + "num-bigint", + "num-traits", + "rand", + "rand_seeder", + "sha2", + "sha3", +] + +[[package]] +name = "multiversx-chain-vm-executor" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b59072fa0624b55ae5ae3fa6bfa91515bbeb4ac440214bc4a509e2c8806d6e9f" + +[[package]] +name = "multiversx-sc" +version = "0.46.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c94b173dc5ff0e157f767275fe6b7a1b4d2ad343bef7b66cd22a6353e016b93" +dependencies = [ + "bitflags 2.4.2", + "hex-literal 0.4.1", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19908153158c03df4582af08f47c0eb39fb52a7dff4736b301a66acbbb9955d3" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", + "num-bigint", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b03b43f9cad320992f54ed162de2ed63e3ec83ed01361e57ee9c1865fba5a2" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.46.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b78945957036c281ad6ee21bb5120dcefa2017688adf43ec94e3e7c982efb09" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-meta" +version = "0.46.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c8250fd72b78dff76fd3789078aee3dec2524ca37250c645dcb2b1bf067551e" +dependencies = [ + "clap", + "colored", + "common-path", + "convert_case", + "copy_dir", + "hex", + "lazy_static", + "multiversx-sc", + "pathdiff", + "reqwest", + "ruplacer", + "rustc_version", + "serde", + "serde_json", + "toml", + "wasmparser 0.118.1", + "wasmprinter", + "zip", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.46.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c63ffaba95e630ff75981e2f5f50da64f523219b52f484234c66f3adc248885f" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-scenario" +version = "0.46.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3aa2644018c85caf3cc39a130961e39bd719ff3d75751b60a7394d6eace1c847" +dependencies = [ + "base64", + "bech32", + "clap", + "colored", + "hex", + "itertools 0.12.1", + "log", + "multiversx-chain-scenario-format", + "multiversx-chain-vm", + "multiversx-chain-vm-executor", + "multiversx-sc", + "multiversx-sc-meta", + "multiversx-sdk", + "num-bigint", + "num-traits", + "pathdiff", + "serde", + "serde_json", + "sha2", + "tokio", +] + +[[package]] +name = "multiversx-sdk" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f86d0da66ca2eb334414786a287010bb669b8d815a7d3b690d629a04b86bb80" +dependencies = [ + "anyhow", + "base64", + "bech32", + "bip39", + "hex", + "hmac", + "itertools 0.12.1", + "pbkdf2", + "pem", + "rand", + "reqwest", + "serde", + "serde_json", + "serde_repr", + "sha2", + "sha3", + "tokio", + "zeroize", +] + +[[package]] +name = "native-tls" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-bigint" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "object" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "openssl" +version = "0.10.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8" +dependencies = [ + "bitflags 2.4.2", + "cfg-if 1.0.0", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "pair" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "fees-collector", + "itertools 0.10.5", + "multiversx-sc", + "multiversx-sc-scenario", + "num-bigint", + "pausable", + "permissions_module", + "simple-lock", + "token_send", + "utils", +] + +[[package]] +name = "pair-abi" +version = "0.0.0" +dependencies = [ + "multiversx-sc-meta", + "pair", +] + +[[package]] +name = "pair-mock" +version = "0.0.0" +dependencies = [ + "common_errors", + "itertools 0.10.5", + "multiversx-sc", + "multiversx-sc-scenario", +] + +[[package]] +name = "pair-mock-meta" +version = "0.0.0" +dependencies = [ + "multiversx-sc-meta", + "pair-mock", +] + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.48.5", +] + +[[package]] +name = "pathdiff" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" + +[[package]] +name = "pausable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", + "permissions_module", +] + +[[package]] +name = "pause-all" +version = "0.0.0" +dependencies = [ + "farm", + "multiversx-sc", + "multiversx-sc-modules", + "multiversx-sc-scenario", + "pair", + "pausable", +] + +[[package]] +name = "pause-all-meta" +version = "0.0.0" +dependencies = [ + "multiversx-sc-meta", + "pause-all", +] + +[[package]] +name = "pbkdf2" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" +dependencies = [ + "digest", +] + +[[package]] +name = "pem" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b8fcc794035347fb64beda2d3b462595dd2753e3f268d89c5aae77e8cf2c310" +dependencies = [ + "base64", + "serde", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "permissions_module" +version = "0.0.0" +dependencies = [ + "bitflags 2.4.2", + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "pkg-config" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" + +[[package]] +name = "platforms" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "626dec3cac7cc0e1577a2ec3fc496277ec2baa084bebad95bb6fdbfae235f84c" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "price-discovery" +version = "0.0.0" +dependencies = [ + "hex", + "hex-literal 0.3.4", + "locking_module", + "multiversx-sc", + "multiversx-sc-modules", + "multiversx-sc-scenario", + "num-bigint", + "num-traits", + "simple-lock", +] + +[[package]] +name = "price-discovery-meta" +version = "0.0.0" +dependencies = [ + "multiversx-sc-meta", + "price-discovery", +] + +[[package]] +name = "proc-macro2" +version = "1.0.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "proxy-deployer" +version = "0.0.0" +dependencies = [ + "config", + "farm", + "farm_token", + "multiversx-sc", + "multiversx-sc-scenario", + "num-bigint", + "pausable", +] + +[[package]] +name = "proxy-deployer-meta" +version = "0.0.0" +dependencies = [ + "multiversx-sc-meta", + "proxy-deployer", +] + +[[package]] +name = "proxy_dex" +version = "0.0.0" +dependencies = [ + "common_structs", + "config", + "energy-factory", + "energy-query", + "farm", + "farm-boosted-yields", + "farm-with-locked-rewards", + "farm_base_impl", + "farm_token", + "fixed-supply-token", + "hex", + "itertools 0.10.5", + "legacy_token_decode_module", + "locking_module", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "multiversx-sc-scenario", + "num-bigint", + "num-traits", + "pair", + "pausable", + "rewards", + "sc_whitelist_module", + "simple-lock", + "token_merge_helper", + "token_send", + "utils", +] + +[[package]] +name = "proxy_dex-meta" +version = "0.0.0" +dependencies = [ + "multiversx-sc-meta", + "proxy_dex", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rand_seeder" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf2890aaef0aa82719a50e808de264f9484b74b442e1a3a0e5ee38243ac40bdb" +dependencies = [ + "rand_core", +] + +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "regex" +version = "1.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" + +[[package]] +name = "reqwest" +version = "0.11.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6920094eb85afde5e4a138be3f2de8bbdf28000f0029e72c45025a56b042251" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-tls", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "system-configuration", + "tokio", + "tokio-native-tls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg", +] + +[[package]] +name = "rewards" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "farm_token", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "router" +version = "0.0.0" +dependencies = [ + "locking_module", + "multiversx-sc", + "multiversx-sc-scenario", + "pair", + "pausable", + "simple-lock", + "token_send", +] + +[[package]] +name = "router-abi" +version = "0.0.0" +dependencies = [ + "multiversx-sc-meta", + "router", +] + +[[package]] +name = "ruplacer" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58a26a1b15ff113d31d139357f7422708312978ed69cd5dd47e36d1b80b7eaf3" +dependencies = [ + "Inflector", + "anyhow", + "clap", + "colored", + "ignore", + "regex", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.38.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +dependencies = [ + "bitflags 2.4.2", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64", +] + +[[package]] +name = "ryu" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "schannel" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "security-framework" +version = "2.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" + +[[package]] +name = "serde" +version = "1.0.196" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.196" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.113" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" +dependencies = [ + "indexmap", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_repr" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_spanned" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest", + "keccak", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +dependencies = [ + "libc", +] + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "rand_core", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "hex", + "multiversx-sc", + "multiversx-sc-modules", + "multiversx-sc-scenario", + "num-bigint", + "num-traits", +] + +[[package]] +name = "simple-lock-meta" +version = "0.0.0" +dependencies = [ + "multiversx-sc-meta", + "simple-lock", +] + +[[package]] +name = "simple-lock-whitelist" +version = "0.0.0" +dependencies = [ + "hex", + "multiversx-sc", + "multiversx-sc-modules", + "multiversx-sc-scenario", + "num-bigint", + "num-traits", + "simple-lock", + "utils", +] + +[[package]] +name = "simple-lock-whitelist-meta" +version = "0.0.0" +dependencies = [ + "multiversx-sc-meta", + "simple-lock-whitelist", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" + +[[package]] +name = "socket2" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tempfile" +version = "3.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" +dependencies = [ + "cfg-if 1.0.0", + "fastrand", + "rustix", + "windows-sys 0.52.0", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "token-unstake" +version = "0.0.0" +dependencies = [ + "common_structs", + "energy-factory", + "energy-query", + "hex", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "multiversx-sc-scenario", + "num-bigint", + "num-traits", + "simple-lock", + "utils", + "week-timekeeping", +] + +[[package]] +name = "token-unstake-abi" +version = "0.0.0" +dependencies = [ + "multiversx-sc-meta", + "token-unstake", +] + +[[package]] +name = "token_merge_helper" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "token_send" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", +] + +[[package]] +name = "tokio" +version = "1.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-macros" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "toml" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a9aad4a3066010876e8dcf5a8a06e70a558751117a145c6ce2b82c2e2054290" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9ffdf896f8daaabf9b66ba8e77ea1ed5ed0f72821b398aba62352e95062951" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-bidi" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-segmentation" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "url" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "walkdir" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" +dependencies = [ + "cfg-if 1.0.0", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" + +[[package]] +name = "wasmparser" +version = "0.118.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95ee9723b928e735d53000dec9eae7b07a60e490c85ab54abb66659fc61bfcd9" +dependencies = [ + "indexmap", + "semver", +] + +[[package]] +name = "wasmparser" +version = "0.121.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "953cf6a7606ab31382cb1caa5ae403e77ba70c7f8e12eeda167e7040d42bfda8" +dependencies = [ + "bitflags 2.4.2", + "indexmap", + "semver", +] + +[[package]] +name = "wasmprinter" +version = "0.2.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05e32c13c59fdc64d3f6998a1d52eb1d362b6904a88b754190ccb85661ad577a" +dependencies = [ + "anyhow", + "wasmparser 0.121.0", +] + +[[package]] +name = "web-sys" +version = "0.3.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "wee_alloc" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" +dependencies = [ + "cfg-if 0.1.10", + "libc", + "memory_units", + "winapi", +] + +[[package]] +name = "week-timekeeping" +version = "0.0.0" +dependencies = [ + "common-types", + "multiversx-sc", +] + +[[package]] +name = "weekly-rewards-splitting" +version = "0.0.0" +dependencies = [ + "common-types", + "energy-query", + "math", + "multiversx-sc", + "unwrappable", + "week-timekeeping", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.0", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + +[[package]] +name = "winnow" +version = "0.5.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5389a154b01683d28c77f8f68f49dea75f0a4da32557a58f68ee51ebba472d29" +dependencies = [ + "memchr", +] + +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if 1.0.0", + "windows-sys 0.48.0", +] + +[[package]] +name = "zeroize" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" + +[[package]] +name = "zip" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" +dependencies = [ + "byteorder", + "crc32fast", + "crossbeam-utils", + "flate2", +] diff --git a/dex/farm-with-locked-rewards/wasm/Cargo.lock b/dex/farm-with-locked-rewards/wasm/Cargo.lock index 08bedbfb4..f3af20c87 100644 --- a/dex/farm-with-locked-rewards/wasm/Cargo.lock +++ b/dex/farm-with-locked-rewards/wasm/Cargo.lock @@ -410,6 +410,7 @@ dependencies = [ "permissions_module", "simple-lock", "token_send", + "utils", ] [[package]] diff --git a/dex/farm/wasm/Cargo.lock b/dex/farm/wasm/Cargo.lock index d844f59f7..2308d9073 100644 --- a/dex/farm/wasm/Cargo.lock +++ b/dex/farm/wasm/Cargo.lock @@ -380,6 +380,7 @@ dependencies = [ "permissions_module", "simple-lock", "token_send", + "utils", ] [[package]] diff --git a/dex/proxy-deployer/wasm/Cargo.lock b/dex/proxy-deployer/wasm/Cargo.lock index db98ddd5b..371955a5f 100644 --- a/dex/proxy-deployer/wasm/Cargo.lock +++ b/dex/proxy-deployer/wasm/Cargo.lock @@ -372,6 +372,7 @@ dependencies = [ "permissions_module", "simple-lock", "token_send", + "utils", ] [[package]] diff --git a/dex/router/wasm/Cargo.lock b/dex/router/wasm/Cargo.lock index 3edc82d36..0f5cc1535 100644 --- a/dex/router/wasm/Cargo.lock +++ b/dex/router/wasm/Cargo.lock @@ -256,6 +256,7 @@ dependencies = [ "permissions_module", "simple-lock", "token_send", + "utils", ] [[package]] diff --git a/energy-integration/energy-update/wasm/Cargo.lock b/energy-integration/energy-update/wasm/Cargo.lock index dc15e967f..559a8a519 100644 --- a/energy-integration/energy-update/wasm/Cargo.lock +++ b/energy-integration/energy-update/wasm/Cargo.lock @@ -390,6 +390,7 @@ dependencies = [ "permissions_module", "simple-lock", "token_send", + "utils", ] [[package]] diff --git a/farm-staking/farm-staking-proxy/wasm/Cargo.lock b/farm-staking/farm-staking-proxy/wasm/Cargo.lock index e0060ea46..feded38ab 100644 --- a/farm-staking/farm-staking-proxy/wasm/Cargo.lock +++ b/farm-staking/farm-staking-proxy/wasm/Cargo.lock @@ -471,6 +471,7 @@ dependencies = [ "permissions_module", "simple-lock", "token_send", + "utils", ] [[package]] diff --git a/farm-staking/farm-staking/wasm/Cargo.lock b/farm-staking/farm-staking/wasm/Cargo.lock index dce82eb7c..88d4b1bba 100644 --- a/farm-staking/farm-staking/wasm/Cargo.lock +++ b/farm-staking/farm-staking/wasm/Cargo.lock @@ -411,6 +411,7 @@ dependencies = [ "permissions_module", "simple-lock", "token_send", + "utils", ] [[package]] diff --git a/farm-staking/farm-staking/wasm/src/lib.rs b/farm-staking/farm-staking/wasm/src/lib.rs index c05cf46e5..02de33846 100644 --- a/farm-staking/farm-staking/wasm/src/lib.rs +++ b/farm-staking/farm-staking/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 70 +// Endpoints: 71 // Async Callback: 1 -// Total number of exported functions: 72 +// Total number of exported functions: 73 #![no_std] #![allow(internal_features)] @@ -24,6 +24,7 @@ multiversx_sc_wasm_adapter::endpoints! { mergeFarmTokens => merge_farm_tokens_endpoint calculateRewardsForGivenPosition => calculate_rewards_for_given_position topUpRewards => top_up_rewards + withdrawRewards => withdraw_rewards endProduceRewards => end_produce_rewards setPerBlockRewardAmount => set_per_block_rewards setMaxApr => set_max_apr diff --git a/locked-asset/proxy_dex/wasm/Cargo.lock b/locked-asset/proxy_dex/wasm/Cargo.lock index 2a639b9c3..7cc65eaa5 100644 --- a/locked-asset/proxy_dex/wasm/Cargo.lock +++ b/locked-asset/proxy_dex/wasm/Cargo.lock @@ -402,6 +402,7 @@ dependencies = [ "permissions_module", "simple-lock", "token_send", + "utils", ] [[package]] From 8e06e8a58eed090bafae4920f234f4b6fc06c36a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Wed, 7 Feb 2024 17:23:48 +0200 Subject: [PATCH 179/213] Fix Cargo.lock --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a1d310c10..fe863b981 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -435,9 +435,9 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "4.1.2" +version = "4.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348" +checksum = "e89b8c6a2e4b1f45971ad09761aafb85514a84744b67a95e32c3cc1352d1f65c" dependencies = [ "cfg-if 1.0.0", "cpufeatures", From 6980ca83851bc0e34e1c186f47ecc7fea5b80e6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Wed, 7 Feb 2024 15:35:37 +0200 Subject: [PATCH 180/213] simple-lock: Test destroy farm --- dex/farm/tests/farm_single_user_test.rs | 422 ++++++++++++++++++++++++ 1 file changed, 422 insertions(+) diff --git a/dex/farm/tests/farm_single_user_test.rs b/dex/farm/tests/farm_single_user_test.rs index c3df21b83..ed2e278b0 100644 --- a/dex/farm/tests/farm_single_user_test.rs +++ b/dex/farm/tests/farm_single_user_test.rs @@ -615,3 +615,425 @@ fn test_farm_through_simple_lock() { Some(&lp_proxy_token_attributes), ); } + +#[test] +fn test_destroy_farm_through_simple_lock() { + use multiversx_sc::storage::mappers::StorageTokenWrapper; + use simple_lock::locked_token::LockedTokenModule; + use simple_lock::proxy_farm::ProxyFarmModule; + use simple_lock::proxy_farm::*; + use simple_lock::proxy_lp::{LpProxyTokenAttributes, ProxyLpModule}; + use simple_lock::SimpleLock; + + const LOCKED_TOKEN_ID: &[u8] = b"NOOOO-123456"; + const LOCKED_LP_TOKEN_ID: &[u8] = b"LKLP-123456"; + const FARM_PROXY_TOKEN_ID: &[u8] = b"PROXY-123456"; + + DebugApi::dummy(); + let rust_zero = rust_biguint!(0); + let mut farm_setup = SingleUserFarmSetup::new(farm::contract_obj); + let b_mock = &mut farm_setup.blockchain_wrapper; + + // setup simple lock SC + let lock_wrapper = b_mock.create_sc_account( + &rust_zero, + Some(&farm_setup.owner_address), + simple_lock::contract_obj, + "Simple Lock Path", + ); + + let farm_addr = farm_setup.farm_wrapper.address_ref().clone(); + b_mock + .execute_tx(&farm_setup.owner_address, &lock_wrapper, &rust_zero, |sc| { + sc.init(); + sc.locked_token() + .set_token_id(managed_token_id!(LOCKED_TOKEN_ID)); + sc.lp_proxy_token() + .set_token_id(managed_token_id!(LOCKED_LP_TOKEN_ID)); + sc.farm_proxy_token() + .set_token_id(managed_token_id!(FARM_PROXY_TOKEN_ID)); + sc.add_farm_to_whitelist( + managed_address!(&farm_addr), + managed_token_id!(LP_TOKEN_ID), + FarmType::SimpleFarm, + ); + }) + .assert_ok(); + + // change farming token for farm + whitelist simple lock contract + b_mock + .execute_tx( + &farm_setup.owner_address, + &farm_setup.farm_wrapper, + &rust_zero, + |sc| { + sc.farming_token_id().set(&managed_token_id!(LP_TOKEN_ID)); + sc.add_sc_address_to_whitelist(managed_address!(lock_wrapper.address_ref())); + }, + ) + .assert_ok(); + + b_mock.set_esdt_local_roles( + lock_wrapper.address_ref(), + LOCKED_LP_TOKEN_ID, + &[ + EsdtLocalRole::NftCreate, + EsdtLocalRole::NftAddQuantity, + EsdtLocalRole::NftBurn, + ], + ); + b_mock.set_esdt_local_roles( + lock_wrapper.address_ref(), + FARM_PROXY_TOKEN_ID, + &[ + EsdtLocalRole::NftCreate, + EsdtLocalRole::NftAddQuantity, + EsdtLocalRole::NftBurn, + ], + ); + + // user lock tokens + let user_addr = farm_setup.user_address.clone(); + + let lp_proxy_token_attributes: LpProxyTokenAttributes = LpProxyTokenAttributes { + lp_token_id: managed_token_id!(LP_TOKEN_ID), + first_token_id: managed_token_id!(WEGLD_TOKEN_ID), + first_token_locked_nonce: 1, + second_token_id: managed_token_id!(MEX_TOKEN_ID), + second_token_locked_nonce: 2, + }; + + b_mock.set_nft_balance( + &user_addr, + LOCKED_LP_TOKEN_ID, + 1, + &rust_biguint!(1_000_000_000), + &lp_proxy_token_attributes, + ); + + b_mock.set_esdt_balance( + lock_wrapper.address_ref(), + LP_TOKEN_ID, + &rust_biguint!(1_000_000_000), + ); + + // user enter farm + b_mock + .execute_esdt_transfer( + &user_addr, + &lock_wrapper, + LOCKED_LP_TOKEN_ID, + 1, + &rust_biguint!(1_000_000_000), + |sc| { + let enter_farm_result = sc.enter_farm_locked_token(FarmType::SimpleFarm); + let (out_farm_token, _reward_token) = enter_farm_result.into_tuple(); + assert_eq!( + out_farm_token.token_identifier, + managed_token_id!(FARM_PROXY_TOKEN_ID) + ); + assert_eq!(out_farm_token.token_nonce, 1); + assert_eq!(out_farm_token.amount, managed_biguint!(1_000_000_000)); + }, + ) + .assert_ok(); + + b_mock.check_nft_balance( + &user_addr, + FARM_PROXY_TOKEN_ID, + 1, + &rust_biguint!(1_000_000_000), + Some(&FarmProxyTokenAttributes:: { + farm_type: FarmType::SimpleFarm, + farm_token_id: managed_token_id!(FARM_TOKEN_ID), + farm_token_nonce: 1, + farming_token_id: managed_token_id!(LP_TOKEN_ID), + farming_token_locked_nonce: 1, + }), + ); + + // user claim farm rewards + b_mock.set_block_nonce(10); + b_mock.set_block_epoch(5); + + b_mock + .execute_esdt_transfer( + &user_addr, + &lock_wrapper, + FARM_PROXY_TOKEN_ID, + 1, + &rust_biguint!(1_000_000_000), + |sc| { + let claim_result = + sc.destroy_farm_locked_tokens(managed_biguint!(1), managed_biguint!(1)); + + let (first_token_payment_out, second_token_payment_out) = + claim_result.into_tuple(); + + assert_eq!( + first_token_payment_out.token_identifier, + managed_token_id!(WEGLD_TOKEN_ID) + ); + assert_eq!(first_token_payment_out.amount, managed_biguint!(1_000_000_000)); + + assert_eq!( + second_token_payment_out.token_identifier, + managed_token_id!(MEX_TOKEN_ID) + ); + assert_eq!( + second_token_payment_out.amount, + managed_biguint!(1_000_000_000) + ); + }, + ) + .assert_ok(); + + b_mock.check_nft_balance( + &user_addr, + FARM_PROXY_TOKEN_ID, + 2, + &rust_biguint!(1_000_000_000), + Some(&FarmProxyTokenAttributes:: { + farm_type: FarmType::SimpleFarm, + farm_token_id: managed_token_id!(FARM_TOKEN_ID), + farm_token_nonce: 2, + farming_token_id: managed_token_id!(LP_TOKEN_ID), + farming_token_locked_nonce: 1, + }), + ); + b_mock.check_esdt_balance( + &user_addr, + MEX_TOKEN_ID, + &rust_biguint!(10 * PER_BLOCK_REWARD_AMOUNT), + ); + + // user exit farm + b_mock.set_block_nonce(25); + + b_mock + .execute_esdt_transfer( + &user_addr, + &lock_wrapper, + FARM_PROXY_TOKEN_ID, + 2, + &rust_biguint!(1_000_000_000), + |sc| { + let exit_farm_result = sc.exit_farm_locked_token(); + let (locked_tokens, reward_tokens) = exit_farm_result.into_tuple(); + + assert_eq!( + locked_tokens.token_identifier, + managed_token_id!(LOCKED_LP_TOKEN_ID) + ); + assert_eq!(locked_tokens.token_nonce, 1); + assert_eq!(locked_tokens.amount, managed_biguint!(1_000_000_000)); + + assert_eq!( + reward_tokens.token_identifier, + managed_token_id!(MEX_TOKEN_ID) + ); + assert_eq!(reward_tokens.token_nonce, 0); + assert_eq!( + reward_tokens.amount, + managed_biguint!(15 * PER_BLOCK_REWARD_AMOUNT) + ); + }, + ) + .assert_ok(); + + b_mock.check_nft_balance( + &user_addr, + LOCKED_LP_TOKEN_ID, + 1, + &rust_biguint!(1_000_000_000), + Some(&lp_proxy_token_attributes), + ); + b_mock.check_esdt_balance( + &user_addr, + MEX_TOKEN_ID, + &rust_biguint!(25 * PER_BLOCK_REWARD_AMOUNT), + ); + + // user enter farm again + b_mock.set_block_epoch(0); + + b_mock + .execute_esdt_transfer( + &user_addr, + &lock_wrapper, + LOCKED_LP_TOKEN_ID, + 1, + &rust_biguint!(500_000_000), + |sc| { + let enter_farm_result = sc.enter_farm_locked_token(FarmType::SimpleFarm); + let (out_farm_token, _reward_token) = enter_farm_result.into_tuple(); + assert_eq!( + out_farm_token.token_identifier, + managed_token_id!(FARM_PROXY_TOKEN_ID) + ); + assert_eq!(out_farm_token.token_nonce, 3); + assert_eq!(out_farm_token.amount, managed_biguint!(500_000_000)); + }, + ) + .assert_ok(); + + b_mock.check_nft_balance( + &user_addr, + FARM_PROXY_TOKEN_ID, + 3, + &rust_biguint!(500_000_000), + Some(&FarmProxyTokenAttributes:: { + farm_type: FarmType::SimpleFarm, + farm_token_id: managed_token_id!(FARM_TOKEN_ID), + farm_token_nonce: 3, + farming_token_id: managed_token_id!(LP_TOKEN_ID), + farming_token_locked_nonce: 1, + }), + ); + + // user enter farm along with previous position + let payments = [ + TxTokenTransfer { + token_identifier: LOCKED_LP_TOKEN_ID.to_vec(), + nonce: 1, + value: rust_biguint!(300_000_000), + }, + TxTokenTransfer { + token_identifier: FARM_PROXY_TOKEN_ID.to_vec(), + nonce: 3, + value: rust_biguint!(500_000_000), + }, + ]; + b_mock + .execute_esdt_multi_transfer(&user_addr, &lock_wrapper, &payments, |sc| { + let enter_farm_result = sc.enter_farm_locked_token(FarmType::SimpleFarm); + let (out_farm_token, _reward_token) = enter_farm_result.into_tuple(); + assert_eq!( + out_farm_token.token_identifier, + managed_token_id!(FARM_PROXY_TOKEN_ID) + ); + assert_eq!(out_farm_token.token_nonce, 4); + assert_eq!(out_farm_token.amount, managed_biguint!(800_000_000)); + }) + .assert_ok(); + + b_mock.check_nft_balance( + &user_addr, + FARM_PROXY_TOKEN_ID, + 4, + &rust_biguint!(800_000_000), + Some(&FarmProxyTokenAttributes:: { + farm_type: FarmType::SimpleFarm, + farm_token_id: managed_token_id!(FARM_TOKEN_ID), + farm_token_nonce: 4, + farming_token_id: managed_token_id!(LP_TOKEN_ID), + farming_token_locked_nonce: 1, + }), + ); + + // test enter with three additional farm tokens + b_mock + .execute_esdt_transfer( + &user_addr, + &lock_wrapper, + LOCKED_LP_TOKEN_ID, + 1, + &rust_biguint!(50_000_000), + |sc| { + sc.enter_farm_locked_token(FarmType::SimpleFarm); + }, + ) + .assert_ok(); + b_mock + .execute_esdt_transfer( + &user_addr, + &lock_wrapper, + LOCKED_LP_TOKEN_ID, + 1, + &rust_biguint!(50_000_000), + |sc| { + sc.enter_farm_locked_token(FarmType::SimpleFarm); + }, + ) + .assert_ok(); + + let payments = [ + TxTokenTransfer { + token_identifier: LOCKED_LP_TOKEN_ID.to_vec(), + nonce: 1, + value: rust_biguint!(100_000_000), + }, + TxTokenTransfer { + token_identifier: FARM_PROXY_TOKEN_ID.to_vec(), + nonce: 4, + value: rust_biguint!(800_000_000), + }, + TxTokenTransfer { + token_identifier: FARM_PROXY_TOKEN_ID.to_vec(), + nonce: 5, + value: rust_biguint!(50_000_000), + }, + TxTokenTransfer { + token_identifier: FARM_PROXY_TOKEN_ID.to_vec(), + nonce: 6, + value: rust_biguint!(50_000_000), + }, + ]; + b_mock + .execute_esdt_multi_transfer(&user_addr, &lock_wrapper, &payments, |sc| { + let enter_farm_result = sc.enter_farm_locked_token(FarmType::SimpleFarm); + let (out_farm_token, _reward_token) = enter_farm_result.into_tuple(); + assert_eq!( + out_farm_token.token_identifier, + managed_token_id!(FARM_PROXY_TOKEN_ID) + ); + assert_eq!(out_farm_token.token_nonce, 7); + assert_eq!(out_farm_token.amount, managed_biguint!(1_000_000_000)); + }) + .assert_ok(); + + b_mock.check_nft_balance( + &user_addr, + FARM_PROXY_TOKEN_ID, + 7, + &rust_biguint!(1_000_000_000), + Some(&FarmProxyTokenAttributes:: { + farm_type: FarmType::SimpleFarm, + farm_token_id: managed_token_id!(FARM_TOKEN_ID), + farm_token_nonce: 7, + farming_token_id: managed_token_id!(LP_TOKEN_ID), + farming_token_locked_nonce: 1, + }), + ); + + // exit farm + b_mock.set_block_epoch(25); + b_mock + .execute_esdt_transfer( + &user_addr, + &lock_wrapper, + FARM_PROXY_TOKEN_ID, + 7, + &rust_biguint!(1_000_000_000), + |sc| { + let exit_farm_result = sc.exit_farm_locked_token(); + let (locked_tokens, _reward_tokens) = exit_farm_result.into_tuple(); + + assert_eq!( + locked_tokens.token_identifier, + managed_token_id!(LOCKED_LP_TOKEN_ID) + ); + assert_eq!(locked_tokens.token_nonce, 1); + assert_eq!(locked_tokens.amount, managed_biguint!(1_000_000_000)); + }, + ) + .assert_ok(); + + b_mock.check_nft_balance( + &user_addr, + LOCKED_LP_TOKEN_ID, + 1, + &rust_biguint!(1_000_000_000), + Some(&lp_proxy_token_attributes), + ); +} From 0d9e8f6434d9ef13b287211fd848a11eebba6dda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Tue, 20 Feb 2024 13:17:39 +0200 Subject: [PATCH 181/213] Simple lock: Destroy farm test --- .../farm_setup/single_user_farm_setup.rs | 103 ++++- dex/farm/tests/farm_single_user_test.rs | 412 ++++++------------ locked-asset/simple-lock/src/proxy_farm.rs | 56 ++- .../simple-lock/tests/simple_lock_test.rs | 253 +++++++++++ .../tests/simple_lock_test_setup/mod.rs | 366 ++++++++++++++++ 5 files changed, 882 insertions(+), 308 deletions(-) create mode 100644 locked-asset/simple-lock/tests/simple_lock_test.rs create mode 100644 locked-asset/simple-lock/tests/simple_lock_test_setup/mod.rs diff --git a/dex/farm/tests/farm_setup/single_user_farm_setup.rs b/dex/farm/tests/farm_setup/single_user_farm_setup.rs index 1e23f999b..4fb48c955 100644 --- a/dex/farm/tests/farm_setup/single_user_farm_setup.rs +++ b/dex/farm/tests/farm_setup/single_user_farm_setup.rs @@ -2,7 +2,7 @@ #![allow(deprecated)] use common_structs::FarmTokenAttributes; -use multiversx_sc::codec::multi_types::OptionalValue; +use multiversx_sc::codec::multi_types::{MultiValue3, OptionalValue}; use multiversx_sc::storage::mappers::StorageTokenWrapper; use multiversx_sc::types::{Address, EsdtLocalRole, ManagedAddress, MultiValueEncoded}; use multiversx_sc_scenario::whitebox_legacy::{TxContextStack, TxTokenTransfer}; @@ -17,9 +17,12 @@ use farm::exit_penalty::ExitPenaltyModule; use farm::*; use farm_boosted_yields::boosted_yields_factors::BoostedYieldsFactorsModule; use farm_token::FarmTokenModule; +use pair::pair_actions::add_liq::AddLiquidityModule as _; +use pair::{config::ConfigModule as OtherConfigModule, Pair}; use pausable::{PausableModule, State}; pub const FARM_WASM_PATH: &str = "farm/output/farm.wasm"; +pub const PAIR_WASM_PATH: &str = "pair/output/pair.wasm"; pub const WEGLD_TOKEN_ID: &[u8] = b"WEGLD-abcdef"; pub const MEX_TOKEN_ID: &[u8] = b"MEX-abcdef"; // reward token ID @@ -36,25 +39,74 @@ pub const USER_REWARDS_ENERGY_CONST: u64 = 3; pub const USER_REWARDS_FARM_CONST: u64 = 2; pub const MIN_ENERGY_AMOUNT_FOR_BOOSTED_YIELDS: u64 = 1; pub const MIN_FARM_AMOUNT_FOR_BOOSTED_YIELDS: u64 = 1; +pub const LOCKED_TOKEN_ID: &[u8] = b"XMEX-123456"; +pub const LOCKED_LP_TOKEN_ID: &[u8] = b"LKLP-123456"; +pub const FARM_PROXY_TOKEN_ID: &[u8] = b"PROXY-123456"; -pub struct SingleUserFarmSetup +pub struct SingleUserFarmSetup where FarmObjBuilder: 'static + Copy + Fn() -> farm::ContractObj, + PairObjBuilder: 'static + Copy + Fn() -> pair::ContractObj, { pub blockchain_wrapper: BlockchainStateWrapper, pub owner_address: Address, pub user_address: Address, pub farm_wrapper: ContractObjWrapper, FarmObjBuilder>, + pub pair_wrapper: ContractObjWrapper, PairObjBuilder>, } -impl SingleUserFarmSetup +impl SingleUserFarmSetup where FarmObjBuilder: 'static + Copy + Fn() -> farm::ContractObj, + PairObjBuilder: 'static + Copy + Fn() -> pair::ContractObj, { - pub fn new(farm_builder: FarmObjBuilder) -> Self { + pub fn new(farm_builder: FarmObjBuilder, pair_builder: PairObjBuilder) -> Self { let rust_zero = rust_biguint!(0u64); let mut blockchain_wrapper = BlockchainStateWrapper::new(); let owner_addr = blockchain_wrapper.create_user_account(&rust_zero); + + let pair_wrapper = blockchain_wrapper.create_sc_account( + &rust_zero, + Some(&owner_addr), + pair_builder, + PAIR_WASM_PATH, + ); + + // init pair contract + blockchain_wrapper + .execute_tx(&owner_addr, &pair_wrapper, &rust_zero, |sc| { + let first_token_id = managed_token_id!(WEGLD_TOKEN_ID); + let second_token_id = managed_token_id!(MEX_TOKEN_ID); + let router_address = managed_address!(&owner_addr); + let router_owner_address = managed_address!(&owner_addr); + let total_fee_percent = 300u64; + let special_fee_percent = 50u64; + + sc.init( + first_token_id, + second_token_id, + router_address, + router_owner_address, + total_fee_percent, + special_fee_percent, + ManagedAddress::::zero(), + MultiValueEncoded::>::new(), + ); + + let lp_token_id = managed_token_id!(LP_TOKEN_ID); + sc.lp_token_identifier().set(&lp_token_id); + + sc.state().set(State::Active); + }) + .assert_ok(); + + let lp_token_roles = [EsdtLocalRole::Mint, EsdtLocalRole::Burn]; + blockchain_wrapper.set_esdt_local_roles( + pair_wrapper.address_ref(), + LP_TOKEN_ID, + &lp_token_roles[..], + ); + let farm_wrapper = blockchain_wrapper.create_sc_account( &rust_zero, Some(&owner_addr), @@ -142,9 +194,52 @@ where owner_address: owner_addr, user_address: user_addr, farm_wrapper, + pair_wrapper, } } + #[allow(clippy::too_many_arguments)] + pub fn add_liquidity( + &mut self, + first_token_amount: u64, + first_token_min: u64, + second_token_amount: u64, + second_token_min: u64, + ) { + let payments = vec![ + TxTokenTransfer { + token_identifier: WEGLD_TOKEN_ID.to_vec(), + nonce: 0, + value: rust_biguint!(first_token_amount), + }, + TxTokenTransfer { + token_identifier: LOCKED_TOKEN_ID.to_vec(), + nonce: 0, + value: rust_biguint!(second_token_amount), + }, + ]; + + self.blockchain_wrapper + .execute_esdt_multi_transfer(&self.user_address, &self.pair_wrapper, &payments, |sc| { + let MultiValue3 { 0: payments } = sc.add_liquidity( + managed_biguint!(first_token_min), + managed_biguint!(second_token_min), + ); + + assert_eq!(payments.0.token_identifier, managed_token_id!(LP_TOKEN_ID)); + + assert_eq!( + payments.1.token_identifier, + managed_token_id!(WEGLD_TOKEN_ID) + ); + assert_eq!( + payments.2.token_identifier, + managed_token_id!(LOCKED_TOKEN_ID) + ); + }) + .assert_ok(); + } + pub fn enter_farm( &mut self, farm_in_amount: u64, diff --git a/dex/farm/tests/farm_single_user_test.rs b/dex/farm/tests/farm_single_user_test.rs index ed2e278b0..1db431556 100644 --- a/dex/farm/tests/farm_single_user_test.rs +++ b/dex/farm/tests/farm_single_user_test.rs @@ -4,21 +4,25 @@ mod farm_setup; use config::ConfigModule; use farm_setup::single_user_farm_setup::*; -use multiversx_sc::types::EsdtLocalRole; +use multiversx_sc::{ + codec::multi_types::OptionalValue, + types::EsdtLocalRole, +}; use multiversx_sc_scenario::{ - managed_address, managed_biguint, managed_token_id, rust_biguint, + managed_address, managed_biguint, managed_token_id, managed_token_id_wrapped, rust_biguint, whitebox_legacy::TxTokenTransfer, DebugApi, }; use sc_whitelist_module::SCWhitelistModule; +use simple_lock::locked_token::LockedTokenAttributes; #[test] fn test_farm_setup() { - let _ = SingleUserFarmSetup::new(farm::contract_obj); + let _ = SingleUserFarmSetup::new(farm::contract_obj, pair::contract_obj); } #[test] fn test_enter_farm() { - let mut farm_setup = SingleUserFarmSetup::new(farm::contract_obj); + let mut farm_setup = SingleUserFarmSetup::new(farm::contract_obj, pair::contract_obj); let farm_in_amount = 100_000_000; let expected_farm_token_nonce = 1; @@ -28,7 +32,7 @@ fn test_enter_farm() { #[test] fn test_exit_farm() { - let mut farm_setup = SingleUserFarmSetup::new(farm::contract_obj); + let mut farm_setup = SingleUserFarmSetup::new(farm::contract_obj, pair::contract_obj); let farm_in_amount = 100_000_000; let expected_farm_token_nonce = 1; @@ -53,7 +57,7 @@ fn test_exit_farm() { #[test] fn test_exit_farm_with_penalty() { - let mut farm_setup = SingleUserFarmSetup::new(farm::contract_obj); + let mut farm_setup = SingleUserFarmSetup::new(farm::contract_obj, pair::contract_obj); let farm_in_amount = 100_000_000; let expected_farm_token_nonce = 1; @@ -81,7 +85,7 @@ fn test_exit_farm_with_penalty() { #[test] fn test_claim_rewards() { - let mut farm_setup = SingleUserFarmSetup::new(farm::contract_obj); + let mut farm_setup = SingleUserFarmSetup::new(farm::contract_obj, pair::contract_obj); let farm_in_amount = 100_000_000; let expected_farm_token_nonce = 1; @@ -106,13 +110,15 @@ fn test_claim_rewards() { farm_setup.check_farm_token_supply(farm_in_amount); } -fn steps_enter_farm_twice( +fn steps_enter_farm_twice( farm_builder: FarmObjBuilder, -) -> SingleUserFarmSetup + pair_builder: PairObjBuilder, +) -> SingleUserFarmSetup where FarmObjBuilder: 'static + Copy + Fn() -> farm::ContractObj, + PairObjBuilder: 'static + Copy + Fn() -> pair::ContractObj, { - let mut farm_setup = SingleUserFarmSetup::new(farm_builder); + let mut farm_setup = SingleUserFarmSetup::new(farm_builder, pair_builder); let farm_in_amount = 100_000_000; let expected_farm_token_nonce = 1; @@ -155,12 +161,12 @@ where #[test] fn test_enter_farm_twice() { - let _ = steps_enter_farm_twice(farm::contract_obj); + let _ = steps_enter_farm_twice(farm::contract_obj, pair::contract_obj); } #[test] fn test_exit_farm_after_enter_twice() { - let mut farm_setup = steps_enter_farm_twice(farm::contract_obj); + let mut farm_setup = steps_enter_farm_twice(farm::contract_obj, pair::contract_obj); let farm_in_amount = 100_000_000; let second_farm_in_amount = 200_000_000; let total_farm_token = farm_in_amount + second_farm_in_amount; @@ -211,7 +217,7 @@ fn test_farm_through_simple_lock() { DebugApi::dummy(); let rust_zero = rust_biguint!(0); - let mut farm_setup = SingleUserFarmSetup::new(farm::contract_obj); + let mut farm_setup = SingleUserFarmSetup::new(farm::contract_obj, pair::contract_obj); let b_mock = &mut farm_setup.blockchain_wrapper; // setup simple lock SC @@ -625,14 +631,11 @@ fn test_destroy_farm_through_simple_lock() { use simple_lock::proxy_lp::{LpProxyTokenAttributes, ProxyLpModule}; use simple_lock::SimpleLock; - const LOCKED_TOKEN_ID: &[u8] = b"NOOOO-123456"; - const LOCKED_LP_TOKEN_ID: &[u8] = b"LKLP-123456"; - const FARM_PROXY_TOKEN_ID: &[u8] = b"PROXY-123456"; - DebugApi::dummy(); let rust_zero = rust_biguint!(0); - let mut farm_setup = SingleUserFarmSetup::new(farm::contract_obj); + let mut farm_setup = SingleUserFarmSetup::new(farm::contract_obj, pair::contract_obj); let b_mock = &mut farm_setup.blockchain_wrapper; + let user_addr = farm_setup.user_address.clone(); // setup simple lock SC let lock_wrapper = b_mock.create_sc_account( @@ -643,6 +646,7 @@ fn test_destroy_farm_through_simple_lock() { ); let farm_addr = farm_setup.farm_wrapper.address_ref().clone(); + let pair_addr = farm_setup.pair_wrapper.address_ref().clone(); b_mock .execute_tx(&farm_setup.owner_address, &lock_wrapper, &rust_zero, |sc| { sc.init(); @@ -657,6 +661,11 @@ fn test_destroy_farm_through_simple_lock() { managed_token_id!(LP_TOKEN_ID), FarmType::SimpleFarm, ); + sc.add_lp_to_whitelist( + managed_address!(&pair_addr), + managed_token_id!(WEGLD_TOKEN_ID), + managed_token_id!(MEX_TOKEN_ID), + ); }) .assert_ok(); @@ -673,6 +682,15 @@ fn test_destroy_farm_through_simple_lock() { ) .assert_ok(); + b_mock.set_esdt_local_roles( + lock_wrapper.address_ref(), + LOCKED_TOKEN_ID, + &[ + EsdtLocalRole::NftCreate, + EsdtLocalRole::NftAddQuantity, + EsdtLocalRole::NftBurn, + ], + ); b_mock.set_esdt_local_roles( lock_wrapper.address_ref(), LOCKED_LP_TOKEN_ID, @@ -692,178 +710,106 @@ fn test_destroy_farm_through_simple_lock() { ], ); - // user lock tokens - let user_addr = farm_setup.user_address.clone(); - - let lp_proxy_token_attributes: LpProxyTokenAttributes = LpProxyTokenAttributes { - lp_token_id: managed_token_id!(LP_TOKEN_ID), - first_token_id: managed_token_id!(WEGLD_TOKEN_ID), - first_token_locked_nonce: 1, - second_token_id: managed_token_id!(MEX_TOKEN_ID), - second_token_locked_nonce: 2, - }; - - b_mock.set_nft_balance( - &user_addr, - LOCKED_LP_TOKEN_ID, - 1, - &rust_biguint!(1_000_000_000), - &lp_proxy_token_attributes, - ); - - b_mock.set_esdt_balance( - lock_wrapper.address_ref(), - LP_TOKEN_ID, - &rust_biguint!(1_000_000_000), - ); + b_mock.set_esdt_balance(&user_addr, WEGLD_TOKEN_ID, &rust_biguint!(10_000_000)); + b_mock.set_esdt_balance(&user_addr, MEX_TOKEN_ID, &rust_biguint!(10_000_000)); - // user enter farm b_mock .execute_esdt_transfer( &user_addr, &lock_wrapper, - LOCKED_LP_TOKEN_ID, - 1, - &rust_biguint!(1_000_000_000), + MEX_TOKEN_ID, + 0, + &rust_biguint!(10_000_000), |sc| { - let enter_farm_result = sc.enter_farm_locked_token(FarmType::SimpleFarm); - let (out_farm_token, _reward_token) = enter_farm_result.into_tuple(); - assert_eq!( - out_farm_token.token_identifier, - managed_token_id!(FARM_PROXY_TOKEN_ID) - ); - assert_eq!(out_farm_token.token_nonce, 1); - assert_eq!(out_farm_token.amount, managed_biguint!(1_000_000_000)); + sc.lock_tokens_endpoint(15, OptionalValue::None); }, ) .assert_ok(); b_mock.check_nft_balance( &user_addr, - FARM_PROXY_TOKEN_ID, + LOCKED_TOKEN_ID, 1, - &rust_biguint!(1_000_000_000), - Some(&FarmProxyTokenAttributes:: { - farm_type: FarmType::SimpleFarm, - farm_token_id: managed_token_id!(FARM_TOKEN_ID), - farm_token_nonce: 1, - farming_token_id: managed_token_id!(LP_TOKEN_ID), - farming_token_locked_nonce: 1, + &rust_biguint!(10_000_000), + Some(&LockedTokenAttributes:: { + original_token_id: managed_token_id_wrapped!(MEX_TOKEN_ID), + original_token_nonce: 0, + unlock_epoch: 15, }), ); - // user claim farm rewards - b_mock.set_block_nonce(10); b_mock.set_block_epoch(5); + // add liquidity through simple-lock SC - one locked (XMEX) token, one unlocked (WEGLD) + let transfers = vec![ + TxTokenTransfer { + token_identifier: WEGLD_TOKEN_ID.to_vec(), + nonce: 0, + value: rust_biguint!(10_000_000), + }, + TxTokenTransfer { + token_identifier: LOCKED_TOKEN_ID.to_vec(), + nonce: 1, + value: rust_biguint!(10_000_000), + }, + ]; b_mock - .execute_esdt_transfer( - &user_addr, - &lock_wrapper, - FARM_PROXY_TOKEN_ID, - 1, - &rust_biguint!(1_000_000_000), - |sc| { - let claim_result = - sc.destroy_farm_locked_tokens(managed_biguint!(1), managed_biguint!(1)); - - let (first_token_payment_out, second_token_payment_out) = - claim_result.into_tuple(); - - assert_eq!( - first_token_payment_out.token_identifier, - managed_token_id!(WEGLD_TOKEN_ID) - ); - assert_eq!(first_token_payment_out.amount, managed_biguint!(1_000_000_000)); - - assert_eq!( - second_token_payment_out.token_identifier, - managed_token_id!(MEX_TOKEN_ID) - ); - assert_eq!( - second_token_payment_out.amount, - managed_biguint!(1_000_000_000) - ); - }, - ) - .assert_ok(); - - b_mock.check_nft_balance( - &user_addr, - FARM_PROXY_TOKEN_ID, - 2, - &rust_biguint!(1_000_000_000), - Some(&FarmProxyTokenAttributes:: { - farm_type: FarmType::SimpleFarm, - farm_token_id: managed_token_id!(FARM_TOKEN_ID), - farm_token_nonce: 2, - farming_token_id: managed_token_id!(LP_TOKEN_ID), - farming_token_locked_nonce: 1, - }), - ); - b_mock.check_esdt_balance( - &user_addr, - MEX_TOKEN_ID, - &rust_biguint!(10 * PER_BLOCK_REWARD_AMOUNT), - ); - - // user exit farm - b_mock.set_block_nonce(25); + .execute_esdt_multi_transfer(&user_addr, &lock_wrapper, &transfers[..], |sc| { + let (dust_first_token, dust_second_token, lp_proxy_payment) = sc + .add_liquidity_locked_token(managed_biguint!(1), managed_biguint!(1)) + .into_tuple(); - b_mock - .execute_esdt_transfer( - &user_addr, - &lock_wrapper, - FARM_PROXY_TOKEN_ID, - 2, - &rust_biguint!(1_000_000_000), - |sc| { - let exit_farm_result = sc.exit_farm_locked_token(); - let (locked_tokens, reward_tokens) = exit_farm_result.into_tuple(); + assert_eq!( + dust_first_token.token_identifier, + managed_token_id!(WEGLD_TOKEN_ID) + ); + assert_eq!(dust_first_token.token_nonce, 0); + assert_eq!(dust_first_token.amount, managed_biguint!(0)); - assert_eq!( - locked_tokens.token_identifier, - managed_token_id!(LOCKED_LP_TOKEN_ID) - ); - assert_eq!(locked_tokens.token_nonce, 1); - assert_eq!(locked_tokens.amount, managed_biguint!(1_000_000_000)); + assert_eq!( + dust_second_token.token_identifier, + managed_token_id!(MEX_TOKEN_ID) + ); + assert_eq!(dust_second_token.token_nonce, 0); + assert_eq!(dust_second_token.amount, managed_biguint!(0)); - assert_eq!( - reward_tokens.token_identifier, - managed_token_id!(MEX_TOKEN_ID) - ); - assert_eq!(reward_tokens.token_nonce, 0); - assert_eq!( - reward_tokens.amount, - managed_biguint!(15 * PER_BLOCK_REWARD_AMOUNT) - ); - }, - ) + assert_eq!( + lp_proxy_payment.token_identifier, + managed_token_id!(LOCKED_LP_TOKEN_ID) + ); + assert_eq!(lp_proxy_payment.token_nonce, 1); + assert_eq!(lp_proxy_payment.amount, managed_biguint!(9_999_000)); + }) .assert_ok(); b_mock.check_nft_balance( &user_addr, LOCKED_LP_TOKEN_ID, 1, - &rust_biguint!(1_000_000_000), - Some(&lp_proxy_token_attributes), + &rust_biguint!(9_999_000), + Some(&LpProxyTokenAttributes:: { + lp_token_id: managed_token_id!(LP_TOKEN_ID), + first_token_id: managed_token_id!(WEGLD_TOKEN_ID), + first_token_locked_nonce: 0, + second_token_id: managed_token_id!(MEX_TOKEN_ID), + second_token_locked_nonce: 1, + }), ); + b_mock.check_esdt_balance( - &user_addr, - MEX_TOKEN_ID, - &rust_biguint!(25 * PER_BLOCK_REWARD_AMOUNT), + lock_wrapper.address_ref(), + LP_TOKEN_ID, + &rust_biguint!(9_999_000), ); - // user enter farm again - b_mock.set_block_epoch(0); - + // user enter farm b_mock .execute_esdt_transfer( &user_addr, &lock_wrapper, LOCKED_LP_TOKEN_ID, 1, - &rust_biguint!(500_000_000), + &rust_biguint!(9_999_000), |sc| { let enter_farm_result = sc.enter_farm_locked_token(FarmType::SimpleFarm); let (out_farm_token, _reward_token) = enter_farm_result.into_tuple(); @@ -871,8 +817,8 @@ fn test_destroy_farm_through_simple_lock() { out_farm_token.token_identifier, managed_token_id!(FARM_PROXY_TOKEN_ID) ); - assert_eq!(out_farm_token.token_nonce, 3); - assert_eq!(out_farm_token.amount, managed_biguint!(500_000_000)); + assert_eq!(out_farm_token.token_nonce, 1); + assert_eq!(out_farm_token.amount, managed_biguint!(9_999_000)); }, ) .assert_ok(); @@ -880,160 +826,52 @@ fn test_destroy_farm_through_simple_lock() { b_mock.check_nft_balance( &user_addr, FARM_PROXY_TOKEN_ID, - 3, - &rust_biguint!(500_000_000), + 1, + &rust_biguint!(9_999_000), Some(&FarmProxyTokenAttributes:: { farm_type: FarmType::SimpleFarm, farm_token_id: managed_token_id!(FARM_TOKEN_ID), - farm_token_nonce: 3, + farm_token_nonce: 1, farming_token_id: managed_token_id!(LP_TOKEN_ID), farming_token_locked_nonce: 1, }), ); - // user enter farm along with previous position - let payments = [ - TxTokenTransfer { - token_identifier: LOCKED_LP_TOKEN_ID.to_vec(), - nonce: 1, - value: rust_biguint!(300_000_000), - }, - TxTokenTransfer { - token_identifier: FARM_PROXY_TOKEN_ID.to_vec(), - nonce: 3, - value: rust_biguint!(500_000_000), - }, - ]; - b_mock - .execute_esdt_multi_transfer(&user_addr, &lock_wrapper, &payments, |sc| { - let enter_farm_result = sc.enter_farm_locked_token(FarmType::SimpleFarm); - let (out_farm_token, _reward_token) = enter_farm_result.into_tuple(); - assert_eq!( - out_farm_token.token_identifier, - managed_token_id!(FARM_PROXY_TOKEN_ID) - ); - assert_eq!(out_farm_token.token_nonce, 4); - assert_eq!(out_farm_token.amount, managed_biguint!(800_000_000)); - }) - .assert_ok(); - - b_mock.check_nft_balance( - &user_addr, - FARM_PROXY_TOKEN_ID, - 4, - &rust_biguint!(800_000_000), - Some(&FarmProxyTokenAttributes:: { - farm_type: FarmType::SimpleFarm, - farm_token_id: managed_token_id!(FARM_TOKEN_ID), - farm_token_nonce: 4, - farming_token_id: managed_token_id!(LP_TOKEN_ID), - farming_token_locked_nonce: 1, - }), - ); + // user claim farm rewards + // b_mock.set_block_nonce(10); + b_mock.set_block_epoch(10); - // test enter with three additional farm tokens b_mock .execute_esdt_transfer( &user_addr, &lock_wrapper, - LOCKED_LP_TOKEN_ID, - 1, - &rust_biguint!(50_000_000), - |sc| { - sc.enter_farm_locked_token(FarmType::SimpleFarm); - }, - ) - .assert_ok(); - b_mock - .execute_esdt_transfer( - &user_addr, - &lock_wrapper, - LOCKED_LP_TOKEN_ID, + FARM_PROXY_TOKEN_ID, 1, - &rust_biguint!(50_000_000), + &rust_biguint!(9_999_000), |sc| { - sc.enter_farm_locked_token(FarmType::SimpleFarm); - }, - ) - .assert_ok(); - - let payments = [ - TxTokenTransfer { - token_identifier: LOCKED_LP_TOKEN_ID.to_vec(), - nonce: 1, - value: rust_biguint!(100_000_000), - }, - TxTokenTransfer { - token_identifier: FARM_PROXY_TOKEN_ID.to_vec(), - nonce: 4, - value: rust_biguint!(800_000_000), - }, - TxTokenTransfer { - token_identifier: FARM_PROXY_TOKEN_ID.to_vec(), - nonce: 5, - value: rust_biguint!(50_000_000), - }, - TxTokenTransfer { - token_identifier: FARM_PROXY_TOKEN_ID.to_vec(), - nonce: 6, - value: rust_biguint!(50_000_000), - }, - ]; - b_mock - .execute_esdt_multi_transfer(&user_addr, &lock_wrapper, &payments, |sc| { - let enter_farm_result = sc.enter_farm_locked_token(FarmType::SimpleFarm); - let (out_farm_token, _reward_token) = enter_farm_result.into_tuple(); - assert_eq!( - out_farm_token.token_identifier, - managed_token_id!(FARM_PROXY_TOKEN_ID) - ); - assert_eq!(out_farm_token.token_nonce, 7); - assert_eq!(out_farm_token.amount, managed_biguint!(1_000_000_000)); - }) - .assert_ok(); + let claim_result = + sc.destroy_farm_locked_tokens(managed_biguint!(1), managed_biguint!(1)); - b_mock.check_nft_balance( - &user_addr, - FARM_PROXY_TOKEN_ID, - 7, - &rust_biguint!(1_000_000_000), - Some(&FarmProxyTokenAttributes:: { - farm_type: FarmType::SimpleFarm, - farm_token_id: managed_token_id!(FARM_TOKEN_ID), - farm_token_nonce: 7, - farming_token_id: managed_token_id!(LP_TOKEN_ID), - farming_token_locked_nonce: 1, - }), - ); + let (first_token_payment_out, second_token_payment_out) = claim_result.into_tuple(); - // exit farm - b_mock.set_block_epoch(25); - b_mock - .execute_esdt_transfer( - &user_addr, - &lock_wrapper, - FARM_PROXY_TOKEN_ID, - 7, - &rust_biguint!(1_000_000_000), - |sc| { - let exit_farm_result = sc.exit_farm_locked_token(); - let (locked_tokens, _reward_tokens) = exit_farm_result.into_tuple(); + assert_eq!( + first_token_payment_out.token_identifier, + managed_token_id!(WEGLD_TOKEN_ID) + ); + assert_eq!( + first_token_payment_out.amount, + managed_biguint!(9_999_000) + ); assert_eq!( - locked_tokens.token_identifier, - managed_token_id!(LOCKED_LP_TOKEN_ID) + second_token_payment_out.token_identifier, + managed_token_id!(LOCKED_TOKEN_ID) + ); + assert_eq!( + second_token_payment_out.amount, + managed_biguint!(9_999_000) ); - assert_eq!(locked_tokens.token_nonce, 1); - assert_eq!(locked_tokens.amount, managed_biguint!(1_000_000_000)); }, ) .assert_ok(); - - b_mock.check_nft_balance( - &user_addr, - LOCKED_LP_TOKEN_ID, - 1, - &rust_biguint!(1_000_000_000), - Some(&lp_proxy_token_attributes), - ); } diff --git a/locked-asset/simple-lock/src/proxy_farm.rs b/locked-asset/simple-lock/src/proxy_farm.rs index 707f73e68..62bba9d6e 100644 --- a/locked-asset/simple-lock/src/proxy_farm.rs +++ b/locked-asset/simple-lock/src/proxy_farm.rs @@ -1,9 +1,7 @@ multiversx_sc::imports!(); multiversx_sc::derive_imports!(); -use multiversx_sc_modules::transfer_role_proxy::PaymentsVec; - -use crate::{error_messages::*, proxy_lp::LpProxyTokenAttributes}; +use crate::{error_messages::*, locked_token::PreviousStatusFlag, proxy_lp::LpProxyTokenAttributes}; #[derive( TypeAbi, TopEncode, TopDecode, NestedEncode, NestedDecode, PartialEq, Debug, Clone, Copy, @@ -287,30 +285,54 @@ pub trait ProxyFarmModule: INVALID_PAYMENTS_RECEIVED_FROM_FARM_ERR_MSG ); - let mut output_payments = PaymentsVec::new(); if exit_farm_result.reward_tokens.amount > 0 { - output_payments.push(exit_farm_result.reward_tokens); + self.send().direct_esdt( + &caller, + &exit_farm_result.reward_tokens.token_identifier, + exit_farm_result.reward_tokens.token_nonce, + &exit_farm_result.reward_tokens.amount, + ); } let initial_farming_tokens = exit_farm_result.initial_farming_tokens; - let (first_token_payment_out, second_token_payment_out) = self.remove_liquidity_locked_token_common( - initial_farming_tokens, + // get LOCKED_LP nonce + let locked_lp_nonce = farm_proxy_token_attributes.farming_token_locked_nonce; + let lp_proxy_token_mapper = self.lp_proxy_token(); + let lp_proxy_token_attributes: LpProxyTokenAttributes = + lp_proxy_token_mapper.get_token_attributes(locked_lp_nonce); + + // get LP address + let lp_address = self + .lp_address_for_token_pair( + &lp_proxy_token_attributes.first_token_id, + &lp_proxy_token_attributes.second_token_id, + ) + .get(); + + let remove_liq_result = self.call_pair_remove_liquidity( + lp_address, + lp_proxy_token_attributes.lp_token_id, + initial_farming_tokens.amount, first_token_min_amount_out, second_token_min_amount_out, - ).into_tuple(); - - output_payments.push(first_token_payment_out.clone()); - output_payments.push(second_token_payment_out.clone()); + &lp_proxy_token_attributes.first_token_id, + &lp_proxy_token_attributes.second_token_id, + ); let caller = self.blockchain().get_caller(); - self.send().direct_multi(&caller, &output_payments); + let first_token_result_payment = self.send_tokens_optimal_status( + &caller, + remove_liq_result.first_token_payment_out, + PreviousStatusFlag::new(lp_proxy_token_attributes.first_token_locked_nonce), + ); + let second_token_result_payment = self.send_tokens_optimal_status( + &caller, + remove_liq_result.second_token_payment_out, + PreviousStatusFlag::new(lp_proxy_token_attributes.second_token_locked_nonce), + ); - ( - first_token_payment_out, - second_token_payment_out, - ) - .into() + (first_token_result_payment, second_token_result_payment).into() } /// Claim rewards from a previously entered farm. diff --git a/locked-asset/simple-lock/tests/simple_lock_test.rs b/locked-asset/simple-lock/tests/simple_lock_test.rs new file mode 100644 index 000000000..65094222e --- /dev/null +++ b/locked-asset/simple-lock/tests/simple_lock_test.rs @@ -0,0 +1,253 @@ +#![allow(deprecated)] + +mod simple_lock_test_setup; + +use common_structs::FarmTokenAttributes; +use config::ConfigModule; +use energy_factory::energy::EnergyModule; +use energy_query::Energy; + +use multiversx_sc::{ + codec::{multi_types::OptionalValue, Empty}, + types::{BigInt, EsdtLocalRole, EsdtTokenPayment}, +}; +use multiversx_sc_scenario::{ + managed_address, managed_biguint, managed_token_id, rust_biguint, + whitebox_legacy::TxTokenTransfer, DebugApi, +}; +use num_traits::ToPrimitive; +use proxy_dex::{ + proxy_farm::ProxyFarmModule, proxy_pair::ProxyPairModule, + wrapped_farm_attributes::WrappedFarmTokenAttributes, + wrapped_lp_attributes::WrappedLpTokenAttributes, +}; + +#[test] +fn destroy_farm_locked_tokens_test() { + let mut setup = SimpleLockSetup::new( + proxy_dex::contract_obj, + pair::contract_obj, + farm_with_locked_rewards::contract_obj, + energy_factory::contract_obj, + ); + + setup + .b_mock + .execute_tx( + &setup.owner, + &setup.farm_locked_wrapper, + &rust_biguint!(0), + |sc| { + sc.farming_token_id().set(&managed_token_id!(LP_TOKEN_ID)); + + // set produce rewards to false for easier calculation + sc.produce_rewards_enabled().set(false); + }, + ) + .assert_ok(); + + setup.b_mock.set_esdt_local_roles( + setup.farm_locked_wrapper.address_ref(), + LP_TOKEN_ID, + &[EsdtLocalRole::Burn], + ); + + let first_user = setup.first_user.clone(); + let locked_token_amount = rust_biguint!(1_000_000_000); + let other_token_amount = rust_biguint!(500_000_000); + let expected_lp_token_amount = rust_biguint!(499_999_000); + + // set the price to 1 EGLD = 2 MEX + let payments = vec![ + TxTokenTransfer { + token_identifier: LOCKED_TOKEN_ID.to_vec(), + nonce: 1, + value: locked_token_amount.clone(), + }, + TxTokenTransfer { + token_identifier: WEGLD_TOKEN_ID.to_vec(), + nonce: 0, + value: other_token_amount.clone(), + }, + ]; + + // add liquidity + let pair_addr = setup.pair_wrapper.address_ref().clone(); + setup + .b_mock + .execute_esdt_multi_transfer(&first_user, &setup.proxy_wrapper, &payments, |sc| { + sc.add_liquidity_proxy( + managed_address!(&pair_addr), + managed_biguint!(locked_token_amount.to_u64().unwrap()), + managed_biguint!(other_token_amount.to_u64().unwrap()), + ); + }) + .assert_ok(); + + setup.b_mock.check_nft_balance( + &first_user, + WRAPPED_LP_TOKEN_ID, + 1, + &expected_lp_token_amount, + Some(&WrappedLpTokenAttributes:: { + locked_tokens: EsdtTokenPayment { + token_identifier: managed_token_id!(LOCKED_TOKEN_ID), + token_nonce: 1, + amount: managed_biguint!(locked_token_amount.to_u64().unwrap()), + }, + lp_token_id: managed_token_id!(LP_TOKEN_ID), + lp_token_amount: managed_biguint!(expected_lp_token_amount.to_u64().unwrap()), + }), + ); + + let block_epoch = 1u64; + let user_balance = USER_BALANCE; + setup + .b_mock + .execute_query(&setup.simple_lock_wrapper, |sc| { + let unlock_epoch = LOCK_OPTIONS[0]; + let lock_epochs = unlock_epoch - block_epoch; + let expected_energy_amount = + BigInt::from((user_balance) as i64) * BigInt::from(lock_epochs as i64); + let expected_energy = Energy::new( + expected_energy_amount, + block_epoch, + managed_biguint!(user_balance), + ); + let actual_energy = sc.user_energy(&managed_address!(&first_user)).get(); + assert_eq!(expected_energy, actual_energy); + }) + .assert_ok(); + + let farm_locked_addr = setup.farm_locked_wrapper.address_ref().clone(); + + //////////////////////////////////////////// ENTER FARM ///////////////////////////////////// + + let mut current_epoch = 5; + setup.b_mock.set_block_epoch(current_epoch); + + setup + .b_mock + .execute_esdt_transfer( + &first_user, + &setup.proxy_wrapper, + WRAPPED_LP_TOKEN_ID, + 1, + &expected_lp_token_amount, + |sc| { + sc.enter_farm_proxy_endpoint( + managed_address!(&farm_locked_addr), + OptionalValue::None, + ); + }, + ) + .assert_ok(); + + let expected_energy = rust_biguint!(LOCK_OPTIONS[0] - current_epoch) * USER_BALANCE; + setup + .b_mock + .execute_query(&setup.simple_lock_wrapper, |sc| { + let managed_result = sc.get_energy_amount_for_user(managed_address!(&first_user)); + let result = to_rust_biguint(managed_result); + assert_eq!(result, expected_energy); + }) + .assert_ok(); + + // check user balance + setup.b_mock.check_nft_balance( + &first_user, + WRAPPED_FARM_TOKEN_ID, + 1, + &expected_lp_token_amount, + Some(&WrappedFarmTokenAttributes:: { + proxy_farming_token: EsdtTokenPayment { + token_identifier: managed_token_id!(WRAPPED_LP_TOKEN_ID), + token_nonce: 1, + amount: managed_biguint!(expected_lp_token_amount.to_u64().unwrap()), + }, + farm_token: EsdtTokenPayment { + token_identifier: managed_token_id!(FARM_LOCKED_TOKEN_ID), + token_nonce: 1, + amount: managed_biguint!(expected_lp_token_amount.to_u64().unwrap()), + }, + }), + ); + + // check proxy balance + setup + .b_mock + .check_nft_balance::>( + setup.proxy_wrapper.address_ref(), + FARM_LOCKED_TOKEN_ID, + 1, + &expected_lp_token_amount, + None, + ); + + // check farm balance + setup.b_mock.check_esdt_balance( + setup.farm_locked_wrapper.address_ref(), + LP_TOKEN_ID, + &expected_lp_token_amount, + ); + + current_epoch += 5; // applies penalty on exit + setup.b_mock.set_block_epoch(current_epoch); + setup.b_mock.set_block_nonce(100); + + ////////////////////////////////////////////// DESTROY FARM ///////////////////////////////////// + + // should be 500_000_000, but ends up so due to approximations + let removed_locked_token_amount = rust_biguint!(499_999_000); + // should be 250_000_000, but ends up so due to approximations + let removed_other_token_amount = rust_biguint!(249_999_500); + // exit with partial amount + setup + .b_mock + .execute_esdt_transfer( + &first_user, + &setup.proxy_wrapper, + WRAPPED_FARM_TOKEN_ID, + 1, + &(expected_lp_token_amount.clone() / rust_biguint!(2)), + |sc| { + let output_payments = sc.destroy_farm_proxy( + managed_address!(&farm_locked_addr), + managed_address!(&pair_addr), + managed_biguint!(1), + managed_biguint!(1), + OptionalValue::None, + ); + + let output_vec = output_payments.to_vec(); + + assert_eq!(output_payments.len(), 3); + assert_eq!( + output_vec.get(0).amount.to_u64().unwrap(), + removed_locked_token_amount.to_u64().unwrap() + ); + assert_eq!( + output_vec.get(1).amount.to_u64().unwrap(), + removed_other_token_amount.to_u64().unwrap() + ); + assert_eq!(output_vec.get(2).amount.to_u64().unwrap(), 0u64); + }, + ) + .assert_ok(); + + setup.b_mock.check_nft_balance::( + &first_user, + WRAPPED_FARM_TOKEN_ID, + 1, + &(&expected_lp_token_amount / 2u64), + None, + ); + + setup.b_mock.check_nft_balance::( + &first_user, + WRAPPED_LP_TOKEN_ID, + 1, + &rust_biguint!(0u64), + None, + ); +} diff --git a/locked-asset/simple-lock/tests/simple_lock_test_setup/mod.rs b/locked-asset/simple-lock/tests/simple_lock_test_setup/mod.rs new file mode 100644 index 000000000..260c382c5 --- /dev/null +++ b/locked-asset/simple-lock/tests/simple_lock_test_setup/mod.rs @@ -0,0 +1,366 @@ +#![allow(dead_code)] +#![allow(deprecated)] + +use common_structs::FarmTokenAttributes; +use multiversx_sc::codec::multi_types::OptionalValue; +use multiversx_sc::storage::mappers::StorageTokenWrapper; +use multiversx_sc::types::{Address, EsdtLocalRole, ManagedAddress, MultiValueEncoded}; +use multiversx_sc_scenario::whitebox_legacy::{TxContextStack, TxTokenTransfer}; +use multiversx_sc_scenario::{ + managed_address, managed_biguint, managed_token_id, rust_biguint, whitebox_legacy::*, DebugApi, +}; + +type RustBigUint = num_bigint::BigUint; + +use config::*; +use farm::exit_penalty::ExitPenaltyModule; +use farm::*; +use farm_boosted_yields::boosted_yields_factors::BoostedYieldsFactorsModule; +use farm_token::FarmTokenModule; +use pausable::{PausableModule, State}; + +// General +pub static MEX_TOKEN_ID: &[u8] = b"MEX-123456"; +pub static WEGLD_TOKEN_ID: &[u8] = b"WEGLD-123456"; +pub const EPOCHS_IN_YEAR: u64 = 360; +pub const USER_BALANCE: u64 = 1_000_000_000_000_000_000; + +// Pair +pub static LP_TOKEN_ID: &[u8] = b"LPTOK-123456"; + +// Farm +pub static FARM_LOCKED_TOKEN_ID: &[u8] = b"FARML-123456"; +pub const DIVISION_SAFETY_CONSTANT: u64 = 1_000_000_000_000_000_000; +pub const PER_BLOCK_REWARD_AMOUNT: u64 = 5_000; +pub const USER_REWARDS_BASE_CONST: u64 = 10; +pub const USER_REWARDS_ENERGY_CONST: u64 = 3; +pub const USER_REWARDS_FARM_CONST: u64 = 2; +pub const MIN_ENERGY_AMOUNT_FOR_BOOSTED_YIELDS: u64 = 1; +pub const MIN_FARM_AMOUNT_FOR_BOOSTED_YIELDS: u64 = 1; + +// Simple Lock +pub static LOCKED_TOKEN_ID: &[u8] = b"LOCKED-123456"; +pub static LEGACY_LOCKED_TOKEN_ID: &[u8] = b"LEGACY-123456"; +pub static LOCK_OPTIONS: &[u64] = &[EPOCHS_IN_YEAR, 5 * EPOCHS_IN_YEAR, 10 * EPOCHS_IN_YEAR]; // 1, 5 or 10 years +pub static PENALTY_PERCENTAGES: &[u64] = &[4_000, 6_000, 8_000]; + +// Proxy +pub static WRAPPED_LP_TOKEN_ID: &[u8] = b"WPLP-123456"; +pub static WRAPPED_FARM_TOKEN_ID: &[u8] = b"WPFARM-123456"; + + +pub struct SimpleLockSetup +where + SimpleLockObjBuilder: 'static + Copy + Fn() -> simple_lock::ContractObj, + PairObjBuilder: 'static + Copy + Fn() -> pair::ContractObj, + FarmLockedObjBuilder: 'static + Copy + Fn() -> farm_with_locked_rewards::ContractObj, +{ + pub b_mock: BlockchainStateWrapper, + pub owner: Address, + pub first_user: Address, + pub second_user: Address, + pub simple_lock_wrapper: + ContractObjWrapper, SimpleLockObjBuilder>, + pub pair_wrapper: ContractObjWrapper, PairObjBuilder>, + pub farm_locked_wrapper: + ContractObjWrapper, FarmLockedObjBuilder>, +} + +impl + SimpleLockSetup +where + SimpleLockObjBuilder: 'static + Copy + Fn() -> simple_lock::ContractObj, + PairObjBuilder: 'static + Copy + Fn() -> pair::ContractObj, + FarmLockedObjBuilder: 'static + Copy + Fn() -> farm_with_locked_rewards::ContractObj, +{ + pub fn new(farm_builder: SimpleLockObjBuilder) -> Self { + let rust_zero = rust_biguint!(0u64); + let mut blockchain_wrapper = BlockchainStateWrapper::new(); + let owner_addr = blockchain_wrapper.create_user_account(&rust_zero); + let farm_wrapper = blockchain_wrapper.create_sc_account( + &rust_zero, + Some(&owner_addr), + farm_builder, + FARM_WASM_PATH, + ); + + // init farm contract + + blockchain_wrapper + .execute_tx(&owner_addr, &farm_wrapper, &rust_zero, |sc| { + let reward_token_id = managed_token_id!(MEX_TOKEN_ID); + let farming_token_id = managed_token_id!(LP_TOKEN_ID); + let division_safety_constant = managed_biguint!(DIVISION_SAFETY_CONSTANT); + let pair_address = managed_address!(&Address::zero()); + + sc.init( + reward_token_id, + farming_token_id, + division_safety_constant, + pair_address, + ManagedAddress::::zero(), + MultiValueEncoded::new(), + ); + + let farm_token_id = managed_token_id!(FARM_TOKEN_ID); + sc.farm_token().set_token_id(farm_token_id); + + sc.per_block_reward_amount() + .set(&managed_biguint!(PER_BLOCK_REWARD_AMOUNT)); + sc.minimum_farming_epochs().set(MIN_FARMING_EPOCHS); + sc.penalty_percent().set(PENALTY_PERCENT); + + sc.state().set(State::Active); + sc.produce_rewards_enabled().set(true); + }) + .assert_ok(); + + blockchain_wrapper + .execute_tx(&owner_addr, &farm_wrapper, &rust_biguint!(0), |sc| { + sc.set_boosted_yields_factors( + managed_biguint!(MAX_REWARDS_FACTOR), + managed_biguint!(USER_REWARDS_ENERGY_CONST), + managed_biguint!(USER_REWARDS_FARM_CONST), + managed_biguint!(MIN_ENERGY_AMOUNT_FOR_BOOSTED_YIELDS), + managed_biguint!(MIN_FARM_AMOUNT_FOR_BOOSTED_YIELDS), + ); + }) + .assert_ok(); + + let farm_token_roles = [ + EsdtLocalRole::NftCreate, + EsdtLocalRole::NftAddQuantity, + EsdtLocalRole::NftBurn, + ]; + blockchain_wrapper.set_esdt_local_roles( + farm_wrapper.address_ref(), + FARM_TOKEN_ID, + &farm_token_roles[..], + ); + + let farming_token_roles = [EsdtLocalRole::Burn]; + blockchain_wrapper.set_esdt_local_roles( + farm_wrapper.address_ref(), + LP_TOKEN_ID, + &farming_token_roles[..], + ); + + let reward_token_roles = [EsdtLocalRole::Mint]; + blockchain_wrapper.set_esdt_local_roles( + farm_wrapper.address_ref(), + MEX_TOKEN_ID, + &reward_token_roles[..], + ); + + let user_addr = blockchain_wrapper.create_user_account(&rust_biguint!(100_000_000)); + blockchain_wrapper.set_esdt_balance( + &user_addr, + LP_TOKEN_ID, + &rust_biguint!(USER_TOTAL_LP_TOKENS), + ); + + SingleUserFarmSetup { + blockchain_wrapper, + owner_address: owner_addr, + user_address: user_addr, + farm_wrapper, + } + } + + pub fn enter_farm( + &mut self, + farm_in_amount: u64, + additional_farm_tokens: &[TxTokenTransfer], + expected_farm_token_nonce: u64, + expected_reward_per_share: u64, + expected_entering_epoch: u64, + expected_compounded_reward: u64, + ) { + let mut payments = Vec::with_capacity(1 + additional_farm_tokens.len()); + payments.push(TxTokenTransfer { + token_identifier: LP_TOKEN_ID.to_vec(), + nonce: 0, + value: rust_biguint!(farm_in_amount), + }); + payments.extend_from_slice(additional_farm_tokens); + + let mut expected_total_out_amount = 0; + for payment in payments.iter() { + expected_total_out_amount += payment.value.to_u64_digits()[0]; + } + + let b_mock = &mut self.blockchain_wrapper; + b_mock + .execute_esdt_multi_transfer(&self.user_address, &self.farm_wrapper, &payments, |sc| { + let enter_farm_result = sc.enter_farm_endpoint(OptionalValue::None); + let (out_farm_token, _reward_token) = enter_farm_result.into_tuple(); + assert_eq!( + out_farm_token.token_identifier, + managed_token_id!(FARM_TOKEN_ID) + ); + assert_eq!(out_farm_token.token_nonce, expected_farm_token_nonce); + assert_eq!( + out_farm_token.amount, + managed_biguint!(expected_total_out_amount) + ); + }) + .assert_ok(); + + DebugApi::dummy(); + + let expected_attributes = FarmTokenAttributes:: { + reward_per_share: managed_biguint!(expected_reward_per_share), + entering_epoch: expected_entering_epoch, + compounded_reward: managed_biguint!(expected_compounded_reward), + current_farm_amount: managed_biguint!(expected_total_out_amount), + original_owner: managed_address!(&self.user_address), + }; + b_mock.check_nft_balance( + &self.user_address, + FARM_TOKEN_ID, + expected_farm_token_nonce, + &rust_biguint!(expected_total_out_amount), + Some(&expected_attributes), + ); + + let _ = TxContextStack::static_pop(); + } + + pub fn exit_farm( + &mut self, + farm_token_amount: u64, + farm_token_nonce: u64, + expected_mex_out: u64, + expected_farm_token_amount: u64, + expected_user_mex_balance: &RustBigUint, + expected_user_lp_token_balance: &RustBigUint, + ) { + let b_mock = &mut self.blockchain_wrapper; + b_mock + .execute_esdt_transfer( + &self.user_address, + &self.farm_wrapper, + FARM_TOKEN_ID, + farm_token_nonce, + &rust_biguint!(farm_token_amount), + |sc| { + let multi_result = sc.exit_farm_endpoint(OptionalValue::None); + + let (first_result, second_result) = multi_result.into_tuple(); + + assert_eq!( + first_result.token_identifier, + managed_token_id!(LP_TOKEN_ID) + ); + assert_eq!(first_result.token_nonce, 0); + assert_eq!( + first_result.amount, + managed_biguint!(expected_farm_token_amount) + ); + + assert_eq!( + second_result.token_identifier, + managed_token_id!(MEX_TOKEN_ID) + ); + assert_eq!(second_result.token_nonce, 0); + assert_eq!(second_result.amount, managed_biguint!(expected_mex_out)); + }, + ) + .assert_ok(); + + b_mock.check_esdt_balance(&self.user_address, MEX_TOKEN_ID, expected_user_mex_balance); + b_mock.check_esdt_balance( + &self.user_address, + LP_TOKEN_ID, + expected_user_lp_token_balance, + ); + } + + #[allow(clippy::too_many_arguments)] + pub fn claim_rewards( + &mut self, + farm_token_amount: u64, + farm_token_nonce: u64, + expected_mex_out: u64, + expected_user_mex_balance: &RustBigUint, + expected_user_lp_token_balance: &RustBigUint, + expected_farm_token_nonce_out: u64, + expected_reward_per_share: u64, + ) { + let b_mock = &mut self.blockchain_wrapper; + b_mock + .execute_esdt_transfer( + &self.user_address, + &self.farm_wrapper, + FARM_TOKEN_ID, + farm_token_nonce, + &rust_biguint!(farm_token_amount), + |sc| { + let multi_result = sc.claim_rewards_endpoint(OptionalValue::None); + + let (first_result, second_result) = multi_result.into_tuple(); + + assert_eq!( + first_result.token_identifier, + managed_token_id!(FARM_TOKEN_ID) + ); + assert_eq!(first_result.token_nonce, expected_farm_token_nonce_out); + assert_eq!(first_result.amount, managed_biguint!(farm_token_amount)); + + assert_eq!( + second_result.token_identifier, + managed_token_id!(MEX_TOKEN_ID) + ); + assert_eq!(second_result.token_nonce, 0); + assert_eq!(second_result.amount, managed_biguint!(expected_mex_out)); + }, + ) + .assert_ok(); + + DebugApi::dummy(); + let expected_attributes = FarmTokenAttributes:: { + reward_per_share: managed_biguint!(expected_reward_per_share), + entering_epoch: 0, + compounded_reward: managed_biguint!(0), + current_farm_amount: managed_biguint!(farm_token_amount), + original_owner: managed_address!(&self.user_address), + }; + + b_mock.check_nft_balance( + &self.user_address, + FARM_TOKEN_ID, + expected_farm_token_nonce_out, + &rust_biguint!(farm_token_amount), + Some(&expected_attributes), + ); + b_mock.check_esdt_balance(&self.user_address, MEX_TOKEN_ID, expected_user_mex_balance); + b_mock.check_esdt_balance( + &self.user_address, + LP_TOKEN_ID, + expected_user_lp_token_balance, + ); + + let _ = TxContextStack::static_pop(); + } + + pub fn check_farm_token_supply(&mut self, expected_farm_token_supply: u64) { + let b_mock = &mut self.blockchain_wrapper; + b_mock + .execute_query(&self.farm_wrapper, |sc| { + let actual_farm_supply = sc.farm_token_supply().get(); + assert_eq!( + managed_biguint!(expected_farm_token_supply), + actual_farm_supply + ); + }) + .assert_ok(); + } + + pub fn set_block_nonce(&mut self, block_nonce: u64) { + self.blockchain_wrapper.set_block_nonce(block_nonce); + } + + pub fn set_block_epoch(&mut self, block_epoch: u64) { + self.blockchain_wrapper.set_block_epoch(block_epoch); + } +} From 1682a478315e0839b3eda5869fbae7d4420e67f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Tue, 20 Feb 2024 13:18:26 +0200 Subject: [PATCH 182/213] Cargo fmt --- dex/farm/tests/farm_single_user_test.rs | 15 +++------------ .../governance-v2/src/configurable.rs | 3 ++- .../governance-v2/tests/gov_rust_test.rs | 2 +- .../governance-v2/tests/gov_test_setup/mod.rs | 14 ++++---------- farm-staking/farm-staking/src/custom_rewards.rs | 8 ++++++-- farm-staking/farm-staking/src/lib.rs | 2 +- .../farm-staking/tests/farm_staking_setup/mod.rs | 11 ++++++++--- .../farm-staking/tests/farm_staking_test.rs | 3 ++- .../lkmex-transfer/tests/lkmex_transfer_tests.rs | 2 +- locked-asset/proxy_dex/src/lib.rs | 2 +- locked-asset/proxy_dex/tests/proxy_farm_test.rs | 2 +- locked-asset/simple-lock/src/proxy_farm.rs | 4 +++- .../simple-lock/tests/simple_lock_test.rs | 2 +- .../tests/simple_lock_test_setup/mod.rs | 1 - .../tests/distribution_scenario_go_test.rs | 3 ++- 15 files changed, 36 insertions(+), 38 deletions(-) diff --git a/dex/farm/tests/farm_single_user_test.rs b/dex/farm/tests/farm_single_user_test.rs index 1db431556..f1262efe0 100644 --- a/dex/farm/tests/farm_single_user_test.rs +++ b/dex/farm/tests/farm_single_user_test.rs @@ -4,10 +4,7 @@ mod farm_setup; use config::ConfigModule; use farm_setup::single_user_farm_setup::*; -use multiversx_sc::{ - codec::multi_types::OptionalValue, - types::EsdtLocalRole, -}; +use multiversx_sc::{codec::multi_types::OptionalValue, types::EsdtLocalRole}; use multiversx_sc_scenario::{ managed_address, managed_biguint, managed_token_id, managed_token_id_wrapped, rust_biguint, whitebox_legacy::TxTokenTransfer, DebugApi, @@ -858,19 +855,13 @@ fn test_destroy_farm_through_simple_lock() { first_token_payment_out.token_identifier, managed_token_id!(WEGLD_TOKEN_ID) ); - assert_eq!( - first_token_payment_out.amount, - managed_biguint!(9_999_000) - ); + assert_eq!(first_token_payment_out.amount, managed_biguint!(9_999_000)); assert_eq!( second_token_payment_out.token_identifier, managed_token_id!(LOCKED_TOKEN_ID) ); - assert_eq!( - second_token_payment_out.amount, - managed_biguint!(9_999_000) - ); + assert_eq!(second_token_payment_out.amount, managed_biguint!(9_999_000)); }, ) .assert_ok(); diff --git a/energy-integration/governance-v2/src/configurable.rs b/energy-integration/governance-v2/src/configurable.rs index a6e5891b8..12751ce7f 100644 --- a/energy-integration/governance-v2/src/configurable.rs +++ b/energy-integration/governance-v2/src/configurable.rs @@ -135,7 +135,8 @@ pub trait ConfigurablePropertiesModule: "Not valid value for withdraw percentage if defeated!" ); - self.withdraw_percentage_defeated().set(new_withdraw_percentage); + self.withdraw_percentage_defeated() + .set(new_withdraw_percentage); } fn try_change_fee_token_id(&self, fee_token_id: TokenIdentifier) { diff --git a/energy-integration/governance-v2/tests/gov_rust_test.rs b/energy-integration/governance-v2/tests/gov_rust_test.rs index d5f371bc2..bd9dcbf17 100644 --- a/energy-integration/governance-v2/tests/gov_rust_test.rs +++ b/energy-integration/governance-v2/tests/gov_rust_test.rs @@ -7,7 +7,7 @@ use governance_v2::{ configurable::ConfigurablePropertiesModule, proposal::GovernanceProposalStatus, proposal_storage::ProposalStorageModule, views::ViewsModule, }; -use multiversx_sc::{types::ManagedVec}; +use multiversx_sc::types::ManagedVec; use multiversx_sc_scenario::{managed_buffer, rust_biguint}; #[test] diff --git a/energy-integration/governance-v2/tests/gov_test_setup/mod.rs b/energy-integration/governance-v2/tests/gov_test_setup/mod.rs index 95b03ecb8..489fec3b3 100644 --- a/energy-integration/governance-v2/tests/gov_test_setup/mod.rs +++ b/energy-integration/governance-v2/tests/gov_test_setup/mod.rs @@ -182,15 +182,8 @@ where }) .assert_ok(); - let vote_nft_roles = [ - EsdtLocalRole::Mint, - EsdtLocalRole::Burn, - ]; - b_mock.set_esdt_local_roles( - gov_wrapper.address_ref(), - MEX_TOKEN_ID, - &vote_nft_roles[..], - ); + let vote_nft_roles = [EsdtLocalRole::Mint, EsdtLocalRole::Burn]; + b_mock.set_esdt_local_roles(gov_wrapper.address_ref(), MEX_TOKEN_ID, &vote_nft_roles[..]); Self { b_mock, @@ -288,7 +281,8 @@ where pub fn change_min_energy(&mut self, min_energy_for_propose: usize) -> TxResult { self.b_mock .execute_tx(&self.owner, &self.gov_wrapper, &rust_biguint!(0), |sc| { - sc.min_energy_for_propose().set(&managed_biguint!(min_energy_for_propose)); + sc.min_energy_for_propose() + .set(&managed_biguint!(min_energy_for_propose)); }) } diff --git a/farm-staking/farm-staking/src/custom_rewards.rs b/farm-staking/farm-staking/src/custom_rewards.rs index f62ec0cb7..4d07dd5a4 100644 --- a/farm-staking/farm-staking/src/custom_rewards.rs +++ b/farm-staking/farm-staking/src/custom_rewards.rs @@ -10,7 +10,8 @@ use crate::base_impl_wrapper::FarmStakingWrapper; pub const MAX_PERCENT: u64 = 10_000; pub const BLOCKS_IN_YEAR: u64 = 31_536_000 / 6; // seconds_in_year / 6_seconds_per_block pub const MAX_MIN_UNBOND_EPOCHS: u64 = 30; -pub const WITHDRAW_AMOUNT_TOO_HIGH: &str = "Withdraw amount is higher than the remaining uncollected rewards!"; +pub const WITHDRAW_AMOUNT_TOO_HIGH: &str = + "Withdraw amount is higher than the remaining uncollected rewards!"; #[multiversx_sc::module] pub trait CustomRewardsModule: @@ -55,7 +56,10 @@ pub trait CustomRewardsModule: let reward_capacity_mapper = self.reward_capacity(); let accumulated_rewards_mapper = self.accumulated_rewards(); let remaining_rewards = reward_capacity_mapper.get() - accumulated_rewards_mapper.get(); - require!(withdraw_amount <= remaining_rewards, WITHDRAW_AMOUNT_TOO_HIGH); + require!( + withdraw_amount <= remaining_rewards, + WITHDRAW_AMOUNT_TOO_HIGH + ); reward_capacity_mapper.update(|rewards| { require!( diff --git a/farm-staking/farm-staking/src/lib.rs b/farm-staking/farm-staking/src/lib.rs index ac1f23727..33f5bbd1a 100644 --- a/farm-staking/farm-staking/src/lib.rs +++ b/farm-staking/farm-staking/src/lib.rs @@ -123,7 +123,7 @@ pub trait FarmStaking: (merged_farm_token, boosted_rewards_payment).into() } - + #[view(calculateRewardsForGivenPosition)] fn calculate_rewards_for_given_position( &self, diff --git a/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs b/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs index 0ba2b2bc5..d8cfc9a46 100644 --- a/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs +++ b/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs @@ -43,8 +43,8 @@ pub const USER_REWARDS_ENERGY_CONST: u64 = 3; pub const USER_REWARDS_FARM_CONST: u64 = 2; pub const MIN_ENERGY_AMOUNT_FOR_BOOSTED_YIELDS: u64 = 1; pub const MIN_FARM_AMOUNT_FOR_BOOSTED_YIELDS: u64 = 1; -pub const WITHDRAW_AMOUNT_TOO_HIGH: &str = "Withdraw amount is higher than the remaining uncollected rewards!"; - +pub const WITHDRAW_AMOUNT_TOO_HIGH: &str = + "Withdraw amount is higher than the remaining uncollected rewards!"; pub struct FarmStakingSetup where @@ -518,7 +518,12 @@ where .assert_ok(); } - pub fn withdraw_rewards_with_error(&mut self, withdraw_amount: &RustBigUint, expected_status: u64, expected_message: &str) { + pub fn withdraw_rewards_with_error( + &mut self, + withdraw_amount: &RustBigUint, + expected_status: u64, + expected_message: &str, + ) { self.b_mock .execute_tx( &self.owner_address, diff --git a/farm-staking/farm-staking/tests/farm_staking_test.rs b/farm-staking/farm-staking/tests/farm_staking_test.rs index a8a6abb3a..89192a6a1 100644 --- a/farm-staking/farm-staking/tests/farm_staking_test.rs +++ b/farm-staking/farm-staking/tests/farm_staking_test.rs @@ -270,7 +270,8 @@ fn test_withdraw_after_produced_rewards() { let expected_reward_token_out = 40; - let withdraw_amount = rust_biguint!(TOTAL_REWARDS_AMOUNT) - rust_biguint!(expected_reward_token_out); + let withdraw_amount = + rust_biguint!(TOTAL_REWARDS_AMOUNT) - rust_biguint!(expected_reward_token_out); farm_setup.withdraw_rewards(&withdraw_amount); // Only the user's rewards will remain diff --git a/locked-asset/lkmex-transfer/tests/lkmex_transfer_tests.rs b/locked-asset/lkmex-transfer/tests/lkmex_transfer_tests.rs index e1c9dce95..4231daecf 100644 --- a/locked-asset/lkmex-transfer/tests/lkmex_transfer_tests.rs +++ b/locked-asset/lkmex-transfer/tests/lkmex_transfer_tests.rs @@ -785,7 +785,7 @@ fn transfer_locked_token_after_unlock_period_test() { // check first user energy b_mock .execute_query(&factory_sc_wrapper, |sc| { - let unlock_epoch = sc.unlock_epoch_to_start_of_month(5 + LOCK_OPTIONS[0]); + let unlock_epoch = sc.unlock_epoch_to_start_of_month(5 + LOCK_OPTIONS[0]); let lock_epochs = unlock_epoch as i64 - current_epoch as i64; let expected_energy_amount = BigInt::from((USER_BALANCE / 2) as i64) * BigInt::from(lock_epochs); diff --git a/locked-asset/proxy_dex/src/lib.rs b/locked-asset/proxy_dex/src/lib.rs index d81055288..f74f69303 100644 --- a/locked-asset/proxy_dex/src/lib.rs +++ b/locked-asset/proxy_dex/src/lib.rs @@ -9,11 +9,11 @@ pub mod energy_update; pub mod events; pub mod external_merging; pub mod farm_interactions; +pub mod other_sc_whitelist; pub mod pair_interactions; pub mod proxy_common; pub mod proxy_farm; pub mod proxy_pair; -pub mod other_sc_whitelist; pub mod wrapped_farm_attributes; pub mod wrapped_farm_token_merge; pub mod wrapped_lp_attributes; diff --git a/locked-asset/proxy_dex/tests/proxy_farm_test.rs b/locked-asset/proxy_dex/tests/proxy_farm_test.rs index 6166b97e8..9018b972c 100644 --- a/locked-asset/proxy_dex/tests/proxy_farm_test.rs +++ b/locked-asset/proxy_dex/tests/proxy_farm_test.rs @@ -1594,7 +1594,7 @@ fn destroy_farm_locked_tokens_test() { setup.b_mock.set_block_nonce(100); ////////////////////////////////////////////// DESTROY FARM ///////////////////////////////////// - + // should be 500_000_000, but ends up so due to approximations let removed_locked_token_amount = rust_biguint!(499_999_000); // should be 250_000_000, but ends up so due to approximations diff --git a/locked-asset/simple-lock/src/proxy_farm.rs b/locked-asset/simple-lock/src/proxy_farm.rs index 62bba9d6e..5932e26a2 100644 --- a/locked-asset/simple-lock/src/proxy_farm.rs +++ b/locked-asset/simple-lock/src/proxy_farm.rs @@ -1,7 +1,9 @@ multiversx_sc::imports!(); multiversx_sc::derive_imports!(); -use crate::{error_messages::*, locked_token::PreviousStatusFlag, proxy_lp::LpProxyTokenAttributes}; +use crate::{ + error_messages::*, locked_token::PreviousStatusFlag, proxy_lp::LpProxyTokenAttributes, +}; #[derive( TypeAbi, TopEncode, TopDecode, NestedEncode, NestedDecode, PartialEq, Debug, Clone, Copy, diff --git a/locked-asset/simple-lock/tests/simple_lock_test.rs b/locked-asset/simple-lock/tests/simple_lock_test.rs index 65094222e..4029ba34a 100644 --- a/locked-asset/simple-lock/tests/simple_lock_test.rs +++ b/locked-asset/simple-lock/tests/simple_lock_test.rs @@ -196,7 +196,7 @@ fn destroy_farm_locked_tokens_test() { setup.b_mock.set_block_nonce(100); ////////////////////////////////////////////// DESTROY FARM ///////////////////////////////////// - + // should be 500_000_000, but ends up so due to approximations let removed_locked_token_amount = rust_biguint!(499_999_000); // should be 250_000_000, but ends up so due to approximations diff --git a/locked-asset/simple-lock/tests/simple_lock_test_setup/mod.rs b/locked-asset/simple-lock/tests/simple_lock_test_setup/mod.rs index 260c382c5..92f145fba 100644 --- a/locked-asset/simple-lock/tests/simple_lock_test_setup/mod.rs +++ b/locked-asset/simple-lock/tests/simple_lock_test_setup/mod.rs @@ -48,7 +48,6 @@ pub static PENALTY_PERCENTAGES: &[u64] = &[4_000, 6_000, 8_000]; pub static WRAPPED_LP_TOKEN_ID: &[u8] = b"WPLP-123456"; pub static WRAPPED_FARM_TOKEN_ID: &[u8] = b"WPFARM-123456"; - pub struct SimpleLockSetup where SimpleLockObjBuilder: 'static + Copy + Fn() -> simple_lock::ContractObj, diff --git a/locked-asset/tests/distribution_scenario_go_test.rs b/locked-asset/tests/distribution_scenario_go_test.rs index b887a0d42..bedda9fe6 100644 --- a/locked-asset/tests/distribution_scenario_go_test.rs +++ b/locked-asset/tests/distribution_scenario_go_test.rs @@ -85,7 +85,8 @@ fn exit_mex_farm_proxy_after_compound_rewards_go() { #[test] #[ignore] fn exit_mex_farm_proxy_after_compound_rewards_and_epoch_increase_go() { - world().run("scenarios/exit_mex_farm_proxy_after_compound_rewards_and_epoch_increase.scen.json"); + world() + .run("scenarios/exit_mex_farm_proxy_after_compound_rewards_and_epoch_increase.scen.json"); } #[test] From c2eb950a7e5755cb4040f2b104a4b01ae80086de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Tue, 20 Feb 2024 13:35:53 +0200 Subject: [PATCH 183/213] Remove unnecessary test --- .../simple-lock/tests/simple_lock_test.rs | 253 ------------ .../tests/simple_lock_test_setup/mod.rs | 365 ------------------ 2 files changed, 618 deletions(-) delete mode 100644 locked-asset/simple-lock/tests/simple_lock_test.rs delete mode 100644 locked-asset/simple-lock/tests/simple_lock_test_setup/mod.rs diff --git a/locked-asset/simple-lock/tests/simple_lock_test.rs b/locked-asset/simple-lock/tests/simple_lock_test.rs deleted file mode 100644 index 4029ba34a..000000000 --- a/locked-asset/simple-lock/tests/simple_lock_test.rs +++ /dev/null @@ -1,253 +0,0 @@ -#![allow(deprecated)] - -mod simple_lock_test_setup; - -use common_structs::FarmTokenAttributes; -use config::ConfigModule; -use energy_factory::energy::EnergyModule; -use energy_query::Energy; - -use multiversx_sc::{ - codec::{multi_types::OptionalValue, Empty}, - types::{BigInt, EsdtLocalRole, EsdtTokenPayment}, -}; -use multiversx_sc_scenario::{ - managed_address, managed_biguint, managed_token_id, rust_biguint, - whitebox_legacy::TxTokenTransfer, DebugApi, -}; -use num_traits::ToPrimitive; -use proxy_dex::{ - proxy_farm::ProxyFarmModule, proxy_pair::ProxyPairModule, - wrapped_farm_attributes::WrappedFarmTokenAttributes, - wrapped_lp_attributes::WrappedLpTokenAttributes, -}; - -#[test] -fn destroy_farm_locked_tokens_test() { - let mut setup = SimpleLockSetup::new( - proxy_dex::contract_obj, - pair::contract_obj, - farm_with_locked_rewards::contract_obj, - energy_factory::contract_obj, - ); - - setup - .b_mock - .execute_tx( - &setup.owner, - &setup.farm_locked_wrapper, - &rust_biguint!(0), - |sc| { - sc.farming_token_id().set(&managed_token_id!(LP_TOKEN_ID)); - - // set produce rewards to false for easier calculation - sc.produce_rewards_enabled().set(false); - }, - ) - .assert_ok(); - - setup.b_mock.set_esdt_local_roles( - setup.farm_locked_wrapper.address_ref(), - LP_TOKEN_ID, - &[EsdtLocalRole::Burn], - ); - - let first_user = setup.first_user.clone(); - let locked_token_amount = rust_biguint!(1_000_000_000); - let other_token_amount = rust_biguint!(500_000_000); - let expected_lp_token_amount = rust_biguint!(499_999_000); - - // set the price to 1 EGLD = 2 MEX - let payments = vec![ - TxTokenTransfer { - token_identifier: LOCKED_TOKEN_ID.to_vec(), - nonce: 1, - value: locked_token_amount.clone(), - }, - TxTokenTransfer { - token_identifier: WEGLD_TOKEN_ID.to_vec(), - nonce: 0, - value: other_token_amount.clone(), - }, - ]; - - // add liquidity - let pair_addr = setup.pair_wrapper.address_ref().clone(); - setup - .b_mock - .execute_esdt_multi_transfer(&first_user, &setup.proxy_wrapper, &payments, |sc| { - sc.add_liquidity_proxy( - managed_address!(&pair_addr), - managed_biguint!(locked_token_amount.to_u64().unwrap()), - managed_biguint!(other_token_amount.to_u64().unwrap()), - ); - }) - .assert_ok(); - - setup.b_mock.check_nft_balance( - &first_user, - WRAPPED_LP_TOKEN_ID, - 1, - &expected_lp_token_amount, - Some(&WrappedLpTokenAttributes:: { - locked_tokens: EsdtTokenPayment { - token_identifier: managed_token_id!(LOCKED_TOKEN_ID), - token_nonce: 1, - amount: managed_biguint!(locked_token_amount.to_u64().unwrap()), - }, - lp_token_id: managed_token_id!(LP_TOKEN_ID), - lp_token_amount: managed_biguint!(expected_lp_token_amount.to_u64().unwrap()), - }), - ); - - let block_epoch = 1u64; - let user_balance = USER_BALANCE; - setup - .b_mock - .execute_query(&setup.simple_lock_wrapper, |sc| { - let unlock_epoch = LOCK_OPTIONS[0]; - let lock_epochs = unlock_epoch - block_epoch; - let expected_energy_amount = - BigInt::from((user_balance) as i64) * BigInt::from(lock_epochs as i64); - let expected_energy = Energy::new( - expected_energy_amount, - block_epoch, - managed_biguint!(user_balance), - ); - let actual_energy = sc.user_energy(&managed_address!(&first_user)).get(); - assert_eq!(expected_energy, actual_energy); - }) - .assert_ok(); - - let farm_locked_addr = setup.farm_locked_wrapper.address_ref().clone(); - - //////////////////////////////////////////// ENTER FARM ///////////////////////////////////// - - let mut current_epoch = 5; - setup.b_mock.set_block_epoch(current_epoch); - - setup - .b_mock - .execute_esdt_transfer( - &first_user, - &setup.proxy_wrapper, - WRAPPED_LP_TOKEN_ID, - 1, - &expected_lp_token_amount, - |sc| { - sc.enter_farm_proxy_endpoint( - managed_address!(&farm_locked_addr), - OptionalValue::None, - ); - }, - ) - .assert_ok(); - - let expected_energy = rust_biguint!(LOCK_OPTIONS[0] - current_epoch) * USER_BALANCE; - setup - .b_mock - .execute_query(&setup.simple_lock_wrapper, |sc| { - let managed_result = sc.get_energy_amount_for_user(managed_address!(&first_user)); - let result = to_rust_biguint(managed_result); - assert_eq!(result, expected_energy); - }) - .assert_ok(); - - // check user balance - setup.b_mock.check_nft_balance( - &first_user, - WRAPPED_FARM_TOKEN_ID, - 1, - &expected_lp_token_amount, - Some(&WrappedFarmTokenAttributes:: { - proxy_farming_token: EsdtTokenPayment { - token_identifier: managed_token_id!(WRAPPED_LP_TOKEN_ID), - token_nonce: 1, - amount: managed_biguint!(expected_lp_token_amount.to_u64().unwrap()), - }, - farm_token: EsdtTokenPayment { - token_identifier: managed_token_id!(FARM_LOCKED_TOKEN_ID), - token_nonce: 1, - amount: managed_biguint!(expected_lp_token_amount.to_u64().unwrap()), - }, - }), - ); - - // check proxy balance - setup - .b_mock - .check_nft_balance::>( - setup.proxy_wrapper.address_ref(), - FARM_LOCKED_TOKEN_ID, - 1, - &expected_lp_token_amount, - None, - ); - - // check farm balance - setup.b_mock.check_esdt_balance( - setup.farm_locked_wrapper.address_ref(), - LP_TOKEN_ID, - &expected_lp_token_amount, - ); - - current_epoch += 5; // applies penalty on exit - setup.b_mock.set_block_epoch(current_epoch); - setup.b_mock.set_block_nonce(100); - - ////////////////////////////////////////////// DESTROY FARM ///////////////////////////////////// - - // should be 500_000_000, but ends up so due to approximations - let removed_locked_token_amount = rust_biguint!(499_999_000); - // should be 250_000_000, but ends up so due to approximations - let removed_other_token_amount = rust_biguint!(249_999_500); - // exit with partial amount - setup - .b_mock - .execute_esdt_transfer( - &first_user, - &setup.proxy_wrapper, - WRAPPED_FARM_TOKEN_ID, - 1, - &(expected_lp_token_amount.clone() / rust_biguint!(2)), - |sc| { - let output_payments = sc.destroy_farm_proxy( - managed_address!(&farm_locked_addr), - managed_address!(&pair_addr), - managed_biguint!(1), - managed_biguint!(1), - OptionalValue::None, - ); - - let output_vec = output_payments.to_vec(); - - assert_eq!(output_payments.len(), 3); - assert_eq!( - output_vec.get(0).amount.to_u64().unwrap(), - removed_locked_token_amount.to_u64().unwrap() - ); - assert_eq!( - output_vec.get(1).amount.to_u64().unwrap(), - removed_other_token_amount.to_u64().unwrap() - ); - assert_eq!(output_vec.get(2).amount.to_u64().unwrap(), 0u64); - }, - ) - .assert_ok(); - - setup.b_mock.check_nft_balance::( - &first_user, - WRAPPED_FARM_TOKEN_ID, - 1, - &(&expected_lp_token_amount / 2u64), - None, - ); - - setup.b_mock.check_nft_balance::( - &first_user, - WRAPPED_LP_TOKEN_ID, - 1, - &rust_biguint!(0u64), - None, - ); -} diff --git a/locked-asset/simple-lock/tests/simple_lock_test_setup/mod.rs b/locked-asset/simple-lock/tests/simple_lock_test_setup/mod.rs deleted file mode 100644 index 92f145fba..000000000 --- a/locked-asset/simple-lock/tests/simple_lock_test_setup/mod.rs +++ /dev/null @@ -1,365 +0,0 @@ -#![allow(dead_code)] -#![allow(deprecated)] - -use common_structs::FarmTokenAttributes; -use multiversx_sc::codec::multi_types::OptionalValue; -use multiversx_sc::storage::mappers::StorageTokenWrapper; -use multiversx_sc::types::{Address, EsdtLocalRole, ManagedAddress, MultiValueEncoded}; -use multiversx_sc_scenario::whitebox_legacy::{TxContextStack, TxTokenTransfer}; -use multiversx_sc_scenario::{ - managed_address, managed_biguint, managed_token_id, rust_biguint, whitebox_legacy::*, DebugApi, -}; - -type RustBigUint = num_bigint::BigUint; - -use config::*; -use farm::exit_penalty::ExitPenaltyModule; -use farm::*; -use farm_boosted_yields::boosted_yields_factors::BoostedYieldsFactorsModule; -use farm_token::FarmTokenModule; -use pausable::{PausableModule, State}; - -// General -pub static MEX_TOKEN_ID: &[u8] = b"MEX-123456"; -pub static WEGLD_TOKEN_ID: &[u8] = b"WEGLD-123456"; -pub const EPOCHS_IN_YEAR: u64 = 360; -pub const USER_BALANCE: u64 = 1_000_000_000_000_000_000; - -// Pair -pub static LP_TOKEN_ID: &[u8] = b"LPTOK-123456"; - -// Farm -pub static FARM_LOCKED_TOKEN_ID: &[u8] = b"FARML-123456"; -pub const DIVISION_SAFETY_CONSTANT: u64 = 1_000_000_000_000_000_000; -pub const PER_BLOCK_REWARD_AMOUNT: u64 = 5_000; -pub const USER_REWARDS_BASE_CONST: u64 = 10; -pub const USER_REWARDS_ENERGY_CONST: u64 = 3; -pub const USER_REWARDS_FARM_CONST: u64 = 2; -pub const MIN_ENERGY_AMOUNT_FOR_BOOSTED_YIELDS: u64 = 1; -pub const MIN_FARM_AMOUNT_FOR_BOOSTED_YIELDS: u64 = 1; - -// Simple Lock -pub static LOCKED_TOKEN_ID: &[u8] = b"LOCKED-123456"; -pub static LEGACY_LOCKED_TOKEN_ID: &[u8] = b"LEGACY-123456"; -pub static LOCK_OPTIONS: &[u64] = &[EPOCHS_IN_YEAR, 5 * EPOCHS_IN_YEAR, 10 * EPOCHS_IN_YEAR]; // 1, 5 or 10 years -pub static PENALTY_PERCENTAGES: &[u64] = &[4_000, 6_000, 8_000]; - -// Proxy -pub static WRAPPED_LP_TOKEN_ID: &[u8] = b"WPLP-123456"; -pub static WRAPPED_FARM_TOKEN_ID: &[u8] = b"WPFARM-123456"; - -pub struct SimpleLockSetup -where - SimpleLockObjBuilder: 'static + Copy + Fn() -> simple_lock::ContractObj, - PairObjBuilder: 'static + Copy + Fn() -> pair::ContractObj, - FarmLockedObjBuilder: 'static + Copy + Fn() -> farm_with_locked_rewards::ContractObj, -{ - pub b_mock: BlockchainStateWrapper, - pub owner: Address, - pub first_user: Address, - pub second_user: Address, - pub simple_lock_wrapper: - ContractObjWrapper, SimpleLockObjBuilder>, - pub pair_wrapper: ContractObjWrapper, PairObjBuilder>, - pub farm_locked_wrapper: - ContractObjWrapper, FarmLockedObjBuilder>, -} - -impl - SimpleLockSetup -where - SimpleLockObjBuilder: 'static + Copy + Fn() -> simple_lock::ContractObj, - PairObjBuilder: 'static + Copy + Fn() -> pair::ContractObj, - FarmLockedObjBuilder: 'static + Copy + Fn() -> farm_with_locked_rewards::ContractObj, -{ - pub fn new(farm_builder: SimpleLockObjBuilder) -> Self { - let rust_zero = rust_biguint!(0u64); - let mut blockchain_wrapper = BlockchainStateWrapper::new(); - let owner_addr = blockchain_wrapper.create_user_account(&rust_zero); - let farm_wrapper = blockchain_wrapper.create_sc_account( - &rust_zero, - Some(&owner_addr), - farm_builder, - FARM_WASM_PATH, - ); - - // init farm contract - - blockchain_wrapper - .execute_tx(&owner_addr, &farm_wrapper, &rust_zero, |sc| { - let reward_token_id = managed_token_id!(MEX_TOKEN_ID); - let farming_token_id = managed_token_id!(LP_TOKEN_ID); - let division_safety_constant = managed_biguint!(DIVISION_SAFETY_CONSTANT); - let pair_address = managed_address!(&Address::zero()); - - sc.init( - reward_token_id, - farming_token_id, - division_safety_constant, - pair_address, - ManagedAddress::::zero(), - MultiValueEncoded::new(), - ); - - let farm_token_id = managed_token_id!(FARM_TOKEN_ID); - sc.farm_token().set_token_id(farm_token_id); - - sc.per_block_reward_amount() - .set(&managed_biguint!(PER_BLOCK_REWARD_AMOUNT)); - sc.minimum_farming_epochs().set(MIN_FARMING_EPOCHS); - sc.penalty_percent().set(PENALTY_PERCENT); - - sc.state().set(State::Active); - sc.produce_rewards_enabled().set(true); - }) - .assert_ok(); - - blockchain_wrapper - .execute_tx(&owner_addr, &farm_wrapper, &rust_biguint!(0), |sc| { - sc.set_boosted_yields_factors( - managed_biguint!(MAX_REWARDS_FACTOR), - managed_biguint!(USER_REWARDS_ENERGY_CONST), - managed_biguint!(USER_REWARDS_FARM_CONST), - managed_biguint!(MIN_ENERGY_AMOUNT_FOR_BOOSTED_YIELDS), - managed_biguint!(MIN_FARM_AMOUNT_FOR_BOOSTED_YIELDS), - ); - }) - .assert_ok(); - - let farm_token_roles = [ - EsdtLocalRole::NftCreate, - EsdtLocalRole::NftAddQuantity, - EsdtLocalRole::NftBurn, - ]; - blockchain_wrapper.set_esdt_local_roles( - farm_wrapper.address_ref(), - FARM_TOKEN_ID, - &farm_token_roles[..], - ); - - let farming_token_roles = [EsdtLocalRole::Burn]; - blockchain_wrapper.set_esdt_local_roles( - farm_wrapper.address_ref(), - LP_TOKEN_ID, - &farming_token_roles[..], - ); - - let reward_token_roles = [EsdtLocalRole::Mint]; - blockchain_wrapper.set_esdt_local_roles( - farm_wrapper.address_ref(), - MEX_TOKEN_ID, - &reward_token_roles[..], - ); - - let user_addr = blockchain_wrapper.create_user_account(&rust_biguint!(100_000_000)); - blockchain_wrapper.set_esdt_balance( - &user_addr, - LP_TOKEN_ID, - &rust_biguint!(USER_TOTAL_LP_TOKENS), - ); - - SingleUserFarmSetup { - blockchain_wrapper, - owner_address: owner_addr, - user_address: user_addr, - farm_wrapper, - } - } - - pub fn enter_farm( - &mut self, - farm_in_amount: u64, - additional_farm_tokens: &[TxTokenTransfer], - expected_farm_token_nonce: u64, - expected_reward_per_share: u64, - expected_entering_epoch: u64, - expected_compounded_reward: u64, - ) { - let mut payments = Vec::with_capacity(1 + additional_farm_tokens.len()); - payments.push(TxTokenTransfer { - token_identifier: LP_TOKEN_ID.to_vec(), - nonce: 0, - value: rust_biguint!(farm_in_amount), - }); - payments.extend_from_slice(additional_farm_tokens); - - let mut expected_total_out_amount = 0; - for payment in payments.iter() { - expected_total_out_amount += payment.value.to_u64_digits()[0]; - } - - let b_mock = &mut self.blockchain_wrapper; - b_mock - .execute_esdt_multi_transfer(&self.user_address, &self.farm_wrapper, &payments, |sc| { - let enter_farm_result = sc.enter_farm_endpoint(OptionalValue::None); - let (out_farm_token, _reward_token) = enter_farm_result.into_tuple(); - assert_eq!( - out_farm_token.token_identifier, - managed_token_id!(FARM_TOKEN_ID) - ); - assert_eq!(out_farm_token.token_nonce, expected_farm_token_nonce); - assert_eq!( - out_farm_token.amount, - managed_biguint!(expected_total_out_amount) - ); - }) - .assert_ok(); - - DebugApi::dummy(); - - let expected_attributes = FarmTokenAttributes:: { - reward_per_share: managed_biguint!(expected_reward_per_share), - entering_epoch: expected_entering_epoch, - compounded_reward: managed_biguint!(expected_compounded_reward), - current_farm_amount: managed_biguint!(expected_total_out_amount), - original_owner: managed_address!(&self.user_address), - }; - b_mock.check_nft_balance( - &self.user_address, - FARM_TOKEN_ID, - expected_farm_token_nonce, - &rust_biguint!(expected_total_out_amount), - Some(&expected_attributes), - ); - - let _ = TxContextStack::static_pop(); - } - - pub fn exit_farm( - &mut self, - farm_token_amount: u64, - farm_token_nonce: u64, - expected_mex_out: u64, - expected_farm_token_amount: u64, - expected_user_mex_balance: &RustBigUint, - expected_user_lp_token_balance: &RustBigUint, - ) { - let b_mock = &mut self.blockchain_wrapper; - b_mock - .execute_esdt_transfer( - &self.user_address, - &self.farm_wrapper, - FARM_TOKEN_ID, - farm_token_nonce, - &rust_biguint!(farm_token_amount), - |sc| { - let multi_result = sc.exit_farm_endpoint(OptionalValue::None); - - let (first_result, second_result) = multi_result.into_tuple(); - - assert_eq!( - first_result.token_identifier, - managed_token_id!(LP_TOKEN_ID) - ); - assert_eq!(first_result.token_nonce, 0); - assert_eq!( - first_result.amount, - managed_biguint!(expected_farm_token_amount) - ); - - assert_eq!( - second_result.token_identifier, - managed_token_id!(MEX_TOKEN_ID) - ); - assert_eq!(second_result.token_nonce, 0); - assert_eq!(second_result.amount, managed_biguint!(expected_mex_out)); - }, - ) - .assert_ok(); - - b_mock.check_esdt_balance(&self.user_address, MEX_TOKEN_ID, expected_user_mex_balance); - b_mock.check_esdt_balance( - &self.user_address, - LP_TOKEN_ID, - expected_user_lp_token_balance, - ); - } - - #[allow(clippy::too_many_arguments)] - pub fn claim_rewards( - &mut self, - farm_token_amount: u64, - farm_token_nonce: u64, - expected_mex_out: u64, - expected_user_mex_balance: &RustBigUint, - expected_user_lp_token_balance: &RustBigUint, - expected_farm_token_nonce_out: u64, - expected_reward_per_share: u64, - ) { - let b_mock = &mut self.blockchain_wrapper; - b_mock - .execute_esdt_transfer( - &self.user_address, - &self.farm_wrapper, - FARM_TOKEN_ID, - farm_token_nonce, - &rust_biguint!(farm_token_amount), - |sc| { - let multi_result = sc.claim_rewards_endpoint(OptionalValue::None); - - let (first_result, second_result) = multi_result.into_tuple(); - - assert_eq!( - first_result.token_identifier, - managed_token_id!(FARM_TOKEN_ID) - ); - assert_eq!(first_result.token_nonce, expected_farm_token_nonce_out); - assert_eq!(first_result.amount, managed_biguint!(farm_token_amount)); - - assert_eq!( - second_result.token_identifier, - managed_token_id!(MEX_TOKEN_ID) - ); - assert_eq!(second_result.token_nonce, 0); - assert_eq!(second_result.amount, managed_biguint!(expected_mex_out)); - }, - ) - .assert_ok(); - - DebugApi::dummy(); - let expected_attributes = FarmTokenAttributes:: { - reward_per_share: managed_biguint!(expected_reward_per_share), - entering_epoch: 0, - compounded_reward: managed_biguint!(0), - current_farm_amount: managed_biguint!(farm_token_amount), - original_owner: managed_address!(&self.user_address), - }; - - b_mock.check_nft_balance( - &self.user_address, - FARM_TOKEN_ID, - expected_farm_token_nonce_out, - &rust_biguint!(farm_token_amount), - Some(&expected_attributes), - ); - b_mock.check_esdt_balance(&self.user_address, MEX_TOKEN_ID, expected_user_mex_balance); - b_mock.check_esdt_balance( - &self.user_address, - LP_TOKEN_ID, - expected_user_lp_token_balance, - ); - - let _ = TxContextStack::static_pop(); - } - - pub fn check_farm_token_supply(&mut self, expected_farm_token_supply: u64) { - let b_mock = &mut self.blockchain_wrapper; - b_mock - .execute_query(&self.farm_wrapper, |sc| { - let actual_farm_supply = sc.farm_token_supply().get(); - assert_eq!( - managed_biguint!(expected_farm_token_supply), - actual_farm_supply - ); - }) - .assert_ok(); - } - - pub fn set_block_nonce(&mut self, block_nonce: u64) { - self.blockchain_wrapper.set_block_nonce(block_nonce); - } - - pub fn set_block_epoch(&mut self, block_epoch: u64) { - self.blockchain_wrapper.set_block_epoch(block_epoch); - } -} From ea688d7da250a55dc2b25188d8d1fb4ab130e3b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Tue, 20 Feb 2024 13:36:15 +0200 Subject: [PATCH 184/213] Fix clippy --- energy-integration/governance-v2/tests/gov_rust_test.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/energy-integration/governance-v2/tests/gov_rust_test.rs b/energy-integration/governance-v2/tests/gov_rust_test.rs index bd9dcbf17..342655adf 100644 --- a/energy-integration/governance-v2/tests/gov_rust_test.rs +++ b/energy-integration/governance-v2/tests/gov_rust_test.rs @@ -71,7 +71,7 @@ fn gov_propose_test() { .b_mock .execute_query(&gov_setup.gov_wrapper, |sc| { let proposal = sc.proposals().get(1); - let action = proposal.actions.get(0).unwrap(); + let action = proposal.actions.first().unwrap(); let mut args_managed = ManagedVec::new(); args_managed.push(managed_buffer!(&1_000u64.to_be_bytes())); From 39cefd6953f3db9810d2d7310a75402877c88e46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Thu, 22 Feb 2024 12:12:09 +0200 Subject: [PATCH 185/213] Fixes after review --- dex/farm/tests/farm_single_user_test.rs | 17 +++-- locked-asset/proxy_dex/src/proxy_farm.rs | 23 +++++-- .../proxy_dex/tests/proxy_farm_test.rs | 9 +-- locked-asset/simple-lock/src/proxy_farm.rs | 65 +++++++------------ 4 files changed, 56 insertions(+), 58 deletions(-) diff --git a/dex/farm/tests/farm_single_user_test.rs b/dex/farm/tests/farm_single_user_test.rs index f1262efe0..5cef9bf08 100644 --- a/dex/farm/tests/farm_single_user_test.rs +++ b/dex/farm/tests/farm_single_user_test.rs @@ -849,19 +849,24 @@ fn test_destroy_farm_through_simple_lock() { let claim_result = sc.destroy_farm_locked_tokens(managed_biguint!(1), managed_biguint!(1)); - let (first_token_payment_out, second_token_payment_out) = claim_result.into_tuple(); - assert_eq!( - first_token_payment_out.token_identifier, + claim_result.first_payment.token_identifier, managed_token_id!(WEGLD_TOKEN_ID) ); - assert_eq!(first_token_payment_out.amount, managed_biguint!(9_999_000)); + assert_eq!(claim_result.first_payment.amount, managed_biguint!(9_999_000)); assert_eq!( - second_token_payment_out.token_identifier, + claim_result.second_payment.token_identifier, managed_token_id!(LOCKED_TOKEN_ID) ); - assert_eq!(second_token_payment_out.amount, managed_biguint!(9_999_000)); + assert_eq!(claim_result.second_payment.amount, managed_biguint!(9_999_000)); + + + assert_eq!( + claim_result.farm_rewards.token_identifier, + managed_token_id!(MEX_TOKEN_ID) + ); + assert_eq!(claim_result.farm_rewards.amount, managed_biguint!(0)); }, ) .assert_ok(); diff --git a/locked-asset/proxy_dex/src/proxy_farm.rs b/locked-asset/proxy_dex/src/proxy_farm.rs index b642da727..a911d1e56 100644 --- a/locked-asset/proxy_dex/src/proxy_farm.rs +++ b/locked-asset/proxy_dex/src/proxy_farm.rs @@ -22,6 +22,14 @@ pub type EnterFarmProxyResultType = MultiValue2, EsdtToke pub type ExitFarmProxyResultType = MultiValue2, EsdtTokenPayment>; pub type ClaimRewardsFarmProxyResultType = MultiValue2, EsdtTokenPayment>; +#[derive(TypeAbi, TopEncode, TopDecode, NestedEncode, NestedDecode)] +pub struct DestroyFarmResultType { + pub first_payment: EsdtTokenPayment, + pub second_payment: EsdtTokenPayment, + pub farm_rewards: EsdtTokenPayment, +} + + #[multiversx_sc::module] pub trait ProxyFarmModule: crate::proxy_common::ProxyCommonModule @@ -243,7 +251,8 @@ pub trait ProxyFarmModule: first_token_amount_min: BigUint, second_token_amount_min: BigUint, opt_original_caller: OptionalValue, - ) -> MultiValueEncoded { + ) -> DestroyFarmResultType { + self.require_is_intermediated_farm(&farm_address); self.require_wrapped_farm_token_id_not_empty(); self.require_wrapped_lp_token_id_not_empty(); @@ -282,7 +291,7 @@ pub trait ProxyFarmModule: exit_result.farming_tokens.amount, ); - let mut output_payments = self.remove_liquidity_proxy_common( + let mut remove_liquidity_result = self.remove_liquidity_proxy_common( initial_proxy_farming_tokens.clone(), pair_address, first_token_amount_min, @@ -293,9 +302,9 @@ pub trait ProxyFarmModule: wrapped_farm_token_mapper.nft_burn(payment.token_nonce, &payment.amount); // Push farm rewards - output_payments.push(exit_result.reward_tokens.clone()); + remove_liquidity_result.push(exit_result.reward_tokens.clone()); - self.send_multiple_tokens_if_not_zero(&caller, &output_payments); + self.send_multiple_tokens_if_not_zero(&caller, &remove_liquidity_result); self.emit_exit_farm_proxy_event( &original_caller, @@ -305,7 +314,11 @@ pub trait ProxyFarmModule: exit_result.reward_tokens.clone(), ); - output_payments.into() + DestroyFarmResultType{ + first_payment: remove_liquidity_result.get(0), + second_payment: remove_liquidity_result.get(1), + farm_rewards: exit_result.reward_tokens + } } fn handle_farm_penalty_and_get_output_proxy_farming_token( diff --git a/locked-asset/proxy_dex/tests/proxy_farm_test.rs b/locked-asset/proxy_dex/tests/proxy_farm_test.rs index 9018b972c..c4bc87b70 100644 --- a/locked-asset/proxy_dex/tests/proxy_farm_test.rs +++ b/locked-asset/proxy_dex/tests/proxy_farm_test.rs @@ -1617,18 +1617,15 @@ fn destroy_farm_locked_tokens_test() { OptionalValue::None, ); - let output_vec = output_payments.to_vec(); - - assert_eq!(output_payments.len(), 3); assert_eq!( - output_vec.get(0).amount.to_u64().unwrap(), + output_payments.first_payment.amount.to_u64().unwrap(), removed_locked_token_amount.to_u64().unwrap() ); assert_eq!( - output_vec.get(1).amount.to_u64().unwrap(), + output_payments.second_payment.amount.to_u64().unwrap(), removed_other_token_amount.to_u64().unwrap() ); - assert_eq!(output_vec.get(2).amount.to_u64().unwrap(), 0u64); + assert_eq!(output_payments.farm_rewards.amount.to_u64().unwrap(), 0u64); }, ) .assert_ok(); diff --git a/locked-asset/simple-lock/src/proxy_farm.rs b/locked-asset/simple-lock/src/proxy_farm.rs index 5932e26a2..c84c2270e 100644 --- a/locked-asset/simple-lock/src/proxy_farm.rs +++ b/locked-asset/simple-lock/src/proxy_farm.rs @@ -1,9 +1,7 @@ multiversx_sc::imports!(); multiversx_sc::derive_imports!(); -use crate::{ - error_messages::*, locked_token::PreviousStatusFlag, proxy_lp::LpProxyTokenAttributes, -}; +use crate::{error_messages::*, proxy_lp::LpProxyTokenAttributes}; #[derive( TypeAbi, TopEncode, TopDecode, NestedEncode, NestedDecode, PartialEq, Debug, Clone, Copy, @@ -28,6 +26,13 @@ pub type FarmClaimRewardsThroughProxyResultType = MultiValue2, EsdtTokenPayment>; pub type FarmCompoundRewardsThroughProxyResultType = EsdtTokenPayment; +#[derive(TypeAbi, TopEncode, TopDecode, NestedEncode, NestedDecode)] +pub struct DestroyFarmResultType { + pub first_payment: EsdtTokenPayment, + pub second_payment: EsdtTokenPayment, + pub farm_rewards: EsdtTokenPayment, +} + #[multiversx_sc::module] pub trait ProxyFarmModule: crate::farm_interactions::FarmInteractionsModule @@ -263,7 +268,7 @@ pub trait ProxyFarmModule: &self, first_token_min_amount_out: BigUint, second_token_min_amount_out: BigUint, - ) -> ExitFarmThroughProxyResultType { + ) -> DestroyFarmResultType { let payment: EsdtTokenPayment = self.call_value().single_esdt(); let farm_proxy_token_attributes: FarmProxyTokenAttributes = @@ -278,7 +283,7 @@ pub trait ProxyFarmModule: farm_address, farm_proxy_token_attributes.farm_token_id, farm_proxy_token_attributes.farm_token_nonce, - payment.amount, + payment.amount.clone(), caller.clone(), ); require!( @@ -296,45 +301,23 @@ pub trait ProxyFarmModule: ); } - let initial_farming_tokens = exit_farm_result.initial_farming_tokens; - - // get LOCKED_LP nonce - let locked_lp_nonce = farm_proxy_token_attributes.farming_token_locked_nonce; - let lp_proxy_token_mapper = self.lp_proxy_token(); - let lp_proxy_token_attributes: LpProxyTokenAttributes = - lp_proxy_token_mapper.get_token_attributes(locked_lp_nonce); - - // get LP address - let lp_address = self - .lp_address_for_token_pair( - &lp_proxy_token_attributes.first_token_id, - &lp_proxy_token_attributes.second_token_id, + let (first_payment, second_payment) = self + .remove_liquidity_locked_token_common( + exit_farm_result.initial_farming_tokens, + first_token_min_amount_out, + second_token_min_amount_out, ) - .get(); - - let remove_liq_result = self.call_pair_remove_liquidity( - lp_address, - lp_proxy_token_attributes.lp_token_id, - initial_farming_tokens.amount, - first_token_min_amount_out, - second_token_min_amount_out, - &lp_proxy_token_attributes.first_token_id, - &lp_proxy_token_attributes.second_token_id, - ); + .into_tuple(); - let caller = self.blockchain().get_caller(); - let first_token_result_payment = self.send_tokens_optimal_status( - &caller, - remove_liq_result.first_token_payment_out, - PreviousStatusFlag::new(lp_proxy_token_attributes.first_token_locked_nonce), - ); - let second_token_result_payment = self.send_tokens_optimal_status( - &caller, - remove_liq_result.second_token_payment_out, - PreviousStatusFlag::new(lp_proxy_token_attributes.second_token_locked_nonce), - ); + // Burn farm token + let farm_proxy_token_mapper = self.farm_proxy_token(); + farm_proxy_token_mapper.nft_burn(payment.token_nonce, &payment.amount); - (first_token_result_payment, second_token_result_payment).into() + DestroyFarmResultType { + first_payment, + second_payment, + farm_rewards: exit_farm_result.reward_tokens, + } } /// Claim rewards from a previously entered farm. From ce739aa1b7546b97443c910ae3e656408997d75d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Thu, 22 Feb 2024 15:16:41 +0200 Subject: [PATCH 186/213] destroy_farm_proxy: Check pair_address is legitimate --- locked-asset/proxy_dex/src/proxy_farm.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/locked-asset/proxy_dex/src/proxy_farm.rs b/locked-asset/proxy_dex/src/proxy_farm.rs index a911d1e56..cacc5db9c 100644 --- a/locked-asset/proxy_dex/src/proxy_farm.rs +++ b/locked-asset/proxy_dex/src/proxy_farm.rs @@ -254,6 +254,7 @@ pub trait ProxyFarmModule: ) -> DestroyFarmResultType { self.require_is_intermediated_farm(&farm_address); + self.require_is_intermediated_pair(&farm_address); self.require_wrapped_farm_token_id_not_empty(); self.require_wrapped_lp_token_id_not_empty(); From dad54239b0d9329b3c3ad500cc29ee3693b54aca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Thu, 22 Feb 2024 15:17:47 +0200 Subject: [PATCH 187/213] simple-lock/destroy_farm_locked_tokens: Burn farm proxy token --- locked-asset/simple-lock/src/proxy_farm.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/locked-asset/simple-lock/src/proxy_farm.rs b/locked-asset/simple-lock/src/proxy_farm.rs index c84c2270e..e03e20da2 100644 --- a/locked-asset/simple-lock/src/proxy_farm.rs +++ b/locked-asset/simple-lock/src/proxy_farm.rs @@ -345,7 +345,7 @@ pub trait ProxyFarmModule: farm_address, farm_proxy_token_attributes.farm_token_id.clone(), farm_proxy_token_attributes.farm_token_nonce, - payment.amount, + payment.amount.clone(), caller.clone(), ); require!( @@ -357,6 +357,10 @@ pub trait ProxyFarmModule: farm_proxy_token_attributes.farm_token_nonce = claim_rewards_result.new_farm_tokens.token_nonce; + // Burn farm token + let farm_proxy_token_mapper = self.farm_proxy_token(); + farm_proxy_token_mapper.nft_burn(payment.token_nonce, &payment.amount); + let new_proxy_token_payment = self.farm_proxy_token().nft_create_and_send( &caller, claim_rewards_result.new_farm_tokens.amount, From adf0267446bbb474158e46eaf0e6fec193e09d89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Thu, 22 Feb 2024 15:19:56 +0200 Subject: [PATCH 188/213] Cargo format --- dex/farm/tests/farm_single_user_test.rs | 11 ++++++++--- locked-asset/proxy_dex/src/proxy_farm.rs | 6 ++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/dex/farm/tests/farm_single_user_test.rs b/dex/farm/tests/farm_single_user_test.rs index 5cef9bf08..6ff0a3d3a 100644 --- a/dex/farm/tests/farm_single_user_test.rs +++ b/dex/farm/tests/farm_single_user_test.rs @@ -853,14 +853,19 @@ fn test_destroy_farm_through_simple_lock() { claim_result.first_payment.token_identifier, managed_token_id!(WEGLD_TOKEN_ID) ); - assert_eq!(claim_result.first_payment.amount, managed_biguint!(9_999_000)); + assert_eq!( + claim_result.first_payment.amount, + managed_biguint!(9_999_000) + ); assert_eq!( claim_result.second_payment.token_identifier, managed_token_id!(LOCKED_TOKEN_ID) ); - assert_eq!(claim_result.second_payment.amount, managed_biguint!(9_999_000)); - + assert_eq!( + claim_result.second_payment.amount, + managed_biguint!(9_999_000) + ); assert_eq!( claim_result.farm_rewards.token_identifier, diff --git a/locked-asset/proxy_dex/src/proxy_farm.rs b/locked-asset/proxy_dex/src/proxy_farm.rs index cacc5db9c..e64f39a36 100644 --- a/locked-asset/proxy_dex/src/proxy_farm.rs +++ b/locked-asset/proxy_dex/src/proxy_farm.rs @@ -29,7 +29,6 @@ pub struct DestroyFarmResultType { pub farm_rewards: EsdtTokenPayment, } - #[multiversx_sc::module] pub trait ProxyFarmModule: crate::proxy_common::ProxyCommonModule @@ -252,7 +251,6 @@ pub trait ProxyFarmModule: second_token_amount_min: BigUint, opt_original_caller: OptionalValue, ) -> DestroyFarmResultType { - self.require_is_intermediated_farm(&farm_address); self.require_is_intermediated_pair(&farm_address); self.require_wrapped_farm_token_id_not_empty(); @@ -315,10 +313,10 @@ pub trait ProxyFarmModule: exit_result.reward_tokens.clone(), ); - DestroyFarmResultType{ + DestroyFarmResultType { first_payment: remove_liquidity_result.get(0), second_payment: remove_liquidity_result.get(1), - farm_rewards: exit_result.reward_tokens + farm_rewards: exit_result.reward_tokens, } } From e76036559d97ddbc39ebb9a28c44b66165a62194 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Thu, 22 Feb 2024 17:37:04 +0200 Subject: [PATCH 189/213] simple-lock: Remove burn of wrapped farm token from destroy and claim rewards --- locked-asset/proxy_dex/src/proxy_pair.rs | 8 ++++++++ locked-asset/simple-lock/src/proxy_farm.rs | 17 ++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/locked-asset/proxy_dex/src/proxy_pair.rs b/locked-asset/proxy_dex/src/proxy_pair.rs index 79542f06a..e580285e1 100644 --- a/locked-asset/proxy_dex/src/proxy_pair.rs +++ b/locked-asset/proxy_dex/src/proxy_pair.rs @@ -9,6 +9,14 @@ use crate::wrapped_lp_attributes::{WrappedLpToken, WrappedLpTokenAttributes}; use common_structs::Epoch; use fixed_supply_token::FixedSupplyToken; + +#[derive(TypeAbi, TopEncode, TopDecode, NestedEncode, NestedDecode)] +pub struct RemoveLiquidityProxyCommon { + pub first_payment: EsdtTokenPayment, + pub second_payment: EsdtTokenPayment, + pub farm_rewards: EsdtTokenPayment, +} + #[multiversx_sc::module] pub trait ProxyPairModule: crate::proxy_common::ProxyCommonModule diff --git a/locked-asset/simple-lock/src/proxy_farm.rs b/locked-asset/simple-lock/src/proxy_farm.rs index e03e20da2..33184ca3f 100644 --- a/locked-asset/simple-lock/src/proxy_farm.rs +++ b/locked-asset/simple-lock/src/proxy_farm.rs @@ -301,18 +301,21 @@ pub trait ProxyFarmModule: ); } + let locked_lp_nonce = farm_proxy_token_attributes.farming_token_locked_nonce; + let lp_proxy_token_mapper = self.lp_proxy_token(); + let (first_payment, second_payment) = self .remove_liquidity_locked_token_common( - exit_farm_result.initial_farming_tokens, + EsdtTokenPayment::new( + lp_proxy_token_mapper.get_token_id(), + locked_lp_nonce, + exit_farm_result.initial_farming_tokens.amount, + ), first_token_min_amount_out, second_token_min_amount_out, ) .into_tuple(); - // Burn farm token - let farm_proxy_token_mapper = self.farm_proxy_token(); - farm_proxy_token_mapper.nft_burn(payment.token_nonce, &payment.amount); - DestroyFarmResultType { first_payment, second_payment, @@ -357,10 +360,6 @@ pub trait ProxyFarmModule: farm_proxy_token_attributes.farm_token_nonce = claim_rewards_result.new_farm_tokens.token_nonce; - // Burn farm token - let farm_proxy_token_mapper = self.farm_proxy_token(); - farm_proxy_token_mapper.nft_burn(payment.token_nonce, &payment.amount); - let new_proxy_token_payment = self.farm_proxy_token().nft_create_and_send( &caller, claim_rewards_result.new_farm_tokens.amount, From f865799617bef6673b99711ec5e128193ddbdbb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Costin=20Caraba=C8=99?= Date: Thu, 22 Feb 2024 17:51:49 +0200 Subject: [PATCH 190/213] Small fix --- locked-asset/proxy_dex/src/proxy_farm.rs | 2 +- locked-asset/proxy_dex/tests/proxy_farm_test.rs | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/locked-asset/proxy_dex/src/proxy_farm.rs b/locked-asset/proxy_dex/src/proxy_farm.rs index e64f39a36..1064a1708 100644 --- a/locked-asset/proxy_dex/src/proxy_farm.rs +++ b/locked-asset/proxy_dex/src/proxy_farm.rs @@ -252,7 +252,7 @@ pub trait ProxyFarmModule: opt_original_caller: OptionalValue, ) -> DestroyFarmResultType { self.require_is_intermediated_farm(&farm_address); - self.require_is_intermediated_pair(&farm_address); + self.require_is_intermediated_pair(&pair_address); self.require_wrapped_farm_token_id_not_empty(); self.require_wrapped_lp_token_id_not_empty(); diff --git a/locked-asset/proxy_dex/tests/proxy_farm_test.rs b/locked-asset/proxy_dex/tests/proxy_farm_test.rs index c4bc87b70..3bc24e494 100644 --- a/locked-asset/proxy_dex/tests/proxy_farm_test.rs +++ b/locked-asset/proxy_dex/tests/proxy_farm_test.rs @@ -17,10 +17,7 @@ use multiversx_sc_scenario::{ }; use num_traits::ToPrimitive; use proxy_dex::{ - proxy_farm::ProxyFarmModule, proxy_pair::ProxyPairModule, - wrapped_farm_attributes::WrappedFarmTokenAttributes, - wrapped_farm_token_merge::WrappedFarmTokenMerge, - wrapped_lp_attributes::WrappedLpTokenAttributes, + proxy_farm::ProxyFarmModule, proxy_pair::ProxyPairModule, wrapped_farm_attributes::WrappedFarmTokenAttributes, wrapped_farm_token_merge::WrappedFarmTokenMerge, wrapped_lp_attributes::WrappedLpTokenAttributes }; use proxy_dex_test_setup::*; use simple_lock::locked_token::LockedTokenAttributes; From 31779fa682585264e3af07376cd9d2e31f4774b7 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Tue, 27 Feb 2024 16:34:42 +0200 Subject: [PATCH 191/213] remove RemoveLiquidityProxyCommon struct --- locked-asset/proxy_dex/src/proxy_pair.rs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/locked-asset/proxy_dex/src/proxy_pair.rs b/locked-asset/proxy_dex/src/proxy_pair.rs index e580285e1..79542f06a 100644 --- a/locked-asset/proxy_dex/src/proxy_pair.rs +++ b/locked-asset/proxy_dex/src/proxy_pair.rs @@ -9,14 +9,6 @@ use crate::wrapped_lp_attributes::{WrappedLpToken, WrappedLpTokenAttributes}; use common_structs::Epoch; use fixed_supply_token::FixedSupplyToken; - -#[derive(TypeAbi, TopEncode, TopDecode, NestedEncode, NestedDecode)] -pub struct RemoveLiquidityProxyCommon { - pub first_payment: EsdtTokenPayment, - pub second_payment: EsdtTokenPayment, - pub farm_rewards: EsdtTokenPayment, -} - #[multiversx_sc::module] pub trait ProxyPairModule: crate::proxy_common::ProxyCommonModule From b71714e248cd21690a510fd242ce3bf79498635b Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Wed, 28 Feb 2024 12:28:10 +0200 Subject: [PATCH 192/213] Remove payable from claim boosted rewards endpoint --- .../farm-staking/src/claim_only_boosted_staking_rewards.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs b/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs index 71e7ab9e3..b13ccc62d 100644 --- a/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs +++ b/farm-staking/farm-staking/src/claim_only_boosted_staking_rewards.rs @@ -24,7 +24,6 @@ pub trait ClaimOnlyBoostedStakingRewardsModule: + farm_boosted_yields::boosted_yields_factors::BoostedYieldsFactorsModule + crate::custom_rewards::CustomRewardsModule { - #[payable("*")] #[endpoint(claimBoostedRewards)] fn claim_boosted_rewards(&self, opt_user: OptionalValue) -> EsdtTokenPayment { let caller = self.blockchain().get_caller(); From a70bbc7225446e63e5c841a42452760222d5f85f Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Wed, 28 Feb 2024 12:32:45 +0200 Subject: [PATCH 193/213] repo build update --- energy-integration/governance-v2/wasm/src/lib.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/energy-integration/governance-v2/wasm/src/lib.rs b/energy-integration/governance-v2/wasm/src/lib.rs index d3c597f9f..bb977bc97 100644 --- a/energy-integration/governance-v2/wasm/src/lib.rs +++ b/energy-integration/governance-v2/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 29 +// Endpoints: 30 // Async Callback (empty): 1 -// Total number of exported functions: 31 +// Total number of exported functions: 32 #![no_std] #![allow(internal_features)] @@ -42,6 +42,7 @@ multiversx_sc_wasm_adapter::endpoints! { getUserVotedProposals => user_voted_proposals getProposalVotes => proposal_votes getProposalStatus => get_proposal_status + changeFeesCollectorAddress => change_fees_collector_address getFeesCollectorAddress => fees_collector_address setEnergyFactoryAddress => set_energy_factory_address getEnergyFactoryAddress => energy_factory_address From a3c65a8162a73fea78d4ae42eb69b57fb6469dd2 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Thu, 29 Feb 2024 14:44:31 +0200 Subject: [PATCH 194/213] Increase energy for proxy LP tokens fix --- locked-asset/proxy_dex/src/proxy_farm.rs | 7 +- .../proxy_dex/tests/proxy_farm_test.rs | 97 ++++++++++++++++--- 2 files changed, 88 insertions(+), 16 deletions(-) diff --git a/locked-asset/proxy_dex/src/proxy_farm.rs b/locked-asset/proxy_dex/src/proxy_farm.rs index 1064a1708..14642cfe5 100644 --- a/locked-asset/proxy_dex/src/proxy_farm.rs +++ b/locked-asset/proxy_dex/src/proxy_farm.rs @@ -462,8 +462,11 @@ pub trait ProxyFarmModule: == wrapped_lp_token_id { let wrapped_lp_mapper = self.wrapped_lp_token(); - let wrapped_lp_attributes: WrappedLpTokenAttributes = - self.get_attributes_as_part_of_fixed_supply(&payment, &wrapped_lp_mapper); + let wrapped_lp_attributes: WrappedLpTokenAttributes = self + .get_attributes_as_part_of_fixed_supply( + &wrapped_farm_attributes.proxy_farming_token, + &wrapped_lp_mapper, + ); let new_locked_tokens = self.increase_proxy_pair_token_energy( caller.clone(), lock_epochs, diff --git a/locked-asset/proxy_dex/tests/proxy_farm_test.rs b/locked-asset/proxy_dex/tests/proxy_farm_test.rs index 3bc24e494..ad0917915 100644 --- a/locked-asset/proxy_dex/tests/proxy_farm_test.rs +++ b/locked-asset/proxy_dex/tests/proxy_farm_test.rs @@ -17,7 +17,10 @@ use multiversx_sc_scenario::{ }; use num_traits::ToPrimitive; use proxy_dex::{ - proxy_farm::ProxyFarmModule, proxy_pair::ProxyPairModule, wrapped_farm_attributes::WrappedFarmTokenAttributes, wrapped_farm_token_merge::WrappedFarmTokenMerge, wrapped_lp_attributes::WrappedLpTokenAttributes + proxy_farm::ProxyFarmModule, proxy_pair::ProxyPairModule, + wrapped_farm_attributes::WrappedFarmTokenAttributes, + wrapped_farm_token_merge::WrappedFarmTokenMerge, + wrapped_lp_attributes::WrappedLpTokenAttributes, }; use proxy_dex_test_setup::*; use simple_lock::locked_token::LockedTokenAttributes; @@ -1305,15 +1308,27 @@ fn increase_proxy_farm_proxy_lp_energy() { }, ]; - // add liquidity + // add liquidity twice, to have 2 nonces let pair_addr = setup.pair_wrapper.address_ref().clone(); setup .b_mock .execute_esdt_multi_transfer(&first_user, &setup.proxy_wrapper, &payments, |sc| { sc.add_liquidity_proxy( managed_address!(&pair_addr), - managed_biguint!(locked_token_amount.to_u64().unwrap()), - managed_biguint!(other_token_amount.to_u64().unwrap()), + managed_biguint!(locked_token_amount.to_u64().unwrap() / 2), + managed_biguint!(other_token_amount.to_u64().unwrap() / 2), + ); + }) + .assert_ok(); + + let pair_addr = setup.pair_wrapper.address_ref().clone(); + setup + .b_mock + .execute_esdt_multi_transfer(&first_user, &setup.proxy_wrapper, &payments, |sc| { + sc.add_liquidity_proxy( + managed_address!(&pair_addr), + managed_biguint!(locked_token_amount.to_u64().unwrap() / 2), + managed_biguint!(other_token_amount.to_u64().unwrap() / 2), ); }) .assert_ok(); @@ -1343,6 +1358,7 @@ fn increase_proxy_farm_proxy_lp_energy() { //////////////////////////////////////////// ENTER FARM ///////////////////////////////////// + // Enter multiple times, to distribute the nonces setup .b_mock .execute_esdt_transfer( @@ -1350,7 +1366,58 @@ fn increase_proxy_farm_proxy_lp_energy() { &setup.proxy_wrapper, WRAPPED_LP_TOKEN_ID, 1, - &expected_lp_token_amount, + &(&expected_lp_token_amount / &rust_biguint!(4u64)), + |sc| { + sc.enter_farm_proxy_endpoint( + managed_address!(&farm_locked_addr), + OptionalValue::None, + ); + }, + ) + .assert_ok(); + + setup + .b_mock + .execute_esdt_transfer( + &first_user, + &setup.proxy_wrapper, + WRAPPED_LP_TOKEN_ID, + 2, + &(&expected_lp_token_amount / &rust_biguint!(4u64)), + |sc| { + sc.enter_farm_proxy_endpoint( + managed_address!(&farm_locked_addr), + OptionalValue::None, + ); + }, + ) + .assert_ok(); + + setup + .b_mock + .execute_esdt_transfer( + &first_user, + &setup.proxy_wrapper, + WRAPPED_LP_TOKEN_ID, + 1, + &(&expected_lp_token_amount / &rust_biguint!(4u64)), + |sc| { + sc.enter_farm_proxy_endpoint( + managed_address!(&farm_locked_addr), + OptionalValue::None, + ); + }, + ) + .assert_ok(); + + setup + .b_mock + .execute_esdt_transfer( + &first_user, + &setup.proxy_wrapper, + WRAPPED_LP_TOKEN_ID, + 2, + &(&expected_lp_token_amount / &rust_biguint!(4u64)), |sc| { sc.enter_farm_proxy_endpoint( managed_address!(&farm_locked_addr), @@ -1367,8 +1434,8 @@ fn increase_proxy_farm_proxy_lp_energy() { &first_user, &setup.proxy_wrapper, WRAPPED_FARM_TOKEN_ID, - 1, - &expected_lp_token_amount, + 4, + &(&expected_lp_token_amount / &rust_biguint!(4u64)), |sc| { sc.increase_proxy_farm_token_energy_endpoint(LOCK_OPTIONS[1]); }, @@ -1376,7 +1443,8 @@ fn increase_proxy_farm_proxy_lp_energy() { .assert_ok(); // check energy after - let user_locked_tokens_in_lp = locked_token_amount.to_u64().unwrap(); + // lp tokens recharged = total tokens / 4 - 500 + let user_locked_tokens_in_lp = locked_token_amount.to_u64().unwrap() / 4 - 500; setup .b_mock .execute_query(&setup.simple_lock_wrapper, |sc| { @@ -1397,21 +1465,22 @@ fn increase_proxy_farm_proxy_lp_energy() { .assert_ok(); // check user token after increase energy + // new farm token was created setup.b_mock.check_nft_balance( &first_user, WRAPPED_FARM_TOKEN_ID, - 2, - &expected_lp_token_amount, + 5, + &(&expected_lp_token_amount / &rust_biguint!(4u64)), Some(&WrappedFarmTokenAttributes:: { proxy_farming_token: EsdtTokenPayment { token_identifier: managed_token_id!(WRAPPED_LP_TOKEN_ID), - token_nonce: 2, - amount: managed_biguint!(expected_lp_token_amount.to_u64().unwrap()), + token_nonce: 3, + amount: managed_biguint!(expected_lp_token_amount.to_u64().unwrap() / 4u64), }, farm_token: EsdtTokenPayment { token_identifier: managed_token_id!(FARM_LOCKED_TOKEN_ID), - token_nonce: 1, - amount: managed_biguint!(expected_lp_token_amount.to_u64().unwrap()), + token_nonce: 4, + amount: managed_biguint!(expected_lp_token_amount.to_u64().unwrap() / 4u64), }, }), ); From ea82f7cff42507caa691ac5eda59812a301ba5a2 Mon Sep 17 00:00:00 2001 From: Claudiu Lataretu Date: Fri, 1 Mar 2024 12:01:06 +0200 Subject: [PATCH 195/213] proxy_dex: only create the wrapped lp token Signed-off-by: Claudiu Lataretu --- locked-asset/proxy_dex/src/proxy_farm.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/locked-asset/proxy_dex/src/proxy_farm.rs b/locked-asset/proxy_dex/src/proxy_farm.rs index 14642cfe5..95b96adb9 100644 --- a/locked-asset/proxy_dex/src/proxy_farm.rs +++ b/locked-asset/proxy_dex/src/proxy_farm.rs @@ -480,11 +480,8 @@ pub trait ProxyFarmModule: }; let new_token_amount = new_wrapped_lp_attributes.get_total_supply(); - let new_wrapped_lp = wrapped_lp_mapper.nft_create_and_send( - &caller, - new_token_amount, - &new_wrapped_lp_attributes, - ); + let new_wrapped_lp = + wrapped_lp_mapper.nft_create(new_token_amount, &new_wrapped_lp_attributes); self.send().esdt_local_burn( &wrapped_farm_attributes.proxy_farming_token.token_identifier, From 8e14d194651561537058ed5fd8a67016ae7625db Mon Sep 17 00:00:00 2001 From: Costin Carabas Date: Tue, 19 Mar 2024 18:17:11 +0200 Subject: [PATCH 196/213] Fix build_swap_output_payments when swap is perfect --- dex/pair/src/contexts/output_builder.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dex/pair/src/contexts/output_builder.rs b/dex/pair/src/contexts/output_builder.rs index 88b160807..1431c1991 100644 --- a/dex/pair/src/contexts/output_builder.rs +++ b/dex/pair/src/contexts/output_builder.rs @@ -137,7 +137,7 @@ pub trait OutputBuilderModule: )); } - if swap_context.final_input_amount < swap_context.input_token_amount { + if swap_context.final_input_amount <= swap_context.input_token_amount { let extra_amount = &swap_context.input_token_amount - &swap_context.final_input_amount; payments.push(EsdtTokenPayment::new( swap_context.input_token_id.clone(), From e53cf1abb236ab55f15041a75fc89f3411339f49 Mon Sep 17 00:00:00 2001 From: Costin Carabas Date: Tue, 19 Mar 2024 18:24:52 +0200 Subject: [PATCH 197/213] Test the fix --- dex/pair/tests/pair_rs_test.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dex/pair/tests/pair_rs_test.rs b/dex/pair/tests/pair_rs_test.rs index 5ff6fbce9..c7da73af2 100644 --- a/dex/pair/tests/pair_rs_test.rs +++ b/dex/pair/tests/pair_rs_test.rs @@ -60,6 +60,17 @@ fn test_swap_fixed_output() { pair_setup.swap_fixed_output(WEGLD_TOKEN_ID, 1_000, MEX_TOKEN_ID, 900, 96); } +#[test] +fn test_perfect_swap_fixed_output() { + let mut pair_setup = PairSetup::new(pair::contract_obj); + + pair_setup.add_liquidity( + 1_001_000, 1_000_000, 1_001_000, 1_000_000, 1_000_000, 1_001_000, 1_001_000, + ); + + pair_setup.swap_fixed_output(WEGLD_TOKEN_ID, 1_000, MEX_TOKEN_ID, 996, 0); +} + #[test] fn test_safe_price() { let mut pair_setup = PairSetup::new(pair::contract_obj); From 4db2d3882d5c8039aafd22facd4520cf1f3a7247 Mon Sep 17 00:00:00 2001 From: Costin Carabas Date: Wed, 20 Mar 2024 16:57:49 +0200 Subject: [PATCH 198/213] Fixes after audit --- dex/pair/src/contexts/output_builder.rs | 14 ++++++-------- dex/pair/tests/pair_rs_test.rs | 20 +++++++++++++++++++- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/dex/pair/src/contexts/output_builder.rs b/dex/pair/src/contexts/output_builder.rs index 1431c1991..3d98d16dc 100644 --- a/dex/pair/src/contexts/output_builder.rs +++ b/dex/pair/src/contexts/output_builder.rs @@ -137,14 +137,12 @@ pub trait OutputBuilderModule: )); } - if swap_context.final_input_amount <= swap_context.input_token_amount { - let extra_amount = &swap_context.input_token_amount - &swap_context.final_input_amount; - payments.push(EsdtTokenPayment::new( - swap_context.input_token_id.clone(), - 0, - extra_amount, - )); - } + let extra_amount = &swap_context.input_token_amount - &swap_context.final_input_amount; + payments.push(EsdtTokenPayment::new( + swap_context.input_token_id.clone(), + 0, + extra_amount, + )); payments } diff --git a/dex/pair/tests/pair_rs_test.rs b/dex/pair/tests/pair_rs_test.rs index c7da73af2..a80469ad0 100644 --- a/dex/pair/tests/pair_rs_test.rs +++ b/dex/pair/tests/pair_rs_test.rs @@ -64,11 +64,29 @@ fn test_swap_fixed_output() { fn test_perfect_swap_fixed_output() { let mut pair_setup = PairSetup::new(pair::contract_obj); + let token_amount = 1_001_000; + pair_setup.add_liquidity( - 1_001_000, 1_000_000, 1_001_000, 1_000_000, 1_000_000, 1_001_000, 1_001_000, + token_amount, + 1_000_000, + token_amount, + 1_000_000, + 1_000_000, + token_amount, + token_amount, ); pair_setup.swap_fixed_output(WEGLD_TOKEN_ID, 1_000, MEX_TOKEN_ID, 996, 0); + pair_setup.b_mock.check_esdt_balance( + &pair_setup.user_address, + WEGLD_TOKEN_ID, + &(rust_biguint!(USER_TOTAL_WEGLD_TOKENS - token_amount - 1_000)), + ); + pair_setup.b_mock.check_esdt_balance( + &pair_setup.user_address, + MEX_TOKEN_ID, + &(rust_biguint!(USER_TOTAL_WEGLD_TOKENS - token_amount + 996)), + ); } #[test] From 10fe315ba3a214eb569628ba1c0526efb2445fa4 Mon Sep 17 00:00:00 2001 From: Laurentiu Ciobanu Date: Tue, 26 Mar 2024 15:45:19 +0200 Subject: [PATCH 199/213] add test-coverage --- .github/workflows/actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 611894dd9..897e2cea8 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -20,7 +20,7 @@ permissions: jobs: contracts: name: Contracts - uses: multiversx/mx-sc-actions/.github/workflows/contracts.yml@v2.3.5 + uses: multiversx/mx-sc-actions/.github/workflows/contracts.yml@3c37e52a9de8f4111f823da0b2412f1fc55b7d30 with: rust-toolchain: nightly-2023-12-11 vmtools-version: v1.5.24 From 518fff63d98aa7d99e3fa7ff13394eeeca24342e Mon Sep 17 00:00:00 2001 From: Laurentiu Ciobanu Date: Tue, 26 Mar 2024 16:18:46 +0200 Subject: [PATCH 200/213] add test-coverage --- .github/workflows/actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 897e2cea8..2a5bfc833 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -23,6 +23,6 @@ jobs: uses: multiversx/mx-sc-actions/.github/workflows/contracts.yml@3c37e52a9de8f4111f823da0b2412f1fc55b7d30 with: rust-toolchain: nightly-2023-12-11 - vmtools-version: v1.5.24 + # vmtools-version: v1.5.24 secrets: token: ${{ secrets.GITHUB_TOKEN }} From bc5545e64c3351b2b91b0b79e1ffafeb2af0a57b Mon Sep 17 00:00:00 2001 From: Laurentiu Ciobanu Date: Wed, 27 Mar 2024 11:26:11 +0200 Subject: [PATCH 201/213] add test-coverage --- .github/workflows/actions.yml | 55 +++++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 2a5bfc833..dba47b91c 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -20,9 +20,60 @@ permissions: jobs: contracts: name: Contracts - uses: multiversx/mx-sc-actions/.github/workflows/contracts.yml@3c37e52a9de8f4111f823da0b2412f1fc55b7d30 + uses: multiversx/mx-sc-actions/.github/workflows/contracts.yml@v2.3.5 with: rust-toolchain: nightly-2023-12-11 - # vmtools-version: v1.5.24 + vmtools-version: v1.5.24 secrets: token: ${{ secrets.GITHUB_TOKEN }} + + test_coverage: + name: Test Coverage + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install rust + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: nightly-2023-12-11 + target: wasm32-unknown-unknown + + - name: Install prerequisites + run: | + rustup component add llvm-tools-preview + dirname $(find ~/.rustup -name llvm-cov) >> $GITHUB_PATH + + echo $(dirname $(find ~/.rustup -name llvm-cov)) + + cargo install multiversx-sc-meta --locked + + - name: Run tests and generate report + env: + RUSTFLAGS: "" + run: | + sc-meta test-coverage --output ./coverage.md + + - name: Upload the report + uses: actions/upload-artifact@v3 + with: + name: coverage + path: coverage.md + + - name: Find the comment containing the report + id: fc + uses: peter-evans/find-comment@v2 + if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository + with: + issue-number: ${{ github.event.pull_request.number }} + comment-author: "github-actions[bot]" + body-includes: "Coverage Summary" + + - name: Create or update the report comment + uses: peter-evans/create-or-update-comment@v2 + if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository + with: + comment-id: ${{ steps.fc.outputs.comment-id }} + issue-number: ${{ github.event.pull_request.number }} + body-file: ./coverage.md + edit-mode: replace From 29fbc2c3865c77bfbd73c42dce8e1c7dd839fd88 Mon Sep 17 00:00:00 2001 From: Laurentiu Ciobanu Date: Wed, 27 Mar 2024 11:32:50 +0200 Subject: [PATCH 202/213] add test-coverage --- .github/workflows/actions.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index dba47b91c..56d357593 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -27,6 +27,7 @@ jobs: secrets: token: ${{ secrets.GITHUB_TOKEN }} + # TEMPORARY: Remove this job when we can upgrade to mx-sc-actions v3+ test_coverage: name: Test Coverage runs-on: ubuntu-latest From 8c09212123e0925a47552fc3b33ab0b3780c5e7e Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Wed, 27 Mar 2024 13:20:13 +0200 Subject: [PATCH 203/213] Audit updates --- dex/router/src/contract.rs | 17 ----------------- dex/router/wasm/src/lib.rs | 5 ++--- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/dex/router/src/contract.rs b/dex/router/src/contract.rs index 8247dada9..c96b86cbe 100644 --- a/dex/router/src/contract.rs +++ b/dex/router/src/contract.rs @@ -270,23 +270,6 @@ pub trait Router: .call_and_exit() } - #[only_owner] - #[endpoint(setLocalRolesOwner)] - fn set_local_roles_owner( - &self, - token: TokenIdentifier, - address: ManagedAddress, - roles: MultiValueEncoded, - ) { - require!(self.is_active(), "Not active"); - - self.send() - .esdt_system_sc_proxy() - .set_special_roles(&address, &token, roles.into_iter()) - .async_call() - .call_and_exit() - } - #[only_owner] #[endpoint(removePair)] fn remove_pair( diff --git a/dex/router/wasm/src/lib.rs b/dex/router/wasm/src/lib.rs index c277c4367..c286e1b01 100644 --- a/dex/router/wasm/src/lib.rs +++ b/dex/router/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 32 +// Endpoints: 31 // Async Callback: 1 -// Total number of exported functions: 34 +// Total number of exported functions: 33 #![no_std] #![allow(internal_features)] @@ -27,7 +27,6 @@ multiversx_sc_wasm_adapter::endpoints! { upgradePair => upgrade_pair_endpoint issueLpToken => issue_lp_token setLocalRoles => set_local_roles - setLocalRolesOwner => set_local_roles_owner removePair => remove_pair setFeeOn => set_fee_on setFeeOff => set_fee_off From 351ae71687c6b8926deebcab81262f90f9af8849 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Thu, 28 Mar 2024 10:21:07 +0200 Subject: [PATCH 204/213] first_week_start_epoch on farm staking init --- farm-staking/farm-staking/src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/farm-staking/farm-staking/src/lib.rs b/farm-staking/farm-staking/src/lib.rs index 33f5bbd1a..c1e1e6402 100644 --- a/farm-staking/farm-staking/src/lib.rs +++ b/farm-staking/farm-staking/src/lib.rs @@ -89,6 +89,9 @@ pub trait FarmStaking: ); self.min_unbond_epochs().set_if_empty(min_unbond_epochs); + let current_epoch = self.blockchain().get_block_epoch(); + self.first_week_start_epoch().set_if_empty(current_epoch); + // Farm position migration code let farm_token_mapper = self.farm_token(); self.try_set_farm_position_migration_nonce(farm_token_mapper); From 50265d96b78d2155b0217dc0f5f4aece9b9edf47 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Thu, 28 Mar 2024 11:41:30 +0200 Subject: [PATCH 205/213] first_week_start_epoch in upgrade function as well --- dex/farm-with-locked-rewards/src/lib.rs | 3 +++ dex/farm/src/lib.rs | 3 +++ farm-staking/farm-staking/src/lib.rs | 3 +++ 3 files changed, 9 insertions(+) diff --git a/dex/farm-with-locked-rewards/src/lib.rs b/dex/farm-with-locked-rewards/src/lib.rs index 473fa77d2..a42f6518c 100644 --- a/dex/farm-with-locked-rewards/src/lib.rs +++ b/dex/farm-with-locked-rewards/src/lib.rs @@ -83,6 +83,9 @@ pub trait Farm: #[endpoint] fn upgrade(&self) { + let current_epoch = self.blockchain().get_block_epoch(); + self.first_week_start_epoch().set_if_empty(current_epoch); + // Farm position migration code let farm_token_mapper = self.farm_token(); self.try_set_farm_position_migration_nonce(farm_token_mapper); diff --git a/dex/farm/src/lib.rs b/dex/farm/src/lib.rs index 48cf893f1..669dd2e50 100644 --- a/dex/farm/src/lib.rs +++ b/dex/farm/src/lib.rs @@ -84,6 +84,9 @@ pub trait Farm: #[endpoint] fn upgrade(&self) { + let current_epoch = self.blockchain().get_block_epoch(); + self.first_week_start_epoch().set_if_empty(current_epoch); + // Farm position migration code let farm_token_mapper = self.farm_token(); self.try_set_farm_position_migration_nonce(farm_token_mapper); diff --git a/farm-staking/farm-staking/src/lib.rs b/farm-staking/farm-staking/src/lib.rs index c1e1e6402..e517d2aa6 100644 --- a/farm-staking/farm-staking/src/lib.rs +++ b/farm-staking/farm-staking/src/lib.rs @@ -99,6 +99,9 @@ pub trait FarmStaking: #[endpoint] fn upgrade(&self) { + let current_epoch = self.blockchain().get_block_epoch(); + self.first_week_start_epoch().set_if_empty(current_epoch); + // Farm position migration code let farm_token_mapper = self.farm_token(); self.try_set_farm_position_migration_nonce(farm_token_mapper); From c792082c953544e094e41a7a4f6779e46d5aadef Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Mon, 1 Apr 2024 12:03:14 +0300 Subject: [PATCH 206/213] Proxy dex backwards compatibility fixes --- locked-asset/proxy_dex/src/lib.rs | 7 ++++++- locked-asset/proxy_dex/src/proxy_common.rs | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/locked-asset/proxy_dex/src/lib.rs b/locked-asset/proxy_dex/src/lib.rs index f74f69303..a1b82f20d 100644 --- a/locked-asset/proxy_dex/src/lib.rs +++ b/locked-asset/proxy_dex/src/lib.rs @@ -59,7 +59,12 @@ pub trait ProxyDexImpl: } #[endpoint] - fn upgrade(&self) {} + fn upgrade(&self, old_locked_token_id: TokenIdentifier, old_factory_address: ManagedAddress) { + self.old_locked_token_id() + .set_if_empty(&old_locked_token_id); + self.old_factory_address() + .set_if_empty(&old_factory_address); + } #[only_owner] #[payable("EGLD")] diff --git a/locked-asset/proxy_dex/src/proxy_common.rs b/locked-asset/proxy_dex/src/proxy_common.rs index ff050e729..16608b2e9 100644 --- a/locked-asset/proxy_dex/src/proxy_common.rs +++ b/locked-asset/proxy_dex/src/proxy_common.rs @@ -135,8 +135,8 @@ pub trait ProxyCommonModule: energy_query::EnergyQueryModule { let new_token_id = self.get_locked_token_id(); let old_token_id = self.old_locked_token_id().get(); let mut results = MultiValueEncoded::new(); - results.push(new_token_id); results.push(old_token_id); + results.push(new_token_id); results } From d720e83067dd1a0de470ef3b4c957031d82c137e Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Mon, 1 Apr 2024 12:10:42 +0300 Subject: [PATCH 207/213] extra checks --- locked-asset/proxy_dex/src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/locked-asset/proxy_dex/src/lib.rs b/locked-asset/proxy_dex/src/lib.rs index a1b82f20d..810cd3640 100644 --- a/locked-asset/proxy_dex/src/lib.rs +++ b/locked-asset/proxy_dex/src/lib.rs @@ -60,6 +60,12 @@ pub trait ProxyDexImpl: #[endpoint] fn upgrade(&self, old_locked_token_id: TokenIdentifier, old_factory_address: ManagedAddress) { + require!( + old_locked_token_id.is_valid_esdt_identifier(), + "Invalid token id" + ); + self.require_sc_address(&old_factory_address); + self.old_locked_token_id() .set_if_empty(&old_locked_token_id); self.old_factory_address() From e07a109c7598cf66d610150d6184845b1fa853f3 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Fri, 5 Apr 2024 17:08:20 +0300 Subject: [PATCH 208/213] Router further audit improvements --- dex/router/src/config.rs | 69 +++++++++++++++++++++++++++ dex/router/src/contract.rs | 34 ++++++------- dex/router/src/enable_swap_by_user.rs | 14 +----- dex/router/src/factory.rs | 43 ++++------------- dex/router/src/multi_pair_swap.rs | 8 +++- dex/router/tests/router_setup/mod.rs | 3 +- dex/router/tests/router_test.rs | 11 +++-- dex/router/wasm/src/lib.rs | 15 +++--- 8 files changed, 117 insertions(+), 80 deletions(-) create mode 100644 dex/router/src/config.rs diff --git a/dex/router/src/config.rs b/dex/router/src/config.rs new file mode 100644 index 000000000..25c96a3e6 --- /dev/null +++ b/dex/router/src/config.rs @@ -0,0 +1,69 @@ +multiversx_sc::imports!(); +multiversx_sc::derive_imports!(); + +use crate::{enable_swap_by_user::EnableSwapByUserConfig, factory::PairTokens}; + +#[multiversx_sc::module] +pub trait ConfigModule { + fn is_active(&self) -> bool { + self.state().get() + } + + fn check_is_pair_sc(&self, pair_address: &ManagedAddress) { + require!( + self.address_pair_map().contains_key(pair_address), + "Not a pair SC" + ); + } + + #[view(getPairCreationEnabled)] + #[storage_mapper("pair_creation_enabled")] + fn pair_creation_enabled(&self) -> SingleValueMapper; + + #[view(getState)] + #[storage_mapper("state")] + fn state(&self) -> SingleValueMapper; + + #[view(getOwner)] + #[storage_mapper("owner")] + fn owner(&self) -> SingleValueMapper; + + #[only_owner] + #[endpoint(setTemporaryOwnerPeriod)] + fn set_temporary_owner_period(&self, period_blocks: u64) { + self.temporary_owner_period().set(period_blocks); + } + + #[only_owner] + #[endpoint(setPairTemplateAddress)] + fn set_pair_template_address(&self, address: ManagedAddress) { + self.pair_template_address().set(&address); + } + + #[storage_mapper("pair_map")] + fn pair_map(&self) -> MapMapper, ManagedAddress>; + + #[storage_mapper("address_pair_map")] + fn address_pair_map(&self) -> MapMapper>; + + #[view(getPairTemplateAddress)] + #[storage_mapper("pair_template_address")] + fn pair_template_address(&self) -> SingleValueMapper; + + #[view(getTemporaryOwnerPeriod)] + #[storage_mapper("temporary_owner_period")] + fn temporary_owner_period(&self) -> SingleValueMapper; + + #[storage_mapper("pair_temporary_owner")] + fn pair_temporary_owner(&self) -> MapMapper; + + #[storage_mapper("enableSwapByUserConfig")] + fn enable_swap_by_user_config( + &self, + token_id: &TokenIdentifier, + ) -> SingleValueMapper>; + + #[view(getCommonTokensForUserPairs)] + #[storage_mapper("commonTokensForUserPairs")] + fn common_tokens_for_user_pairs(&self) -> UnorderedSetMapper; +} diff --git a/dex/router/src/contract.rs b/dex/router/src/contract.rs index 8247dada9..9ecacf4d5 100644 --- a/dex/router/src/contract.rs +++ b/dex/router/src/contract.rs @@ -3,6 +3,7 @@ multiversx_sc::imports!(); multiversx_sc::derive_imports!(); +pub mod config; pub mod enable_swap_by_user; mod events; pub mod factory; @@ -24,7 +25,8 @@ const USER_DEFINED_TOTAL_FEE_PERCENT: u64 = 1_000; #[multiversx_sc::contract] pub trait Router: - factory::FactoryModule + config::ConfigModule + + factory::FactoryModule + events::EventsModule + multi_pair_swap::MultiPairSwap + token_send::TokenSendModule @@ -40,7 +42,9 @@ pub trait Router: } #[endpoint] - fn upgrade(&self) {} + fn upgrade(&self) { + self.state().set(false); + } #[only_owner] #[endpoint] @@ -60,6 +64,10 @@ pub trait Router: #[endpoint] fn resume(&self, address: ManagedAddress) { if address == self.blockchain().get_sc_address() { + require!( + self.pair_map().len() == self.address_pair_map().len(), + "The size of the 2 pair maps is not the same" + ); self.state().set(true); } else { self.check_is_pair_sc(&address); @@ -389,11 +397,6 @@ pub trait Router: } } - #[inline] - fn is_active(&self) -> bool { - self.state().get() - } - #[only_owner] #[endpoint(setPairCreationEnabled)] fn set_pair_creation_enabled(&self, enabled: bool) { @@ -412,17 +415,10 @@ pub trait Router: for (pair_tokens, address) in pair_map.iter() { address_pair_map.insert(address, pair_tokens); } - } - #[view(getPairCreationEnabled)] - #[storage_mapper("pair_creation_enabled")] - fn pair_creation_enabled(&self) -> SingleValueMapper; - - #[view(getState)] - #[storage_mapper("state")] - fn state(&self) -> SingleValueMapper; - - #[view(getOwner)] - #[storage_mapper("owner")] - fn owner(&self) -> SingleValueMapper; + require!( + pair_map.len() == address_pair_map.len(), + "The size of the 2 pair maps is not the same" + ); + } } diff --git a/dex/router/src/enable_swap_by_user.rs b/dex/router/src/enable_swap_by_user.rs index f1857403e..7c77036c1 100644 --- a/dex/router/src/enable_swap_by_user.rs +++ b/dex/router/src/enable_swap_by_user.rs @@ -5,7 +5,7 @@ use pair::{config::ProxyTrait as _, pair_actions::views::ProxyTrait as _}; use pausable::{ProxyTrait as _, State}; use simple_lock::locked_token::LockedTokenAttributes; -use crate::{DEFAULT_SPECIAL_FEE_PERCENT, USER_DEFINED_TOTAL_FEE_PERCENT}; +use crate::{config, DEFAULT_SPECIAL_FEE_PERCENT, USER_DEFINED_TOTAL_FEE_PERCENT}; static PAIR_LP_TOKEN_ID_STORAGE_KEY: &[u8] = b"lpTokenIdentifier"; static PAIR_INITIAL_LIQ_ADDER_STORAGE_KEY: &[u8] = b"initial_liquidity_adder"; @@ -27,7 +27,7 @@ pub struct SafePriceResult { #[multiversx_sc::module] pub trait EnableSwapByUserModule: - crate::factory::FactoryModule + crate::events::EventsModule + config::ConfigModule + crate::factory::FactoryModule + crate::events::EventsModule { #[only_owner] #[endpoint(configEnableByUserParameters)] @@ -250,14 +250,4 @@ pub trait EnableSwapByUserModule: #[proxy] fn user_pair_proxy(&self, to: ManagedAddress) -> pair::Proxy; - - #[storage_mapper("enableSwapByUserConfig")] - fn enable_swap_by_user_config( - &self, - token_id: &TokenIdentifier, - ) -> SingleValueMapper>; - - #[view(getCommonTokensForUserPairs)] - #[storage_mapper("commonTokensForUserPairs")] - fn common_tokens_for_user_pairs(&self) -> UnorderedSetMapper; } diff --git a/dex/router/src/factory.rs b/dex/router/src/factory.rs index c0badf49c..4994db235 100644 --- a/dex/router/src/factory.rs +++ b/dex/router/src/factory.rs @@ -1,6 +1,8 @@ multiversx_sc::imports!(); multiversx_sc::derive_imports!(); +use crate::config; + const TEMPORARY_OWNER_PERIOD_BLOCKS: u64 = 50; #[derive(TopEncode, TopDecode, NestedEncode, NestedDecode, PartialEq, TypeAbi)] @@ -17,7 +19,7 @@ pub struct PairContractMetadata { } #[multiversx_sc::module] -pub trait FactoryModule { +pub trait FactoryModule: config::ConfigModule { #[proxy] fn pair_contract_deploy_proxy(&self) -> pair::Proxy; @@ -172,11 +174,11 @@ pub trait FactoryModule { address } - fn check_is_pair_sc(&self, pair_address: &ManagedAddress) { - require!( - self.address_pair_map().contains_key(pair_address), - "Not a pair SC" - ); + #[view(getPairTokens)] + fn get_pair_tokens(&self, pair_address: ManagedAddress) -> PairTokens { + let pair_tokens_opt = self.address_pair_map().get(&pair_address); + require!(pair_tokens_opt.is_some(), "Pair address not found"); + pair_tokens_opt.unwrap() } fn get_pair_temporary_owner(&self, pair_address: &ManagedAddress) -> Option { @@ -204,33 +206,4 @@ pub trait FactoryModule { self.pair_temporary_owner().clear(); size } - - #[only_owner] - #[endpoint(setTemporaryOwnerPeriod)] - fn set_temporary_owner_period(&self, period_blocks: u64) { - self.temporary_owner_period().set(period_blocks); - } - - #[only_owner] - #[endpoint(setPairTemplateAddress)] - fn set_pair_template_address(&self, address: ManagedAddress) { - self.pair_template_address().set(&address); - } - - #[storage_mapper("pair_map")] - fn pair_map(&self) -> MapMapper, ManagedAddress>; - - #[storage_mapper("address_pair_map")] - fn address_pair_map(&self) -> MapMapper>; - - #[view(getPairTemplateAddress)] - #[storage_mapper("pair_template_address")] - fn pair_template_address(&self) -> SingleValueMapper; - - #[view(getTemporaryOwnerPeriod)] - #[storage_mapper("temporary_owner_period")] - fn temporary_owner_period(&self) -> SingleValueMapper; - - #[storage_mapper("pair_temporary_owner")] - fn pair_temporary_owner(&self) -> MapMapper; } diff --git a/dex/router/src/multi_pair_swap.rs b/dex/router/src/multi_pair_swap.rs index 3b0f73620..7a4355e5c 100644 --- a/dex/router/src/multi_pair_swap.rs +++ b/dex/router/src/multi_pair_swap.rs @@ -3,6 +3,8 @@ multiversx_sc::derive_imports!(); use pair::pair_actions::swap::ProxyTrait as _; +use crate::config; + use super::factory; type SwapOperationType = @@ -12,10 +14,14 @@ pub const SWAP_TOKENS_FIXED_INPUT_FUNC_NAME: &[u8] = b"swapTokensFixedInput"; pub const SWAP_TOKENS_FIXED_OUTPUT_FUNC_NAME: &[u8] = b"swapTokensFixedOutput"; #[multiversx_sc::module] -pub trait MultiPairSwap: factory::FactoryModule + token_send::TokenSendModule { +pub trait MultiPairSwap: + config::ConfigModule + factory::FactoryModule + token_send::TokenSendModule +{ #[payable("*")] #[endpoint(multiPairSwap)] fn multi_pair_swap(&self, swap_operations: MultiValueEncoded>) { + require!(self.is_active(), "Not active"); + let (token_id, nonce, amount) = self.call_value().single_esdt().into_tuple(); require!(nonce == 0, "Invalid nonce. Should be zero"); require!(amount > 0u64, "Invalid amount. Should not be zero"); diff --git a/dex/router/tests/router_setup/mod.rs b/dex/router/tests/router_setup/mod.rs index 7b2969361..c72b6a971 100644 --- a/dex/router/tests/router_setup/mod.rs +++ b/dex/router/tests/router_setup/mod.rs @@ -27,10 +27,11 @@ pub const MIN_LOCKED_PERIOD_EPOCHS: u64 = 100; pub const USER_CUSTOM_TOKEN_BALANCE: u64 = 1_000_000_000; pub const USER_USDC_BALANCE: u64 = 1_000_000; -use pair::config::*; +use pair::config::ConfigModule as PairConfigModule; use pair::pair_actions::add_liq::AddLiquidityModule; use pair::*; use pausable::{PausableModule, State}; +use router::config::ConfigModule; use router::factory::*; use router::multi_pair_swap::*; use router::*; diff --git a/dex/router/tests/router_test.rs b/dex/router/tests/router_test.rs index cb5f1a78f..54c73c838 100644 --- a/dex/router/tests/router_test.rs +++ b/dex/router/tests/router_test.rs @@ -9,13 +9,14 @@ use multiversx_sc::{ MultiValueEncoded, }, }; -use pair::{config::ConfigModule, pair_actions::initial_liq::InitialLiquidityModule, Pair}; +use pair::{ + config::ConfigModule as PairConfigModule, pair_actions::initial_liq::InitialLiquidityModule, + Pair, +}; use pausable::{PausableModule, State}; use router::{ - enable_swap_by_user::EnableSwapByUserModule, - factory::{FactoryModule, PairTokens}, - multi_pair_swap::SWAP_TOKENS_FIXED_INPUT_FUNC_NAME, - Router, + config::ConfigModule, enable_swap_by_user::EnableSwapByUserModule, factory::PairTokens, + multi_pair_swap::SWAP_TOKENS_FIXED_INPUT_FUNC_NAME, Router, }; use router_setup::*; diff --git a/dex/router/wasm/src/lib.rs b/dex/router/wasm/src/lib.rs index c277c4367..15868516f 100644 --- a/dex/router/wasm/src/lib.rs +++ b/dex/router/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 32 +// Endpoints: 33 // Async Callback: 1 -// Total number of exported functions: 34 +// Total number of exported functions: 35 #![no_std] #![allow(internal_features)] @@ -36,22 +36,23 @@ multiversx_sc_wasm_adapter::endpoints! { getPairCreationEnabled => pair_creation_enabled getState => state getOwner => owner + setTemporaryOwnerPeriod => set_temporary_owner_period + setPairTemplateAddress => set_pair_template_address + getPairTemplateAddress => pair_template_address + getTemporaryOwnerPeriod => temporary_owner_period + getCommonTokensForUserPairs => common_tokens_for_user_pairs getAllPairsManagedAddresses => get_all_pairs_addresses getAllPairTokens => get_all_token_pairs getAllPairContractMetadata => get_all_pair_contract_metadata getPair => get_pair + getPairTokens => get_pair_tokens clearPairTemporaryOwnerStorage => clear_pair_temporary_owner_storage - setTemporaryOwnerPeriod => set_temporary_owner_period - setPairTemplateAddress => set_pair_template_address - getPairTemplateAddress => pair_template_address - getTemporaryOwnerPeriod => temporary_owner_period multiPairSwap => multi_pair_swap configEnableByUserParameters => config_enable_by_user_parameters addCommonTokensForUserPairs => add_common_tokens_for_user_pairs removeCommonTokensForUserPairs => remove_common_tokens_for_user_pairs setSwapEnabledByUser => set_swap_enabled_by_user getEnableSwapByUserConfig => try_get_config - getCommonTokensForUserPairs => common_tokens_for_user_pairs ) } From 60824b8137fa84dbe86dea2304c4fd48cf7e888e Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Mon, 8 Apr 2024 17:12:26 +0300 Subject: [PATCH 209/213] Remove position destroyer from v3.0 --- locked-asset/proxy_dex/src/proxy_farm.rs | 86 ------- .../proxy_dex/tests/proxy_farm_test.rs | 227 ------------------ locked-asset/proxy_dex/wasm/src/lib.rs | 5 +- .../simple-lock-whitelist/elrond.json | 3 - .../simple-lock-whitelist/wasm/src/lib.rs | 5 +- locked-asset/simple-lock/src/proxy_farm.rs | 75 ------ locked-asset/simple-lock/wasm/src/lib.rs | 5 +- 7 files changed, 6 insertions(+), 400 deletions(-) delete mode 100644 locked-asset/simple-lock-whitelist/elrond.json diff --git a/locked-asset/proxy_dex/src/proxy_farm.rs b/locked-asset/proxy_dex/src/proxy_farm.rs index 95b96adb9..b90f00f69 100644 --- a/locked-asset/proxy_dex/src/proxy_farm.rs +++ b/locked-asset/proxy_dex/src/proxy_farm.rs @@ -22,13 +22,6 @@ pub type EnterFarmProxyResultType = MultiValue2, EsdtToke pub type ExitFarmProxyResultType = MultiValue2, EsdtTokenPayment>; pub type ClaimRewardsFarmProxyResultType = MultiValue2, EsdtTokenPayment>; -#[derive(TypeAbi, TopEncode, TopDecode, NestedEncode, NestedDecode)] -pub struct DestroyFarmResultType { - pub first_payment: EsdtTokenPayment, - pub second_payment: EsdtTokenPayment, - pub farm_rewards: EsdtTokenPayment, -} - #[multiversx_sc::module] pub trait ProxyFarmModule: crate::proxy_common::ProxyCommonModule @@ -241,85 +234,6 @@ pub trait ProxyFarmModule: (initial_proxy_farming_tokens, exit_result.reward_tokens).into() } - #[payable("*")] - #[endpoint(destroyFarmProxy)] - fn destroy_farm_proxy( - &self, - farm_address: ManagedAddress, - pair_address: ManagedAddress, - first_token_amount_min: BigUint, - second_token_amount_min: BigUint, - opt_original_caller: OptionalValue, - ) -> DestroyFarmResultType { - self.require_is_intermediated_farm(&farm_address); - self.require_is_intermediated_pair(&pair_address); - self.require_wrapped_farm_token_id_not_empty(); - self.require_wrapped_lp_token_id_not_empty(); - - let wrapped_farm_token_mapper = self.wrapped_farm_token(); - let payment = self.call_value().single_esdt(); - wrapped_farm_token_mapper.require_same_token(&payment.token_identifier); - - let full_wrapped_farm_attributes: WrappedFarmTokenAttributes = self - .blockchain() - .get_token_attributes(&payment.token_identifier, payment.token_nonce); - - let wrapped_farm_attributes_for_exit: WrappedFarmTokenAttributes = - full_wrapped_farm_attributes.into_part(&payment.amount); - - let caller = self.blockchain().get_caller(); - let original_caller = self.get_orig_caller_from_opt(&caller, opt_original_caller); - - let exit_result = self.call_exit_farm( - original_caller.clone(), - farm_address.clone(), - wrapped_farm_attributes_for_exit.farm_token.clone(), - ); - - self.burn_if_base_asset(&exit_result.farming_tokens); - - let wrapped_farm_tokens_for_initial_tokens = WrappedFarmToken { - payment: payment.clone(), - attributes: wrapped_farm_attributes_for_exit.clone(), - }; - - let initial_proxy_farming_tokens = self - .handle_farm_penalty_and_get_output_proxy_farming_token( - &original_caller, - wrapped_farm_tokens_for_initial_tokens, - exit_result.farming_tokens.amount, - ); - - let mut remove_liquidity_result = self.remove_liquidity_proxy_common( - initial_proxy_farming_tokens.clone(), - pair_address, - first_token_amount_min, - second_token_amount_min, - ); - - // Burn farm token - wrapped_farm_token_mapper.nft_burn(payment.token_nonce, &payment.amount); - - // Push farm rewards - remove_liquidity_result.push(exit_result.reward_tokens.clone()); - - self.send_multiple_tokens_if_not_zero(&caller, &remove_liquidity_result); - - self.emit_exit_farm_proxy_event( - &original_caller, - &farm_address, - payment, - wrapped_farm_attributes_for_exit, - exit_result.reward_tokens.clone(), - ); - - DestroyFarmResultType { - first_payment: remove_liquidity_result.get(0), - second_payment: remove_liquidity_result.get(1), - farm_rewards: exit_result.reward_tokens, - } - } - fn handle_farm_penalty_and_get_output_proxy_farming_token( &self, caller: &ManagedAddress, diff --git a/locked-asset/proxy_dex/tests/proxy_farm_test.rs b/locked-asset/proxy_dex/tests/proxy_farm_test.rs index ad0917915..b2acafc94 100644 --- a/locked-asset/proxy_dex/tests/proxy_farm_test.rs +++ b/locked-asset/proxy_dex/tests/proxy_farm_test.rs @@ -1485,230 +1485,3 @@ fn increase_proxy_farm_proxy_lp_energy() { }), ); } - -#[test] -fn destroy_farm_locked_tokens_test() { - let mut setup = ProxySetup::new( - proxy_dex::contract_obj, - pair::contract_obj, - farm_with_locked_rewards::contract_obj, - energy_factory::contract_obj, - ); - - setup - .b_mock - .execute_tx( - &setup.owner, - &setup.farm_locked_wrapper, - &rust_biguint!(0), - |sc| { - sc.farming_token_id().set(&managed_token_id!(LP_TOKEN_ID)); - - // set produce rewards to false for easier calculation - sc.produce_rewards_enabled().set(false); - }, - ) - .assert_ok(); - - setup.b_mock.set_esdt_local_roles( - setup.farm_locked_wrapper.address_ref(), - LP_TOKEN_ID, - &[EsdtLocalRole::Burn], - ); - - let first_user = setup.first_user.clone(); - let locked_token_amount = rust_biguint!(1_000_000_000); - let other_token_amount = rust_biguint!(500_000_000); - let expected_lp_token_amount = rust_biguint!(499_999_000); - - // set the price to 1 EGLD = 2 MEX - let payments = vec![ - TxTokenTransfer { - token_identifier: LOCKED_TOKEN_ID.to_vec(), - nonce: 1, - value: locked_token_amount.clone(), - }, - TxTokenTransfer { - token_identifier: WEGLD_TOKEN_ID.to_vec(), - nonce: 0, - value: other_token_amount.clone(), - }, - ]; - - // add liquidity - let pair_addr = setup.pair_wrapper.address_ref().clone(); - setup - .b_mock - .execute_esdt_multi_transfer(&first_user, &setup.proxy_wrapper, &payments, |sc| { - sc.add_liquidity_proxy( - managed_address!(&pair_addr), - managed_biguint!(locked_token_amount.to_u64().unwrap()), - managed_biguint!(other_token_amount.to_u64().unwrap()), - ); - }) - .assert_ok(); - - setup.b_mock.check_nft_balance( - &first_user, - WRAPPED_LP_TOKEN_ID, - 1, - &expected_lp_token_amount, - Some(&WrappedLpTokenAttributes:: { - locked_tokens: EsdtTokenPayment { - token_identifier: managed_token_id!(LOCKED_TOKEN_ID), - token_nonce: 1, - amount: managed_biguint!(locked_token_amount.to_u64().unwrap()), - }, - lp_token_id: managed_token_id!(LP_TOKEN_ID), - lp_token_amount: managed_biguint!(expected_lp_token_amount.to_u64().unwrap()), - }), - ); - - let block_epoch = 1u64; - let user_balance = USER_BALANCE; - setup - .b_mock - .execute_query(&setup.simple_lock_wrapper, |sc| { - let unlock_epoch = LOCK_OPTIONS[0]; - let lock_epochs = unlock_epoch - block_epoch; - let expected_energy_amount = - BigInt::from((user_balance) as i64) * BigInt::from(lock_epochs as i64); - let expected_energy = Energy::new( - expected_energy_amount, - block_epoch, - managed_biguint!(user_balance), - ); - let actual_energy = sc.user_energy(&managed_address!(&first_user)).get(); - assert_eq!(expected_energy, actual_energy); - }) - .assert_ok(); - - let farm_locked_addr = setup.farm_locked_wrapper.address_ref().clone(); - - //////////////////////////////////////////// ENTER FARM ///////////////////////////////////// - - let mut current_epoch = 5; - setup.b_mock.set_block_epoch(current_epoch); - - setup - .b_mock - .execute_esdt_transfer( - &first_user, - &setup.proxy_wrapper, - WRAPPED_LP_TOKEN_ID, - 1, - &expected_lp_token_amount, - |sc| { - sc.enter_farm_proxy_endpoint( - managed_address!(&farm_locked_addr), - OptionalValue::None, - ); - }, - ) - .assert_ok(); - - let expected_energy = rust_biguint!(LOCK_OPTIONS[0] - current_epoch) * USER_BALANCE; - setup - .b_mock - .execute_query(&setup.simple_lock_wrapper, |sc| { - let managed_result = sc.get_energy_amount_for_user(managed_address!(&first_user)); - let result = to_rust_biguint(managed_result); - assert_eq!(result, expected_energy); - }) - .assert_ok(); - - // check user balance - setup.b_mock.check_nft_balance( - &first_user, - WRAPPED_FARM_TOKEN_ID, - 1, - &expected_lp_token_amount, - Some(&WrappedFarmTokenAttributes:: { - proxy_farming_token: EsdtTokenPayment { - token_identifier: managed_token_id!(WRAPPED_LP_TOKEN_ID), - token_nonce: 1, - amount: managed_biguint!(expected_lp_token_amount.to_u64().unwrap()), - }, - farm_token: EsdtTokenPayment { - token_identifier: managed_token_id!(FARM_LOCKED_TOKEN_ID), - token_nonce: 1, - amount: managed_biguint!(expected_lp_token_amount.to_u64().unwrap()), - }, - }), - ); - - // check proxy balance - setup - .b_mock - .check_nft_balance::>( - setup.proxy_wrapper.address_ref(), - FARM_LOCKED_TOKEN_ID, - 1, - &expected_lp_token_amount, - None, - ); - - // check farm balance - setup.b_mock.check_esdt_balance( - setup.farm_locked_wrapper.address_ref(), - LP_TOKEN_ID, - &expected_lp_token_amount, - ); - - current_epoch += 5; // applies penalty on exit - setup.b_mock.set_block_epoch(current_epoch); - setup.b_mock.set_block_nonce(100); - - ////////////////////////////////////////////// DESTROY FARM ///////////////////////////////////// - - // should be 500_000_000, but ends up so due to approximations - let removed_locked_token_amount = rust_biguint!(499_999_000); - // should be 250_000_000, but ends up so due to approximations - let removed_other_token_amount = rust_biguint!(249_999_500); - // exit with partial amount - setup - .b_mock - .execute_esdt_transfer( - &first_user, - &setup.proxy_wrapper, - WRAPPED_FARM_TOKEN_ID, - 1, - &(expected_lp_token_amount.clone() / rust_biguint!(2)), - |sc| { - let output_payments = sc.destroy_farm_proxy( - managed_address!(&farm_locked_addr), - managed_address!(&pair_addr), - managed_biguint!(1), - managed_biguint!(1), - OptionalValue::None, - ); - - assert_eq!( - output_payments.first_payment.amount.to_u64().unwrap(), - removed_locked_token_amount.to_u64().unwrap() - ); - assert_eq!( - output_payments.second_payment.amount.to_u64().unwrap(), - removed_other_token_amount.to_u64().unwrap() - ); - assert_eq!(output_payments.farm_rewards.amount.to_u64().unwrap(), 0u64); - }, - ) - .assert_ok(); - - setup.b_mock.check_nft_balance::( - &first_user, - WRAPPED_FARM_TOKEN_ID, - 1, - &(&expected_lp_token_amount / 2u64), - None, - ); - - setup.b_mock.check_nft_balance::( - &first_user, - WRAPPED_LP_TOKEN_ID, - 1, - &rust_biguint!(0u64), - None, - ); -} diff --git a/locked-asset/proxy_dex/wasm/src/lib.rs b/locked-asset/proxy_dex/wasm/src/lib.rs index 90c1ad26d..29b3ab709 100644 --- a/locked-asset/proxy_dex/wasm/src/lib.rs +++ b/locked-asset/proxy_dex/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 32 +// Endpoints: 31 // Async Callback: 1 -// Total number of exported functions: 34 +// Total number of exported functions: 33 #![no_std] #![allow(internal_features)] @@ -42,7 +42,6 @@ multiversx_sc_wasm_adapter::endpoints! { increaseProxyPairTokenEnergy => increase_proxy_pair_token_energy_endpoint enterFarmProxy => enter_farm_proxy_endpoint exitFarmProxy => exit_farm_proxy - destroyFarmProxy => destroy_farm_proxy claimRewardsProxy => claim_rewards_proxy increaseProxyFarmTokenEnergy => increase_proxy_farm_token_energy_endpoint mergeWrappedFarmTokens => merge_wrapped_farm_tokens_endpoint diff --git a/locked-asset/simple-lock-whitelist/elrond.json b/locked-asset/simple-lock-whitelist/elrond.json deleted file mode 100644 index 736553962..000000000 --- a/locked-asset/simple-lock-whitelist/elrond.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "language": "rust" -} \ No newline at end of file diff --git a/locked-asset/simple-lock-whitelist/wasm/src/lib.rs b/locked-asset/simple-lock-whitelist/wasm/src/lib.rs index ce5b64928..d82101ff8 100644 --- a/locked-asset/simple-lock-whitelist/wasm/src/lib.rs +++ b/locked-asset/simple-lock-whitelist/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 26 +// Endpoints: 25 // Async Callback: 1 -// Total number of exported functions: 28 +// Total number of exported functions: 27 #![no_std] #![allow(internal_features)] @@ -42,7 +42,6 @@ multiversx_sc_wasm_adapter::endpoints! { removeFarmFromWhitelist => remove_farm_from_whitelist enterFarmLockedToken => enter_farm_locked_token exitFarmLockedToken => exit_farm_locked_token - destroyFarmLockedTokens => destroy_farm_locked_tokens farmClaimRewardsLockedToken => farm_claim_rewards_locked_token getKnownFarms => known_farms getFarmProxyTokenId => farm_proxy_token diff --git a/locked-asset/simple-lock/src/proxy_farm.rs b/locked-asset/simple-lock/src/proxy_farm.rs index 33184ca3f..1d1a918d2 100644 --- a/locked-asset/simple-lock/src/proxy_farm.rs +++ b/locked-asset/simple-lock/src/proxy_farm.rs @@ -26,13 +26,6 @@ pub type FarmClaimRewardsThroughProxyResultType = MultiValue2, EsdtTokenPayment>; pub type FarmCompoundRewardsThroughProxyResultType = EsdtTokenPayment; -#[derive(TypeAbi, TopEncode, TopDecode, NestedEncode, NestedDecode)] -pub struct DestroyFarmResultType { - pub first_payment: EsdtTokenPayment, - pub second_payment: EsdtTokenPayment, - pub farm_rewards: EsdtTokenPayment, -} - #[multiversx_sc::module] pub trait ProxyFarmModule: crate::farm_interactions::FarmInteractionsModule @@ -255,74 +248,6 @@ pub trait ProxyFarmModule: (lp_proxy_token_payment, exit_farm_result.reward_tokens).into() } - /// Destroy a farm to the original tokens. - /// - /// Expected payment: Original tokens tokens - /// - /// Output Payments: - /// - original tokens - /// - farm reward tokens - #[payable("*")] - #[endpoint(destroyFarmLockedTokens)] - fn destroy_farm_locked_tokens( - &self, - first_token_min_amount_out: BigUint, - second_token_min_amount_out: BigUint, - ) -> DestroyFarmResultType { - let payment: EsdtTokenPayment = self.call_value().single_esdt(); - - let farm_proxy_token_attributes: FarmProxyTokenAttributes = - self.validate_payment_and_get_farm_proxy_token_attributes(&payment); - - let farm_address = self.try_get_farm_address( - &farm_proxy_token_attributes.farming_token_id, - farm_proxy_token_attributes.farm_type, - ); - let caller = self.blockchain().get_caller(); - let exit_farm_result = self.call_farm_exit( - farm_address, - farm_proxy_token_attributes.farm_token_id, - farm_proxy_token_attributes.farm_token_nonce, - payment.amount.clone(), - caller.clone(), - ); - require!( - exit_farm_result.initial_farming_tokens.token_identifier - == farm_proxy_token_attributes.farming_token_id, - INVALID_PAYMENTS_RECEIVED_FROM_FARM_ERR_MSG - ); - - if exit_farm_result.reward_tokens.amount > 0 { - self.send().direct_esdt( - &caller, - &exit_farm_result.reward_tokens.token_identifier, - exit_farm_result.reward_tokens.token_nonce, - &exit_farm_result.reward_tokens.amount, - ); - } - - let locked_lp_nonce = farm_proxy_token_attributes.farming_token_locked_nonce; - let lp_proxy_token_mapper = self.lp_proxy_token(); - - let (first_payment, second_payment) = self - .remove_liquidity_locked_token_common( - EsdtTokenPayment::new( - lp_proxy_token_mapper.get_token_id(), - locked_lp_nonce, - exit_farm_result.initial_farming_tokens.amount, - ), - first_token_min_amount_out, - second_token_min_amount_out, - ) - .into_tuple(); - - DestroyFarmResultType { - first_payment, - second_payment, - farm_rewards: exit_farm_result.reward_tokens, - } - } - /// Claim rewards from a previously entered farm. /// The FARM_PROXY tokens are burned, and new ones are created. /// This is needed because every farm action changes the farm token nonce diff --git a/locked-asset/simple-lock/wasm/src/lib.rs b/locked-asset/simple-lock/wasm/src/lib.rs index ad1446ca6..4e1b87c7d 100644 --- a/locked-asset/simple-lock/wasm/src/lib.rs +++ b/locked-asset/simple-lock/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 21 +// Endpoints: 20 // Async Callback: 1 -// Total number of exported functions: 23 +// Total number of exported functions: 22 #![no_std] #![allow(internal_features)] @@ -37,7 +37,6 @@ multiversx_sc_wasm_adapter::endpoints! { removeFarmFromWhitelist => remove_farm_from_whitelist enterFarmLockedToken => enter_farm_locked_token exitFarmLockedToken => exit_farm_locked_token - destroyFarmLockedTokens => destroy_farm_locked_tokens farmClaimRewardsLockedToken => farm_claim_rewards_locked_token getKnownFarms => known_farms getFarmProxyTokenId => farm_proxy_token From 4c1290b88b391eb4bcf1e7076cd0fc0278cec53d Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Mon, 8 Apr 2024 17:17:27 +0300 Subject: [PATCH 210/213] remove test --- dex/farm/tests/farm_single_user_test.rs | 263 +----------------------- 1 file changed, 2 insertions(+), 261 deletions(-) diff --git a/dex/farm/tests/farm_single_user_test.rs b/dex/farm/tests/farm_single_user_test.rs index 6ff0a3d3a..e060fbbdf 100644 --- a/dex/farm/tests/farm_single_user_test.rs +++ b/dex/farm/tests/farm_single_user_test.rs @@ -4,13 +4,12 @@ mod farm_setup; use config::ConfigModule; use farm_setup::single_user_farm_setup::*; -use multiversx_sc::{codec::multi_types::OptionalValue, types::EsdtLocalRole}; +use multiversx_sc::types::EsdtLocalRole; use multiversx_sc_scenario::{ - managed_address, managed_biguint, managed_token_id, managed_token_id_wrapped, rust_biguint, + managed_address, managed_biguint, managed_token_id, rust_biguint, whitebox_legacy::TxTokenTransfer, DebugApi, }; use sc_whitelist_module::SCWhitelistModule; -use simple_lock::locked_token::LockedTokenAttributes; #[test] fn test_farm_setup() { @@ -618,261 +617,3 @@ fn test_farm_through_simple_lock() { Some(&lp_proxy_token_attributes), ); } - -#[test] -fn test_destroy_farm_through_simple_lock() { - use multiversx_sc::storage::mappers::StorageTokenWrapper; - use simple_lock::locked_token::LockedTokenModule; - use simple_lock::proxy_farm::ProxyFarmModule; - use simple_lock::proxy_farm::*; - use simple_lock::proxy_lp::{LpProxyTokenAttributes, ProxyLpModule}; - use simple_lock::SimpleLock; - - DebugApi::dummy(); - let rust_zero = rust_biguint!(0); - let mut farm_setup = SingleUserFarmSetup::new(farm::contract_obj, pair::contract_obj); - let b_mock = &mut farm_setup.blockchain_wrapper; - let user_addr = farm_setup.user_address.clone(); - - // setup simple lock SC - let lock_wrapper = b_mock.create_sc_account( - &rust_zero, - Some(&farm_setup.owner_address), - simple_lock::contract_obj, - "Simple Lock Path", - ); - - let farm_addr = farm_setup.farm_wrapper.address_ref().clone(); - let pair_addr = farm_setup.pair_wrapper.address_ref().clone(); - b_mock - .execute_tx(&farm_setup.owner_address, &lock_wrapper, &rust_zero, |sc| { - sc.init(); - sc.locked_token() - .set_token_id(managed_token_id!(LOCKED_TOKEN_ID)); - sc.lp_proxy_token() - .set_token_id(managed_token_id!(LOCKED_LP_TOKEN_ID)); - sc.farm_proxy_token() - .set_token_id(managed_token_id!(FARM_PROXY_TOKEN_ID)); - sc.add_farm_to_whitelist( - managed_address!(&farm_addr), - managed_token_id!(LP_TOKEN_ID), - FarmType::SimpleFarm, - ); - sc.add_lp_to_whitelist( - managed_address!(&pair_addr), - managed_token_id!(WEGLD_TOKEN_ID), - managed_token_id!(MEX_TOKEN_ID), - ); - }) - .assert_ok(); - - // change farming token for farm + whitelist simple lock contract - b_mock - .execute_tx( - &farm_setup.owner_address, - &farm_setup.farm_wrapper, - &rust_zero, - |sc| { - sc.farming_token_id().set(&managed_token_id!(LP_TOKEN_ID)); - sc.add_sc_address_to_whitelist(managed_address!(lock_wrapper.address_ref())); - }, - ) - .assert_ok(); - - b_mock.set_esdt_local_roles( - lock_wrapper.address_ref(), - LOCKED_TOKEN_ID, - &[ - EsdtLocalRole::NftCreate, - EsdtLocalRole::NftAddQuantity, - EsdtLocalRole::NftBurn, - ], - ); - b_mock.set_esdt_local_roles( - lock_wrapper.address_ref(), - LOCKED_LP_TOKEN_ID, - &[ - EsdtLocalRole::NftCreate, - EsdtLocalRole::NftAddQuantity, - EsdtLocalRole::NftBurn, - ], - ); - b_mock.set_esdt_local_roles( - lock_wrapper.address_ref(), - FARM_PROXY_TOKEN_ID, - &[ - EsdtLocalRole::NftCreate, - EsdtLocalRole::NftAddQuantity, - EsdtLocalRole::NftBurn, - ], - ); - - b_mock.set_esdt_balance(&user_addr, WEGLD_TOKEN_ID, &rust_biguint!(10_000_000)); - b_mock.set_esdt_balance(&user_addr, MEX_TOKEN_ID, &rust_biguint!(10_000_000)); - - b_mock - .execute_esdt_transfer( - &user_addr, - &lock_wrapper, - MEX_TOKEN_ID, - 0, - &rust_biguint!(10_000_000), - |sc| { - sc.lock_tokens_endpoint(15, OptionalValue::None); - }, - ) - .assert_ok(); - - b_mock.check_nft_balance( - &user_addr, - LOCKED_TOKEN_ID, - 1, - &rust_biguint!(10_000_000), - Some(&LockedTokenAttributes:: { - original_token_id: managed_token_id_wrapped!(MEX_TOKEN_ID), - original_token_nonce: 0, - unlock_epoch: 15, - }), - ); - - b_mock.set_block_epoch(5); - - // add liquidity through simple-lock SC - one locked (XMEX) token, one unlocked (WEGLD) - let transfers = vec![ - TxTokenTransfer { - token_identifier: WEGLD_TOKEN_ID.to_vec(), - nonce: 0, - value: rust_biguint!(10_000_000), - }, - TxTokenTransfer { - token_identifier: LOCKED_TOKEN_ID.to_vec(), - nonce: 1, - value: rust_biguint!(10_000_000), - }, - ]; - b_mock - .execute_esdt_multi_transfer(&user_addr, &lock_wrapper, &transfers[..], |sc| { - let (dust_first_token, dust_second_token, lp_proxy_payment) = sc - .add_liquidity_locked_token(managed_biguint!(1), managed_biguint!(1)) - .into_tuple(); - - assert_eq!( - dust_first_token.token_identifier, - managed_token_id!(WEGLD_TOKEN_ID) - ); - assert_eq!(dust_first_token.token_nonce, 0); - assert_eq!(dust_first_token.amount, managed_biguint!(0)); - - assert_eq!( - dust_second_token.token_identifier, - managed_token_id!(MEX_TOKEN_ID) - ); - assert_eq!(dust_second_token.token_nonce, 0); - assert_eq!(dust_second_token.amount, managed_biguint!(0)); - - assert_eq!( - lp_proxy_payment.token_identifier, - managed_token_id!(LOCKED_LP_TOKEN_ID) - ); - assert_eq!(lp_proxy_payment.token_nonce, 1); - assert_eq!(lp_proxy_payment.amount, managed_biguint!(9_999_000)); - }) - .assert_ok(); - - b_mock.check_nft_balance( - &user_addr, - LOCKED_LP_TOKEN_ID, - 1, - &rust_biguint!(9_999_000), - Some(&LpProxyTokenAttributes:: { - lp_token_id: managed_token_id!(LP_TOKEN_ID), - first_token_id: managed_token_id!(WEGLD_TOKEN_ID), - first_token_locked_nonce: 0, - second_token_id: managed_token_id!(MEX_TOKEN_ID), - second_token_locked_nonce: 1, - }), - ); - - b_mock.check_esdt_balance( - lock_wrapper.address_ref(), - LP_TOKEN_ID, - &rust_biguint!(9_999_000), - ); - - // user enter farm - b_mock - .execute_esdt_transfer( - &user_addr, - &lock_wrapper, - LOCKED_LP_TOKEN_ID, - 1, - &rust_biguint!(9_999_000), - |sc| { - let enter_farm_result = sc.enter_farm_locked_token(FarmType::SimpleFarm); - let (out_farm_token, _reward_token) = enter_farm_result.into_tuple(); - assert_eq!( - out_farm_token.token_identifier, - managed_token_id!(FARM_PROXY_TOKEN_ID) - ); - assert_eq!(out_farm_token.token_nonce, 1); - assert_eq!(out_farm_token.amount, managed_biguint!(9_999_000)); - }, - ) - .assert_ok(); - - b_mock.check_nft_balance( - &user_addr, - FARM_PROXY_TOKEN_ID, - 1, - &rust_biguint!(9_999_000), - Some(&FarmProxyTokenAttributes:: { - farm_type: FarmType::SimpleFarm, - farm_token_id: managed_token_id!(FARM_TOKEN_ID), - farm_token_nonce: 1, - farming_token_id: managed_token_id!(LP_TOKEN_ID), - farming_token_locked_nonce: 1, - }), - ); - - // user claim farm rewards - // b_mock.set_block_nonce(10); - b_mock.set_block_epoch(10); - - b_mock - .execute_esdt_transfer( - &user_addr, - &lock_wrapper, - FARM_PROXY_TOKEN_ID, - 1, - &rust_biguint!(9_999_000), - |sc| { - let claim_result = - sc.destroy_farm_locked_tokens(managed_biguint!(1), managed_biguint!(1)); - - assert_eq!( - claim_result.first_payment.token_identifier, - managed_token_id!(WEGLD_TOKEN_ID) - ); - assert_eq!( - claim_result.first_payment.amount, - managed_biguint!(9_999_000) - ); - - assert_eq!( - claim_result.second_payment.token_identifier, - managed_token_id!(LOCKED_TOKEN_ID) - ); - assert_eq!( - claim_result.second_payment.amount, - managed_biguint!(9_999_000) - ); - - assert_eq!( - claim_result.farm_rewards.token_identifier, - managed_token_id!(MEX_TOKEN_ID) - ); - assert_eq!(claim_result.farm_rewards.amount, managed_biguint!(0)); - }, - ) - .assert_ok(); -} From dd4cb715ad51a06be03b2c20b06c8c5406db27d4 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Tue, 9 Apr 2024 13:55:00 +0300 Subject: [PATCH 211/213] Github actions on rc branches --- .github/workflows/actions.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 56d357593..afa63aa92 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -2,9 +2,9 @@ name: CI on: push: - branches: [ main, feat/* ] + branches: [ main, feat/*, rc/* ] pull_request: - branches: [ main, feat/* ] + branches: [ main, feat/*, rc/* ] workflow_dispatch: permissions: From de594b3b5390039a45c7e3a946907ce1569809d1 Mon Sep 17 00:00:00 2001 From: dragosrebegea Date: Tue, 9 Apr 2024 16:27:36 +0200 Subject: [PATCH 212/213] total quorum check --- energy-integration/governance-v2/src/lib.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/energy-integration/governance-v2/src/lib.rs b/energy-integration/governance-v2/src/lib.rs index c914e3a95..0165979cd 100644 --- a/energy-integration/governance-v2/src/lib.rs +++ b/energy-integration/governance-v2/src/lib.rs @@ -52,6 +52,17 @@ pub trait GovernanceV2: self.try_change_fee_token_id(fee_token); } + #[endpoint] + fn upgrade(&self) { + &self, + proposal_id: ProposalId, + total_percentage: BigUint, + ) { + let mut proposal = self.proposals().get(proposal_id); + proposal.total_quorum = total_percentage; + self.proposals().set(proposal_id, &proposal); + } + /// Propose a list of actions. /// A maximum of MAX_GOVERNANCE_PROPOSAL_ACTIONS can be proposed at a time. /// From 5c3900ffa92fa9194c04eff69a836161614930e0 Mon Sep 17 00:00:00 2001 From: dragosrebegea Date: Tue, 16 Apr 2024 10:58:50 +0300 Subject: [PATCH 213/213] fix compile issue --- energy-integration/governance-v2/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/energy-integration/governance-v2/src/lib.rs b/energy-integration/governance-v2/src/lib.rs index 0165979cd..ac502e0fa 100644 --- a/energy-integration/governance-v2/src/lib.rs +++ b/energy-integration/governance-v2/src/lib.rs @@ -53,7 +53,7 @@ pub trait GovernanceV2: } #[endpoint] - fn upgrade(&self) { + fn upgrade( &self, proposal_id: ProposalId, total_percentage: BigUint,