From 067064bc48f6cc6081b7c09bf73bf1263924c106 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Wed, 8 May 2024 00:45:01 +0300 Subject: [PATCH 01/15] Energy factory unit test audit update --- .../tests/simple_lock_energy_test.rs | 80 ++++++++++++++++++- 1 file changed, 79 insertions(+), 1 deletion(-) 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 6d23bd1ef..8c0655476 100644 --- a/locked-asset/energy-factory/tests/simple_lock_energy_test.rs +++ b/locked-asset/energy-factory/tests/simple_lock_energy_test.rs @@ -2,7 +2,9 @@ mod energy_factory_setup; -use energy_factory::energy::EnergyModule; +use energy_factory::{ + energy::EnergyModule, locked_token_transfer::LockedTokenTransferModule, SimpleLockEnergy, +}; use energy_factory_setup::*; use multiversx_sc::types::BigUint; use simple_lock::locked_token::LockedTokenAttributes; @@ -489,3 +491,79 @@ fn energy_deplete_test() { }) .assert_ok(); } + +#[test] +fn extend_lock_period_endpoint_test() { + let mut setup = SimpleLockEnergySetup::new(energy_factory::contract_obj); + let first_user = setup.first_user.clone(); + let random_user = setup.b_mock.create_user_account(&rust_biguint!(0u64)); + + let current_epoch = 1; + setup.b_mock.set_block_epoch(current_epoch); + + setup + .lock( + &first_user, + BASE_ASSET_TOKEN_ID, + USER_BALANCE, + LOCK_OPTIONS[0], + ) + .assert_ok(); + + setup + .b_mock + .execute_esdt_transfer( + &first_user, + &setup.sc_wrapper, + LOCKED_TOKEN_ID, + 1, + &rust_biguint!(USER_BALANCE), + |sc| { + sc.extend_lock_period(100, managed_address!(&first_user)); + }, + ) + .assert_user_error("Invalid lock choice"); + + setup + .b_mock + .execute_esdt_transfer( + &first_user, + &setup.sc_wrapper, + LOCKED_TOKEN_ID, + 1, + &rust_biguint!(USER_BALANCE), + |sc| { + sc.extend_lock_period(LOCK_OPTIONS[0], managed_address!(&first_user)); + }, + ) + .assert_user_error("May not call this endpoint. Use lockTokens instead"); + + let energy_per_epoch = rust_biguint!(USER_BALANCE); + let energy_before = setup.get_user_energy(&first_user); + assert_eq!( + energy_before, + LOCK_OPTIONS[0] * energy_per_epoch.clone() - energy_per_epoch.clone() + ); + + setup + .b_mock + .execute_esdt_transfer( + &first_user, + &setup.sc_wrapper, + LOCKED_TOKEN_ID, + 1, + &rust_biguint!(USER_BALANCE), + |sc| { + sc.token_transfer_whitelist() + .add(&managed_address!(&first_user)); + sc.extend_lock_period(LOCK_OPTIONS[1], managed_address!(&first_user)); + }, + ) + .assert_ok(); + + let energy_after = setup.get_user_energy(&first_user); + assert_eq!( + energy_after, + LOCK_OPTIONS[1] * energy_per_epoch.clone() - energy_per_epoch.clone() + ); +} From 867a88d82192d515d9a3c01b6324073d700febec Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Thu, 9 May 2024 17:15:59 +0300 Subject: [PATCH 02/15] clippy fix --- locked-asset/energy-factory/tests/simple_lock_energy_test.rs | 1 - 1 file changed, 1 deletion(-) 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 8c0655476..202630958 100644 --- a/locked-asset/energy-factory/tests/simple_lock_energy_test.rs +++ b/locked-asset/energy-factory/tests/simple_lock_energy_test.rs @@ -496,7 +496,6 @@ fn energy_deplete_test() { fn extend_lock_period_endpoint_test() { let mut setup = SimpleLockEnergySetup::new(energy_factory::contract_obj); let first_user = setup.first_user.clone(); - let random_user = setup.b_mock.create_user_account(&rust_biguint!(0u64)); let current_epoch = 1; setup.b_mock.set_block_epoch(current_epoch); From c8f3f213f78f54656a3eda2ed22b9c1f96e2ad4e Mon Sep 17 00:00:00 2001 From: Dorin Marian Iancu Date: Mon, 13 May 2024 12:07:10 +0300 Subject: [PATCH 03/15] farm energy fix --- common/common_structs/src/farm_types.rs | 7 +++ .../contexts/src/claim_rewards_context.rs | 30 +++++++--- .../farm/contexts/src/enter_farm_context.rs | 28 +++++++-- common/modules/farm/events/src/events.rs | 4 +- .../farm_base_impl/src/base_traits_impl.rs | 34 ++++------- .../farm/farm_base_impl/src/claim_rewards.rs | 12 +++- .../farm_base_impl/src/compound_rewards.rs | 10 +++- .../farm/farm_base_impl/src/enter_farm.rs | 7 ++- .../farm/farm_base_impl/src/exit_farm.rs | 2 +- common/modules/utils/src/lib.rs | 24 +++++--- dex/farm-with-locked-rewards/src/lib.rs | 2 - dex/farm/src/base_functions.rs | 45 +++++++++++++- dex/farm/src/lib.rs | 2 - .../farm-boosted-yields/src/lib.rs | 2 +- .../farm-staking/src/base_impl_wrapper.rs | 58 ------------------- .../src/claim_stake_farm_rewards.rs | 5 ++ .../src/compound_stake_farm_rewards.rs | 5 ++ .../farm-staking/src/delete_energy.rs | 43 ++++++++++++++ farm-staking/farm-staking/src/lib.rs | 15 ++++- farm-staking/farm-staking/src/stake_farm.rs | 5 ++ .../farm-staking/src/token_attributes.rs | 4 ++ farm-staking/farm-staking/src/unstake_farm.rs | 6 +- 22 files changed, 230 insertions(+), 120 deletions(-) create mode 100644 farm-staking/farm-staking/src/delete_energy.rs diff --git a/common/common_structs/src/farm_types.rs b/common/common_structs/src/farm_types.rs index d7d85e20b..676b26e36 100644 --- a/common/common_structs/src/farm_types.rs +++ b/common/common_structs/src/farm_types.rs @@ -80,6 +80,8 @@ pub trait FarmToken { fn get_compounded_rewards(&self) -> BigUint; fn get_initial_farming_tokens(&self) -> BigUint; + + fn get_original_owner(&self) -> ManagedAddress; } impl FarmToken for FarmTokenAttributes { @@ -97,4 +99,9 @@ impl FarmToken for FarmTokenAttributes { fn get_initial_farming_tokens(&self) -> BigUint { &self.current_farm_amount - &self.compounded_reward } + + #[inline] + fn get_original_owner(&self) -> ManagedAddress { + self.original_owner.clone() + } } diff --git a/common/modules/farm/contexts/src/claim_rewards_context.rs b/common/modules/farm/contexts/src/claim_rewards_context.rs index 653c6b2e6..78b8f4e67 100644 --- a/common/modules/farm/contexts/src/claim_rewards_context.rs +++ b/common/modules/farm/contexts/src/claim_rewards_context.rs @@ -2,26 +2,28 @@ multiversx_sc::imports!(); multiversx_sc::derive_imports!(); use common_errors::{ERROR_BAD_PAYMENTS, ERROR_EMPTY_PAYMENTS}; -use common_structs::PaymentAttributesPair; +use common_structs::{PaymentAttributesPair, PaymentsVec}; use multiversx_sc::api::BlockchainApi; use multiversx_sc::contract_base::BlockchainWrapper; pub struct ClaimRewardsContext where M: ManagedTypeApi, - T: Clone + TopEncode + TopDecode + NestedEncode + NestedDecode, + T: Clone + TopEncode + TopDecode + NestedEncode + NestedDecode + ManagedVecItem, { pub first_farm_token: PaymentAttributesPair, - pub additional_payments: ManagedVec>, + pub additional_payments: PaymentsVec, + pub additional_attributes: ManagedVec, + pub all_attributes: ManagedVec, } impl ClaimRewardsContext where M: ManagedTypeApi + BlockchainApi, - T: Clone + TopEncode + TopDecode + NestedEncode + NestedDecode, + T: Clone + TopEncode + TopDecode + NestedEncode + NestedDecode + ManagedVecItem, { pub fn new( - mut payments: ManagedVec>, + mut payments: PaymentsVec, farm_token_id: &TokenIdentifier, api_wrapper: BlockchainWrapper, ) -> Self { @@ -29,22 +31,32 @@ where M::error_api_impl().signal_error(ERROR_EMPTY_PAYMENTS); } + let own_sc_address = api_wrapper.get_sc_address(); + let mut all_attributes = ManagedVec::new(); for p in &payments { if &p.token_identifier != farm_token_id { M::error_api_impl().signal_error(ERROR_BAD_PAYMENTS); } + + let token_data = + api_wrapper.get_esdt_token_data(&own_sc_address, farm_token_id, p.token_nonce); + let token_attributes: T = token_data.decode_attributes(); + all_attributes.push(token_attributes); } let first_payment = payments.get(0); payments.remove(0); - let own_sc_address = api_wrapper.get_sc_address(); - let token_data = api_wrapper.get_esdt_token_data( + // dumb framework errors otherwise + let first_token_data = api_wrapper.get_esdt_token_data( &own_sc_address, farm_token_id, first_payment.token_nonce, ); - let first_token_attributes: T = token_data.decode_attributes(); + let first_token_attributes: T = first_token_data.decode_attributes(); + + let mut additional_attributes = all_attributes.clone(); + additional_attributes.remove(0); ClaimRewardsContext { first_farm_token: PaymentAttributesPair { @@ -52,6 +64,8 @@ where attributes: first_token_attributes, }, additional_payments: payments, + additional_attributes, + all_attributes, } } } diff --git a/common/modules/farm/contexts/src/enter_farm_context.rs b/common/modules/farm/contexts/src/enter_farm_context.rs index 9da789d9a..27a060015 100644 --- a/common/modules/farm/contexts/src/enter_farm_context.rs +++ b/common/modules/farm/contexts/src/enter_farm_context.rs @@ -2,17 +2,28 @@ multiversx_sc::imports!(); multiversx_sc::derive_imports!(); use common_errors::{ERROR_BAD_PAYMENTS, ERROR_EMPTY_PAYMENTS}; +use common_structs::PaymentsVec; +use multiversx_sc::{api::BlockchainApi, contract_base::BlockchainWrapper}; -pub struct EnterFarmContext { +pub struct EnterFarmContext< + M: ManagedTypeApi, + T: Clone + TopEncode + TopDecode + NestedEncode + NestedDecode + ManagedVecItem, +> { pub farming_token_payment: EsdtTokenPayment, - pub additional_farm_tokens: ManagedVec>, + pub additional_farm_tokens: PaymentsVec, + pub additional_attributes: ManagedVec, } -impl EnterFarmContext { +impl< + M: ManagedTypeApi + BlockchainApi, + T: Clone + TopEncode + TopDecode + NestedEncode + NestedDecode + ManagedVecItem, + > EnterFarmContext +{ pub fn new( - mut payments: ManagedVec>, + mut payments: PaymentsVec, farming_token_id: &TokenIdentifier, farm_token_id: &TokenIdentifier, + api_wrapper: BlockchainWrapper, ) -> Self { if payments.is_empty() { M::error_api_impl().signal_error(ERROR_EMPTY_PAYMENTS); @@ -24,15 +35,24 @@ impl EnterFarmContext { } payments.remove(0); + + let own_sc_address = api_wrapper.get_sc_address(); + let mut additional_attributes = ManagedVec::new(); for p in &payments { if &p.token_identifier != farm_token_id { M::error_api_impl().signal_error(ERROR_BAD_PAYMENTS); } + + let token_data = + api_wrapper.get_esdt_token_data(&own_sc_address, farm_token_id, p.token_nonce); + let token_attributes: T = token_data.decode_attributes(); + additional_attributes.push(token_attributes); } EnterFarmContext { farming_token_payment, additional_farm_tokens: payments, + additional_attributes, } } } diff --git a/common/modules/farm/events/src/events.rs b/common/modules/farm/events/src/events.rs index c32988130..6b55fed0c 100644 --- a/common/modules/farm/events/src/events.rs +++ b/common/modules/farm/events/src/events.rs @@ -142,7 +142,7 @@ pub trait EventsModule { fn emit_claim_rewards_event< 'a, C: FarmContracTraitBounds, - AttributesType: Clone + TopEncode + TopDecode + NestedEncode + NestedDecode, + AttributesType: Clone + TopEncode + TopDecode + NestedEncode + NestedDecode + ManagedVecItem, >( &self, original_caller: &ManagedAddress, @@ -189,7 +189,7 @@ pub trait EventsModule { fn emit_compound_rewards_event< 'a, C: FarmContracTraitBounds, - AttributesType: Clone + TopEncode + TopDecode + NestedEncode + NestedDecode, + AttributesType: Clone + TopEncode + TopDecode + NestedEncode + NestedDecode + ManagedVecItem, >( self, original_caller: &ManagedAddress, 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 f2ccc293c..7fdb6cdc3 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 @@ -1,12 +1,11 @@ multiversx_sc::imports!(); -use common_structs::{FarmToken, FarmTokenAttributes, Nonce}; +use common_structs::{FarmToken, FarmTokenAttributes, Nonce, PaymentsVec}; use config::ConfigModule; 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 = @@ -30,8 +29,8 @@ pub trait FarmContract { + FixedSupplyToken<::Api> + FarmToken<::Api> + From::Api>> - + Into::Api>> = - FarmTokenAttributes<::Api>; + + Into::Api>> + + ManagedVecItem = FarmTokenAttributes<::Api>; #[inline] fn mint_rewards( @@ -192,27 +191,21 @@ pub trait FarmContract { fn check_and_update_user_farm_position( sc: &Self::FarmSc, user: &ManagedAddress<::Api>, - farm_positions: &PaymentsVec<::Api>, + farm_tokens: &PaymentsVec<::Api>, + farm_attributes: &ManagedVec<::Api, Self::AttributesType>, ) { - 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) { + for (attr, farm_token) in farm_attributes.into_iter().zip(farm_tokens.iter()) { + if sc.is_old_farm_position(farm_token.token_nonce) { continue; } - 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); - Self::increase_user_farm_position(sc, user, &farm_position.amount); + if &attr.get_original_owner() != user { + Self::decrease_user_farm_position(sc, &farm_token, &attr); + Self::increase_user_farm_position(sc, user, &farm_token.amount); } } } - #[inline] fn increase_user_farm_position( sc: &Self::FarmSc, user: &ManagedAddress<::Api>, @@ -227,16 +220,13 @@ pub trait FarmContract { fn decrease_user_farm_position( sc: &Self::FarmSc, farm_position: &EsdtTokenPayment<::Api>, + attributes: &Self::AttributesType, ) { 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); - - sc.user_total_farm_position(&token_attributes.original_owner) + sc.user_total_farm_position(&attributes.get_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; 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 d9dfe293e..30b943089 100644 --- a/common/modules/farm/farm_base_impl/src/claim_rewards.rs +++ b/common/modules/farm/farm_base_impl/src/claim_rewards.rs @@ -11,7 +11,7 @@ use fixed_supply_token::FixedSupplyToken; pub struct InternalClaimRewardsResult<'a, C, T> where C: FarmContracTraitBounds, - T: Clone + TopEncode + TopDecode + NestedEncode + NestedDecode, + T: Clone + TopEncode + TopDecode + NestedEncode + NestedDecode + ManagedVecItem, { pub context: ClaimRewardsContext, pub storage_cache: StorageCache<'a, C>, @@ -81,7 +81,12 @@ pub trait BaseClaimRewardsModule: ); storage_cache.reward_reserve -= &reward; - FC::check_and_update_user_farm_position(self, &caller, &payments); + FC::check_and_update_user_farm_position( + self, + &caller, + &payments, + &claim_rewards_context.all_attributes, + ); let farm_token_mapper = self.farm_token(); let base_attributes = FC::create_claim_rewards_initial_attributes( @@ -90,10 +95,11 @@ pub trait BaseClaimRewardsModule: token_attributes, storage_cache.reward_per_share.clone(), ); + let new_token_attributes = self.merge_attributes_from_payments( base_attributes, + &claim_rewards_context.additional_attributes, &claim_rewards_context.additional_payments, - &farm_token_mapper, ); let new_farm_token = PaymentAttributesPair { payment: EsdtTokenPayment::new( 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 06e52585c..530f732c0 100644 --- a/common/modules/farm/farm_base_impl/src/compound_rewards.rs +++ b/common/modules/farm/farm_base_impl/src/compound_rewards.rs @@ -12,7 +12,7 @@ use fixed_supply_token::FixedSupplyToken; pub struct InternalCompoundRewardsResult<'a, C, T> where C: FarmContracTraitBounds, - T: Clone + TopEncode + TopDecode + NestedEncode + NestedDecode, + T: Clone + TopEncode + TopDecode + NestedEncode + NestedDecode + ManagedVecItem, { pub context: CompoundRewardsContext, pub storage_cache: StorageCache<'a, C>, @@ -70,7 +70,12 @@ pub trait BaseCompoundRewardsModule: storage_cache.reward_reserve -= &reward; storage_cache.farm_token_supply += &reward; - FC::check_and_update_user_farm_position(self, &caller, &payments); + FC::check_and_update_user_farm_position( + self, + &caller, + &payments, + &compound_rewards_context.all_attributes, + ); let farm_token_mapper = self.farm_token(); let base_attributes = FC::create_compound_rewards_initial_attributes( @@ -82,6 +87,7 @@ pub trait BaseCompoundRewardsModule: ); let new_farm_token = self.merge_and_create_token( base_attributes, + &compound_rewards_context.additional_attributes, &compound_rewards_context.additional_payments, &farm_token_mapper, ); 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 02e20d42a..850606829 100644 --- a/common/modules/farm/farm_base_impl/src/enter_farm.rs +++ b/common/modules/farm/farm_base_impl/src/enter_farm.rs @@ -10,9 +10,9 @@ use contexts::{ pub struct InternalEnterFarmResult<'a, C, T> where C: FarmContracTraitBounds, - T: Clone + TopEncode + TopDecode + NestedEncode + NestedDecode, + T: Clone + TopEncode + TopDecode + NestedEncode + NestedDecode + ManagedVecItem, { - pub context: EnterFarmContext, + pub context: EnterFarmContext, pub storage_cache: StorageCache<'a, C>, pub new_farm_token: PaymentAttributesPair, pub created_with_merge: bool, @@ -42,6 +42,7 @@ pub trait BaseEnterFarmModule: payments, &storage_cache.farming_token_id, &storage_cache.farm_token_id, + self.blockchain(), ); // The order is important - first check and update, then increase position @@ -49,6 +50,7 @@ pub trait BaseEnterFarmModule: self, &caller, &enter_farm_context.additional_farm_tokens, + &enter_farm_context.additional_attributes, ); FC::increase_user_farm_position( self, @@ -69,6 +71,7 @@ pub trait BaseEnterFarmModule: ); let new_farm_token = self.merge_and_create_token( base_attributes, + &enter_farm_context.additional_attributes, &enter_farm_context.additional_farm_tokens, &farm_token_mapper, ); 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 315abe421..30d420787 100644 --- a/common/modules/farm/farm_base_impl/src/exit_farm.rs +++ b/common/modules/farm/farm_base_impl/src/exit_farm.rs @@ -62,7 +62,7 @@ pub trait BaseExitFarmModule: ); storage_cache.reward_reserve -= &reward; - FC::decrease_user_farm_position(self, &payment); + FC::decrease_user_farm_position(self, &payment, &exit_farm_context.farm_token.attributes); let farming_token_amount = token_attributes.get_total_supply(); let farming_token_payment = EsdtTokenPayment::new( diff --git a/common/modules/utils/src/lib.rs b/common/modules/utils/src/lib.rs index 990b88329..9077b7203 100644 --- a/common/modules/utils/src/lib.rs +++ b/common/modules/utils/src/lib.rs @@ -57,7 +57,7 @@ pub trait UtilsModule { } fn merge_from_payments_and_burn< - T: FixedSupplyToken + Mergeable + TopDecode, + T: FixedSupplyToken + Mergeable + TopDecode + ManagedVecItem, >( &self, mut payments: PaymentsVec, @@ -68,23 +68,29 @@ pub trait UtilsModule { self.get_attributes_as_part_of_fixed_supply(&first_payment, mapper); mapper.nft_burn(first_payment.token_nonce, &first_payment.amount); + let mut other_attributes = ManagedVec::new(); + for payment in &payments { + let attr = mapper.get_token_attributes(payment.token_nonce); + other_attributes.push(attr); + } + let output_attributes = - self.merge_attributes_from_payments(base_attributes, &payments, mapper); + self.merge_attributes_from_payments(base_attributes, &other_attributes, &payments); self.send().esdt_local_burn_multi(&payments); output_attributes } fn merge_attributes_from_payments< - T: FixedSupplyToken + Mergeable + TopDecode, + T: FixedSupplyToken + Mergeable + TopDecode + ManagedVecItem, >( &self, mut base_attributes: T, + other_attributes: &ManagedVec, payments: &PaymentsVec, - mapper: &NonFungibleTokenMapper, ) -> T { - for payment in payments { - let attributes: T = self.get_attributes_as_part_of_fixed_supply(&payment, mapper); + for (attr, payment) in other_attributes.into_iter().zip(payments.iter()) { + let attributes = attr.into_part(&payment.amount); base_attributes.merge_with(attributes); } @@ -98,15 +104,17 @@ pub trait UtilsModule { + TopEncode + TopDecode + NestedEncode - + NestedDecode, + + NestedDecode + + ManagedVecItem, >( &self, base_attributes: T, + other_attributes: &ManagedVec, payments: &PaymentsVec, mapper: &NonFungibleTokenMapper, ) -> PaymentAttributesPair { let output_attributes = - self.merge_attributes_from_payments(base_attributes, payments, mapper); + self.merge_attributes_from_payments(base_attributes, other_attributes, payments); let new_token_amount = output_attributes.get_total_supply(); let new_token_payment = mapper.nft_create(new_token_amount, &output_attributes); diff --git a/dex/farm-with-locked-rewards/src/lib.rs b/dex/farm-with-locked-rewards/src/lib.rs index d704a80df..34600f80b 100644 --- a/dex/farm-with-locked-rewards/src/lib.rs +++ b/dex/farm-with-locked-rewards/src/lib.rs @@ -182,8 +182,6 @@ pub trait Farm: orig_caller.clone(), ); - self.clear_user_energy_if_needed(&orig_caller); - (exit_farm_result.farming_tokens, locked_rewards_payment).into() } diff --git a/dex/farm/src/base_functions.rs b/dex/farm/src/base_functions.rs index 48a59ac56..510887aa6 100644 --- a/dex/farm/src/base_functions.rs +++ b/dex/farm/src/base_functions.rs @@ -7,6 +7,7 @@ multiversx_sc::derive_imports!(); use core::marker::PhantomData; use common_errors::ERROR_ZERO_AMOUNT; +use common_structs::FarmToken; use common_structs::FarmTokenAttributes; use contexts::storage_cache::StorageCache; @@ -81,6 +82,10 @@ pub trait BaseFunctionsModule: &base_enter_farm_result.storage_cache.farm_token_supply, ); + self.delete_user_energy_if_needed::( + &base_enter_farm_result.context.additional_attributes, + ); + self.emit_enter_farm_event( &caller, base_enter_farm_result.context.farming_token_payment, @@ -106,6 +111,8 @@ pub trait BaseFunctionsModule: &base_claim_rewards_result.storage_cache.farm_token_supply, ); + self.delete_user_energy_if_needed::(&base_claim_rewards_result.context.all_attributes); + self.emit_claim_rewards_event( &caller, base_claim_rewards_result.context, @@ -135,6 +142,10 @@ pub trait BaseFunctionsModule: &base_compound_rewards_result.storage_cache.farm_token_supply, ); + self.delete_user_energy_if_needed::( + &base_compound_rewards_result.context.all_attributes, + ); + self.emit_compound_rewards_event( &caller, base_compound_rewards_result.context, @@ -161,6 +172,10 @@ pub trait BaseFunctionsModule: &base_exit_farm_result.storage_cache.farm_token_supply, ); + self.delete_user_energy_if_needed::(&ManagedVec::from_single_item( + base_exit_farm_result.context.farm_token.attributes.clone(), + )); + FC::apply_penalty( self, &mut farming_token_payment.amount, @@ -188,9 +203,18 @@ pub trait BaseFunctionsModule: ) -> FC::AttributesType { let payments = self.get_non_empty_payments(); let token_mapper = self.farm_token(); - token_mapper.require_all_same_token(&payments); - FC::check_and_update_user_farm_position(self, orig_caller, &payments); + let mut all_attributes = ManagedVec::new(); + for payment in &payments { + token_mapper.require_same_token(&payment.token_identifier); + + let attr = token_mapper.get_token_attributes(payment.token_nonce); + all_attributes.push(attr); + } + + self.delete_user_energy_if_needed::(&all_attributes); + + FC::check_and_update_user_farm_position(self, orig_caller, &payments, &all_attributes); self.merge_from_payments_and_burn(payments, &token_mapper) } @@ -253,6 +277,23 @@ pub trait BaseFunctionsModule: self.per_block_reward_amount().set(&per_block_amount); } + fn delete_user_energy_if_needed>( + &self, + all_attributes: &ManagedVec, + ) { + let mut processed_users = ManagedMap::new(); + for attr in all_attributes { + let original_owner = attr.get_original_owner(); + if processed_users.contains(original_owner.as_managed_buffer()) { + continue; + } + + self.clear_user_energy_if_needed(&original_owner); + + processed_users.put(original_owner.as_managed_buffer(), &ManagedBuffer::new()); + } + } + fn require_queried(&self) { let caller = self.blockchain().get_caller(); let sc_address = self.blockchain().get_sc_address(); diff --git a/dex/farm/src/lib.rs b/dex/farm/src/lib.rs index 1a35c1631..5bf5dba64 100644 --- a/dex/farm/src/lib.rs +++ b/dex/farm/src/lib.rs @@ -177,8 +177,6 @@ pub trait Farm: self.send_payment_non_zero(&caller, &exit_farm_result.farming_tokens); self.send_payment_non_zero(&caller, &exit_farm_result.rewards); - self.clear_user_energy_if_needed(&orig_caller); - (exit_farm_result.farming_tokens, exit_farm_result.rewards).into() } diff --git a/energy-integration/farm-boosted-yields/src/lib.rs b/energy-integration/farm-boosted-yields/src/lib.rs index 09bacc676..78ec0fb4e 100644 --- a/energy-integration/farm-boosted-yields/src/lib.rs +++ b/energy-integration/farm-boosted-yields/src/lib.rs @@ -123,8 +123,8 @@ pub trait FarmBoostedYieldsModule: 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 user_total_farm_position = self.get_user_total_farm_position(original_caller); let boosted_yields_factors = config.get_latest_factors(); self.clear_user_energy( original_caller, diff --git a/farm-staking/farm-staking/src/base_impl_wrapper.rs b/farm-staking/farm-staking/src/base_impl_wrapper.rs index 2b671677f..da30a1c84 100644 --- a/farm-staking/farm-staking/src/base_impl_wrapper.rs +++ b/farm-staking/farm-staking/src/base_impl_wrapper.rs @@ -5,7 +5,6 @@ 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; @@ -184,61 +183,4 @@ 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(); - for farm_position in farm_positions { - 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 &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>, - 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) - .set(user_total_farm_position); - } - - fn decrease_user_farm_position( - 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); - - 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/farm-staking/farm-staking/src/claim_stake_farm_rewards.rs b/farm-staking/farm-staking/src/claim_stake_farm_rewards.rs index 93d4802ea..4fb4de268 100644 --- a/farm-staking/farm-staking/src/claim_stake_farm_rewards.rs +++ b/farm-staking/farm-staking/src/claim_stake_farm_rewards.rs @@ -30,6 +30,7 @@ pub trait ClaimStakeFarmRewardsModule: + weekly_rewards_splitting::locked_token_buckets::WeeklyRewardsLockedTokenBucketsModule + weekly_rewards_splitting::update_claim_progress_energy::UpdateClaimProgressEnergyModule + energy_query::EnergyQueryModule + + crate::delete_energy::DeleteEnergyModule { #[payable("*")] #[endpoint(claimRewards)] @@ -86,6 +87,10 @@ pub trait ClaimStakeFarmRewardsModule: self.set_farm_supply_for_current_week(&claim_result.storage_cache.farm_token_supply); } + self.delete_user_energy_if_needed::>( + &claim_result.context.all_attributes, + ); + self.update_energy_and_progress(&original_caller); let new_farm_token_nonce = self.send().esdt_nft_create_compact( 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 a7d83d574..bb0c2906d 100644 --- a/farm-staking/farm-staking/src/compound_stake_farm_rewards.rs +++ b/farm-staking/farm-staking/src/compound_stake_farm_rewards.rs @@ -28,6 +28,7 @@ pub trait CompoundStakeFarmRewardsModule: + weekly_rewards_splitting::locked_token_buckets::WeeklyRewardsLockedTokenBucketsModule + weekly_rewards_splitting::update_claim_progress_energy::UpdateClaimProgressEnergyModule + energy_query::EnergyQueryModule + + crate::delete_energy::DeleteEnergyModule { #[payable("*")] #[endpoint(compoundRewards)] @@ -43,6 +44,10 @@ pub trait CompoundStakeFarmRewardsModule: self.set_farm_supply_for_current_week(&compound_result.storage_cache.farm_token_supply); + self.delete_user_energy_if_needed::>( + &compound_result.context.all_attributes, + ); + self.emit_compound_rewards_event( &caller, compound_result.context, diff --git a/farm-staking/farm-staking/src/delete_energy.rs b/farm-staking/farm-staking/src/delete_energy.rs new file mode 100644 index 000000000..ddb8c9d52 --- /dev/null +++ b/farm-staking/farm-staking/src/delete_energy.rs @@ -0,0 +1,43 @@ +use common_structs::FarmToken; +use farm_base_impl::base_traits_impl::FarmContract; + +multiversx_sc::imports!(); + +#[multiversx_sc::module] +pub trait DeleteEnergyModule: + rewards::RewardsModule + + config::ConfigModule + + token_send::TokenSendModule + + farm_token::FarmTokenModule + + pausable::PausableModule + + permissions_module::PermissionsModule + + events::EventsModule + + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule + + utils::UtilsModule + + farm_boosted_yields::FarmBoostedYieldsModule + + farm_boosted_yields::boosted_yields_factors::BoostedYieldsFactorsModule + + 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 +{ + fn delete_user_energy_if_needed>( + &self, + all_attributes: &ManagedVec, + ) { + let mut processed_users = ManagedMap::new(); + for attr in all_attributes { + let original_owner = attr.get_original_owner(); + if processed_users.contains(original_owner.as_managed_buffer()) { + continue; + } + + self.clear_user_energy_if_needed(&original_owner); + + processed_users.put(original_owner.as_managed_buffer(), &ManagedBuffer::new()); + } + } +} diff --git a/farm-staking/farm-staking/src/lib.rs b/farm-staking/farm-staking/src/lib.rs index 5fd2b28d6..f7aa53f70 100644 --- a/farm-staking/farm-staking/src/lib.rs +++ b/farm-staking/farm-staking/src/lib.rs @@ -19,6 +19,7 @@ pub mod claim_only_boosted_staking_rewards; pub mod claim_stake_farm_rewards; pub mod compound_stake_farm_rewards; pub mod custom_rewards; +pub mod delete_energy; pub mod farm_token_roles; pub mod stake_farm; pub mod token_attributes; @@ -60,6 +61,7 @@ pub trait FarmStaking: + weekly_rewards_splitting::locked_token_buckets::WeeklyRewardsLockedTokenBucketsModule + weekly_rewards_splitting::update_claim_progress_energy::UpdateClaimProgressEnergyModule + energy_query::EnergyQueryModule + + delete_energy::DeleteEnergyModule { #[init] fn init( @@ -141,9 +143,18 @@ pub trait FarmStaking: ) -> FC::AttributesType { let payments = self.get_non_empty_payments(); let token_mapper = self.farm_token(); - token_mapper.require_all_same_token(&payments); - FC::check_and_update_user_farm_position(self, orig_caller, &payments); + let mut all_attributes = ManagedVec::new(); + for payment in &payments { + token_mapper.require_same_token(&payment.token_identifier); + + let attr = token_mapper.get_token_attributes(payment.token_nonce); + all_attributes.push(attr); + } + + self.delete_user_energy_if_needed::(&all_attributes); + + FC::check_and_update_user_farm_position(self, orig_caller, &payments, &all_attributes); self.merge_from_payments_and_burn(payments, &token_mapper) } diff --git a/farm-staking/farm-staking/src/stake_farm.rs b/farm-staking/farm-staking/src/stake_farm.rs index 7ab3dea1c..5dfa8ca53 100644 --- a/farm-staking/farm-staking/src/stake_farm.rs +++ b/farm-staking/farm-staking/src/stake_farm.rs @@ -31,6 +31,7 @@ pub trait StakeFarmModule: + weekly_rewards_splitting::locked_token_buckets::WeeklyRewardsLockedTokenBucketsModule + weekly_rewards_splitting::update_claim_progress_energy::UpdateClaimProgressEnergyModule + energy_query::EnergyQueryModule + + crate::delete_energy::DeleteEnergyModule { #[payable("*")] #[endpoint(stakeFarmThroughProxy)] @@ -86,6 +87,10 @@ pub trait StakeFarmModule: self.set_farm_supply_for_current_week(&enter_result.storage_cache.farm_token_supply); + self.delete_user_energy_if_needed::>( + &enter_result.context.additional_attributes, + ); + self.update_energy_and_progress(&original_caller); self.emit_enter_farm_event( diff --git a/farm-staking/farm-staking/src/token_attributes.rs b/farm-staking/farm-staking/src/token_attributes.rs index 59f8c6326..0fcabeba3 100644 --- a/farm-staking/farm-staking/src/token_attributes.rs +++ b/farm-staking/farm-staking/src/token_attributes.rs @@ -82,6 +82,10 @@ impl FarmToken for StakingFarmTokenAttributes { fn get_initial_farming_tokens(&self) -> BigUint { &self.current_farm_amount - &self.compounded_reward } + + fn get_original_owner(&self) -> ManagedAddress { + self.original_owner.clone() + } } impl FixedSupplyToken for StakingFarmTokenAttributes { diff --git a/farm-staking/farm-staking/src/unstake_farm.rs b/farm-staking/farm-staking/src/unstake_farm.rs index e40642b4f..6b87d9782 100644 --- a/farm-staking/farm-staking/src/unstake_farm.rs +++ b/farm-staking/farm-staking/src/unstake_farm.rs @@ -30,6 +30,7 @@ pub trait UnstakeFarmModule: + weekly_rewards_splitting::locked_token_buckets::WeeklyRewardsLockedTokenBucketsModule + weekly_rewards_splitting::update_claim_progress_energy::UpdateClaimProgressEnergyModule + energy_query::EnergyQueryModule + + crate::delete_energy::DeleteEnergyModule { #[payable("*")] #[endpoint(unstakeFarm)] @@ -89,9 +90,12 @@ pub trait UnstakeFarmModule: self.send_payment_non_zero(&caller, &exit_result.reward_payment); - self.clear_user_energy_if_needed(&original_caller); self.set_farm_supply_for_current_week(&exit_result.storage_cache.farm_token_supply); + self.delete_user_energy_if_needed::>( + &ManagedVec::from_single_item(exit_result.context.farm_token.attributes.clone()), + ); + self.emit_exit_farm_event( &caller, exit_result.context, From d8a5d6f004b50b4e111bec7dc0a1bdf29bcfa9bd Mon Sep 17 00:00:00 2001 From: Dorin Marian Iancu Date: Mon, 13 May 2024 12:49:12 +0300 Subject: [PATCH 04/15] more fixes + test --- dex/farm/tests/energy_update_test.rs | 133 ++++++++++++++++++ .../farm-boosted-yields/src/lib.rs | 24 ++-- 2 files changed, 148 insertions(+), 9 deletions(-) diff --git a/dex/farm/tests/energy_update_test.rs b/dex/farm/tests/energy_update_test.rs index 1d8f78a98..e091a028e 100644 --- a/dex/farm/tests/energy_update_test.rs +++ b/dex/farm/tests/energy_update_test.rs @@ -2,7 +2,14 @@ mod farm_setup; +use common_structs::FarmTokenAttributes; +use farm::Farm; use farm_setup::multi_user_farm_setup::*; +use multiversx_sc::imports::OptionalValue; +use multiversx_sc_scenario::{ + managed_biguint, rust_biguint, whitebox_legacy::TxTokenTransfer, DebugApi, +}; +use weekly_rewards_splitting::global_info::WeeklyRewardsGlobalInfo; #[test] fn test_farm_setup() { @@ -53,3 +60,129 @@ fn test_energy_update_no_claim_current_week() { farm_setup.update_energy_for_user(); farm_setup.check_farm_claim_progress_energy(0); } + +#[test] +fn enter_farm_other_users_pos_test() { + DebugApi::dummy(); + + let mut farm_setup = MultiUserFarmSetup::new( + farm::contract_obj, + energy_factory_mock::contract_obj, + energy_update::contract_obj, + ); + + let first_farm_token_amount = 100_000_000; + let first_user = farm_setup.first_user.clone(); + let second_user = farm_setup.second_user.clone(); + + let first_user_energy_amount = 1_000; + let second_user_energy_amount = 5_000; + farm_setup.set_user_energy(&first_user, first_user_energy_amount, 13, 1); + farm_setup.set_user_energy(&second_user, second_user_energy_amount, 13, 1); + + farm_setup.enter_farm(&first_user, first_farm_token_amount); + + let token_attributes: FarmTokenAttributes = farm_setup + .b_mock + .get_nft_attributes(&first_user, FARM_TOKEN_ID, 1) + .unwrap(); + + // first user transfer pos to second user + farm_setup.b_mock.set_nft_balance( + &second_user, + FARM_TOKEN_ID, + 1, + &rust_biguint!(first_farm_token_amount), + &token_attributes, + ); + farm_setup.b_mock.set_nft_balance( + &first_user, + FARM_TOKEN_ID, + 1, + &rust_biguint!(0), + &token_attributes, + ); + + let transfers = [ + TxTokenTransfer { + token_identifier: FARMING_TOKEN_ID.to_vec(), + nonce: 0, + value: rust_biguint!(1_000), + }, + TxTokenTransfer { + token_identifier: FARM_TOKEN_ID.to_vec(), + nonce: 1, + value: rust_biguint!(first_farm_token_amount), + }, + ]; + + farm_setup + .b_mock + .execute_esdt_multi_transfer(&second_user, &farm_setup.farm_wrapper, &transfers, |sc| { + sc.enter_farm_endpoint(OptionalValue::None); + + let actual_energy = sc.total_energy_for_week(1).get(); + assert_eq!(actual_energy, managed_biguint!(second_user_energy_amount)); + }) + .assert_ok(); +} + +#[test] +fn exit_other_users_pos_test() { + DebugApi::dummy(); + + let mut farm_setup = MultiUserFarmSetup::new( + farm::contract_obj, + energy_factory_mock::contract_obj, + energy_update::contract_obj, + ); + + let first_farm_token_amount = 100_000_000; + let first_user = farm_setup.first_user.clone(); + let second_user = farm_setup.second_user.clone(); + + let first_user_energy_amount = 1_000; + let second_user_energy_amount = 200; + farm_setup.set_user_energy(&first_user, first_user_energy_amount, 13, 1); + farm_setup.set_user_energy(&second_user, second_user_energy_amount, 13, 1); + + farm_setup.enter_farm(&first_user, first_farm_token_amount); + + let token_attributes: FarmTokenAttributes = farm_setup + .b_mock + .get_nft_attributes(&first_user, FARM_TOKEN_ID, 1) + .unwrap(); + + // first user transfer pos to second user + farm_setup.b_mock.set_nft_balance( + &second_user, + FARM_TOKEN_ID, + 1, + &rust_biguint!(first_farm_token_amount), + &token_attributes, + ); + farm_setup.b_mock.set_nft_balance( + &first_user, + FARM_TOKEN_ID, + 1, + &rust_biguint!(0), + &token_attributes, + ); + + farm_setup + .b_mock + .execute_esdt_transfer( + &second_user, + &farm_setup.farm_wrapper, + FARM_TOKEN_ID, + 1, + &rust_biguint!(first_farm_token_amount), + |sc| { + sc.exit_farm_endpoint(OptionalValue::None); + + let actual_energy = sc.total_energy_for_week(1).get(); + assert_eq!(actual_energy, managed_biguint!(0)); + }, + ) + .assert_ok(); +} diff --git a/energy-integration/farm-boosted-yields/src/lib.rs b/energy-integration/farm-boosted-yields/src/lib.rs index 78ec0fb4e..0c8543132 100644 --- a/energy-integration/farm-boosted-yields/src/lib.rs +++ b/energy-integration/farm-boosted-yields/src/lib.rs @@ -15,6 +15,7 @@ use weekly_rewards_splitting::{ pub mod boosted_yields_factors; const MAX_PERCENT: u64 = 10_000; +const DEFAULT_MIN_FARM_AMT: u64 = 1; pub struct SplitReward { pub base_farm: BigUint, @@ -123,15 +124,20 @@ pub trait FarmBoostedYieldsModule: fn clear_user_energy_if_needed(&self, original_caller: &ManagedAddress) { let opt_config = self.try_get_boosted_yields_config(); - if let Some(config) = opt_config { - let user_total_farm_position = self.get_user_total_farm_position(original_caller); - let boosted_yields_factors = config.get_latest_factors(); - self.clear_user_energy( - original_caller, - &user_total_farm_position.total_farm_position, - &boosted_yields_factors.min_farm_amount, - ); - } + let user_total_farm_position = self.get_user_total_farm_position(original_caller); + let min_farm_amount = match opt_config { + Some(config) => { + let boosted_yields_factors = config.get_latest_factors(); + boosted_yields_factors.min_farm_amount.clone() + } + None => BigUint::from(DEFAULT_MIN_FARM_AMT), + }; + + self.clear_user_energy( + original_caller, + &user_total_farm_position.total_farm_position, + &min_farm_amount, + ); } #[view(getBoostedYieldsRewardsPercentage)] From 457831115b775283fba97d5df5d18c9fbb51665a Mon Sep 17 00:00:00 2001 From: Dorin Marian Iancu Date: Mon, 13 May 2024 13:06:33 +0300 Subject: [PATCH 05/15] fix for old users --- dex/farm/src/base_functions.rs | 33 +++++++++++++------ .../src/claim_stake_farm_rewards.rs | 4 ++- .../src/compound_stake_farm_rewards.rs | 6 ++-- .../farm-staking/src/delete_energy.rs | 9 +++-- farm-staking/farm-staking/src/lib.rs | 2 +- farm-staking/farm-staking/src/stake_farm.rs | 1 + farm-staking/farm-staking/src/unstake_farm.rs | 5 +-- 7 files changed, 41 insertions(+), 19 deletions(-) diff --git a/dex/farm/src/base_functions.rs b/dex/farm/src/base_functions.rs index 510887aa6..16704331d 100644 --- a/dex/farm/src/base_functions.rs +++ b/dex/farm/src/base_functions.rs @@ -9,6 +9,7 @@ use core::marker::PhantomData; use common_errors::ERROR_ZERO_AMOUNT; use common_structs::FarmToken; use common_structs::FarmTokenAttributes; +use common_structs::PaymentsVec; use contexts::storage_cache::StorageCache; use farm_base_impl::base_traits_impl::{DefaultFarmWrapper, FarmContract}; @@ -83,6 +84,7 @@ pub trait BaseFunctionsModule: ); self.delete_user_energy_if_needed::( + &base_enter_farm_result.context.additional_farm_tokens, &base_enter_farm_result.context.additional_attributes, ); @@ -102,7 +104,8 @@ pub trait BaseFunctionsModule: caller: ManagedAddress, ) -> ClaimRewardsResultWrapper { let payments = self.call_value().all_esdt_transfers().clone_value(); - let base_claim_rewards_result = self.claim_rewards_base::(caller.clone(), payments); + let base_claim_rewards_result = + self.claim_rewards_base::(caller.clone(), payments.clone()); let output_farm_token_payment = base_claim_rewards_result.new_farm_token.payment.clone(); let rewards_payment = base_claim_rewards_result.rewards; @@ -111,7 +114,10 @@ pub trait BaseFunctionsModule: &base_claim_rewards_result.storage_cache.farm_token_supply, ); - self.delete_user_energy_if_needed::(&base_claim_rewards_result.context.all_attributes); + self.delete_user_energy_if_needed::( + &payments, + &base_claim_rewards_result.context.all_attributes, + ); self.emit_claim_rewards_event( &caller, @@ -134,7 +140,7 @@ pub trait BaseFunctionsModule: ) -> EsdtTokenPayment { let payments = self.call_value().all_esdt_transfers().clone_value(); let base_compound_rewards_result = - self.compound_rewards_base::(caller.clone(), payments); + self.compound_rewards_base::(caller.clone(), payments.clone()); let output_farm_token_payment = base_compound_rewards_result.new_farm_token.payment.clone(); @@ -143,6 +149,7 @@ pub trait BaseFunctionsModule: ); self.delete_user_energy_if_needed::( + &payments, &base_compound_rewards_result.context.all_attributes, ); @@ -163,7 +170,7 @@ pub trait BaseFunctionsModule: caller: ManagedAddress, payment: EsdtTokenPayment, ) -> ExitFarmResultWrapper { - let base_exit_farm_result = self.exit_farm_base::(caller.clone(), payment); + let base_exit_farm_result = self.exit_farm_base::(caller.clone(), payment.clone()); let mut farming_token_payment = base_exit_farm_result.farming_token_payment; let reward_payment = base_exit_farm_result.reward_payment; @@ -172,9 +179,12 @@ pub trait BaseFunctionsModule: &base_exit_farm_result.storage_cache.farm_token_supply, ); - self.delete_user_energy_if_needed::(&ManagedVec::from_single_item( - base_exit_farm_result.context.farm_token.attributes.clone(), - )); + self.delete_user_energy_if_needed::( + &ManagedVec::from_single_item(payment), + &ManagedVec::from_single_item( + base_exit_farm_result.context.farm_token.attributes.clone(), + ), + ); FC::apply_penalty( self, @@ -212,7 +222,7 @@ pub trait BaseFunctionsModule: all_attributes.push(attr); } - self.delete_user_energy_if_needed::(&all_attributes); + self.delete_user_energy_if_needed::(&payments, &all_attributes); FC::check_and_update_user_farm_position(self, orig_caller, &payments, &all_attributes); @@ -279,12 +289,15 @@ pub trait BaseFunctionsModule: fn delete_user_energy_if_needed>( &self, + payments: &PaymentsVec, all_attributes: &ManagedVec, ) { let mut processed_users = ManagedMap::new(); - for attr in all_attributes { + for (payment, attr) in payments.iter().zip(all_attributes.into_iter()) { let original_owner = attr.get_original_owner(); - if processed_users.contains(original_owner.as_managed_buffer()) { + if processed_users.contains(original_owner.as_managed_buffer()) + || self.is_old_farm_position(payment.token_nonce) + { continue; } 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 4fb4de268..53050ba98 100644 --- a/farm-staking/farm-staking/src/claim_stake_farm_rewards.rs +++ b/farm-staking/farm-staking/src/claim_stake_farm_rewards.rs @@ -63,11 +63,12 @@ pub trait ClaimStakeFarmRewardsModule: 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::>( original_caller.clone(), - ManagedVec::from_single_item(payment), + ManagedVec::from_single_item(payment.clone()), ); let mut virtual_farm_token = claim_result.new_farm_token.clone(); @@ -88,6 +89,7 @@ pub trait ClaimStakeFarmRewardsModule: } self.delete_user_energy_if_needed::>( + &ManagedVec::from_single_item(payment), &claim_result.context.all_attributes, ); 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 bb0c2906d..cd8df29a9 100644 --- a/farm-staking/farm-staking/src/compound_stake_farm_rewards.rs +++ b/farm-staking/farm-staking/src/compound_stake_farm_rewards.rs @@ -35,9 +35,10 @@ pub trait CompoundStakeFarmRewardsModule: 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); + let compound_result = self + .compound_rewards_base::>(caller.clone(), payments.clone()); let new_farm_token = compound_result.new_farm_token.payment.clone(); self.send_payment_non_zero(&caller, &new_farm_token); @@ -45,6 +46,7 @@ pub trait CompoundStakeFarmRewardsModule: self.set_farm_supply_for_current_week(&compound_result.storage_cache.farm_token_supply); self.delete_user_energy_if_needed::>( + &payments, &compound_result.context.all_attributes, ); diff --git a/farm-staking/farm-staking/src/delete_energy.rs b/farm-staking/farm-staking/src/delete_energy.rs index ddb8c9d52..7c80412eb 100644 --- a/farm-staking/farm-staking/src/delete_energy.rs +++ b/farm-staking/farm-staking/src/delete_energy.rs @@ -1,4 +1,4 @@ -use common_structs::FarmToken; +use common_structs::{FarmToken, PaymentsVec}; use farm_base_impl::base_traits_impl::FarmContract; multiversx_sc::imports!(); @@ -26,12 +26,15 @@ pub trait DeleteEnergyModule: { fn delete_user_energy_if_needed>( &self, + payments: &PaymentsVec, all_attributes: &ManagedVec, ) { let mut processed_users = ManagedMap::new(); - for attr in all_attributes { + for (payment, attr) in payments.iter().zip(all_attributes.into_iter()) { let original_owner = attr.get_original_owner(); - if processed_users.contains(original_owner.as_managed_buffer()) { + if processed_users.contains(original_owner.as_managed_buffer()) + || self.is_old_farm_position(payment.token_nonce) + { continue; } diff --git a/farm-staking/farm-staking/src/lib.rs b/farm-staking/farm-staking/src/lib.rs index f7aa53f70..589748364 100644 --- a/farm-staking/farm-staking/src/lib.rs +++ b/farm-staking/farm-staking/src/lib.rs @@ -152,7 +152,7 @@ pub trait FarmStaking: all_attributes.push(attr); } - self.delete_user_energy_if_needed::(&all_attributes); + self.delete_user_energy_if_needed::(&payments, &all_attributes); FC::check_and_update_user_farm_position(self, orig_caller, &payments, &all_attributes); diff --git a/farm-staking/farm-staking/src/stake_farm.rs b/farm-staking/farm-staking/src/stake_farm.rs index 5dfa8ca53..a022b689d 100644 --- a/farm-staking/farm-staking/src/stake_farm.rs +++ b/farm-staking/farm-staking/src/stake_farm.rs @@ -88,6 +88,7 @@ pub trait StakeFarmModule: self.set_farm_supply_for_current_week(&enter_result.storage_cache.farm_token_supply); self.delete_user_energy_if_needed::>( + &enter_result.context.additional_farm_tokens, &enter_result.context.additional_attributes, ); diff --git a/farm-staking/farm-staking/src/unstake_farm.rs b/farm-staking/farm-staking/src/unstake_farm.rs index 6b87d9782..1d40cfd15 100644 --- a/farm-staking/farm-staking/src/unstake_farm.rs +++ b/farm-staking/farm-staking/src/unstake_farm.rs @@ -75,8 +75,8 @@ pub trait UnstakeFarmModule: ) -> ExitFarmWithPartialPosResultType { let migrated_amount = self.migrate_old_farm_positions(&original_caller); - let exit_result = - self.exit_farm_base::>(original_caller.clone(), payment); + let exit_result = self + .exit_farm_base::>(original_caller.clone(), payment.clone()); self.decrease_old_farm_positions(migrated_amount, &original_caller); @@ -93,6 +93,7 @@ pub trait UnstakeFarmModule: self.set_farm_supply_for_current_week(&exit_result.storage_cache.farm_token_supply); self.delete_user_energy_if_needed::>( + &ManagedVec::from_single_item(payment), &ManagedVec::from_single_item(exit_result.context.farm_token.attributes.clone()), ); From 9803759e81fb54d9b8e044b9af21396346234a3f Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Tue, 14 May 2024 03:00:15 +0300 Subject: [PATCH 06/15] proxy dex unit tests audit update --- .../proxy_dex/tests/proxy_farm_test.rs | 422 +++++++++++++++++- locked-asset/proxy_dex/tests/proxy_lp_test.rs | 118 +++-- 2 files changed, 493 insertions(+), 47 deletions(-) diff --git a/locked-asset/proxy_dex/tests/proxy_farm_test.rs b/locked-asset/proxy_dex/tests/proxy_farm_test.rs index 6fe7c59b9..af054dc93 100644 --- a/locked-asset/proxy_dex/tests/proxy_farm_test.rs +++ b/locked-asset/proxy_dex/tests/proxy_farm_test.rs @@ -355,7 +355,8 @@ fn farm_with_wrapped_lp_test() { block_epoch, managed_biguint!(user_balance), ); - let actual_energy = sc.user_energy(&managed_address!(&first_user)).get(); + let actual_energy = + sc.get_updated_energy_entry_for_user(&managed_address!(&first_user)); assert_eq!(expected_energy, actual_energy); }) .assert_ok(); @@ -1216,6 +1217,19 @@ fn total_farm_mechanism_test() { let mut block_epoch = 1; setup.b_mock.set_block_epoch(block_epoch); + // Check total farm position + setup + .b_mock + .execute_query(&setup.farm_locked_wrapper, |sc| { + let first_user_total_farm_position = + sc.get_user_total_farm_position(&managed_address!(&first_user)); + assert_eq!( + first_user_total_farm_position.total_farm_position, + managed_biguint!(0) + ); + }) + .assert_ok(); + //////////////////////////////////////////// ENTER FARM ///////////////////////////////////// setup @@ -1232,6 +1246,19 @@ fn total_farm_mechanism_test() { ) .assert_ok(); + // Check total farm position + setup + .b_mock + .execute_query(&setup.farm_locked_wrapper, |sc| { + let first_user_total_farm_position = + sc.get_user_total_farm_position(&managed_address!(&first_user)); + assert_eq!( + first_user_total_farm_position.total_farm_position, + managed_biguint!(USER_BALANCE) + ); + }) + .assert_ok(); + block_epoch += 7; setup.b_mock.set_block_epoch(block_epoch); @@ -1249,6 +1276,19 @@ fn total_farm_mechanism_test() { ) .assert_ok(); + // Check total farm position + setup + .b_mock + .execute_query(&setup.farm_locked_wrapper, |sc| { + let first_user_total_farm_position = + sc.get_user_total_farm_position(&managed_address!(&first_user)); + assert_eq!( + first_user_total_farm_position.total_farm_position, + managed_biguint!(USER_BALANCE * 2) + ); + }) + .assert_ok(); + setup.b_mock.check_nft_balance( &first_user, WRAPPED_FARM_TOKEN_ID, @@ -1304,6 +1344,19 @@ fn total_farm_mechanism_test() { ) .assert_ok(); + // Check total farm position + setup + .b_mock + .execute_query(&setup.farm_locked_wrapper, |sc| { + let first_user_total_farm_position = + sc.get_user_total_farm_position(&managed_address!(&first_user)); + assert_eq!( + first_user_total_farm_position.total_farm_position, + managed_biguint!(USER_BALANCE * 2) + ); + }) + .assert_ok(); + // check user balance setup.b_mock.check_nft_balance::( &first_user, @@ -1400,7 +1453,8 @@ fn increase_proxy_farm_lkmex_energy() { block_epoch, managed_biguint!(USER_BALANCE), ); - let actual_energy = sc.user_energy(&managed_address!(&first_user)).get(); + let actual_energy = + sc.get_updated_energy_entry_for_user(&managed_address!(&first_user)); assert_eq!(expected_energy, actual_energy); }) .assert_ok(); @@ -1432,7 +1486,8 @@ fn increase_proxy_farm_lkmex_energy() { block_epoch, managed_biguint!(USER_BALANCE), ); - let actual_energy = sc.user_energy(&managed_address!(&first_user)).get(); + let actual_energy = + sc.get_updated_energy_entry_for_user(&managed_address!(&first_user)); assert_eq!(expected_energy, actual_energy); }) .assert_ok(); @@ -1528,7 +1583,8 @@ fn increase_proxy_farm_proxy_lp_energy() { block_epoch, managed_biguint!(user_balance), ); - let actual_energy = sc.user_energy(&managed_address!(&first_user)).get(); + let actual_energy = + sc.get_updated_energy_entry_for_user(&managed_address!(&first_user)); assert_eq!(expected_energy, actual_energy); }) .assert_ok(); @@ -1621,6 +1677,17 @@ fn increase_proxy_farm_proxy_lp_energy() { ) .assert_ok(); + // check old tokens were burned + setup + .b_mock + .check_nft_balance::>( + setup.proxy_wrapper.address_ref(), + WRAPPED_FARM_TOKEN_ID, + 4, + &rust_biguint!(0u64), + None, + ); + // check energy after // lp tokens recharged = total tokens / 4 - 500 let user_locked_tokens_in_lp = locked_token_amount.to_u64().unwrap() / 4 - 500; @@ -1638,7 +1705,8 @@ fn increase_proxy_farm_proxy_lp_energy() { block_epoch, managed_biguint!(USER_BALANCE), ); - let actual_energy = sc.user_energy(&managed_address!(&first_user)).get(); + let actual_energy = + sc.get_updated_energy_entry_for_user(&managed_address!(&first_user)); assert_eq!(expected_energy, actual_energy); }) .assert_ok(); @@ -1755,7 +1823,8 @@ fn increase_proxy_farm_proxy_lp_energy_unlocked_tokens() { block_epoch, managed_biguint!(user_balance), ); - let actual_energy = sc.user_energy(&managed_address!(&first_user)).get(); + let actual_energy = + sc.get_updated_energy_entry_for_user(&managed_address!(&first_user)); assert_eq!(expected_energy, actual_energy); }) .assert_ok(); @@ -1852,6 +1921,17 @@ fn increase_proxy_farm_proxy_lp_energy_unlocked_tokens() { ) .assert_ok(); + // check old tokens were burned + setup + .b_mock + .check_nft_balance::>( + setup.proxy_wrapper.address_ref(), + WRAPPED_FARM_TOKEN_ID, + 4, + &rust_biguint!(0u64), + None, + ); + // check energy after // lp tokens recharged = total tokens / 4 - 500 let user_locked_tokens_in_lp = locked_token_amount.to_u64().unwrap() / 4 - 500; @@ -1870,7 +1950,8 @@ fn increase_proxy_farm_proxy_lp_energy_unlocked_tokens() { block_epoch, managed_biguint!(USER_BALANCE), ); - let actual_energy = sc.user_energy(&managed_address!(&first_user)).get(); + let actual_energy = + sc.get_updated_energy_entry_for_user(&managed_address!(&first_user)); assert_eq!(expected_energy, actual_energy); }) .assert_ok(); @@ -1971,7 +2052,7 @@ fn increase_proxy_farm_proxy_lp_energy_partially_unlocked_tokens() { }) .assert_ok(); - let mut block_epoch = 1u64; + let block_epoch = 1u64; let user_balance = USER_BALANCE; // check energy before @@ -1987,7 +2068,8 @@ fn increase_proxy_farm_proxy_lp_energy_partially_unlocked_tokens() { block_epoch, managed_biguint!(user_balance), ); - let actual_energy = sc.user_energy(&managed_address!(&first_user)).get(); + let actual_energy = + sc.get_updated_energy_entry_for_user(&managed_address!(&first_user)); assert_eq!(expected_energy, actual_energy); }) .assert_ok(); @@ -2065,10 +2147,6 @@ fn increase_proxy_farm_proxy_lp_energy_partially_unlocked_tokens() { ) .assert_ok(); - ////////////////////////////// Wait for tokens to unlock ///////////////////////////////////// - block_epoch += LOCK_OPTIONS[0] / 2; - setup.b_mock.set_block_epoch(block_epoch); - //////////////////////////////////////////// INCREASE ENERGY ///////////////////////////////////// setup .b_mock @@ -2084,6 +2162,17 @@ fn increase_proxy_farm_proxy_lp_energy_partially_unlocked_tokens() { ) .assert_ok(); + // check old tokens were burned + setup + .b_mock + .check_nft_balance::>( + setup.proxy_wrapper.address_ref(), + WRAPPED_FARM_TOKEN_ID, + 4, + &rust_biguint!(0u64), + None, + ); + // check energy after // lp tokens recharged = total tokens / 4 - 500 let user_locked_tokens_in_lp = locked_token_amount.to_u64().unwrap() / 4 - 500; @@ -2102,7 +2191,8 @@ fn increase_proxy_farm_proxy_lp_energy_partially_unlocked_tokens() { block_epoch, managed_biguint!(USER_BALANCE), ); - let actual_energy = sc.user_energy(&managed_address!(&first_user)).get(); + let actual_energy = + sc.get_updated_energy_entry_for_user(&managed_address!(&first_user)); assert_eq!(expected_energy, actual_energy); }) .assert_ok(); @@ -2371,3 +2461,307 @@ fn total_farm_position_migration_through_proxy_dex_test() { }) .assert_ok(); } + +#[test] +fn increase_proxy_farm_legacy_token_energy_negative_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(); + + //////////////////////////////////////////// ENTER FARM ///////////////////////////////////// + + setup + .b_mock + .execute_esdt_transfer( + &first_user, + &setup.proxy_wrapper, + LEGACY_LOCKED_TOKEN_ID, + 3, + &rust_biguint!(USER_BALANCE), + |sc| { + sc.enter_farm_proxy_endpoint(managed_address!(&farm_addr), OptionalValue::None); + }, + ) + .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_user_error("Invalid payments"); +} + +#[test] +fn total_farm_position_migration_mechanism_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 * 6); + setup + .b_mock + .set_esdt_balance(&first_user, MEX_TOKEN_ID, &user_balance); + + // user locks 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 * 6)); + }, + ) + .assert_ok(); + + // User enter farm 5 times before migration + 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), OptionalValue::None); + }, + ) + .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), OptionalValue::None); + }, + ) + .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), OptionalValue::None); + }, + ) + .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), OptionalValue::None); + }, + ) + .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), OptionalValue::None); + }, + ) + .assert_ok(); + + // Simulate contract upgrade - total farm position is reset and migration nonce set + setup + .b_mock + .execute_tx( + &setup.owner, + &setup.farm_locked_wrapper, + &rust_biguint!(0), + |sc| { + let mut first_user_total_farm_position = + sc.get_user_total_farm_position(&managed_address!(&first_user)); + first_user_total_farm_position.total_farm_position = managed_biguint!(0u64); + + sc.user_total_farm_position(&managed_address!(&first_user)) + .set(first_user_total_farm_position); + sc.farm_position_migration_nonce().set(6u64); + }, + ) + .assert_ok(); + + setup + .b_mock + .execute_query(&setup.farm_locked_wrapper, |sc| { + let first_user_total_farm_position = + sc.get_user_total_farm_position(&managed_address!(&first_user)); + assert_eq!( + first_user_total_farm_position.total_farm_position, + managed_biguint!(0) + ); + }) + .assert_ok(); + + // User enters farm again after migration + let enter_payments = vec![ + TxTokenTransfer { + token_identifier: LOCKED_TOKEN_ID.to_vec(), + nonce: 2, + value: rust_biguint!(USER_BALANCE), + }, + TxTokenTransfer { + token_identifier: WRAPPED_FARM_TOKEN_ID.to_vec(), + nonce: 1, + value: rust_biguint!(USER_BALANCE / 2), + }, + ]; + setup + .b_mock + .execute_esdt_multi_transfer(&first_user, &setup.proxy_wrapper, &enter_payments, |sc| { + sc.enter_farm_proxy_endpoint(managed_address!(&farm_addr), OptionalValue::None); + }) + .assert_ok(); + + // Check total farm position + let mut user_total_farm_position = USER_BALANCE + (USER_BALANCE / 2); + setup + .b_mock + .execute_query(&setup.farm_locked_wrapper, |sc| { + let first_user_total_farm_position = + sc.get_user_total_farm_position(&managed_address!(&first_user)); + assert_eq!( + first_user_total_farm_position.total_farm_position, + managed_biguint!(user_total_farm_position) + ); + }) + .assert_ok(); + + // Claim rewards with half old position + setup + .b_mock + .execute_esdt_transfer( + &first_user, + &setup.proxy_wrapper, + WRAPPED_FARM_TOKEN_ID, + 2, + &rust_biguint!(USER_BALANCE / 2), + |sc| { + sc.claim_rewards_proxy(managed_address!(&farm_addr), OptionalValue::None); + }, + ) + .assert_ok(); + + // Check total farm position + user_total_farm_position += USER_BALANCE / 2; + setup + .b_mock + .execute_query(&setup.farm_locked_wrapper, |sc| { + let first_user_total_farm_position = + sc.get_user_total_farm_position(&managed_address!(&first_user)); + assert_eq!( + first_user_total_farm_position.total_farm_position, + managed_biguint!(user_total_farm_position) + ); + }) + .assert_ok(); + + // Exit farm with half old position + 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), OptionalValue::None); + }, + ) + .assert_ok(); + + // Total farm position stays the same + setup + .b_mock + .execute_query(&setup.farm_locked_wrapper, |sc| { + let first_user_total_farm_position = + sc.get_user_total_farm_position(&managed_address!(&first_user)); + assert_eq!( + first_user_total_farm_position.total_farm_position, + managed_biguint!(user_total_farm_position) + ); + }) + .assert_ok(); + + // Merge 2 partial old farm positions + let merge_payments = vec![ + TxTokenTransfer { + token_identifier: WRAPPED_FARM_TOKEN_ID.to_vec(), + nonce: 4, + value: rust_biguint!(USER_BALANCE / 2), + }, + TxTokenTransfer { + token_identifier: WRAPPED_FARM_TOKEN_ID.to_vec(), + nonce: 5, + value: rust_biguint!(USER_BALANCE / 4 * 3), + }, + ]; + setup + .b_mock + .execute_esdt_multi_transfer(&first_user, &setup.proxy_wrapper, &merge_payments, |sc| { + sc.merge_wrapped_farm_tokens_endpoint(managed_address!(&farm_addr)); + }) + .assert_ok(); + + // Check final total farm position + user_total_farm_position += USER_BALANCE / 2; + user_total_farm_position += USER_BALANCE / 4 * 3; + setup + .b_mock + .execute_query(&setup.farm_locked_wrapper, |sc| { + let first_user_total_farm_position = + sc.get_user_total_farm_position(&managed_address!(&first_user)); + assert_eq!( + first_user_total_farm_position.total_farm_position, + managed_biguint!(user_total_farm_position) + ); + }) + .assert_ok(); +} diff --git a/locked-asset/proxy_dex/tests/proxy_lp_test.rs b/locked-asset/proxy_dex/tests/proxy_lp_test.rs index 4dab8b14a..5d524ba3a 100644 --- a/locked-asset/proxy_dex/tests/proxy_lp_test.rs +++ b/locked-asset/proxy_dex/tests/proxy_lp_test.rs @@ -133,7 +133,8 @@ fn add_remove_liquidity_proxy_test() { block_epoch, managed_biguint!(user_balance), ); - let actual_energy = sc.user_energy(&managed_address!(&first_user)).get(); + let actual_energy = + sc.get_updated_energy_entry_for_user(&managed_address!(&first_user)); assert_eq!(expected_energy, actual_energy); }) .assert_ok(); @@ -190,7 +191,8 @@ fn add_remove_liquidity_proxy_test() { block_epoch, managed_biguint!(user_balance), ); - let actual_energy = sc.user_energy(&managed_address!(&first_user)).get(); + let actual_energy = + sc.get_updated_energy_entry_for_user(&managed_address!(&first_user)); assert_eq!(expected_energy, actual_energy); }) .assert_ok(); @@ -884,7 +886,8 @@ fn increase_proxy_lp_token_energy() { block_epoch, managed_biguint!(USER_BALANCE), ); - let actual_energy = sc.user_energy(&managed_address!(&first_user)).get(); + let actual_energy = + sc.get_updated_energy_entry_for_user(&managed_address!(&first_user)); assert_eq!(expected_energy, actual_energy); }) .assert_ok(); @@ -904,6 +907,17 @@ fn increase_proxy_lp_token_energy() { ) .assert_ok(); + // check old tokens were burned + setup + .b_mock + .check_nft_balance::>( + setup.proxy_wrapper.address_ref(), + WRAPPED_LP_TOKEN_ID, + 1, + &rust_biguint!(0u64), + None, + ); + // chceck new wrapped lp token setup.b_mock.check_nft_balance( &first_user, @@ -936,7 +950,8 @@ fn increase_proxy_lp_token_energy() { block_epoch, managed_biguint!(USER_BALANCE), ); - let actual_energy = sc.user_energy(&managed_address!(&first_user)).get(); + let actual_energy = + sc.get_updated_energy_entry_for_user(&managed_address!(&first_user)); assert_eq!(expected_energy, actual_energy); }) .assert_ok(); @@ -1027,18 +1042,17 @@ fn increase_proxy_lp_token_energy_unlocked_tokens() { block_epoch, managed_biguint!(USER_BALANCE), ); - let actual_energy = sc.user_energy(&managed_address!(&first_user)).get(); + let actual_energy = + sc.get_updated_energy_entry_for_user(&managed_address!(&first_user)); assert_eq!(expected_energy, actual_energy); }) .assert_ok(); - // Wait for tokens to unlock block_epoch += LOCK_OPTIONS[0]; setup.b_mock.set_block_epoch(block_epoch); - // call increase energy setup .b_mock @@ -1054,7 +1068,7 @@ fn increase_proxy_lp_token_energy_unlocked_tokens() { ) .assert_ok(); - // chceck new wrapped lp token + // check new wrapped lp token setup.b_mock.check_nft_balance( &first_user, WRAPPED_LP_TOKEN_ID, @@ -1072,22 +1086,36 @@ fn increase_proxy_lp_token_energy_unlocked_tokens() { }), ); + // check old tokens were burned + setup + .b_mock + .check_nft_balance::>( + setup.proxy_wrapper.address_ref(), + WRAPPED_LP_TOKEN_ID, + 1, + &rust_biguint!(0u64), + None, + ); + // check user energy after setup .b_mock .execute_query(&setup.simple_lock_wrapper, |sc| { let first_lock_epochs = LOCK_OPTIONS[1] - 1u64; - let second_lock_epochs = BigInt::from(LOCK_OPTIONS[0] as i64) - BigInt::from(block_epoch as i64); + let second_lock_epochs = + BigInt::from(LOCK_OPTIONS[0] as i64) - BigInt::from(block_epoch as i64); 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) * second_lock_epochs; + + BigInt::from((USER_BALANCE - user_locked_tokens_in_lp) as i64) + * second_lock_epochs; 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(); + let actual_energy = + sc.get_updated_energy_entry_for_user(&managed_address!(&first_user)); assert_eq!(expected_energy, actual_energy); }) .assert_ok(); @@ -1163,7 +1191,7 @@ fn increase_proxy_lp_token_energy_partially_unlocked_tokens() { }), ); - let mut block_epoch = 1; + let block_epoch = 1; let user_locked_tokens_in_lp = locked_token_amount.to_u64().unwrap(); // check user energy before @@ -1178,18 +1206,12 @@ fn increase_proxy_lp_token_energy_partially_unlocked_tokens() { block_epoch, managed_biguint!(USER_BALANCE), ); - let actual_energy = sc.user_energy(&managed_address!(&first_user)).get(); + let actual_energy = + sc.get_updated_energy_entry_for_user(&managed_address!(&first_user)); assert_eq!(expected_energy, actual_energy); }) .assert_ok(); - - // Wait for tokens to unlock - block_epoch += LOCK_OPTIONS[0] / 2; - - setup.b_mock.set_block_epoch(block_epoch); - - // call increase energy setup .b_mock @@ -1198,24 +1220,35 @@ fn increase_proxy_lp_token_energy_partially_unlocked_tokens() { &setup.proxy_wrapper, WRAPPED_LP_TOKEN_ID, 1, - &expected_lp_token_amount, + &(&expected_lp_token_amount / 2u64), |sc| { let _ = sc.increase_proxy_pair_token_energy_endpoint(LOCK_OPTIONS[1]); }, ) .assert_ok(); - // chceck new wrapped lp token + // check old tokens were burned + setup + .b_mock + .check_nft_balance::>( + setup.proxy_wrapper.address_ref(), + WRAPPED_LP_TOKEN_ID, + 1, + &rust_biguint!(0u64), + None, + ); + + // check remaining old wrapped lp token setup.b_mock.check_nft_balance( &first_user, WRAPPED_LP_TOKEN_ID, - 2, - &expected_lp_token_amount, + 1, + &(&expected_lp_token_amount / 2u64), Some(&WrappedLpTokenAttributes:: { locked_tokens: EsdtTokenPayment { token_identifier: managed_token_id!(LOCKED_TOKEN_ID), // Nonce increases - token_nonce: 3, + token_nonce: 1, amount: managed_biguint!(locked_token_amount.to_u64().unwrap()), }, lp_token_id: managed_token_id!(LP_TOKEN_ID), @@ -1223,29 +1256,47 @@ fn increase_proxy_lp_token_energy_partially_unlocked_tokens() { }), ); + // check new wrapped lp token + setup.b_mock.check_nft_balance( + &first_user, + WRAPPED_LP_TOKEN_ID, + 2, + &(&expected_lp_token_amount / 2u64), + 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() / 2u64), + }, + lp_token_id: managed_token_id!(LP_TOKEN_ID), + lp_token_amount: managed_biguint!(expected_lp_token_amount.to_u64().unwrap() / 2u64), + }), + ); + // check user energy after setup .b_mock .execute_query(&setup.simple_lock_wrapper, |sc| { let first_lock_epochs = LOCK_OPTIONS[1] - 1u64; - let second_lock_epochs = BigInt::from(LOCK_OPTIONS[0] as i64) - BigInt::from(block_epoch as i64); + let second_lock_epochs = + BigInt::from(LOCK_OPTIONS[0] as i64) - BigInt::from(block_epoch as i64); - let expected_energy_amount = BigInt::from((user_locked_tokens_in_lp) as i64) + let expected_energy_amount = BigInt::from((user_locked_tokens_in_lp / 2u64) as i64) * BigInt::from(first_lock_epochs as i64) - + BigInt::from((USER_BALANCE - user_locked_tokens_in_lp) as i64) * second_lock_epochs; + + BigInt::from((USER_BALANCE) as i64) * second_lock_epochs.clone() + - BigInt::from((user_locked_tokens_in_lp / 2u64) as i64) * second_lock_epochs; 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(); + let actual_energy = + sc.get_updated_energy_entry_for_user(&managed_address!(&first_user)); assert_eq!(expected_energy, actual_energy); }) .assert_ok(); } - - #[test] fn increase_proxy_lp_legacy_token_energy() { let mut setup = ProxySetup::new( @@ -1330,7 +1381,8 @@ fn increase_proxy_lp_legacy_token_energy() { block_epoch, managed_biguint!(USER_BALANCE), ); - let actual_energy = sc.user_energy(&managed_address!(&first_user)).get(); + let actual_energy = + sc.get_updated_energy_entry_for_user(&managed_address!(&first_user)); assert_eq!(expected_energy, actual_energy); }) .assert_ok(); @@ -1349,4 +1401,4 @@ fn increase_proxy_lp_legacy_token_energy() { }, ) .assert_error(4, "Invalid payment"); -} \ No newline at end of file +} From 55088f88a9c755561a7459df2a17be3be10b9aa2 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Tue, 14 May 2024 15:33:01 +0300 Subject: [PATCH 07/15] proxy dex unit test scenario improvement --- locked-asset/proxy_dex/tests/proxy_farm_test.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/locked-asset/proxy_dex/tests/proxy_farm_test.rs b/locked-asset/proxy_dex/tests/proxy_farm_test.rs index af054dc93..7f7a23b60 100644 --- a/locked-asset/proxy_dex/tests/proxy_farm_test.rs +++ b/locked-asset/proxy_dex/tests/proxy_farm_test.rs @@ -2155,7 +2155,7 @@ fn increase_proxy_farm_proxy_lp_energy_partially_unlocked_tokens() { &setup.proxy_wrapper, WRAPPED_FARM_TOKEN_ID, 4, - &(&expected_lp_token_amount / &rust_biguint!(4u64)), + &(&expected_lp_token_amount / &rust_biguint!(8u64)), |sc| { sc.increase_proxy_farm_token_energy_endpoint(LOCK_OPTIONS[1]); }, @@ -2182,10 +2182,11 @@ fn increase_proxy_farm_proxy_lp_energy_partially_unlocked_tokens() { let first_lock_epochs = LOCK_OPTIONS[1] - 1u64; let second_lock_epochs = BigInt::from(LOCK_OPTIONS[0] as i64) - BigInt::from(block_epoch as i64); - let expected_energy_amount = BigInt::from((user_locked_tokens_in_lp) as i64) + let expected_energy_amount = BigInt::from((user_locked_tokens_in_lp / 2) as i64) * BigInt::from(first_lock_epochs as i64) - + BigInt::from((USER_BALANCE - user_locked_tokens_in_lp) as i64) - * second_lock_epochs; + + BigInt::from((USER_BALANCE) as i64) * second_lock_epochs.clone() + - BigInt::from((user_locked_tokens_in_lp / 2u64) as i64) * second_lock_epochs; + let expected_energy = Energy::new( expected_energy_amount, block_epoch, @@ -2203,17 +2204,17 @@ fn increase_proxy_farm_proxy_lp_energy_partially_unlocked_tokens() { &first_user, WRAPPED_FARM_TOKEN_ID, 5, - &(&expected_lp_token_amount / &rust_biguint!(4u64)), + &(&expected_lp_token_amount / &rust_biguint!(8u64)), Some(&WrappedFarmTokenAttributes:: { proxy_farming_token: EsdtTokenPayment { token_identifier: managed_token_id!(WRAPPED_LP_TOKEN_ID), token_nonce: 3, - amount: managed_biguint!(expected_lp_token_amount.to_u64().unwrap() / 4u64), + amount: managed_biguint!(expected_lp_token_amount.to_u64().unwrap() / 8u64), }, farm_token: EsdtTokenPayment { token_identifier: managed_token_id!(FARM_LOCKED_TOKEN_ID), token_nonce: 4, - amount: managed_biguint!(expected_lp_token_amount.to_u64().unwrap() / 4u64), + amount: managed_biguint!(expected_lp_token_amount.to_u64().unwrap() / 8u64), }, }), ); From b9ed86c1a76f2331225f349aab898df4b464f36b Mon Sep 17 00:00:00 2001 From: Sorin Petreasca <90727972+psorinionut@users.noreply.github.com> Date: Mon, 20 May 2024 11:29:50 +0300 Subject: [PATCH 08/15] Revert "farm energy fix" --- common/common_structs/src/farm_types.rs | 7 - .../contexts/src/claim_rewards_context.rs | 30 ++-- .../farm/contexts/src/enter_farm_context.rs | 28 +--- common/modules/farm/events/src/events.rs | 4 +- .../farm_base_impl/src/base_traits_impl.rs | 34 +++-- .../farm/farm_base_impl/src/claim_rewards.rs | 12 +- .../farm_base_impl/src/compound_rewards.rs | 10 +- .../farm/farm_base_impl/src/enter_farm.rs | 7 +- .../farm/farm_base_impl/src/exit_farm.rs | 2 +- common/modules/utils/src/lib.rs | 24 ++-- dex/farm-with-locked-rewards/src/lib.rs | 2 + dex/farm/src/base_functions.rs | 64 +-------- dex/farm/src/lib.rs | 2 + dex/farm/tests/energy_update_test.rs | 133 ------------------ .../farm-boosted-yields/src/lib.rs | 22 ++- .../farm-staking/src/base_impl_wrapper.rs | 58 ++++++++ .../src/claim_stake_farm_rewards.rs | 9 +- .../src/compound_stake_farm_rewards.rs | 11 +- .../farm-staking/src/delete_energy.rs | 46 ------ farm-staking/farm-staking/src/lib.rs | 15 +- farm-staking/farm-staking/src/stake_farm.rs | 6 - .../farm-staking/src/token_attributes.rs | 4 - farm-staking/farm-staking/src/unstake_farm.rs | 11 +- 23 files changed, 135 insertions(+), 406 deletions(-) delete mode 100644 farm-staking/farm-staking/src/delete_energy.rs diff --git a/common/common_structs/src/farm_types.rs b/common/common_structs/src/farm_types.rs index 676b26e36..d7d85e20b 100644 --- a/common/common_structs/src/farm_types.rs +++ b/common/common_structs/src/farm_types.rs @@ -80,8 +80,6 @@ pub trait FarmToken { fn get_compounded_rewards(&self) -> BigUint; fn get_initial_farming_tokens(&self) -> BigUint; - - fn get_original_owner(&self) -> ManagedAddress; } impl FarmToken for FarmTokenAttributes { @@ -99,9 +97,4 @@ impl FarmToken for FarmTokenAttributes { fn get_initial_farming_tokens(&self) -> BigUint { &self.current_farm_amount - &self.compounded_reward } - - #[inline] - fn get_original_owner(&self) -> ManagedAddress { - self.original_owner.clone() - } } diff --git a/common/modules/farm/contexts/src/claim_rewards_context.rs b/common/modules/farm/contexts/src/claim_rewards_context.rs index 78b8f4e67..653c6b2e6 100644 --- a/common/modules/farm/contexts/src/claim_rewards_context.rs +++ b/common/modules/farm/contexts/src/claim_rewards_context.rs @@ -2,28 +2,26 @@ multiversx_sc::imports!(); multiversx_sc::derive_imports!(); use common_errors::{ERROR_BAD_PAYMENTS, ERROR_EMPTY_PAYMENTS}; -use common_structs::{PaymentAttributesPair, PaymentsVec}; +use common_structs::PaymentAttributesPair; use multiversx_sc::api::BlockchainApi; use multiversx_sc::contract_base::BlockchainWrapper; pub struct ClaimRewardsContext where M: ManagedTypeApi, - T: Clone + TopEncode + TopDecode + NestedEncode + NestedDecode + ManagedVecItem, + T: Clone + TopEncode + TopDecode + NestedEncode + NestedDecode, { pub first_farm_token: PaymentAttributesPair, - pub additional_payments: PaymentsVec, - pub additional_attributes: ManagedVec, - pub all_attributes: ManagedVec, + pub additional_payments: ManagedVec>, } impl ClaimRewardsContext where M: ManagedTypeApi + BlockchainApi, - T: Clone + TopEncode + TopDecode + NestedEncode + NestedDecode + ManagedVecItem, + T: Clone + TopEncode + TopDecode + NestedEncode + NestedDecode, { pub fn new( - mut payments: PaymentsVec, + mut payments: ManagedVec>, farm_token_id: &TokenIdentifier, api_wrapper: BlockchainWrapper, ) -> Self { @@ -31,32 +29,22 @@ where M::error_api_impl().signal_error(ERROR_EMPTY_PAYMENTS); } - let own_sc_address = api_wrapper.get_sc_address(); - let mut all_attributes = ManagedVec::new(); for p in &payments { if &p.token_identifier != farm_token_id { M::error_api_impl().signal_error(ERROR_BAD_PAYMENTS); } - - let token_data = - api_wrapper.get_esdt_token_data(&own_sc_address, farm_token_id, p.token_nonce); - let token_attributes: T = token_data.decode_attributes(); - all_attributes.push(token_attributes); } let first_payment = payments.get(0); payments.remove(0); - // dumb framework errors otherwise - let first_token_data = api_wrapper.get_esdt_token_data( + let own_sc_address = api_wrapper.get_sc_address(); + let token_data = api_wrapper.get_esdt_token_data( &own_sc_address, farm_token_id, first_payment.token_nonce, ); - let first_token_attributes: T = first_token_data.decode_attributes(); - - let mut additional_attributes = all_attributes.clone(); - additional_attributes.remove(0); + let first_token_attributes: T = token_data.decode_attributes(); ClaimRewardsContext { first_farm_token: PaymentAttributesPair { @@ -64,8 +52,6 @@ where attributes: first_token_attributes, }, additional_payments: payments, - additional_attributes, - all_attributes, } } } diff --git a/common/modules/farm/contexts/src/enter_farm_context.rs b/common/modules/farm/contexts/src/enter_farm_context.rs index 27a060015..9da789d9a 100644 --- a/common/modules/farm/contexts/src/enter_farm_context.rs +++ b/common/modules/farm/contexts/src/enter_farm_context.rs @@ -2,28 +2,17 @@ multiversx_sc::imports!(); multiversx_sc::derive_imports!(); use common_errors::{ERROR_BAD_PAYMENTS, ERROR_EMPTY_PAYMENTS}; -use common_structs::PaymentsVec; -use multiversx_sc::{api::BlockchainApi, contract_base::BlockchainWrapper}; -pub struct EnterFarmContext< - M: ManagedTypeApi, - T: Clone + TopEncode + TopDecode + NestedEncode + NestedDecode + ManagedVecItem, -> { +pub struct EnterFarmContext { pub farming_token_payment: EsdtTokenPayment, - pub additional_farm_tokens: PaymentsVec, - pub additional_attributes: ManagedVec, + pub additional_farm_tokens: ManagedVec>, } -impl< - M: ManagedTypeApi + BlockchainApi, - T: Clone + TopEncode + TopDecode + NestedEncode + NestedDecode + ManagedVecItem, - > EnterFarmContext -{ +impl EnterFarmContext { pub fn new( - mut payments: PaymentsVec, + mut payments: ManagedVec>, farming_token_id: &TokenIdentifier, farm_token_id: &TokenIdentifier, - api_wrapper: BlockchainWrapper, ) -> Self { if payments.is_empty() { M::error_api_impl().signal_error(ERROR_EMPTY_PAYMENTS); @@ -35,24 +24,15 @@ impl< } payments.remove(0); - - let own_sc_address = api_wrapper.get_sc_address(); - let mut additional_attributes = ManagedVec::new(); for p in &payments { if &p.token_identifier != farm_token_id { M::error_api_impl().signal_error(ERROR_BAD_PAYMENTS); } - - let token_data = - api_wrapper.get_esdt_token_data(&own_sc_address, farm_token_id, p.token_nonce); - let token_attributes: T = token_data.decode_attributes(); - additional_attributes.push(token_attributes); } EnterFarmContext { farming_token_payment, additional_farm_tokens: payments, - additional_attributes, } } } diff --git a/common/modules/farm/events/src/events.rs b/common/modules/farm/events/src/events.rs index 6b55fed0c..c32988130 100644 --- a/common/modules/farm/events/src/events.rs +++ b/common/modules/farm/events/src/events.rs @@ -142,7 +142,7 @@ pub trait EventsModule { fn emit_claim_rewards_event< 'a, C: FarmContracTraitBounds, - AttributesType: Clone + TopEncode + TopDecode + NestedEncode + NestedDecode + ManagedVecItem, + AttributesType: Clone + TopEncode + TopDecode + NestedEncode + NestedDecode, >( &self, original_caller: &ManagedAddress, @@ -189,7 +189,7 @@ pub trait EventsModule { fn emit_compound_rewards_event< 'a, C: FarmContracTraitBounds, - AttributesType: Clone + TopEncode + TopDecode + NestedEncode + NestedDecode + ManagedVecItem, + AttributesType: Clone + TopEncode + TopDecode + NestedEncode + NestedDecode, >( self, original_caller: &ManagedAddress, 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 7fdb6cdc3..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 @@ -1,11 +1,12 @@ multiversx_sc::imports!(); -use common_structs::{FarmToken, FarmTokenAttributes, Nonce, PaymentsVec}; +use common_structs::{FarmToken, FarmTokenAttributes, Nonce}; use config::ConfigModule; 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 = @@ -29,8 +30,8 @@ pub trait FarmContract { + FixedSupplyToken<::Api> + FarmToken<::Api> + From::Api>> - + Into::Api>> - + ManagedVecItem = FarmTokenAttributes<::Api>; + + Into::Api>> = + FarmTokenAttributes<::Api>; #[inline] fn mint_rewards( @@ -191,21 +192,27 @@ pub trait FarmContract { fn check_and_update_user_farm_position( sc: &Self::FarmSc, user: &ManagedAddress<::Api>, - farm_tokens: &PaymentsVec<::Api>, - farm_attributes: &ManagedVec<::Api, Self::AttributesType>, + farm_positions: &PaymentsVec<::Api>, ) { - for (attr, farm_token) in farm_attributes.into_iter().zip(farm_tokens.iter()) { - if sc.is_old_farm_position(farm_token.token_nonce) { + 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; } - if &attr.get_original_owner() != user { - Self::decrease_user_farm_position(sc, &farm_token, &attr); - Self::increase_user_farm_position(sc, user, &farm_token.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); + Self::increase_user_farm_position(sc, user, &farm_position.amount); } } } + #[inline] fn increase_user_farm_position( sc: &Self::FarmSc, user: &ManagedAddress<::Api>, @@ -220,13 +227,16 @@ pub trait FarmContract { fn decrease_user_farm_position( sc: &Self::FarmSc, farm_position: &EsdtTokenPayment<::Api>, - attributes: &Self::AttributesType, ) { if sc.is_old_farm_position(farm_position.token_nonce) { return; } - sc.user_total_farm_position(&attributes.get_original_owner()) + 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_total_farm_position| { if user_total_farm_position.total_farm_position > farm_position.amount { user_total_farm_position.total_farm_position -= &farm_position.amount; 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 30b943089..d9dfe293e 100644 --- a/common/modules/farm/farm_base_impl/src/claim_rewards.rs +++ b/common/modules/farm/farm_base_impl/src/claim_rewards.rs @@ -11,7 +11,7 @@ use fixed_supply_token::FixedSupplyToken; pub struct InternalClaimRewardsResult<'a, C, T> where C: FarmContracTraitBounds, - T: Clone + TopEncode + TopDecode + NestedEncode + NestedDecode + ManagedVecItem, + T: Clone + TopEncode + TopDecode + NestedEncode + NestedDecode, { pub context: ClaimRewardsContext, pub storage_cache: StorageCache<'a, C>, @@ -81,12 +81,7 @@ pub trait BaseClaimRewardsModule: ); storage_cache.reward_reserve -= &reward; - FC::check_and_update_user_farm_position( - self, - &caller, - &payments, - &claim_rewards_context.all_attributes, - ); + 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( @@ -95,11 +90,10 @@ pub trait BaseClaimRewardsModule: token_attributes, storage_cache.reward_per_share.clone(), ); - let new_token_attributes = self.merge_attributes_from_payments( base_attributes, - &claim_rewards_context.additional_attributes, &claim_rewards_context.additional_payments, + &farm_token_mapper, ); let new_farm_token = PaymentAttributesPair { payment: EsdtTokenPayment::new( 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 530f732c0..06e52585c 100644 --- a/common/modules/farm/farm_base_impl/src/compound_rewards.rs +++ b/common/modules/farm/farm_base_impl/src/compound_rewards.rs @@ -12,7 +12,7 @@ use fixed_supply_token::FixedSupplyToken; pub struct InternalCompoundRewardsResult<'a, C, T> where C: FarmContracTraitBounds, - T: Clone + TopEncode + TopDecode + NestedEncode + NestedDecode + ManagedVecItem, + T: Clone + TopEncode + TopDecode + NestedEncode + NestedDecode, { pub context: CompoundRewardsContext, pub storage_cache: StorageCache<'a, C>, @@ -70,12 +70,7 @@ pub trait BaseCompoundRewardsModule: storage_cache.reward_reserve -= &reward; storage_cache.farm_token_supply += &reward; - FC::check_and_update_user_farm_position( - self, - &caller, - &payments, - &compound_rewards_context.all_attributes, - ); + 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( @@ -87,7 +82,6 @@ pub trait BaseCompoundRewardsModule: ); let new_farm_token = self.merge_and_create_token( base_attributes, - &compound_rewards_context.additional_attributes, &compound_rewards_context.additional_payments, &farm_token_mapper, ); 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 850606829..02e20d42a 100644 --- a/common/modules/farm/farm_base_impl/src/enter_farm.rs +++ b/common/modules/farm/farm_base_impl/src/enter_farm.rs @@ -10,9 +10,9 @@ use contexts::{ pub struct InternalEnterFarmResult<'a, C, T> where C: FarmContracTraitBounds, - T: Clone + TopEncode + TopDecode + NestedEncode + NestedDecode + ManagedVecItem, + T: Clone + TopEncode + TopDecode + NestedEncode + NestedDecode, { - pub context: EnterFarmContext, + pub context: EnterFarmContext, pub storage_cache: StorageCache<'a, C>, pub new_farm_token: PaymentAttributesPair, pub created_with_merge: bool, @@ -42,7 +42,6 @@ pub trait BaseEnterFarmModule: payments, &storage_cache.farming_token_id, &storage_cache.farm_token_id, - self.blockchain(), ); // The order is important - first check and update, then increase position @@ -50,7 +49,6 @@ pub trait BaseEnterFarmModule: self, &caller, &enter_farm_context.additional_farm_tokens, - &enter_farm_context.additional_attributes, ); FC::increase_user_farm_position( self, @@ -71,7 +69,6 @@ pub trait BaseEnterFarmModule: ); let new_farm_token = self.merge_and_create_token( base_attributes, - &enter_farm_context.additional_attributes, &enter_farm_context.additional_farm_tokens, &farm_token_mapper, ); 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 30d420787..315abe421 100644 --- a/common/modules/farm/farm_base_impl/src/exit_farm.rs +++ b/common/modules/farm/farm_base_impl/src/exit_farm.rs @@ -62,7 +62,7 @@ pub trait BaseExitFarmModule: ); storage_cache.reward_reserve -= &reward; - FC::decrease_user_farm_position(self, &payment, &exit_farm_context.farm_token.attributes); + FC::decrease_user_farm_position(self, &payment); let farming_token_amount = token_attributes.get_total_supply(); let farming_token_payment = EsdtTokenPayment::new( diff --git a/common/modules/utils/src/lib.rs b/common/modules/utils/src/lib.rs index 9077b7203..990b88329 100644 --- a/common/modules/utils/src/lib.rs +++ b/common/modules/utils/src/lib.rs @@ -57,7 +57,7 @@ pub trait UtilsModule { } fn merge_from_payments_and_burn< - T: FixedSupplyToken + Mergeable + TopDecode + ManagedVecItem, + T: FixedSupplyToken + Mergeable + TopDecode, >( &self, mut payments: PaymentsVec, @@ -68,29 +68,23 @@ pub trait UtilsModule { self.get_attributes_as_part_of_fixed_supply(&first_payment, mapper); mapper.nft_burn(first_payment.token_nonce, &first_payment.amount); - let mut other_attributes = ManagedVec::new(); - for payment in &payments { - let attr = mapper.get_token_attributes(payment.token_nonce); - other_attributes.push(attr); - } - let output_attributes = - self.merge_attributes_from_payments(base_attributes, &other_attributes, &payments); + self.merge_attributes_from_payments(base_attributes, &payments, mapper); self.send().esdt_local_burn_multi(&payments); output_attributes } fn merge_attributes_from_payments< - T: FixedSupplyToken + Mergeable + TopDecode + ManagedVecItem, + T: FixedSupplyToken + Mergeable + TopDecode, >( &self, mut base_attributes: T, - other_attributes: &ManagedVec, payments: &PaymentsVec, + mapper: &NonFungibleTokenMapper, ) -> T { - for (attr, payment) in other_attributes.into_iter().zip(payments.iter()) { - let attributes = attr.into_part(&payment.amount); + for payment in payments { + let attributes: T = self.get_attributes_as_part_of_fixed_supply(&payment, mapper); base_attributes.merge_with(attributes); } @@ -104,17 +98,15 @@ pub trait UtilsModule { + TopEncode + TopDecode + NestedEncode - + NestedDecode - + ManagedVecItem, + + NestedDecode, >( &self, base_attributes: T, - other_attributes: &ManagedVec, payments: &PaymentsVec, mapper: &NonFungibleTokenMapper, ) -> PaymentAttributesPair { let output_attributes = - self.merge_attributes_from_payments(base_attributes, other_attributes, payments); + self.merge_attributes_from_payments(base_attributes, payments, mapper); let new_token_amount = output_attributes.get_total_supply(); let new_token_payment = mapper.nft_create(new_token_amount, &output_attributes); diff --git a/dex/farm-with-locked-rewards/src/lib.rs b/dex/farm-with-locked-rewards/src/lib.rs index 34600f80b..d704a80df 100644 --- a/dex/farm-with-locked-rewards/src/lib.rs +++ b/dex/farm-with-locked-rewards/src/lib.rs @@ -182,6 +182,8 @@ pub trait Farm: orig_caller.clone(), ); + self.clear_user_energy_if_needed(&orig_caller); + (exit_farm_result.farming_tokens, locked_rewards_payment).into() } diff --git a/dex/farm/src/base_functions.rs b/dex/farm/src/base_functions.rs index 16704331d..48a59ac56 100644 --- a/dex/farm/src/base_functions.rs +++ b/dex/farm/src/base_functions.rs @@ -7,9 +7,7 @@ multiversx_sc::derive_imports!(); use core::marker::PhantomData; use common_errors::ERROR_ZERO_AMOUNT; -use common_structs::FarmToken; use common_structs::FarmTokenAttributes; -use common_structs::PaymentsVec; use contexts::storage_cache::StorageCache; use farm_base_impl::base_traits_impl::{DefaultFarmWrapper, FarmContract}; @@ -83,11 +81,6 @@ pub trait BaseFunctionsModule: &base_enter_farm_result.storage_cache.farm_token_supply, ); - self.delete_user_energy_if_needed::( - &base_enter_farm_result.context.additional_farm_tokens, - &base_enter_farm_result.context.additional_attributes, - ); - self.emit_enter_farm_event( &caller, base_enter_farm_result.context.farming_token_payment, @@ -104,8 +97,7 @@ pub trait BaseFunctionsModule: caller: ManagedAddress, ) -> ClaimRewardsResultWrapper { let payments = self.call_value().all_esdt_transfers().clone_value(); - let base_claim_rewards_result = - self.claim_rewards_base::(caller.clone(), payments.clone()); + 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(); let rewards_payment = base_claim_rewards_result.rewards; @@ -114,11 +106,6 @@ pub trait BaseFunctionsModule: &base_claim_rewards_result.storage_cache.farm_token_supply, ); - self.delete_user_energy_if_needed::( - &payments, - &base_claim_rewards_result.context.all_attributes, - ); - self.emit_claim_rewards_event( &caller, base_claim_rewards_result.context, @@ -140,7 +127,7 @@ pub trait BaseFunctionsModule: ) -> EsdtTokenPayment { let payments = self.call_value().all_esdt_transfers().clone_value(); let base_compound_rewards_result = - self.compound_rewards_base::(caller.clone(), payments.clone()); + self.compound_rewards_base::(caller.clone(), payments); let output_farm_token_payment = base_compound_rewards_result.new_farm_token.payment.clone(); @@ -148,11 +135,6 @@ pub trait BaseFunctionsModule: &base_compound_rewards_result.storage_cache.farm_token_supply, ); - self.delete_user_energy_if_needed::( - &payments, - &base_compound_rewards_result.context.all_attributes, - ); - self.emit_compound_rewards_event( &caller, base_compound_rewards_result.context, @@ -170,7 +152,7 @@ pub trait BaseFunctionsModule: caller: ManagedAddress, payment: EsdtTokenPayment, ) -> ExitFarmResultWrapper { - let base_exit_farm_result = self.exit_farm_base::(caller.clone(), payment.clone()); + let base_exit_farm_result = self.exit_farm_base::(caller.clone(), payment); let mut farming_token_payment = base_exit_farm_result.farming_token_payment; let reward_payment = base_exit_farm_result.reward_payment; @@ -179,13 +161,6 @@ pub trait BaseFunctionsModule: &base_exit_farm_result.storage_cache.farm_token_supply, ); - self.delete_user_energy_if_needed::( - &ManagedVec::from_single_item(payment), - &ManagedVec::from_single_item( - base_exit_farm_result.context.farm_token.attributes.clone(), - ), - ); - FC::apply_penalty( self, &mut farming_token_payment.amount, @@ -213,18 +188,9 @@ pub trait BaseFunctionsModule: ) -> FC::AttributesType { let payments = self.get_non_empty_payments(); let token_mapper = self.farm_token(); + token_mapper.require_all_same_token(&payments); - let mut all_attributes = ManagedVec::new(); - for payment in &payments { - token_mapper.require_same_token(&payment.token_identifier); - - let attr = token_mapper.get_token_attributes(payment.token_nonce); - all_attributes.push(attr); - } - - self.delete_user_energy_if_needed::(&payments, &all_attributes); - - FC::check_and_update_user_farm_position(self, orig_caller, &payments, &all_attributes); + FC::check_and_update_user_farm_position(self, orig_caller, &payments); self.merge_from_payments_and_burn(payments, &token_mapper) } @@ -287,26 +253,6 @@ pub trait BaseFunctionsModule: self.per_block_reward_amount().set(&per_block_amount); } - fn delete_user_energy_if_needed>( - &self, - payments: &PaymentsVec, - all_attributes: &ManagedVec, - ) { - let mut processed_users = ManagedMap::new(); - for (payment, attr) in payments.iter().zip(all_attributes.into_iter()) { - let original_owner = attr.get_original_owner(); - if processed_users.contains(original_owner.as_managed_buffer()) - || self.is_old_farm_position(payment.token_nonce) - { - continue; - } - - self.clear_user_energy_if_needed(&original_owner); - - processed_users.put(original_owner.as_managed_buffer(), &ManagedBuffer::new()); - } - } - fn require_queried(&self) { let caller = self.blockchain().get_caller(); let sc_address = self.blockchain().get_sc_address(); diff --git a/dex/farm/src/lib.rs b/dex/farm/src/lib.rs index 5bf5dba64..1a35c1631 100644 --- a/dex/farm/src/lib.rs +++ b/dex/farm/src/lib.rs @@ -177,6 +177,8 @@ pub trait Farm: self.send_payment_non_zero(&caller, &exit_farm_result.farming_tokens); self.send_payment_non_zero(&caller, &exit_farm_result.rewards); + self.clear_user_energy_if_needed(&orig_caller); + (exit_farm_result.farming_tokens, exit_farm_result.rewards).into() } diff --git a/dex/farm/tests/energy_update_test.rs b/dex/farm/tests/energy_update_test.rs index e091a028e..1d8f78a98 100644 --- a/dex/farm/tests/energy_update_test.rs +++ b/dex/farm/tests/energy_update_test.rs @@ -2,14 +2,7 @@ mod farm_setup; -use common_structs::FarmTokenAttributes; -use farm::Farm; use farm_setup::multi_user_farm_setup::*; -use multiversx_sc::imports::OptionalValue; -use multiversx_sc_scenario::{ - managed_biguint, rust_biguint, whitebox_legacy::TxTokenTransfer, DebugApi, -}; -use weekly_rewards_splitting::global_info::WeeklyRewardsGlobalInfo; #[test] fn test_farm_setup() { @@ -60,129 +53,3 @@ fn test_energy_update_no_claim_current_week() { farm_setup.update_energy_for_user(); farm_setup.check_farm_claim_progress_energy(0); } - -#[test] -fn enter_farm_other_users_pos_test() { - DebugApi::dummy(); - - let mut farm_setup = MultiUserFarmSetup::new( - farm::contract_obj, - energy_factory_mock::contract_obj, - energy_update::contract_obj, - ); - - let first_farm_token_amount = 100_000_000; - let first_user = farm_setup.first_user.clone(); - let second_user = farm_setup.second_user.clone(); - - let first_user_energy_amount = 1_000; - let second_user_energy_amount = 5_000; - farm_setup.set_user_energy(&first_user, first_user_energy_amount, 13, 1); - farm_setup.set_user_energy(&second_user, second_user_energy_amount, 13, 1); - - farm_setup.enter_farm(&first_user, first_farm_token_amount); - - let token_attributes: FarmTokenAttributes = farm_setup - .b_mock - .get_nft_attributes(&first_user, FARM_TOKEN_ID, 1) - .unwrap(); - - // first user transfer pos to second user - farm_setup.b_mock.set_nft_balance( - &second_user, - FARM_TOKEN_ID, - 1, - &rust_biguint!(first_farm_token_amount), - &token_attributes, - ); - farm_setup.b_mock.set_nft_balance( - &first_user, - FARM_TOKEN_ID, - 1, - &rust_biguint!(0), - &token_attributes, - ); - - let transfers = [ - TxTokenTransfer { - token_identifier: FARMING_TOKEN_ID.to_vec(), - nonce: 0, - value: rust_biguint!(1_000), - }, - TxTokenTransfer { - token_identifier: FARM_TOKEN_ID.to_vec(), - nonce: 1, - value: rust_biguint!(first_farm_token_amount), - }, - ]; - - farm_setup - .b_mock - .execute_esdt_multi_transfer(&second_user, &farm_setup.farm_wrapper, &transfers, |sc| { - sc.enter_farm_endpoint(OptionalValue::None); - - let actual_energy = sc.total_energy_for_week(1).get(); - assert_eq!(actual_energy, managed_biguint!(second_user_energy_amount)); - }) - .assert_ok(); -} - -#[test] -fn exit_other_users_pos_test() { - DebugApi::dummy(); - - let mut farm_setup = MultiUserFarmSetup::new( - farm::contract_obj, - energy_factory_mock::contract_obj, - energy_update::contract_obj, - ); - - let first_farm_token_amount = 100_000_000; - let first_user = farm_setup.first_user.clone(); - let second_user = farm_setup.second_user.clone(); - - let first_user_energy_amount = 1_000; - let second_user_energy_amount = 200; - farm_setup.set_user_energy(&first_user, first_user_energy_amount, 13, 1); - farm_setup.set_user_energy(&second_user, second_user_energy_amount, 13, 1); - - farm_setup.enter_farm(&first_user, first_farm_token_amount); - - let token_attributes: FarmTokenAttributes = farm_setup - .b_mock - .get_nft_attributes(&first_user, FARM_TOKEN_ID, 1) - .unwrap(); - - // first user transfer pos to second user - farm_setup.b_mock.set_nft_balance( - &second_user, - FARM_TOKEN_ID, - 1, - &rust_biguint!(first_farm_token_amount), - &token_attributes, - ); - farm_setup.b_mock.set_nft_balance( - &first_user, - FARM_TOKEN_ID, - 1, - &rust_biguint!(0), - &token_attributes, - ); - - farm_setup - .b_mock - .execute_esdt_transfer( - &second_user, - &farm_setup.farm_wrapper, - FARM_TOKEN_ID, - 1, - &rust_biguint!(first_farm_token_amount), - |sc| { - sc.exit_farm_endpoint(OptionalValue::None); - - let actual_energy = sc.total_energy_for_week(1).get(); - assert_eq!(actual_energy, managed_biguint!(0)); - }, - ) - .assert_ok(); -} diff --git a/energy-integration/farm-boosted-yields/src/lib.rs b/energy-integration/farm-boosted-yields/src/lib.rs index 0c8543132..09bacc676 100644 --- a/energy-integration/farm-boosted-yields/src/lib.rs +++ b/energy-integration/farm-boosted-yields/src/lib.rs @@ -15,7 +15,6 @@ use weekly_rewards_splitting::{ pub mod boosted_yields_factors; const MAX_PERCENT: u64 = 10_000; -const DEFAULT_MIN_FARM_AMT: u64 = 1; pub struct SplitReward { pub base_farm: BigUint, @@ -125,19 +124,14 @@ pub trait FarmBoostedYieldsModule: 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); - let min_farm_amount = match opt_config { - Some(config) => { - let boosted_yields_factors = config.get_latest_factors(); - boosted_yields_factors.min_farm_amount.clone() - } - None => BigUint::from(DEFAULT_MIN_FARM_AMT), - }; - - self.clear_user_energy( - original_caller, - &user_total_farm_position.total_farm_position, - &min_farm_amount, - ); + if let Some(config) = opt_config { + let boosted_yields_factors = config.get_latest_factors(); + self.clear_user_energy( + original_caller, + &user_total_farm_position.total_farm_position, + &boosted_yields_factors.min_farm_amount, + ); + } } #[view(getBoostedYieldsRewardsPercentage)] diff --git a/farm-staking/farm-staking/src/base_impl_wrapper.rs b/farm-staking/farm-staking/src/base_impl_wrapper.rs index da30a1c84..2b671677f 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; @@ -183,4 +184,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(); + for farm_position in farm_positions { + 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 &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>, + 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) + .set(user_total_farm_position); + } + + fn decrease_user_farm_position( + 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); + + 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/farm-staking/farm-staking/src/claim_stake_farm_rewards.rs b/farm-staking/farm-staking/src/claim_stake_farm_rewards.rs index 53050ba98..93d4802ea 100644 --- a/farm-staking/farm-staking/src/claim_stake_farm_rewards.rs +++ b/farm-staking/farm-staking/src/claim_stake_farm_rewards.rs @@ -30,7 +30,6 @@ pub trait ClaimStakeFarmRewardsModule: + weekly_rewards_splitting::locked_token_buckets::WeeklyRewardsLockedTokenBucketsModule + weekly_rewards_splitting::update_claim_progress_energy::UpdateClaimProgressEnergyModule + energy_query::EnergyQueryModule - + crate::delete_energy::DeleteEnergyModule { #[payable("*")] #[endpoint(claimRewards)] @@ -63,12 +62,11 @@ pub trait ClaimStakeFarmRewardsModule: 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::>( original_caller.clone(), - ManagedVec::from_single_item(payment.clone()), + ManagedVec::from_single_item(payment), ); let mut virtual_farm_token = claim_result.new_farm_token.clone(); @@ -88,11 +86,6 @@ pub trait ClaimStakeFarmRewardsModule: self.set_farm_supply_for_current_week(&claim_result.storage_cache.farm_token_supply); } - self.delete_user_energy_if_needed::>( - &ManagedVec::from_single_item(payment), - &claim_result.context.all_attributes, - ); - self.update_energy_and_progress(&original_caller); let new_farm_token_nonce = self.send().esdt_nft_create_compact( 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 cd8df29a9..a7d83d574 100644 --- a/farm-staking/farm-staking/src/compound_stake_farm_rewards.rs +++ b/farm-staking/farm-staking/src/compound_stake_farm_rewards.rs @@ -28,28 +28,21 @@ pub trait CompoundStakeFarmRewardsModule: + weekly_rewards_splitting::locked_token_buckets::WeeklyRewardsLockedTokenBucketsModule + weekly_rewards_splitting::update_claim_progress_energy::UpdateClaimProgressEnergyModule + energy_query::EnergyQueryModule - + crate::delete_energy::DeleteEnergyModule { #[payable("*")] #[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.clone()); + let compound_result = + self.compound_rewards_base::>(caller.clone(), payments); let new_farm_token = compound_result.new_farm_token.payment.clone(); self.send_payment_non_zero(&caller, &new_farm_token); self.set_farm_supply_for_current_week(&compound_result.storage_cache.farm_token_supply); - self.delete_user_energy_if_needed::>( - &payments, - &compound_result.context.all_attributes, - ); - self.emit_compound_rewards_event( &caller, compound_result.context, diff --git a/farm-staking/farm-staking/src/delete_energy.rs b/farm-staking/farm-staking/src/delete_energy.rs deleted file mode 100644 index 7c80412eb..000000000 --- a/farm-staking/farm-staking/src/delete_energy.rs +++ /dev/null @@ -1,46 +0,0 @@ -use common_structs::{FarmToken, PaymentsVec}; -use farm_base_impl::base_traits_impl::FarmContract; - -multiversx_sc::imports!(); - -#[multiversx_sc::module] -pub trait DeleteEnergyModule: - rewards::RewardsModule - + config::ConfigModule - + token_send::TokenSendModule - + farm_token::FarmTokenModule - + pausable::PausableModule - + permissions_module::PermissionsModule - + events::EventsModule - + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule - + utils::UtilsModule - + farm_boosted_yields::FarmBoostedYieldsModule - + farm_boosted_yields::boosted_yields_factors::BoostedYieldsFactorsModule - + 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 -{ - fn delete_user_energy_if_needed>( - &self, - payments: &PaymentsVec, - all_attributes: &ManagedVec, - ) { - let mut processed_users = ManagedMap::new(); - for (payment, attr) in payments.iter().zip(all_attributes.into_iter()) { - let original_owner = attr.get_original_owner(); - if processed_users.contains(original_owner.as_managed_buffer()) - || self.is_old_farm_position(payment.token_nonce) - { - continue; - } - - self.clear_user_energy_if_needed(&original_owner); - - processed_users.put(original_owner.as_managed_buffer(), &ManagedBuffer::new()); - } - } -} diff --git a/farm-staking/farm-staking/src/lib.rs b/farm-staking/farm-staking/src/lib.rs index 589748364..5fd2b28d6 100644 --- a/farm-staking/farm-staking/src/lib.rs +++ b/farm-staking/farm-staking/src/lib.rs @@ -19,7 +19,6 @@ pub mod claim_only_boosted_staking_rewards; pub mod claim_stake_farm_rewards; pub mod compound_stake_farm_rewards; pub mod custom_rewards; -pub mod delete_energy; pub mod farm_token_roles; pub mod stake_farm; pub mod token_attributes; @@ -61,7 +60,6 @@ pub trait FarmStaking: + weekly_rewards_splitting::locked_token_buckets::WeeklyRewardsLockedTokenBucketsModule + weekly_rewards_splitting::update_claim_progress_energy::UpdateClaimProgressEnergyModule + energy_query::EnergyQueryModule - + delete_energy::DeleteEnergyModule { #[init] fn init( @@ -143,18 +141,9 @@ pub trait FarmStaking: ) -> FC::AttributesType { let payments = self.get_non_empty_payments(); let token_mapper = self.farm_token(); + token_mapper.require_all_same_token(&payments); - let mut all_attributes = ManagedVec::new(); - for payment in &payments { - token_mapper.require_same_token(&payment.token_identifier); - - let attr = token_mapper.get_token_attributes(payment.token_nonce); - all_attributes.push(attr); - } - - self.delete_user_energy_if_needed::(&payments, &all_attributes); - - FC::check_and_update_user_farm_position(self, orig_caller, &payments, &all_attributes); + FC::check_and_update_user_farm_position(self, orig_caller, &payments); self.merge_from_payments_and_burn(payments, &token_mapper) } diff --git a/farm-staking/farm-staking/src/stake_farm.rs b/farm-staking/farm-staking/src/stake_farm.rs index a022b689d..7ab3dea1c 100644 --- a/farm-staking/farm-staking/src/stake_farm.rs +++ b/farm-staking/farm-staking/src/stake_farm.rs @@ -31,7 +31,6 @@ pub trait StakeFarmModule: + weekly_rewards_splitting::locked_token_buckets::WeeklyRewardsLockedTokenBucketsModule + weekly_rewards_splitting::update_claim_progress_energy::UpdateClaimProgressEnergyModule + energy_query::EnergyQueryModule - + crate::delete_energy::DeleteEnergyModule { #[payable("*")] #[endpoint(stakeFarmThroughProxy)] @@ -87,11 +86,6 @@ pub trait StakeFarmModule: self.set_farm_supply_for_current_week(&enter_result.storage_cache.farm_token_supply); - self.delete_user_energy_if_needed::>( - &enter_result.context.additional_farm_tokens, - &enter_result.context.additional_attributes, - ); - self.update_energy_and_progress(&original_caller); self.emit_enter_farm_event( diff --git a/farm-staking/farm-staking/src/token_attributes.rs b/farm-staking/farm-staking/src/token_attributes.rs index 0fcabeba3..59f8c6326 100644 --- a/farm-staking/farm-staking/src/token_attributes.rs +++ b/farm-staking/farm-staking/src/token_attributes.rs @@ -82,10 +82,6 @@ impl FarmToken for StakingFarmTokenAttributes { fn get_initial_farming_tokens(&self) -> BigUint { &self.current_farm_amount - &self.compounded_reward } - - fn get_original_owner(&self) -> ManagedAddress { - self.original_owner.clone() - } } impl FixedSupplyToken for StakingFarmTokenAttributes { diff --git a/farm-staking/farm-staking/src/unstake_farm.rs b/farm-staking/farm-staking/src/unstake_farm.rs index 1d40cfd15..e40642b4f 100644 --- a/farm-staking/farm-staking/src/unstake_farm.rs +++ b/farm-staking/farm-staking/src/unstake_farm.rs @@ -30,7 +30,6 @@ pub trait UnstakeFarmModule: + weekly_rewards_splitting::locked_token_buckets::WeeklyRewardsLockedTokenBucketsModule + weekly_rewards_splitting::update_claim_progress_energy::UpdateClaimProgressEnergyModule + energy_query::EnergyQueryModule - + crate::delete_energy::DeleteEnergyModule { #[payable("*")] #[endpoint(unstakeFarm)] @@ -75,8 +74,8 @@ pub trait UnstakeFarmModule: ) -> ExitFarmWithPartialPosResultType { let migrated_amount = self.migrate_old_farm_positions(&original_caller); - let exit_result = self - .exit_farm_base::>(original_caller.clone(), payment.clone()); + let exit_result = + self.exit_farm_base::>(original_caller.clone(), payment); self.decrease_old_farm_positions(migrated_amount, &original_caller); @@ -90,13 +89,9 @@ pub trait UnstakeFarmModule: self.send_payment_non_zero(&caller, &exit_result.reward_payment); + self.clear_user_energy_if_needed(&original_caller); self.set_farm_supply_for_current_week(&exit_result.storage_cache.farm_token_supply); - self.delete_user_energy_if_needed::>( - &ManagedVec::from_single_item(payment), - &ManagedVec::from_single_item(exit_result.context.farm_token.attributes.clone()), - ); - self.emit_exit_farm_event( &caller, exit_result.context, From 497a61f246f1b5b8bd903d138f537e04c9f013c3 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Mon, 20 May 2024 12:44:56 +0300 Subject: [PATCH 09/15] framework upgrade 0.48.1 --- Cargo.lock | 28 +++++++++---------- 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 | 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 | 24 ++++++++-------- 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 | 24 ++++++++-------- 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 | 20 ++++++------- 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 | 20 ++++++------- 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 | 24 ++++++++-------- dex/pair/wasm-pair-full/Cargo.toml | 2 +- dex/pair/wasm-safe-price-view/Cargo.lock | 24 ++++++++-------- dex/pair/wasm-safe-price-view/Cargo.toml | 2 +- dex/pair/wasm/Cargo.lock | 24 ++++++++-------- 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 | 24 ++++++++-------- 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 | 24 ++++++++-------- dex/proxy-deployer/wasm/Cargo.toml | 2 +- dex/router/Cargo.toml | 4 +-- dex/router/meta/Cargo.toml | 2 +- dex/router/wasm/Cargo.lock | 24 ++++++++-------- 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 | 24 ++++++++-------- .../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 | 24 ++++++++-------- .../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 | 24 ++++++++-------- .../fees-collector/wasm/Cargo.toml | 2 +- energy-integration/governance-v2/Cargo.toml | 4 +-- .../governance-v2/meta/Cargo.toml | 2 +- .../governance-v2/wasm/Cargo.lock | 24 ++++++++-------- .../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 | 24 ++++++++-------- .../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 | 24 ++++++++-------- 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 | 24 ++++++++-------- .../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 | 24 ++++++++-------- 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 | 24 ++++++++-------- 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 | 24 ++++++++-------- 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 | 24 ++++++++-------- 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 | 24 ++++++++-------- .../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 | 24 ++++++++-------- 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 | 24 ++++++++-------- .../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 | 24 ++++++++-------- 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 | 24 ++++++++-------- locked-asset/token-unstake/wasm/Cargo.toml | 2 +- pause-all/Cargo.toml | 6 ++-- pause-all/meta/Cargo.toml | 2 +- pause-all/wasm/Cargo.lock | 24 ++++++++-------- pause-all/wasm/Cargo.toml | 2 +- 134 files changed, 493 insertions(+), 493 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6f7637b31..f673c68fc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1598,9 +1598,9 @@ checksum = "b59072fa0624b55ae5ae3fa6bfa91515bbeb4ac440214bc4a509e2c8806d6e9f" [[package]] name = "multiversx-sc" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "23f5fa49bfb4505465784dc6b8b1d5e52ffcdafedfc2c6f5e9ba54b4bcf5cee8" dependencies = [ "bitflags 2.4.2", "hex-literal 0.4.1", @@ -1611,9 +1611,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" +checksum = "2f7711088da6b140257f35a25d90dc4f78bc4e2be324d1096f7f5842dd397cda" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -1622,9 +1622,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" +checksum = "5dc92c79e975de4b4f956d54d2c31aaca5e18310e1c36d37593fe856a07b8130" dependencies = [ "hex", "proc-macro2", @@ -1634,9 +1634,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "7f114e0cd72950ae1f0dc1bca2da7d2a02f6ce51bcbee7721980340436bfe63a" dependencies = [ "hex", "proc-macro2", @@ -1647,9 +1647,9 @@ dependencies = [ [[package]] name = "multiversx-sc-meta" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "add1bda75ed39bdb246097e5233a4ed7af6587f7c06a7e5084742199d685f6ab" +checksum = "4ce1f4557894ea3b556d3376d4a12c0494b8085a69c7f02def42bed0702ade58" dependencies = [ "clap", "colored", @@ -1674,18 +1674,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "17c9e2000b81f241706a080291f6a7791e221a6ba292cec93687feae53592c9c" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-scenario" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42dea5dcc79ef692e907d919ca6bffc81a07c84af977e98b4192c2fd4ff2c67f" +checksum = "fa109d85d90599c232c2c4ac19a0f6c12a558ad72aa04f4b40ff9e23365b1897" dependencies = [ "base64", "bech32", diff --git a/common/common_errors/Cargo.toml b/common/common_errors/Cargo.toml index 09ba443fb..64926a87a 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.48.0" +version = "=0.48.1" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/common_structs/Cargo.toml b/common/common_structs/Cargo.toml index 80c4d6b33..7379b6b97 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.48.0" +version = "=0.48.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 f7f478234..89f943416 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.48.0" +version = "=0.48.1" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/farm/contexts/Cargo.toml b/common/modules/farm/contexts/Cargo.toml index 033d99987..fc43fa5e1 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.48.0" +version = "=0.48.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.48.0" +version = "=0.48.1" diff --git a/common/modules/farm/events/Cargo.toml b/common/modules/farm/events/Cargo.toml index 1c4a763d4..96af56178 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.48.0" +version = "=0.48.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 119d39c53..ff33b5860 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.48.0" +version = "=0.48.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.48.0" +version = "=0.48.1" [dev-dependencies.multiversx-sc-scenario] -version = "=0.48.0" +version = "=0.48.1" diff --git a/common/modules/farm/farm_token/Cargo.toml b/common/modules/farm/farm_token/Cargo.toml index d66aef7ed..eaf015a78 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.48.0" +version = "=0.48.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.48.0" +version = "=0.48.1" diff --git a/common/modules/farm/farm_token_merge/Cargo.toml b/common/modules/farm/farm_token_merge/Cargo.toml index 07e671721..1b8ec9ee2 100644 --- a/common/modules/farm/farm_token_merge/Cargo.toml +++ b/common/modules/farm/farm_token_merge/Cargo.toml @@ -23,11 +23,11 @@ path = "../../token_merge_helper" path = "../farm_token" [dependencies.multiversx-sc] -version = "=0.48.0" +version = "=0.48.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.48.0" +version = "=0.48.1" [workspace] members = ["."] diff --git a/common/modules/farm/rewards/Cargo.toml b/common/modules/farm/rewards/Cargo.toml index d11286d68..115cd04b3 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.48.0" +version = "=0.48.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.48.0" +version = "=0.48.1" diff --git a/common/modules/legacy_token_decode_module/Cargo.toml b/common/modules/legacy_token_decode_module/Cargo.toml index 54c96c1ca..5c12ba15d 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.48.0" +version = "=0.48.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 5be58100d..07b8719b7 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.48.0" +version = "=0.48.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 987f0021e..830764e08 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.48.0" +version = "=0.48.1" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/pausable/Cargo.toml b/common/modules/pausable/Cargo.toml index 271081564..3668c2822 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.48.0" +version = "=0.48.1" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/permissions_module/Cargo.toml b/common/modules/permissions_module/Cargo.toml index 85d7e9b3c..af71e2aef 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.48.0" +version = "=0.48.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 1c0fdd874..82e3e103a 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.48.0" +version = "=0.48.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 216bf3ebf..46795b0fc 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.48.0" +version = "=0.48.1" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/token_send/Cargo.toml b/common/modules/token_send/Cargo.toml index 17b83882c..714272dea 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.48.0" +version = "=0.48.1" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/utils/Cargo.toml b/common/modules/utils/Cargo.toml index c17c30212..cc25d8fb1 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.48.0" +version = "=0.48.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 bc26dc17d..951361da3 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.48.0" +version = "=0.48.1" diff --git a/common/traits/mergeable/Cargo.toml b/common/traits/mergeable/Cargo.toml index d0e86244d..5d21bb032 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.48.0" +version = "=0.48.1" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/traits/unwrappable/Cargo.toml b/common/traits/unwrappable/Cargo.toml index fd10b42e4..abfe07baa 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.48.0" +version = "=0.48.1" features = ["esdt-token-payment-legacy-decode"] diff --git a/dex/Cargo.toml b/dex/Cargo.toml index 7b517a030..15911dec5 100644 --- a/dex/Cargo.toml +++ b/dex/Cargo.toml @@ -5,17 +5,17 @@ edition = "2021" publish = false [dependencies.multiversx-sc] -version = "=0.48.0" +version = "=0.48.1" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-modules] -version = "=0.48.0" +version = "=0.48.1" [dev-dependencies.multiversx-sc-scenario] -version = "=0.48.0" +version = "=0.48.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 4471c010d..2f7981506 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.48.0" +version = "=0.48.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.48.0" +version = "=0.48.1" [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.48.0" +version = "=0.48.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 453251275..804328648 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.48.0" +version = "0.48.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 04273a9ea..8cdfe8576 100644 --- a/dex/farm-with-locked-rewards/wasm/Cargo.lock +++ b/dex/farm-with-locked-rewards/wasm/Cargo.lock @@ -315,9 +315,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "23f5fa49bfb4505465784dc6b8b1d5e52ffcdafedfc2c6f5e9ba54b4bcf5cee8" dependencies = [ "bitflags", "hex-literal", @@ -328,9 +328,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" +checksum = "2f7711088da6b140257f35a25d90dc4f78bc4e2be324d1096f7f5842dd397cda" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -338,9 +338,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" +checksum = "5dc92c79e975de4b4f956d54d2c31aaca5e18310e1c36d37593fe856a07b8130" dependencies = [ "hex", "proc-macro2", @@ -350,9 +350,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "7f114e0cd72950ae1f0dc1bca2da7d2a02f6ce51bcbee7721980340436bfe63a" dependencies = [ "hex", "proc-macro2", @@ -363,18 +363,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "17c9e2000b81f241706a080291f6a7791e221a6ba292cec93687feae53592c9c" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "24c50d29ab99fab424227c181b6a918ca4ee234c4f18ea5fbbf2853b2ccb0ebc" dependencies = [ "multiversx-sc", ] diff --git a/dex/farm-with-locked-rewards/wasm/Cargo.toml b/dex/farm-with-locked-rewards/wasm/Cargo.toml index 701179e7f..6a907bd28 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.48.0" +version = "=0.48.1" [workspace] members = ["."] diff --git a/dex/farm/Cargo.toml b/dex/farm/Cargo.toml index 8563b6fa5..411855d62 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.48.0" +version = "=0.48.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.48.0" +version = "=0.48.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.48.0" +version = "=0.48.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 28f681018..396e12099 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.48.0" +version = "0.48.1" default-features = false diff --git a/dex/farm/wasm/Cargo.lock b/dex/farm/wasm/Cargo.lock index 2dacef823..98035925c 100644 --- a/dex/farm/wasm/Cargo.lock +++ b/dex/farm/wasm/Cargo.lock @@ -285,9 +285,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "23f5fa49bfb4505465784dc6b8b1d5e52ffcdafedfc2c6f5e9ba54b4bcf5cee8" dependencies = [ "bitflags", "hex-literal", @@ -298,9 +298,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" +checksum = "2f7711088da6b140257f35a25d90dc4f78bc4e2be324d1096f7f5842dd397cda" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -308,9 +308,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" +checksum = "5dc92c79e975de4b4f956d54d2c31aaca5e18310e1c36d37593fe856a07b8130" dependencies = [ "hex", "proc-macro2", @@ -320,9 +320,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "7f114e0cd72950ae1f0dc1bca2da7d2a02f6ce51bcbee7721980340436bfe63a" dependencies = [ "hex", "proc-macro2", @@ -333,18 +333,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "17c9e2000b81f241706a080291f6a7791e221a6ba292cec93687feae53592c9c" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "24c50d29ab99fab424227c181b6a918ca4ee234c4f18ea5fbbf2853b2ccb0ebc" dependencies = [ "multiversx-sc", ] diff --git a/dex/farm/wasm/Cargo.toml b/dex/farm/wasm/Cargo.toml index 1fa20b905..f2c3e3d7b 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.48.0" +version = "=0.48.1" [workspace] members = ["."] diff --git a/dex/fuzz/Cargo.toml b/dex/fuzz/Cargo.toml index 391a4c7c1..c88fdb5fe 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.48.0" +version = "=0.48.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-scenario] -version = "=0.48.0" +version = "=0.48.1" [dependencies.pausable] path = "../../common/modules/pausable" diff --git a/dex/governance/Cargo.toml b/dex/governance/Cargo.toml index 61ba59e59..8488415a5 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.48.0" +version = "=0.48.1" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.48.0" +version = "=0.48.1" [dev-dependencies.pair-mock] path = "../pair-mock" diff --git a/dex/governance/meta/Cargo.toml b/dex/governance/meta/Cargo.toml index e99c24667..89991cea1 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.48.0" +version = "0.48.1" default-features = false diff --git a/dex/governance/wasm/Cargo.lock b/dex/governance/wasm/Cargo.lock index 5104abd3f..9fff7d29b 100644 --- a/dex/governance/wasm/Cargo.lock +++ b/dex/governance/wasm/Cargo.lock @@ -55,9 +55,9 @@ checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "multiversx-sc" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "23f5fa49bfb4505465784dc6b8b1d5e52ffcdafedfc2c6f5e9ba54b4bcf5cee8" dependencies = [ "bitflags", "hex-literal", @@ -68,9 +68,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" +checksum = "2f7711088da6b140257f35a25d90dc4f78bc4e2be324d1096f7f5842dd397cda" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -78,9 +78,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" +checksum = "5dc92c79e975de4b4f956d54d2c31aaca5e18310e1c36d37593fe856a07b8130" dependencies = [ "hex", "proc-macro2", @@ -90,9 +90,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "7f114e0cd72950ae1f0dc1bca2da7d2a02f6ce51bcbee7721980340436bfe63a" dependencies = [ "hex", "proc-macro2", @@ -103,9 +103,9 @@ dependencies = [ [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "24c50d29ab99fab424227c181b6a918ca4ee234c4f18ea5fbbf2853b2ccb0ebc" dependencies = [ "multiversx-sc", ] diff --git a/dex/governance/wasm/Cargo.toml b/dex/governance/wasm/Cargo.toml index 7b1d0521f..773f97944 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.48.0" +version = "=0.48.1" [workspace] members = ["."] diff --git a/dex/pair-mock/Cargo.toml b/dex/pair-mock/Cargo.toml index 4854f150c..e723b6cb2 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.48.0" +version = "=0.48.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.48.0" +version = "=0.48.1" diff --git a/dex/pair-mock/meta/Cargo.toml b/dex/pair-mock/meta/Cargo.toml index 8f2d3b0ca..6be30bffe 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.48.0" +version = "0.48.1" default-features = false diff --git a/dex/pair-mock/wasm/Cargo.lock b/dex/pair-mock/wasm/Cargo.lock index 6e83ea775..e792a0986 100644 --- a/dex/pair-mock/wasm/Cargo.lock +++ b/dex/pair-mock/wasm/Cargo.lock @@ -62,9 +62,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "23f5fa49bfb4505465784dc6b8b1d5e52ffcdafedfc2c6f5e9ba54b4bcf5cee8" dependencies = [ "bitflags", "hex-literal", @@ -75,9 +75,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" +checksum = "2f7711088da6b140257f35a25d90dc4f78bc4e2be324d1096f7f5842dd397cda" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -85,9 +85,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" +checksum = "5dc92c79e975de4b4f956d54d2c31aaca5e18310e1c36d37593fe856a07b8130" dependencies = [ "hex", "proc-macro2", @@ -97,9 +97,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "7f114e0cd72950ae1f0dc1bca2da7d2a02f6ce51bcbee7721980340436bfe63a" dependencies = [ "hex", "proc-macro2", @@ -110,9 +110,9 @@ dependencies = [ [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "24c50d29ab99fab424227c181b6a918ca4ee234c4f18ea5fbbf2853b2ccb0ebc" dependencies = [ "multiversx-sc", ] diff --git a/dex/pair-mock/wasm/Cargo.toml b/dex/pair-mock/wasm/Cargo.toml index 2bbacc718..76349235f 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.48.0" +version = "=0.48.1" [workspace] members = ["."] diff --git a/dex/pair/Cargo.toml b/dex/pair/Cargo.toml index 7fc6998a8..145fc58af 100644 --- a/dex/pair/Cargo.toml +++ b/dex/pair/Cargo.toml @@ -37,11 +37,11 @@ version = "0.10.1" default-features = false [dependencies.multiversx-sc] -version = "=0.48.0" +version = "=0.48.1" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.48.0" +version = "=0.48.1" diff --git a/dex/pair/meta/Cargo.toml b/dex/pair/meta/Cargo.toml index 508ad1a44..cb381e44d 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.48.0" +version = "0.48.1" default-features = false diff --git a/dex/pair/wasm-pair-full/Cargo.lock b/dex/pair/wasm-pair-full/Cargo.lock index 9ca48d0d0..31a1865f1 100644 --- a/dex/pair/wasm-pair-full/Cargo.lock +++ b/dex/pair/wasm-pair-full/Cargo.lock @@ -161,9 +161,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "23f5fa49bfb4505465784dc6b8b1d5e52ffcdafedfc2c6f5e9ba54b4bcf5cee8" dependencies = [ "bitflags", "hex-literal", @@ -174,9 +174,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" +checksum = "2f7711088da6b140257f35a25d90dc4f78bc4e2be324d1096f7f5842dd397cda" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -184,9 +184,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" +checksum = "5dc92c79e975de4b4f956d54d2c31aaca5e18310e1c36d37593fe856a07b8130" dependencies = [ "hex", "proc-macro2", @@ -196,9 +196,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "7f114e0cd72950ae1f0dc1bca2da7d2a02f6ce51bcbee7721980340436bfe63a" dependencies = [ "hex", "proc-macro2", @@ -209,18 +209,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "17c9e2000b81f241706a080291f6a7791e221a6ba292cec93687feae53592c9c" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "24c50d29ab99fab424227c181b6a918ca4ee234c4f18ea5fbbf2853b2ccb0ebc" dependencies = [ "multiversx-sc", ] diff --git a/dex/pair/wasm-pair-full/Cargo.toml b/dex/pair/wasm-pair-full/Cargo.toml index 702f1a1fd..96ee5d5db 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.48.0" +version = "=0.48.1" [workspace] members = ["."] diff --git a/dex/pair/wasm-safe-price-view/Cargo.lock b/dex/pair/wasm-safe-price-view/Cargo.lock index 929875e3f..4357069de 100644 --- a/dex/pair/wasm-safe-price-view/Cargo.lock +++ b/dex/pair/wasm-safe-price-view/Cargo.lock @@ -161,9 +161,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "23f5fa49bfb4505465784dc6b8b1d5e52ffcdafedfc2c6f5e9ba54b4bcf5cee8" dependencies = [ "bitflags", "hex-literal", @@ -174,9 +174,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" +checksum = "2f7711088da6b140257f35a25d90dc4f78bc4e2be324d1096f7f5842dd397cda" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -184,9 +184,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" +checksum = "5dc92c79e975de4b4f956d54d2c31aaca5e18310e1c36d37593fe856a07b8130" dependencies = [ "hex", "proc-macro2", @@ -196,9 +196,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "7f114e0cd72950ae1f0dc1bca2da7d2a02f6ce51bcbee7721980340436bfe63a" dependencies = [ "hex", "proc-macro2", @@ -209,18 +209,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "17c9e2000b81f241706a080291f6a7791e221a6ba292cec93687feae53592c9c" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "24c50d29ab99fab424227c181b6a918ca4ee234c4f18ea5fbbf2853b2ccb0ebc" dependencies = [ "multiversx-sc", ] diff --git a/dex/pair/wasm-safe-price-view/Cargo.toml b/dex/pair/wasm-safe-price-view/Cargo.toml index 035a097bf..2ded396fe 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.48.0" +version = "=0.48.1" [workspace] members = ["."] diff --git a/dex/pair/wasm/Cargo.lock b/dex/pair/wasm/Cargo.lock index 26d648185..42713d696 100644 --- a/dex/pair/wasm/Cargo.lock +++ b/dex/pair/wasm/Cargo.lock @@ -161,9 +161,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "23f5fa49bfb4505465784dc6b8b1d5e52ffcdafedfc2c6f5e9ba54b4bcf5cee8" dependencies = [ "bitflags", "hex-literal", @@ -174,9 +174,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" +checksum = "2f7711088da6b140257f35a25d90dc4f78bc4e2be324d1096f7f5842dd397cda" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -184,9 +184,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" +checksum = "5dc92c79e975de4b4f956d54d2c31aaca5e18310e1c36d37593fe856a07b8130" dependencies = [ "hex", "proc-macro2", @@ -196,9 +196,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "7f114e0cd72950ae1f0dc1bca2da7d2a02f6ce51bcbee7721980340436bfe63a" dependencies = [ "hex", "proc-macro2", @@ -209,18 +209,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "17c9e2000b81f241706a080291f6a7791e221a6ba292cec93687feae53592c9c" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "24c50d29ab99fab424227c181b6a918ca4ee234c4f18ea5fbbf2853b2ccb0ebc" dependencies = [ "multiversx-sc", ] diff --git a/dex/pair/wasm/Cargo.toml b/dex/pair/wasm/Cargo.toml index 8114353ef..7ab7c8901 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.48.0" +version = "=0.48.1" [workspace] members = ["."] diff --git a/dex/price-discovery/Cargo.toml b/dex/price-discovery/Cargo.toml index 7eecf6dd9..74efd78a8 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.48.0" +version = "=0.48.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.48.0" +version = "=0.48.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.48.0" +version = "=0.48.1" diff --git a/dex/price-discovery/meta/Cargo.toml b/dex/price-discovery/meta/Cargo.toml index c6955d199..c6a8b19d7 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.48.0" +version = "0.48.1" default-features = false diff --git a/dex/price-discovery/wasm/Cargo.lock b/dex/price-discovery/wasm/Cargo.lock index 65c5b9037..ae8611c4d 100644 --- a/dex/price-discovery/wasm/Cargo.lock +++ b/dex/price-discovery/wasm/Cargo.lock @@ -119,9 +119,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "23f5fa49bfb4505465784dc6b8b1d5e52ffcdafedfc2c6f5e9ba54b4bcf5cee8" dependencies = [ "bitflags", "hex-literal 0.4.1", @@ -132,9 +132,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" +checksum = "2f7711088da6b140257f35a25d90dc4f78bc4e2be324d1096f7f5842dd397cda" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -142,9 +142,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" +checksum = "5dc92c79e975de4b4f956d54d2c31aaca5e18310e1c36d37593fe856a07b8130" dependencies = [ "hex", "proc-macro2", @@ -154,9 +154,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "7f114e0cd72950ae1f0dc1bca2da7d2a02f6ce51bcbee7721980340436bfe63a" dependencies = [ "hex", "proc-macro2", @@ -167,18 +167,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "17c9e2000b81f241706a080291f6a7791e221a6ba292cec93687feae53592c9c" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "24c50d29ab99fab424227c181b6a918ca4ee234c4f18ea5fbbf2853b2ccb0ebc" dependencies = [ "multiversx-sc", ] diff --git a/dex/price-discovery/wasm/Cargo.toml b/dex/price-discovery/wasm/Cargo.toml index e1d773a07..0969e1b66 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.48.0" +version = "=0.48.1" [workspace] members = ["."] diff --git a/dex/proxy-deployer/Cargo.toml b/dex/proxy-deployer/Cargo.toml index f4efe45d6..f50a038ff 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.48.0" +version = "=0.48.1" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.48.0" +version = "=0.48.1" diff --git a/dex/proxy-deployer/meta/Cargo.toml b/dex/proxy-deployer/meta/Cargo.toml index 9a516a7c0..ddae9ccb9 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.48.0" +version = "0.48.1" default-features = false diff --git a/dex/proxy-deployer/wasm/Cargo.lock b/dex/proxy-deployer/wasm/Cargo.lock index 02b775cc5..e3585e359 100644 --- a/dex/proxy-deployer/wasm/Cargo.lock +++ b/dex/proxy-deployer/wasm/Cargo.lock @@ -277,9 +277,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "23f5fa49bfb4505465784dc6b8b1d5e52ffcdafedfc2c6f5e9ba54b4bcf5cee8" dependencies = [ "bitflags", "hex-literal", @@ -290,9 +290,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" +checksum = "2f7711088da6b140257f35a25d90dc4f78bc4e2be324d1096f7f5842dd397cda" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -300,9 +300,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" +checksum = "5dc92c79e975de4b4f956d54d2c31aaca5e18310e1c36d37593fe856a07b8130" dependencies = [ "hex", "proc-macro2", @@ -312,9 +312,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "7f114e0cd72950ae1f0dc1bca2da7d2a02f6ce51bcbee7721980340436bfe63a" dependencies = [ "hex", "proc-macro2", @@ -325,18 +325,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "17c9e2000b81f241706a080291f6a7791e221a6ba292cec93687feae53592c9c" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "24c50d29ab99fab424227c181b6a918ca4ee234c4f18ea5fbbf2853b2ccb0ebc" dependencies = [ "multiversx-sc", ] diff --git a/dex/proxy-deployer/wasm/Cargo.toml b/dex/proxy-deployer/wasm/Cargo.toml index 1a9bc3b4f..33d489855 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.48.0" +version = "=0.48.1" [workspace] members = ["."] diff --git a/dex/router/Cargo.toml b/dex/router/Cargo.toml index f70fa5c04..a70a9ba1d 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.48.0" +version = "=0.48.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.48.0" +version = "=0.48.1" diff --git a/dex/router/meta/Cargo.toml b/dex/router/meta/Cargo.toml index 8966e7476..744ea5d49 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.48.0" +version = "0.48.1" default-features = false diff --git a/dex/router/wasm/Cargo.lock b/dex/router/wasm/Cargo.lock index 6b2344040..4b5559753 100644 --- a/dex/router/wasm/Cargo.lock +++ b/dex/router/wasm/Cargo.lock @@ -161,9 +161,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "23f5fa49bfb4505465784dc6b8b1d5e52ffcdafedfc2c6f5e9ba54b4bcf5cee8" dependencies = [ "bitflags", "hex-literal", @@ -174,9 +174,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" +checksum = "2f7711088da6b140257f35a25d90dc4f78bc4e2be324d1096f7f5842dd397cda" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -184,9 +184,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" +checksum = "5dc92c79e975de4b4f956d54d2c31aaca5e18310e1c36d37593fe856a07b8130" dependencies = [ "hex", "proc-macro2", @@ -196,9 +196,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "7f114e0cd72950ae1f0dc1bca2da7d2a02f6ce51bcbee7721980340436bfe63a" dependencies = [ "hex", "proc-macro2", @@ -209,18 +209,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "17c9e2000b81f241706a080291f6a7791e221a6ba292cec93687feae53592c9c" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "24c50d29ab99fab424227c181b6a918ca4ee234c4f18ea5fbbf2853b2ccb0ebc" dependencies = [ "multiversx-sc", ] diff --git a/dex/router/wasm/Cargo.toml b/dex/router/wasm/Cargo.toml index 678a87da6..32fa69d41 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.48.0" +version = "=0.48.1" [workspace] members = ["."] diff --git a/energy-integration/common-modules/energy-query/Cargo.toml b/energy-integration/common-modules/energy-query/Cargo.toml index adefb3769..71d7eae02 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.48.0" +version = "=0.48.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 b4af11ce3..9fd1da07a 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.48.0" +version = "=0.48.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 36bb5efe2..5492ba8cb 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.48.0" +version = "=0.48.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 a368f9f75..1f8d53b0a 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.48.0" +version = "=0.48.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 1c919df1f..d7f9bcec9 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.48.0" +version = "=0.48.1" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies.multiversx-sc-scenario] -version = "=0.48.0" +version = "=0.48.1" diff --git a/energy-integration/energy-factory-mock/meta/Cargo.toml b/energy-integration/energy-factory-mock/meta/Cargo.toml index a2872b370..0806b3834 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.48.0" +version = "0.48.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 63470f3ab..a0351871d 100644 --- a/energy-integration/energy-factory-mock/wasm/Cargo.lock +++ b/energy-integration/energy-factory-mock/wasm/Cargo.lock @@ -128,9 +128,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "23f5fa49bfb4505465784dc6b8b1d5e52ffcdafedfc2c6f5e9ba54b4bcf5cee8" dependencies = [ "bitflags", "hex-literal", @@ -141,9 +141,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" +checksum = "2f7711088da6b140257f35a25d90dc4f78bc4e2be324d1096f7f5842dd397cda" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -151,9 +151,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" +checksum = "5dc92c79e975de4b4f956d54d2c31aaca5e18310e1c36d37593fe856a07b8130" dependencies = [ "hex", "proc-macro2", @@ -163,9 +163,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "7f114e0cd72950ae1f0dc1bca2da7d2a02f6ce51bcbee7721980340436bfe63a" dependencies = [ "hex", "proc-macro2", @@ -176,18 +176,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "17c9e2000b81f241706a080291f6a7791e221a6ba292cec93687feae53592c9c" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "24c50d29ab99fab424227c181b6a918ca4ee234c4f18ea5fbbf2853b2ccb0ebc" dependencies = [ "multiversx-sc", ] diff --git a/energy-integration/energy-factory-mock/wasm/Cargo.toml b/energy-integration/energy-factory-mock/wasm/Cargo.toml index 0d381efb7..eb5ced1a1 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.48.0" +version = "=0.48.1" [workspace] members = ["."] diff --git a/energy-integration/energy-update/Cargo.toml b/energy-integration/energy-update/Cargo.toml index c7a8d41c8..e090da980 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.48.0" +version = "=0.48.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.48.0" +version = "=0.48.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.48.0" +version = "=0.48.1" diff --git a/energy-integration/energy-update/meta/Cargo.toml b/energy-integration/energy-update/meta/Cargo.toml index 627514dae..cb055bb36 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.48.0" +version = "0.48.1" default-features = false diff --git a/energy-integration/energy-update/wasm/Cargo.lock b/energy-integration/energy-update/wasm/Cargo.lock index 9d23276fc..e167135ea 100644 --- a/energy-integration/energy-update/wasm/Cargo.lock +++ b/energy-integration/energy-update/wasm/Cargo.lock @@ -295,9 +295,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "23f5fa49bfb4505465784dc6b8b1d5e52ffcdafedfc2c6f5e9ba54b4bcf5cee8" dependencies = [ "bitflags", "hex-literal", @@ -308,9 +308,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" +checksum = "2f7711088da6b140257f35a25d90dc4f78bc4e2be324d1096f7f5842dd397cda" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -318,9 +318,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" +checksum = "5dc92c79e975de4b4f956d54d2c31aaca5e18310e1c36d37593fe856a07b8130" dependencies = [ "hex", "proc-macro2", @@ -330,9 +330,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "7f114e0cd72950ae1f0dc1bca2da7d2a02f6ce51bcbee7721980340436bfe63a" dependencies = [ "hex", "proc-macro2", @@ -343,18 +343,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "17c9e2000b81f241706a080291f6a7791e221a6ba292cec93687feae53592c9c" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "24c50d29ab99fab424227c181b6a918ca4ee234c4f18ea5fbbf2853b2ccb0ebc" dependencies = [ "multiversx-sc", ] diff --git a/energy-integration/energy-update/wasm/Cargo.toml b/energy-integration/energy-update/wasm/Cargo.toml index 5042edb22..7b47001ca 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.48.0" +version = "=0.48.1" [workspace] members = ["."] diff --git a/energy-integration/farm-boosted-yields/Cargo.toml b/energy-integration/farm-boosted-yields/Cargo.toml index afd011e84..2cd9dd558 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.48.0" +version = "=0.48.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 09b6525d5..0a978dfb8 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.48.0" +version = "=0.48.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.48.0" +version = "=0.48.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.48.0" +version = "=0.48.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 f4cd4b07f..319511b83 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.48.0" +version = "0.48.1" default-features = false diff --git a/energy-integration/fees-collector/wasm/Cargo.lock b/energy-integration/fees-collector/wasm/Cargo.lock index c91a53592..695f4de4b 100644 --- a/energy-integration/fees-collector/wasm/Cargo.lock +++ b/energy-integration/fees-collector/wasm/Cargo.lock @@ -154,9 +154,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "23f5fa49bfb4505465784dc6b8b1d5e52ffcdafedfc2c6f5e9ba54b4bcf5cee8" dependencies = [ "bitflags", "hex-literal", @@ -167,9 +167,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" +checksum = "2f7711088da6b140257f35a25d90dc4f78bc4e2be324d1096f7f5842dd397cda" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -177,9 +177,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" +checksum = "5dc92c79e975de4b4f956d54d2c31aaca5e18310e1c36d37593fe856a07b8130" dependencies = [ "hex", "proc-macro2", @@ -189,9 +189,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "7f114e0cd72950ae1f0dc1bca2da7d2a02f6ce51bcbee7721980340436bfe63a" dependencies = [ "hex", "proc-macro2", @@ -202,18 +202,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "17c9e2000b81f241706a080291f6a7791e221a6ba292cec93687feae53592c9c" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "24c50d29ab99fab424227c181b6a918ca4ee234c4f18ea5fbbf2853b2ccb0ebc" dependencies = [ "multiversx-sc", ] diff --git a/energy-integration/fees-collector/wasm/Cargo.toml b/energy-integration/fees-collector/wasm/Cargo.toml index cf5c52d0b..0d9804acf 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.48.0" +version = "=0.48.1" [workspace] members = ["."] diff --git a/energy-integration/governance-v2/Cargo.toml b/energy-integration/governance-v2/Cargo.toml index 606b40d8c..aec8974fb 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.48.0" +version = "=0.48.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.48.0" +version = "=0.48.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 3187a47ce..cb33b5197 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.48.0" +version = "0.48.1" default-features = false diff --git a/energy-integration/governance-v2/wasm/Cargo.lock b/energy-integration/governance-v2/wasm/Cargo.lock index 6ff033cc1..cfe51a0c6 100644 --- a/energy-integration/governance-v2/wasm/Cargo.lock +++ b/energy-integration/governance-v2/wasm/Cargo.lock @@ -165,9 +165,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "23f5fa49bfb4505465784dc6b8b1d5e52ffcdafedfc2c6f5e9ba54b4bcf5cee8" dependencies = [ "bitflags", "hex-literal", @@ -178,9 +178,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" +checksum = "2f7711088da6b140257f35a25d90dc4f78bc4e2be324d1096f7f5842dd397cda" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -188,9 +188,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" +checksum = "5dc92c79e975de4b4f956d54d2c31aaca5e18310e1c36d37593fe856a07b8130" dependencies = [ "hex", "proc-macro2", @@ -200,9 +200,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "7f114e0cd72950ae1f0dc1bca2da7d2a02f6ce51bcbee7721980340436bfe63a" dependencies = [ "hex", "proc-macro2", @@ -213,18 +213,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "17c9e2000b81f241706a080291f6a7791e221a6ba292cec93687feae53592c9c" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "24c50d29ab99fab424227c181b6a918ca4ee234c4f18ea5fbbf2853b2ccb0ebc" dependencies = [ "multiversx-sc", ] diff --git a/energy-integration/governance-v2/wasm/Cargo.toml b/energy-integration/governance-v2/wasm/Cargo.toml index 3615366fb..090b2e76b 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.48.0" +version = "=0.48.1" [workspace] members = ["."] diff --git a/farm-staking/farm-staking-proxy/Cargo.toml b/farm-staking/farm-staking-proxy/Cargo.toml index fb3c4b339..a4fa7e84b 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.48.0" +version = "=0.48.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.48.0" +version = "=0.48.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.48.0" +version = "=0.48.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 1c7a0f9fe..62566f32c 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.48.0" +version = "0.48.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 4462d4205..eed21c778 100644 --- a/farm-staking/farm-staking-proxy/wasm/Cargo.lock +++ b/farm-staking/farm-staking-proxy/wasm/Cargo.lock @@ -376,9 +376,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "23f5fa49bfb4505465784dc6b8b1d5e52ffcdafedfc2c6f5e9ba54b4bcf5cee8" dependencies = [ "bitflags", "hex-literal 0.4.1", @@ -389,9 +389,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" +checksum = "2f7711088da6b140257f35a25d90dc4f78bc4e2be324d1096f7f5842dd397cda" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -399,9 +399,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" +checksum = "5dc92c79e975de4b4f956d54d2c31aaca5e18310e1c36d37593fe856a07b8130" dependencies = [ "hex", "proc-macro2", @@ -411,9 +411,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "7f114e0cd72950ae1f0dc1bca2da7d2a02f6ce51bcbee7721980340436bfe63a" dependencies = [ "hex", "proc-macro2", @@ -424,18 +424,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "17c9e2000b81f241706a080291f6a7791e221a6ba292cec93687feae53592c9c" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "24c50d29ab99fab424227c181b6a918ca4ee234c4f18ea5fbbf2853b2ccb0ebc" dependencies = [ "multiversx-sc", ] diff --git a/farm-staking/farm-staking-proxy/wasm/Cargo.toml b/farm-staking/farm-staking-proxy/wasm/Cargo.toml index ee87f5eee..7656441fa 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.48.0" +version = "=0.48.1" [workspace] members = ["."] diff --git a/farm-staking/farm-staking/Cargo.toml b/farm-staking/farm-staking/Cargo.toml index b4e81589f..988da5f65 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.48.0" +version = "=0.48.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.48.0" +version = "=0.48.1" [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.48.0" +version = "=0.48.1" diff --git a/farm-staking/farm-staking/meta/Cargo.toml b/farm-staking/farm-staking/meta/Cargo.toml index 49357bd4a..ec34dd897 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.48.0" +version = "0.48.1" default-features = false diff --git a/farm-staking/farm-staking/wasm/Cargo.lock b/farm-staking/farm-staking/wasm/Cargo.lock index 79a0f410b..61f912ed6 100644 --- a/farm-staking/farm-staking/wasm/Cargo.lock +++ b/farm-staking/farm-staking/wasm/Cargo.lock @@ -316,9 +316,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "23f5fa49bfb4505465784dc6b8b1d5e52ffcdafedfc2c6f5e9ba54b4bcf5cee8" dependencies = [ "bitflags", "hex-literal", @@ -329,9 +329,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" +checksum = "2f7711088da6b140257f35a25d90dc4f78bc4e2be324d1096f7f5842dd397cda" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -339,9 +339,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" +checksum = "5dc92c79e975de4b4f956d54d2c31aaca5e18310e1c36d37593fe856a07b8130" dependencies = [ "hex", "proc-macro2", @@ -351,9 +351,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "7f114e0cd72950ae1f0dc1bca2da7d2a02f6ce51bcbee7721980340436bfe63a" dependencies = [ "hex", "proc-macro2", @@ -364,18 +364,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "17c9e2000b81f241706a080291f6a7791e221a6ba292cec93687feae53592c9c" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "24c50d29ab99fab424227c181b6a918ca4ee234c4f18ea5fbbf2853b2ccb0ebc" dependencies = [ "multiversx-sc", ] diff --git a/farm-staking/farm-staking/wasm/Cargo.toml b/farm-staking/farm-staking/wasm/Cargo.toml index 7068d3f6e..3c20c8125 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.48.0" +version = "=0.48.1" [workspace] members = ["."] diff --git a/farm-staking/metabonding-staking/Cargo.toml b/farm-staking/metabonding-staking/Cargo.toml index ee8282db3..b0cfbd186 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.48.0" +version = "=0.48.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.48.0" +version = "=0.48.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.48.0" +version = "=0.48.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 2e049a4d6..ed0656799 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.48.0" +version = "0.48.1" default-features = false diff --git a/farm-staking/metabonding-staking/wasm/Cargo.lock b/farm-staking/metabonding-staking/wasm/Cargo.lock index 21aba28e9..80567369d 100644 --- a/farm-staking/metabonding-staking/wasm/Cargo.lock +++ b/farm-staking/metabonding-staking/wasm/Cargo.lock @@ -170,9 +170,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "23f5fa49bfb4505465784dc6b8b1d5e52ffcdafedfc2c6f5e9ba54b4bcf5cee8" dependencies = [ "bitflags", "hex-literal", @@ -183,9 +183,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" +checksum = "2f7711088da6b140257f35a25d90dc4f78bc4e2be324d1096f7f5842dd397cda" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -193,9 +193,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" +checksum = "5dc92c79e975de4b4f956d54d2c31aaca5e18310e1c36d37593fe856a07b8130" dependencies = [ "hex", "proc-macro2", @@ -205,9 +205,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "7f114e0cd72950ae1f0dc1bca2da7d2a02f6ce51bcbee7721980340436bfe63a" dependencies = [ "hex", "proc-macro2", @@ -218,18 +218,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "17c9e2000b81f241706a080291f6a7791e221a6ba292cec93687feae53592c9c" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "24c50d29ab99fab424227c181b6a918ca4ee234c4f18ea5fbbf2853b2ccb0ebc" dependencies = [ "multiversx-sc", ] diff --git a/farm-staking/metabonding-staking/wasm/Cargo.toml b/farm-staking/metabonding-staking/wasm/Cargo.toml index 79b5e4fc0..35311134a 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.48.0" +version = "=0.48.1" [workspace] members = ["."] diff --git a/locked-asset/Cargo.toml b/locked-asset/Cargo.toml index 443d0040d..ad5a5986f 100644 --- a/locked-asset/Cargo.toml +++ b/locked-asset/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" publish = false [dependencies.multiversx-sc] -version = "=0.48.0" +version = "=0.48.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.48.0" +version = "=0.48.1" [dev-dependencies.multiversx-sc-scenario] -version = "=0.48.0" +version = "=0.48.1" diff --git a/locked-asset/distribution/Cargo.toml b/locked-asset/distribution/Cargo.toml index a966c5af6..f17a090c9 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.48.0" +version = "=0.48.1" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies.multiversx-sc-scenario] -version = "=0.48.0" +version = "=0.48.1" diff --git a/locked-asset/distribution/meta/Cargo.toml b/locked-asset/distribution/meta/Cargo.toml index de2ca6868..596ee0e76 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.48.0" +version = "0.48.1" default-features = false diff --git a/locked-asset/distribution/wasm/Cargo.lock b/locked-asset/distribution/wasm/Cargo.lock index a66da5bfb..f942da7bf 100644 --- a/locked-asset/distribution/wasm/Cargo.lock +++ b/locked-asset/distribution/wasm/Cargo.lock @@ -170,9 +170,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "23f5fa49bfb4505465784dc6b8b1d5e52ffcdafedfc2c6f5e9ba54b4bcf5cee8" dependencies = [ "bitflags", "hex-literal", @@ -183,9 +183,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" +checksum = "2f7711088da6b140257f35a25d90dc4f78bc4e2be324d1096f7f5842dd397cda" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -193,9 +193,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" +checksum = "5dc92c79e975de4b4f956d54d2c31aaca5e18310e1c36d37593fe856a07b8130" dependencies = [ "hex", "proc-macro2", @@ -205,9 +205,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "7f114e0cd72950ae1f0dc1bca2da7d2a02f6ce51bcbee7721980340436bfe63a" dependencies = [ "hex", "proc-macro2", @@ -218,18 +218,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "17c9e2000b81f241706a080291f6a7791e221a6ba292cec93687feae53592c9c" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "24c50d29ab99fab424227c181b6a918ca4ee234c4f18ea5fbbf2853b2ccb0ebc" dependencies = [ "multiversx-sc", ] diff --git a/locked-asset/distribution/wasm/Cargo.toml b/locked-asset/distribution/wasm/Cargo.toml index e63900a72..b878ac51b 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.48.0" +version = "=0.48.1" [workspace] members = ["."] diff --git a/locked-asset/energy-factory/Cargo.toml b/locked-asset/energy-factory/Cargo.toml index 2e2f62dc6..8b88fa231 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.48.0" +version = "=0.48.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.48.0" +version = "=0.48.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.48.0" +version = "=0.48.1" diff --git a/locked-asset/energy-factory/meta/Cargo.toml b/locked-asset/energy-factory/meta/Cargo.toml index 5516a213f..2329f08ed 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.48.0" +version = "0.48.1" default-features = false diff --git a/locked-asset/energy-factory/wasm/Cargo.lock b/locked-asset/energy-factory/wasm/Cargo.lock index d25961008..ea350f025 100644 --- a/locked-asset/energy-factory/wasm/Cargo.lock +++ b/locked-asset/energy-factory/wasm/Cargo.lock @@ -112,9 +112,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "23f5fa49bfb4505465784dc6b8b1d5e52ffcdafedfc2c6f5e9ba54b4bcf5cee8" dependencies = [ "bitflags", "hex-literal", @@ -125,9 +125,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" +checksum = "2f7711088da6b140257f35a25d90dc4f78bc4e2be324d1096f7f5842dd397cda" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -135,9 +135,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" +checksum = "5dc92c79e975de4b4f956d54d2c31aaca5e18310e1c36d37593fe856a07b8130" dependencies = [ "hex", "proc-macro2", @@ -147,9 +147,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "7f114e0cd72950ae1f0dc1bca2da7d2a02f6ce51bcbee7721980340436bfe63a" dependencies = [ "hex", "proc-macro2", @@ -160,18 +160,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "17c9e2000b81f241706a080291f6a7791e221a6ba292cec93687feae53592c9c" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "24c50d29ab99fab424227c181b6a918ca4ee234c4f18ea5fbbf2853b2ccb0ebc" dependencies = [ "multiversx-sc", ] diff --git a/locked-asset/energy-factory/wasm/Cargo.toml b/locked-asset/energy-factory/wasm/Cargo.toml index 05c44897a..195fec384 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.48.0" +version = "=0.48.1" [workspace] members = ["."] diff --git a/locked-asset/factory/Cargo.toml b/locked-asset/factory/Cargo.toml index 2fb4cc002..bebae0fe8 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.48.0" +version = "=0.48.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.48.0" +version = "=0.48.1" [dependencies.arrayvec] version = "0.7.1" @@ -49,4 +49,4 @@ hex = "0.4" path = "../simple-lock" [dev-dependencies.multiversx-sc-scenario] -version = "=0.48.0" +version = "=0.48.1" diff --git a/locked-asset/factory/meta/Cargo.toml b/locked-asset/factory/meta/Cargo.toml index 4bc27087e..a18aa81f1 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.48.0" +version = "0.48.1" default-features = false diff --git a/locked-asset/factory/wasm/Cargo.lock b/locked-asset/factory/wasm/Cargo.lock index 26e60cd35..499ad138f 100644 --- a/locked-asset/factory/wasm/Cargo.lock +++ b/locked-asset/factory/wasm/Cargo.lock @@ -161,9 +161,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "23f5fa49bfb4505465784dc6b8b1d5e52ffcdafedfc2c6f5e9ba54b4bcf5cee8" dependencies = [ "bitflags", "hex-literal", @@ -174,9 +174,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" +checksum = "2f7711088da6b140257f35a25d90dc4f78bc4e2be324d1096f7f5842dd397cda" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -184,9 +184,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" +checksum = "5dc92c79e975de4b4f956d54d2c31aaca5e18310e1c36d37593fe856a07b8130" dependencies = [ "hex", "proc-macro2", @@ -196,9 +196,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "7f114e0cd72950ae1f0dc1bca2da7d2a02f6ce51bcbee7721980340436bfe63a" dependencies = [ "hex", "proc-macro2", @@ -209,18 +209,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "17c9e2000b81f241706a080291f6a7791e221a6ba292cec93687feae53592c9c" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "24c50d29ab99fab424227c181b6a918ca4ee234c4f18ea5fbbf2853b2ccb0ebc" dependencies = [ "multiversx-sc", ] diff --git a/locked-asset/factory/wasm/Cargo.toml b/locked-asset/factory/wasm/Cargo.toml index e3d3cf466..5b7a5a327 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.48.0" +version = "=0.48.1" [workspace] members = ["."] diff --git a/locked-asset/lkmex-transfer/Cargo.toml b/locked-asset/lkmex-transfer/Cargo.toml index 2f4631f56..dbfa97c2b 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.48.0" +version = "=0.48.1" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.48.0" +version = "=0.48.1" [dev-dependencies.multiversx-sc-modules] -version = "=0.48.0" +version = "=0.48.1" diff --git a/locked-asset/lkmex-transfer/meta/Cargo.toml b/locked-asset/lkmex-transfer/meta/Cargo.toml index 78211a21e..9ed81bd18 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.48.0" +version = "0.48.1" default-features = false diff --git a/locked-asset/lkmex-transfer/wasm/Cargo.lock b/locked-asset/lkmex-transfer/wasm/Cargo.lock index b1689bd61..68f71358d 100644 --- a/locked-asset/lkmex-transfer/wasm/Cargo.lock +++ b/locked-asset/lkmex-transfer/wasm/Cargo.lock @@ -134,9 +134,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "23f5fa49bfb4505465784dc6b8b1d5e52ffcdafedfc2c6f5e9ba54b4bcf5cee8" dependencies = [ "bitflags", "hex-literal", @@ -147,9 +147,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" +checksum = "2f7711088da6b140257f35a25d90dc4f78bc4e2be324d1096f7f5842dd397cda" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -157,9 +157,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" +checksum = "5dc92c79e975de4b4f956d54d2c31aaca5e18310e1c36d37593fe856a07b8130" dependencies = [ "hex", "proc-macro2", @@ -169,9 +169,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "7f114e0cd72950ae1f0dc1bca2da7d2a02f6ce51bcbee7721980340436bfe63a" dependencies = [ "hex", "proc-macro2", @@ -182,18 +182,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "17c9e2000b81f241706a080291f6a7791e221a6ba292cec93687feae53592c9c" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "24c50d29ab99fab424227c181b6a918ca4ee234c4f18ea5fbbf2853b2ccb0ebc" dependencies = [ "multiversx-sc", ] diff --git a/locked-asset/lkmex-transfer/wasm/Cargo.toml b/locked-asset/lkmex-transfer/wasm/Cargo.toml index 474ebc202..53407e6a3 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.48.0" +version = "=0.48.1" [workspace] members = ["."] diff --git a/locked-asset/locked-token-wrapper/Cargo.toml b/locked-asset/locked-token-wrapper/Cargo.toml index 941f8aa52..47ae7ce44 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.48.0" +version = "=0.48.1" [dependencies.multiversx-sc-modules] -version = "=0.48.0" +version = "=0.48.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.48.0" +version = "=0.48.1" diff --git a/locked-asset/locked-token-wrapper/meta/Cargo.toml b/locked-asset/locked-token-wrapper/meta/Cargo.toml index 400316ce3..9f28fba35 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.48.0" +version = "0.48.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 cf219a208..b4acc31d9 100644 --- a/locked-asset/locked-token-wrapper/wasm/Cargo.lock +++ b/locked-asset/locked-token-wrapper/wasm/Cargo.lock @@ -158,9 +158,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "23f5fa49bfb4505465784dc6b8b1d5e52ffcdafedfc2c6f5e9ba54b4bcf5cee8" dependencies = [ "bitflags", "hex-literal", @@ -171,9 +171,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" +checksum = "2f7711088da6b140257f35a25d90dc4f78bc4e2be324d1096f7f5842dd397cda" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -181,9 +181,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" +checksum = "5dc92c79e975de4b4f956d54d2c31aaca5e18310e1c36d37593fe856a07b8130" dependencies = [ "hex", "proc-macro2", @@ -193,9 +193,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "7f114e0cd72950ae1f0dc1bca2da7d2a02f6ce51bcbee7721980340436bfe63a" dependencies = [ "hex", "proc-macro2", @@ -206,18 +206,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "17c9e2000b81f241706a080291f6a7791e221a6ba292cec93687feae53592c9c" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "24c50d29ab99fab424227c181b6a918ca4ee234c4f18ea5fbbf2853b2ccb0ebc" dependencies = [ "multiversx-sc", ] diff --git a/locked-asset/locked-token-wrapper/wasm/Cargo.toml b/locked-asset/locked-token-wrapper/wasm/Cargo.toml index 87150c0ca..ed6d0c360 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.48.0" +version = "=0.48.1" [workspace] members = ["."] diff --git a/locked-asset/proxy_dex/Cargo.toml b/locked-asset/proxy_dex/Cargo.toml index f598598eb..a36ca0338 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.48.0" +version = "=0.48.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.48.0" +version = "=0.48.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.48.0" +version = "=0.48.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 3a3e9de3e..3cec85ec8 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.48.0" +version = "0.48.1" default-features = false diff --git a/locked-asset/proxy_dex/wasm/Cargo.lock b/locked-asset/proxy_dex/wasm/Cargo.lock index d601aa1f1..6194e8070 100644 --- a/locked-asset/proxy_dex/wasm/Cargo.lock +++ b/locked-asset/proxy_dex/wasm/Cargo.lock @@ -307,9 +307,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "23f5fa49bfb4505465784dc6b8b1d5e52ffcdafedfc2c6f5e9ba54b4bcf5cee8" dependencies = [ "bitflags", "hex-literal", @@ -320,9 +320,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" +checksum = "2f7711088da6b140257f35a25d90dc4f78bc4e2be324d1096f7f5842dd397cda" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -330,9 +330,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" +checksum = "5dc92c79e975de4b4f956d54d2c31aaca5e18310e1c36d37593fe856a07b8130" dependencies = [ "hex", "proc-macro2", @@ -342,9 +342,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "7f114e0cd72950ae1f0dc1bca2da7d2a02f6ce51bcbee7721980340436bfe63a" dependencies = [ "hex", "proc-macro2", @@ -355,18 +355,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "17c9e2000b81f241706a080291f6a7791e221a6ba292cec93687feae53592c9c" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "24c50d29ab99fab424227c181b6a918ca4ee234c4f18ea5fbbf2853b2ccb0ebc" dependencies = [ "multiversx-sc", ] diff --git a/locked-asset/proxy_dex/wasm/Cargo.toml b/locked-asset/proxy_dex/wasm/Cargo.toml index 6101d9e7a..294ba0f8a 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.48.0" +version = "=0.48.1" [workspace] members = ["."] diff --git a/locked-asset/simple-lock-whitelist/Cargo.toml b/locked-asset/simple-lock-whitelist/Cargo.toml index e49600a9a..4a32dcedd 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.48.0" +version = "=0.48.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.48.0" +version = "=0.48.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.48.0" +version = "=0.48.1" diff --git a/locked-asset/simple-lock-whitelist/meta/Cargo.toml b/locked-asset/simple-lock-whitelist/meta/Cargo.toml index e5efe2245..85ac1d568 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.48.0" +version = "0.48.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 34b1df932..d6632d0df 100644 --- a/locked-asset/simple-lock-whitelist/wasm/Cargo.lock +++ b/locked-asset/simple-lock-whitelist/wasm/Cargo.lock @@ -72,9 +72,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "23f5fa49bfb4505465784dc6b8b1d5e52ffcdafedfc2c6f5e9ba54b4bcf5cee8" dependencies = [ "bitflags", "hex-literal", @@ -85,9 +85,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" +checksum = "2f7711088da6b140257f35a25d90dc4f78bc4e2be324d1096f7f5842dd397cda" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -95,9 +95,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" +checksum = "5dc92c79e975de4b4f956d54d2c31aaca5e18310e1c36d37593fe856a07b8130" dependencies = [ "hex", "proc-macro2", @@ -107,9 +107,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "7f114e0cd72950ae1f0dc1bca2da7d2a02f6ce51bcbee7721980340436bfe63a" dependencies = [ "hex", "proc-macro2", @@ -120,18 +120,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "17c9e2000b81f241706a080291f6a7791e221a6ba292cec93687feae53592c9c" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "24c50d29ab99fab424227c181b6a918ca4ee234c4f18ea5fbbf2853b2ccb0ebc" dependencies = [ "multiversx-sc", ] diff --git a/locked-asset/simple-lock-whitelist/wasm/Cargo.toml b/locked-asset/simple-lock-whitelist/wasm/Cargo.toml index 57d2e8645..7af4d7079 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.48.0" +version = "=0.48.1" [workspace] members = ["."] diff --git a/locked-asset/simple-lock/Cargo.toml b/locked-asset/simple-lock/Cargo.toml index 08a745214..5a2205d17 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.48.0" +version = "=0.48.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.48.0" +version = "=0.48.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.48.0" +version = "=0.48.1" diff --git a/locked-asset/simple-lock/meta/Cargo.toml b/locked-asset/simple-lock/meta/Cargo.toml index ade748c64..e8398e175 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.48.0" +version = "0.48.1" default-features = false diff --git a/locked-asset/simple-lock/wasm/Cargo.lock b/locked-asset/simple-lock/wasm/Cargo.lock index 102bb0d32..b09697870 100644 --- a/locked-asset/simple-lock/wasm/Cargo.lock +++ b/locked-asset/simple-lock/wasm/Cargo.lock @@ -72,9 +72,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "23f5fa49bfb4505465784dc6b8b1d5e52ffcdafedfc2c6f5e9ba54b4bcf5cee8" dependencies = [ "bitflags", "hex-literal", @@ -85,9 +85,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" +checksum = "2f7711088da6b140257f35a25d90dc4f78bc4e2be324d1096f7f5842dd397cda" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -95,9 +95,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" +checksum = "5dc92c79e975de4b4f956d54d2c31aaca5e18310e1c36d37593fe856a07b8130" dependencies = [ "hex", "proc-macro2", @@ -107,9 +107,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "7f114e0cd72950ae1f0dc1bca2da7d2a02f6ce51bcbee7721980340436bfe63a" dependencies = [ "hex", "proc-macro2", @@ -120,18 +120,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "17c9e2000b81f241706a080291f6a7791e221a6ba292cec93687feae53592c9c" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "24c50d29ab99fab424227c181b6a918ca4ee234c4f18ea5fbbf2853b2ccb0ebc" dependencies = [ "multiversx-sc", ] diff --git a/locked-asset/simple-lock/wasm/Cargo.toml b/locked-asset/simple-lock/wasm/Cargo.toml index c52eb04df..df38efee7 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.48.0" +version = "=0.48.1" [workspace] members = ["."] diff --git a/locked-asset/token-unstake/Cargo.toml b/locked-asset/token-unstake/Cargo.toml index 9f05894e6..e98adb1a8 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.48.0" +version = "=0.48.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.48.0" +version = "=0.48.1" [dev-dependencies.multiversx-sc-modules] -version = "=0.48.0" +version = "=0.48.1" diff --git a/locked-asset/token-unstake/meta/Cargo.toml b/locked-asset/token-unstake/meta/Cargo.toml index 035037168..217e2f67f 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.48.0" +version = "0.48.1" default-features = false diff --git a/locked-asset/token-unstake/wasm/Cargo.lock b/locked-asset/token-unstake/wasm/Cargo.lock index 415f82989..87bea6198 100644 --- a/locked-asset/token-unstake/wasm/Cargo.lock +++ b/locked-asset/token-unstake/wasm/Cargo.lock @@ -119,9 +119,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "23f5fa49bfb4505465784dc6b8b1d5e52ffcdafedfc2c6f5e9ba54b4bcf5cee8" dependencies = [ "bitflags", "hex-literal", @@ -132,9 +132,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" +checksum = "2f7711088da6b140257f35a25d90dc4f78bc4e2be324d1096f7f5842dd397cda" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -142,9 +142,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" +checksum = "5dc92c79e975de4b4f956d54d2c31aaca5e18310e1c36d37593fe856a07b8130" dependencies = [ "hex", "proc-macro2", @@ -154,9 +154,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "7f114e0cd72950ae1f0dc1bca2da7d2a02f6ce51bcbee7721980340436bfe63a" dependencies = [ "hex", "proc-macro2", @@ -167,18 +167,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "17c9e2000b81f241706a080291f6a7791e221a6ba292cec93687feae53592c9c" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "24c50d29ab99fab424227c181b6a918ca4ee234c4f18ea5fbbf2853b2ccb0ebc" dependencies = [ "multiversx-sc", ] diff --git a/locked-asset/token-unstake/wasm/Cargo.toml b/locked-asset/token-unstake/wasm/Cargo.toml index f7753f8de..cba43e2e5 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.48.0" +version = "=0.48.1" [workspace] members = ["."] diff --git a/pause-all/Cargo.toml b/pause-all/Cargo.toml index becbee8e1..4428bd4ea 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.48.0" +version = "=0.48.1" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.48.0" +version = "=0.48.1" [dev-dependencies.multiversx-sc-scenario] -version = "=0.48.0" +version = "=0.48.1" [dev-dependencies.farm] path = "../dex/farm" diff --git a/pause-all/meta/Cargo.toml b/pause-all/meta/Cargo.toml index cec738238..204a54967 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.48.0" +version = "0.48.1" default-features = false diff --git a/pause-all/wasm/Cargo.lock b/pause-all/wasm/Cargo.lock index 0972422cf..1f61fcf8f 100644 --- a/pause-all/wasm/Cargo.lock +++ b/pause-all/wasm/Cargo.lock @@ -47,9 +47,9 @@ checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "multiversx-sc" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "23f5fa49bfb4505465784dc6b8b1d5e52ffcdafedfc2c6f5e9ba54b4bcf5cee8" dependencies = [ "bitflags", "hex-literal", @@ -60,9 +60,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" +checksum = "2f7711088da6b140257f35a25d90dc4f78bc4e2be324d1096f7f5842dd397cda" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -70,9 +70,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.6" +version = "0.18.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" +checksum = "5dc92c79e975de4b4f956d54d2c31aaca5e18310e1c36d37593fe856a07b8130" dependencies = [ "hex", "proc-macro2", @@ -82,9 +82,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "7f114e0cd72950ae1f0dc1bca2da7d2a02f6ce51bcbee7721980340436bfe63a" dependencies = [ "hex", "proc-macro2", @@ -95,18 +95,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "17c9e2000b81f241706a080291f6a7791e221a6ba292cec93687feae53592c9c" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "24c50d29ab99fab424227c181b6a918ca4ee234c4f18ea5fbbf2853b2ccb0ebc" dependencies = [ "multiversx-sc", ] diff --git a/pause-all/wasm/Cargo.toml b/pause-all/wasm/Cargo.toml index 3fcca5422..6bbe809bc 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.48.0" +version = "=0.48.1" [workspace] members = ["."] From 9867ab2b3a282b3366997a0769a5140ee5adcce7 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Tue, 21 May 2024 18:10:46 +0300 Subject: [PATCH 10/15] Simple lock legacy contract --- Cargo.lock | 25 +- Cargo.toml | 5 +- .../simple-lock-legacy}/.gitignore | 0 .../simple-lock-legacy}/Cargo.toml | 13 +- .../simple-lock-legacy}/meta/Cargo.toml | 6 +- .../simple-lock-legacy/meta/src/main.rs | 3 + .../simple-lock-legacy}/multiversx.json | 0 .../src/basic_lock_unlock.rs | 61 ++ .../simple-lock-legacy/src/error_messages.rs | 2 + .../simple-lock-legacy/src/lib.rs | 41 ++ .../simple-lock-legacy/src/locked_token.rs | 16 + .../simple-lock-legacy/src/proxy_farm.rs | 97 +++ .../simple-lock-legacy/src/proxy_lp.rs | 83 +++ .../simple-lock-legacy}/wasm/Cargo.lock | 26 +- .../simple-lock-legacy}/wasm/Cargo.toml | 4 +- .../simple-lock-legacy/wasm/src/lib.rs | 34 + .../simple-lock-whitelist/meta/src/main.rs | 3 - .../scenarios/factory_old.wasm | Bin 34481 -> 0 bytes .../scenarios/old-farm.wasm | Bin 35969 -> 0 bytes .../scenarios/old-farm_locked_rewards.wasm | Bin 37790 -> 0 bytes .../scenarios/simple_lock_whitelist.scen.json | 605 ------------------ locked-asset/simple-lock-whitelist/src/lib.rs | 157 ----- .../simple-lock-whitelist/testnet.toml | 0 .../tests/whitelist_test.rs | 99 --- .../simple-lock-whitelist/wasm/src/lib.rs | 52 -- 25 files changed, 365 insertions(+), 967 deletions(-) rename {locked-asset/simple-lock-whitelist => legacy-contracts/simple-lock-legacy}/.gitignore (100%) rename {locked-asset/simple-lock-whitelist => legacy-contracts/simple-lock-legacy}/Cargo.toml (66%) rename {locked-asset/simple-lock-whitelist => legacy-contracts/simple-lock-legacy}/meta/Cargo.toml (54%) create mode 100644 legacy-contracts/simple-lock-legacy/meta/src/main.rs rename {locked-asset/simple-lock-whitelist => legacy-contracts/simple-lock-legacy}/multiversx.json (100%) create mode 100644 legacy-contracts/simple-lock-legacy/src/basic_lock_unlock.rs create mode 100644 legacy-contracts/simple-lock-legacy/src/error_messages.rs create mode 100644 legacy-contracts/simple-lock-legacy/src/lib.rs create mode 100644 legacy-contracts/simple-lock-legacy/src/locked_token.rs create mode 100644 legacy-contracts/simple-lock-legacy/src/proxy_farm.rs create mode 100644 legacy-contracts/simple-lock-legacy/src/proxy_lp.rs rename {locked-asset/simple-lock-whitelist => legacy-contracts/simple-lock-legacy}/wasm/Cargo.lock (93%) rename {locked-asset/simple-lock-whitelist => legacy-contracts/simple-lock-legacy}/wasm/Cargo.toml (87%) create mode 100644 legacy-contracts/simple-lock-legacy/wasm/src/lib.rs delete mode 100644 locked-asset/simple-lock-whitelist/meta/src/main.rs delete mode 100644 locked-asset/simple-lock-whitelist/scenarios/factory_old.wasm delete mode 100644 locked-asset/simple-lock-whitelist/scenarios/old-farm.wasm delete mode 100644 locked-asset/simple-lock-whitelist/scenarios/old-farm_locked_rewards.wasm delete mode 100644 locked-asset/simple-lock-whitelist/scenarios/simple_lock_whitelist.scen.json delete mode 100644 locked-asset/simple-lock-whitelist/src/lib.rs delete mode 100644 locked-asset/simple-lock-whitelist/testnet.toml delete mode 100644 locked-asset/simple-lock-whitelist/tests/whitelist_test.rs delete mode 100644 locked-asset/simple-lock-whitelist/wasm/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index f673c68fc..515bb376b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2568,33 +2568,32 @@ dependencies = [ ] [[package]] -name = "simple-lock-meta" -version = "0.0.0" -dependencies = [ - "multiversx-sc-meta", - "simple-lock", -] - -[[package]] -name = "simple-lock-whitelist" +name = "simple-lock-legacy" version = "0.0.0" dependencies = [ + "common_structs", "hex", "multiversx-sc", "multiversx-sc-modules", "multiversx-sc-scenario", "num-bigint", "num-traits", - "simple-lock", - "utils", ] [[package]] -name = "simple-lock-whitelist-meta" +name = "simple-lock-legacy-meta" version = "0.0.0" dependencies = [ "multiversx-sc-meta", - "simple-lock-whitelist", + "simple-lock-legacy", +] + +[[package]] +name = "simple-lock-meta" +version = "0.0.0" +dependencies = [ + "multiversx-sc-meta", + "simple-lock", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index dbdd0d3ec..0944e273b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,6 +37,9 @@ members = [ "farm-staking/metabonding-staking", "farm-staking/metabonding-staking/meta", + "legacy-contracts/simple-lock-legacy", + "legacy-contracts/simple-lock-legacy/meta", + "locked-asset/", "locked-asset/distribution", "locked-asset/distribution/meta", @@ -50,8 +53,6 @@ members = [ "locked-asset/factory/meta", "locked-asset/simple-lock", "locked-asset/simple-lock/meta", - "locked-asset/simple-lock-whitelist", - "locked-asset/simple-lock-whitelist/meta", "locked-asset/energy-factory", "locked-asset/energy-factory/meta", "locked-asset/token-unstake", diff --git a/locked-asset/simple-lock-whitelist/.gitignore b/legacy-contracts/simple-lock-legacy/.gitignore similarity index 100% rename from locked-asset/simple-lock-whitelist/.gitignore rename to legacy-contracts/simple-lock-legacy/.gitignore diff --git a/locked-asset/simple-lock-whitelist/Cargo.toml b/legacy-contracts/simple-lock-legacy/Cargo.toml similarity index 66% rename from locked-asset/simple-lock-whitelist/Cargo.toml rename to legacy-contracts/simple-lock-legacy/Cargo.toml index 4a32dcedd..fb660121e 100644 --- a/locked-asset/simple-lock-whitelist/Cargo.toml +++ b/legacy-contracts/simple-lock-legacy/Cargo.toml @@ -1,19 +1,13 @@ [package] -name = "simple-lock-whitelist" +name = "simple-lock-legacy" version = "0.0.0" -authors = ["Dorin Iancu "] +authors = ["MultiversX "] edition = "2021" publish = false [lib] path = "src/lib.rs" -[dependencies.simple-lock] -path = "../simple-lock" - -[dependencies.utils] -path = "../../common/modules/utils" - [dependencies.multiversx-sc] version = "=0.48.1" features = ["esdt-token-payment-legacy-decode"] @@ -21,6 +15,9 @@ features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] version = "=0.48.1" +[dependencies.common_structs] +path = "../../common/common_structs" + [dev-dependencies] num-bigint = "0.4.2" num-traits = "0.2" diff --git a/locked-asset/simple-lock-whitelist/meta/Cargo.toml b/legacy-contracts/simple-lock-legacy/meta/Cargo.toml similarity index 54% rename from locked-asset/simple-lock-whitelist/meta/Cargo.toml rename to legacy-contracts/simple-lock-legacy/meta/Cargo.toml index 85ac1d568..d9ce41012 100644 --- a/locked-asset/simple-lock-whitelist/meta/Cargo.toml +++ b/legacy-contracts/simple-lock-legacy/meta/Cargo.toml @@ -1,11 +1,11 @@ [package] -name = "simple-lock-whitelist-meta" +name = "simple-lock-legacy-meta" version = "0.0.0" edition = "2021" publish = false -authors = ["Dorin Iancu "] +authors = ["MultiversX "] -[dependencies.simple-lock-whitelist] +[dependencies.simple-lock-legacy] path = ".." [dependencies.multiversx-sc-meta] diff --git a/legacy-contracts/simple-lock-legacy/meta/src/main.rs b/legacy-contracts/simple-lock-legacy/meta/src/main.rs new file mode 100644 index 000000000..8f84e327a --- /dev/null +++ b/legacy-contracts/simple-lock-legacy/meta/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + multiversx_sc_meta::cli_main::(); +} diff --git a/locked-asset/simple-lock-whitelist/multiversx.json b/legacy-contracts/simple-lock-legacy/multiversx.json similarity index 100% rename from locked-asset/simple-lock-whitelist/multiversx.json rename to legacy-contracts/simple-lock-legacy/multiversx.json diff --git a/legacy-contracts/simple-lock-legacy/src/basic_lock_unlock.rs b/legacy-contracts/simple-lock-legacy/src/basic_lock_unlock.rs new file mode 100644 index 000000000..0585da9a6 --- /dev/null +++ b/legacy-contracts/simple-lock-legacy/src/basic_lock_unlock.rs @@ -0,0 +1,61 @@ +multiversx_sc::imports!(); + +use crate::{ + error_messages::{CANNOT_UNLOCK_YET_ERR_MSG, NO_PAYMENT_ERR_MSG}, + locked_token::LockedTokenAttributes, +}; + +#[multiversx_sc::module] +pub trait BasicLockUnlock: + crate::locked_token::LockedTokenModule +{ + fn unlock_and_send( + &self, + to: &ManagedAddress, + payment: EsdtTokenPayment, + ) -> EgldOrEsdtTokenPayment { + let out_payment = self.unlock_tokens(payment); + self.send().direct( + to, + &out_payment.token_identifier, + out_payment.token_nonce, + &out_payment.amount, + ); + + out_payment + } + + fn unlock_tokens( + &self, + payment: EsdtTokenPayment, + ) -> EgldOrEsdtTokenPayment { + let locked_token_mapper = self.locked_token(); + locked_token_mapper.require_same_token(&payment.token_identifier); + + let attributes: LockedTokenAttributes = + locked_token_mapper.get_token_attributes(payment.token_nonce); + let current_epoch = self.blockchain().get_block_epoch(); + require!( + current_epoch >= attributes.unlock_epoch, + CANNOT_UNLOCK_YET_ERR_MSG + ); + + locked_token_mapper.nft_burn(payment.token_nonce, &payment.amount); + + self.unlock_tokens_unchecked(payment, &attributes) + } + + fn unlock_tokens_unchecked( + &self, + payment: EsdtTokenPayment, + attributes: &LockedTokenAttributes, + ) -> EgldOrEsdtTokenPayment { + require!(payment.amount > 0, NO_PAYMENT_ERR_MSG); + + EgldOrEsdtTokenPayment::new( + attributes.original_token_id.clone(), + attributes.original_token_nonce, + payment.amount, + ) + } +} diff --git a/legacy-contracts/simple-lock-legacy/src/error_messages.rs b/legacy-contracts/simple-lock-legacy/src/error_messages.rs new file mode 100644 index 000000000..345e5a015 --- /dev/null +++ b/legacy-contracts/simple-lock-legacy/src/error_messages.rs @@ -0,0 +1,2 @@ +pub static NO_PAYMENT_ERR_MSG: &[u8] = b"No payment"; +pub static CANNOT_UNLOCK_YET_ERR_MSG: &[u8] = b"Cannot unlock yet"; diff --git a/legacy-contracts/simple-lock-legacy/src/lib.rs b/legacy-contracts/simple-lock-legacy/src/lib.rs new file mode 100644 index 000000000..14bf6f447 --- /dev/null +++ b/legacy-contracts/simple-lock-legacy/src/lib.rs @@ -0,0 +1,41 @@ +#![no_std] + +multiversx_sc::imports!(); + +pub mod basic_lock_unlock; +pub mod error_messages; +pub mod locked_token; +pub mod proxy_farm; +pub mod proxy_lp; + +#[multiversx_sc::contract] +pub trait SimpleLock: + basic_lock_unlock::BasicLockUnlock + + locked_token::LockedTokenModule + + proxy_lp::ProxyLpModule + + proxy_farm::ProxyFarmModule +{ + #[init] + fn init(&self) {} + + #[upgrade] + fn upgrade(&self) {} + + #[payable("*")] + #[endpoint(unlockTokens)] + fn unlock_tokens_endpoint( + &self, + opt_destination: OptionalValue, + ) -> EgldOrEsdtTokenPayment { + let payment = self.call_value().single_esdt(); + let dest_address = self.dest_from_optional(opt_destination); + self.unlock_and_send(&dest_address, payment) + } + + fn dest_from_optional(&self, opt_destination: OptionalValue) -> ManagedAddress { + match opt_destination { + OptionalValue::Some(dest) => dest, + OptionalValue::None => self.blockchain().get_caller(), + } + } +} diff --git a/legacy-contracts/simple-lock-legacy/src/locked_token.rs b/legacy-contracts/simple-lock-legacy/src/locked_token.rs new file mode 100644 index 000000000..69c20142c --- /dev/null +++ b/legacy-contracts/simple-lock-legacy/src/locked_token.rs @@ -0,0 +1,16 @@ +multiversx_sc::imports!(); +multiversx_sc::derive_imports!(); + +#[derive(TypeAbi, TopEncode, TopDecode, NestedDecode, NestedEncode, PartialEq, Debug, Clone)] +pub struct LockedTokenAttributes { + pub original_token_id: EgldOrEsdtTokenIdentifier, + pub original_token_nonce: u64, + pub unlock_epoch: u64, +} + +#[multiversx_sc::module] +pub trait LockedTokenModule { + #[view(getLockedTokenId)] + #[storage_mapper("lockedTokenId")] + fn locked_token(&self) -> NonFungibleTokenMapper; +} diff --git a/legacy-contracts/simple-lock-legacy/src/proxy_farm.rs b/legacy-contracts/simple-lock-legacy/src/proxy_farm.rs new file mode 100644 index 000000000..c17cdfd7f --- /dev/null +++ b/legacy-contracts/simple-lock-legacy/src/proxy_farm.rs @@ -0,0 +1,97 @@ +multiversx_sc::imports!(); +multiversx_sc::derive_imports!(); + +use crate::error_messages::*; + +#[derive( + TypeAbi, TopEncode, TopDecode, NestedEncode, NestedDecode, PartialEq, Debug, Clone, Copy, +)] +pub enum FarmType { + SimpleFarm, + FarmWithLockedRewards, +} + +#[derive(TypeAbi, TopEncode, TopDecode, NestedEncode, NestedDecode, PartialEq, Debug)] +pub struct FarmProxyTokenAttributes { + pub farm_type: FarmType, + pub farm_token_id: TokenIdentifier, + pub farm_token_nonce: u64, + pub farming_token_id: TokenIdentifier, + pub farming_token_locked_nonce: u64, +} + +#[multiversx_sc::module] +pub trait ProxyFarmModule: + crate::locked_token::LockedTokenModule + crate::proxy_lp::ProxyLpModule +{ + /// Output payments: the underlying farm tokens + #[payable("*")] + #[endpoint(exitFarmLockedToken)] + fn exit_farm_locked_token(&self) -> EsdtTokenPayment { + let payment: EsdtTokenPayment = self.call_value().single_esdt(); + let caller = self.blockchain().get_caller(); + + let farm_proxy_token_attributes: FarmProxyTokenAttributes = + self.validate_payment_and_get_farm_proxy_token_attributes(&payment); + + let _ = self.check_and_get_unlocked_lp_token( + &self.lp_proxy_token().get_token_id(), + farm_proxy_token_attributes.farming_token_locked_nonce, + ); + + self.send().esdt_local_burn( + &self.lp_proxy_token().get_token_id(), + farm_proxy_token_attributes.farming_token_locked_nonce, + &payment.amount, + ); + + self.send().esdt_local_burn( + &payment.token_identifier, + payment.token_nonce, + &payment.amount, + ); + + let output_token_payment = EsdtTokenPayment::new( + farm_proxy_token_attributes.farm_token_id, + farm_proxy_token_attributes.farm_token_nonce, + payment.amount, + ); + + self.send().direct_esdt( + &caller, + &output_token_payment.token_identifier, + output_token_payment.token_nonce, + &output_token_payment.amount, + ); + + output_token_payment + } + + /// Output payments: the underlying farm tokens + #[payable("*")] + #[endpoint(farmClaimRewardsLockedToken)] + fn farm_claim_rewards_locked_token(&self) -> EsdtTokenPayment { + self.exit_farm_locked_token() + } + + fn validate_payment_and_get_farm_proxy_token_attributes( + &self, + payment: &EsdtTokenPayment, + ) -> FarmProxyTokenAttributes { + require!(payment.amount > 0, NO_PAYMENT_ERR_MSG); + + let farm_proxy_token_mapper = self.farm_proxy_token(); + farm_proxy_token_mapper.require_same_token(&payment.token_identifier); + + 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, &payment.amount); + + farm_proxy_token_attributes + } + + #[view(getFarmProxyTokenId)] + #[storage_mapper("farmProxyTokenId")] + fn farm_proxy_token(&self) -> NonFungibleTokenMapper; +} diff --git a/legacy-contracts/simple-lock-legacy/src/proxy_lp.rs b/legacy-contracts/simple-lock-legacy/src/proxy_lp.rs new file mode 100644 index 000000000..4f5f120eb --- /dev/null +++ b/legacy-contracts/simple-lock-legacy/src/proxy_lp.rs @@ -0,0 +1,83 @@ +multiversx_sc::imports!(); +multiversx_sc::derive_imports!(); + +use crate::{error_messages::CANNOT_UNLOCK_YET_ERR_MSG, locked_token::LockedTokenAttributes}; + +#[derive(TypeAbi, TopEncode, TopDecode, NestedEncode, NestedDecode, PartialEq, Debug)] +pub struct LpProxyTokenAttributes { + pub lp_token_id: TokenIdentifier, + pub first_token_id: TokenIdentifier, + pub first_token_locked_nonce: u64, + pub second_token_id: TokenIdentifier, + pub second_token_locked_nonce: u64, +} + +#[multiversx_sc::module] +pub trait ProxyLpModule: crate::locked_token::LockedTokenModule { + #[payable("*")] + #[endpoint(removeLiquidityLockedToken)] + fn remove_liquidity_locked_token(&self) -> EsdtTokenPayment { + let payment = self.call_value().single_esdt(); + let caller = self.blockchain().get_caller(); + + let unlocked_lp_token_id = + self.check_and_get_unlocked_lp_token(&payment.token_identifier, payment.token_nonce); + + self.send().esdt_local_burn( + &payment.token_identifier, + payment.token_nonce, + &payment.amount, + ); + + let output_token_payment = EsdtTokenPayment::new(unlocked_lp_token_id, 0, payment.amount); + + self.send().direct_esdt( + &caller, + &output_token_payment.token_identifier, + output_token_payment.token_nonce, + &output_token_payment.amount, + ); + + output_token_payment + } + + fn check_and_get_unlocked_lp_token( + &self, + token_id: &TokenIdentifier, + token_nonce: u64, + ) -> TokenIdentifier { + let lp_proxy_token_mapper: NonFungibleTokenMapper = self.lp_proxy_token(); + lp_proxy_token_mapper.require_same_token(token_id); + + let lp_proxy_token_attributes: LpProxyTokenAttributes = + lp_proxy_token_mapper.get_token_attributes(token_nonce); + + let current_epoch = self.blockchain().get_block_epoch(); + if lp_proxy_token_attributes.first_token_locked_nonce > 0 { + let token_attributes: LockedTokenAttributes = self + .locked_token() + .get_token_attributes(lp_proxy_token_attributes.first_token_locked_nonce); + + require!( + token_attributes.unlock_epoch >= current_epoch, + CANNOT_UNLOCK_YET_ERR_MSG + ); + } + if lp_proxy_token_attributes.second_token_locked_nonce > 0 { + let token_attributes: LockedTokenAttributes = self + .locked_token() + .get_token_attributes(lp_proxy_token_attributes.second_token_locked_nonce); + + require!( + token_attributes.unlock_epoch >= current_epoch, + CANNOT_UNLOCK_YET_ERR_MSG + ); + } + + lp_proxy_token_attributes.lp_token_id + } + + #[view(getLpProxyTokenId)] + #[storage_mapper("lpProxyTokenId")] + fn lp_proxy_token(&self) -> NonFungibleTokenMapper; +} diff --git a/locked-asset/simple-lock-whitelist/wasm/Cargo.lock b/legacy-contracts/simple-lock-legacy/wasm/Cargo.lock similarity index 93% rename from locked-asset/simple-lock-whitelist/wasm/Cargo.lock rename to legacy-contracts/simple-lock-legacy/wasm/Cargo.lock index d6632d0df..0a3d09bf3 100644 --- a/locked-asset/simple-lock-whitelist/wasm/Cargo.lock +++ b/legacy-contracts/simple-lock-legacy/wasm/Cargo.lock @@ -183,7 +183,7 @@ dependencies = [ ] [[package]] -name = "simple-lock" +name = "simple-lock-legacy" version = "0.0.0" dependencies = [ "common_structs", @@ -192,21 +192,11 @@ dependencies = [ ] [[package]] -name = "simple-lock-whitelist" -version = "0.0.0" -dependencies = [ - "multiversx-sc", - "multiversx-sc-modules", - "simple-lock", - "utils", -] - -[[package]] -name = "simple-lock-whitelist-wasm" +name = "simple-lock-legacy-wasm" version = "0.0.0" dependencies = [ "multiversx-sc-wasm-adapter", - "simple-lock-whitelist", + "simple-lock-legacy", ] [[package]] @@ -238,13 +228,3 @@ version = "0.0.0" dependencies = [ "multiversx-sc", ] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] diff --git a/locked-asset/simple-lock-whitelist/wasm/Cargo.toml b/legacy-contracts/simple-lock-legacy/wasm/Cargo.toml similarity index 87% rename from locked-asset/simple-lock-whitelist/wasm/Cargo.toml rename to legacy-contracts/simple-lock-legacy/wasm/Cargo.toml index 7af4d7079..258af6806 100644 --- a/locked-asset/simple-lock-whitelist/wasm/Cargo.toml +++ b/legacy-contracts/simple-lock-legacy/wasm/Cargo.toml @@ -5,7 +5,7 @@ # ########################################## [package] -name = "simple-lock-whitelist-wasm" +name = "simple-lock-legacy-wasm" version = "0.0.0" edition = "2021" publish = false @@ -21,7 +21,7 @@ debug = false panic = "abort" overflow-checks = false -[dependencies.simple-lock-whitelist] +[dependencies.simple-lock-legacy] path = ".." [dependencies.multiversx-sc-wasm-adapter] diff --git a/legacy-contracts/simple-lock-legacy/wasm/src/lib.rs b/legacy-contracts/simple-lock-legacy/wasm/src/lib.rs new file mode 100644 index 000000000..59effebc7 --- /dev/null +++ b/legacy-contracts/simple-lock-legacy/wasm/src/lib.rs @@ -0,0 +1,34 @@ +// Code generated by the multiversx-sc build system. DO NOT EDIT. + +//////////////////////////////////////////////////// +////////////////// AUTO-GENERATED ////////////////// +//////////////////////////////////////////////////// + +// Init: 1 +// Endpoints: 8 +// Async Callback (empty): 1 +// Total number of exported functions: 10 + +#![no_std] +#![allow(internal_features)] +#![feature(lang_items)] + +multiversx_sc_wasm_adapter::allocator!(); +multiversx_sc_wasm_adapter::panic_handler!(); + +multiversx_sc_wasm_adapter::endpoints! { + simple_lock_legacy + ( + init => init + upgrade => upgrade + unlockTokens => unlock_tokens_endpoint + getLockedTokenId => locked_token + removeLiquidityLockedToken => remove_liquidity_locked_token + getLpProxyTokenId => lp_proxy_token + exitFarmLockedToken => exit_farm_locked_token + farmClaimRewardsLockedToken => farm_claim_rewards_locked_token + getFarmProxyTokenId => farm_proxy_token + ) +} + +multiversx_sc_wasm_adapter::async_callback_empty! {} diff --git a/locked-asset/simple-lock-whitelist/meta/src/main.rs b/locked-asset/simple-lock-whitelist/meta/src/main.rs deleted file mode 100644 index c58ebf7a8..000000000 --- a/locked-asset/simple-lock-whitelist/meta/src/main.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - multiversx_sc_meta::cli_main::(); -} diff --git a/locked-asset/simple-lock-whitelist/scenarios/factory_old.wasm b/locked-asset/simple-lock-whitelist/scenarios/factory_old.wasm deleted file mode 100644 index 3c6ca8c4ed094c96eb655b614f8c7996dfd6960b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 34481 zcmc(o3!EL-UEk--+~>|d&dQR#dL)^9Bg#5hsSQR_g&{j@OS0l;VmWbKinQLnmi8^} zUdeXqNNZbhl*D#SG2oB@ArR~mLP7~8$%LRwM?k5bdLsZB%N@9%$R z?(WJ~2%k@Az1E$XGw1O?|MP#H|M{OY(Zuq+i=xQA=)Ue~eD-W~)SY!_b;oZM9Zk-L zwCHF=LWL)?D6xD}Hg`s)&QR(MkNhgj88TMSa#2=ptfcBaqw*mOzf`H5v3{J2I}%eX zXJtsPQ3wC=E(x{O^~kN2pxHBeS5u2IUp<|uy&8Oz`rDLa*xE$4#Iza09+~VZy{u7In$D=-_ zHSd}}c4(n{bLXDuQa$(0kDt2x?#_}DtdK7f4tBaXb{39xk4Mh(QP;tVQT{3f*j|h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^1axpANZ#f~ouy5a~g?pAJPK;iDl!418vZH)Ty>m1u zn7d$*iKV59`?9&t!m;l01mW)a*Wh1;f7Nx*HSP=EeM@H&KAY;?n=PWc&?gA_W1am6 zZ@f;zV9C@`(0Ti^d8ErV-=L@fLHDCXK-It5?MEqByIjSd8H z`w2dK-dXz${km6-8&XX^g~X8|Y@ diff --git a/locked-asset/simple-lock-whitelist/scenarios/old-farm.wasm b/locked-asset/simple-lock-whitelist/scenarios/old-farm.wasm deleted file mode 100644 index 0ffa046e31f275daf54dd6186bbf386d0b77d08d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 35969 zcmd6w51bv>Ro`dsytn&y-&^gKEZMTGz`Tb7t73rwM-q+`cGi~U5L;F(C2>Q_dbRr` zt)%_q{bO4cB*j)7IsOv^33VX}A{cCf^9M-41SbeEsasrXAb?v!YFf9r5NM#Gm^3B* z{?475_ufi&96q$4%HB6K_wTvqo`3h;b7!K7#hEyYqWJgX^k#SRWOQ>B-5hg?PsS&2 zj`$;y-{hq7^vgqq3r}{jQYTdW1Vv9oH&;)dJYl7HB9q6W@CoXuHA*Wdrf}T~TM;t* zsK`I^tRoscp@L2oD{3{mxnC9RF5wbjpdFI!A8jY0cUm|RxsMEdd(xi0b=BnI_TLX>3MB<-Zect zy?FSIvudL~6}g`3JLl&n4~OcjizfF^&$JhpCT8YC`cMvIHb38!SM@_EVK?WOD5vxk-rM@bi48snO-=j)e`1vm!-ocphtzBMEi_@c(Hg}Irr z<4f(u(C=k=zxx*^W*5Qen!_e{*RdysTBSU1X8laC{(nd{~za@4o-K0)8obOEs%+_P(c4<-uWvc==GlL8{D z1q6kuQ%ZXwz;sdG<_)*awikMaa!H<(k7d7rzGh-+B3i4qHg<9ioC^%Mn6VtR8)mP8 zwyvI=U25OH6s=PugCJ!0#Nu`BgG+(nhKr#?;x_gDDpnvQkYP_o7|^~h9x);>Y5;pV zZHC)R%lSEPT8+8-4jRh@qF&z_;|&Ybho<4f{kLB`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XuMllhT)Abl-f6E40J&vR7o_o0YbnL$J6^;5}`?k)Yiy7|$E*;q{_-5vAZC^Ki z%kuQp^wRNcc4}<-_!vmGyM@{P5{ZkDDJ< zx*PVr@y4Aw8oLRgxW8VMu_8aRcbe4yz)3z&EG$eMm-s%kboly-SwNY3Q+qO?pQoLx3Gi|zcKdFKDJ?hF!9mS!ZM6}Y_YArgiEIHjq_7XUsjS?R~C4GSCbLy=%q)LpM6D<)R_y10D62o)-v6df=jlA7slbIZpd$aXs0 zJ~Sc4H$O2uJ((A*yO{go{P{AjkN5d#N57B0iNA~ai}?F1(w^n- IH~akm0nH;legFUf diff --git a/locked-asset/simple-lock-whitelist/scenarios/old-farm_locked_rewards.wasm b/locked-asset/simple-lock-whitelist/scenarios/old-farm_locked_rewards.wasm deleted file mode 100644 index 064e2a8871750cb787464e14ac4788d3be6cc663..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 37790 zcmd6w3!GfnUEl9xW?!?bJ(49$mKC@&h_Wsg2yi6fIIwqZ$#UX{VkvQ&rd^MAN772W zv+J2z+oHizY{gNC6DttF4G9s!U;{BRA#Y6B&_G-;#DFQLgw%lBrcEFrxUEUkq~G8F z+kH4!XOC3KMa$bqZ22Bn}guykV|+XJaKct zzxaeosmkuTlqjOiEue>7|l-rFVOQ!q~df6zF)+zo%DXKR6xS5ky}cesSDr-nwSyNMq*M z^^5!J#}^vSP7tbaWMOLg(4j`_`o?WRNd@DF8=dQy7t+?@WwmPi(n@>oaI-$YyVY83 z1%cX)(QayfQ5`mC8bL*6!w2UMU(@WQv$H{2&+Gm3p1I~+`^YPs>Z36mM18OCURsf7_(Hu|KirtTsWsPWT)TMKPs(L2uWod% zZ8Q&ejs$VfytKv(dY-Rap7-+{@$)=z)!ePV;DRnx_OuokrjB|Z|EPpE*hx67Z2-W`QeJQ&AuDIO>VrBVKs_{T3lVJVJ-!NDL3 z%KR4wgBMz}k&OcbrGfGglAs*Lk^Z0m7sqRd%6bTbfgl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~&qv5%xIEHPIV7O3k9`Ax< zcXM`WagO0<>dj=aIe$Dk*sz`(v&q5Z$>MEI@C?S(X{62BJ&P^jVz!Vec3HRAE;8Bt zfdyV^%^~hNwh-o*Kr@T8Oh>4GIV{gp&UKAWU9U6no>rsrLk(_jnp@IkUwyf)>y<`F zH`pBN%~vkL0_dyWOlN2J(~$me6p4XXJ&!^9<8Ov3hhdQZf^PmGjK2PLE&Nd9w(h!f zeCV58GI5FKx3G9?YI>%Y|)bjBu;B0rT<^l1?Hb@M?_Pu?%U!gA(v(@U7 z?v`Di?7sTitFD}yzVg}|_P_GR-5D5r(IdaVPI$Ab-q6DHm%u(gQu*UZs8MgV>c_?B z4|k4SS8p<_*;h4YlDXz=7-gr$YY>l{Ua@*qaJlNStnhhud0l8Ff&dnr?Gc(JrR%6!0*jj$`e;0B;o;_d8_2~f@ Z+&t)l8~FDF{F~t4Mf@A$-(L^7{|hq&h) { - let mut whitelist = self.token_whitelist(); - for token_id in token_whitelist { - self.require_valid_token_id(&token_id); - - let _ = whitelist.insert(token_id); - } - - self.transfer_roles_not_set().set(true); - } - - #[upgrade] - fn upgrade(&self) {} - - /// Sets the transfer role for the given address. Defaults to own address. - #[only_owner] - #[endpoint(setTransferRoleLockedToken)] - fn set_transfer_role(&self, opt_address: OptionalValue) { - let address = match opt_address { - OptionalValue::Some(addr) => addr, - OptionalValue::None => self.blockchain().get_sc_address(), - }; - - self.locked_token() - .set_local_roles_for_address(&address, &[EsdtLocalRole::Transfer], None); - } - - #[only_owner] - #[endpoint(setTransferRolesStatus)] - fn set_transfer_roles_status(&self, roles_status: bool) { - self.locked_token().require_issued_or_set(); - - self.transfer_roles_not_set().set(roles_status); - } - - #[only_owner] - #[endpoint(setTransferRoleProxyLpToken)] - fn set_transfer_role_proxy_lp(&self, opt_address: OptionalValue) { - let address = match opt_address { - OptionalValue::Some(addr) => addr, - OptionalValue::None => self.blockchain().get_sc_address(), - }; - - self.lp_proxy_token().set_local_roles_for_address( - &address, - &[EsdtLocalRole::Transfer], - None, - ); - } - - #[only_owner] - #[endpoint(setTransferRoleProxyFarmToken)] - fn set_transfer_role_proxy_farm(&self, opt_address: OptionalValue) { - let address = match opt_address { - OptionalValue::Some(addr) => addr, - OptionalValue::None => self.blockchain().get_sc_address(), - }; - - self.farm_proxy_token().set_local_roles_for_address( - &address, - &[EsdtLocalRole::Transfer], - None, - ); - } - - /// Locks a whitelisted token 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. - /// - /// Expected payment: A whitelisted token - /// - /// Arguments: - /// - unlock epoch - the epoch from which the LOCKED token holder may call the unlock endpoint - /// - opt_destination - OPTIONAL: destination address for the LOCKED tokens. Default is caller. - /// - /// Output payments: LOCKED tokens (or original payment if current_epoch >= unlock_epoch) - #[payable("*")] - #[endpoint(lockTokens)] - fn lock_tokens_endpoint( - &self, - unlock_epoch: u64, - opt_destination: OptionalValue, - ) -> EgldOrEsdtTokenPayment { - self.require_transfer_roles_ready(); - let payment = self.call_value().single_esdt(); - self.require_token_in_whitelist(&payment.token_identifier); - - let dest_address = self.dest_from_optional(opt_destination); - self.lock_and_send( - &dest_address, - EgldOrEsdtTokenPayment::from(payment), - unlock_epoch, - ) - } - - /// Unlock tokens, previously locked with the `lockTokens` endpoint - /// - /// Expected payment: LOCKED tokens - /// - /// Arguments: - /// - opt_destination - OPTIONAL: destination address for the unlocked tokens - /// - /// Output payments: the originally locked tokens - #[payable("*")] - #[endpoint(unlockTokens)] - fn unlock_tokens_endpoint( - &self, - opt_destination: OptionalValue, - ) -> EgldOrEsdtTokenPayment { - self.require_transfer_roles_ready(); - let payment = self.call_value().single_esdt(); - let dest_address = self.dest_from_optional(opt_destination); - self.unlock_and_send(&dest_address, payment) - } - - fn require_token_in_whitelist(&self, token_id: &TokenIdentifier) { - require!( - self.token_whitelist().contains(token_id), - INVALID_PAYMENTS_ERR_MSG - ); - } - - fn require_transfer_roles_ready(&self) { - require!( - !self.transfer_roles_not_set().get(), - "Transfer roles not ready" - ); - } - - #[view(getTokenWhitelist)] - #[storage_mapper("tokenWhitelist")] - fn token_whitelist(&self) -> UnorderedSetMapper; - - #[view(getTransferRolesNotSet)] - #[storage_mapper("transferRolesNotSet")] - fn transfer_roles_not_set(&self) -> SingleValueMapper; -} diff --git a/locked-asset/simple-lock-whitelist/testnet.toml b/locked-asset/simple-lock-whitelist/testnet.toml deleted file mode 100644 index e69de29bb..000000000 diff --git a/locked-asset/simple-lock-whitelist/tests/whitelist_test.rs b/locked-asset/simple-lock-whitelist/tests/whitelist_test.rs deleted file mode 100644 index 193c633cf..000000000 --- a/locked-asset/simple-lock-whitelist/tests/whitelist_test.rs +++ /dev/null @@ -1,99 +0,0 @@ -#![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_legacy::*}; - -use multiversx_sc::storage::mappers::StorageTokenWrapper; -use simple_lock::locked_token::*; -use simple_lock_whitelist::SimpleLockWhitelist; - -static FREE_TOKEN_ID: &[u8] = b"FREEEEE-123456"; -static OTHER_TOKEN_ID: &[u8] = b"ILLEGAL-123456"; -static LOCKED_TOKEN_ID: &[u8] = b"NOOO0-123456"; - -#[test] -fn lock_whitelist_test() { - let rust_zero = rust_biguint!(0); - let mut b_mock = BlockchainStateWrapper::new(); - - let user_addr = b_mock.create_user_account(&rust_zero); - let owner_addr = b_mock.create_user_account(&rust_zero); - let sc_wrapper = b_mock.create_sc_account( - &rust_zero, - Some(&owner_addr), - simple_lock_whitelist::contract_obj, - "Some path", - ); - - b_mock.set_block_epoch(5); - - b_mock - .execute_tx(&owner_addr, &sc_wrapper, &rust_zero, |sc| { - let mut whitelist = MultiValueEncoded::new(); - whitelist.push(managed_token_id!(FREE_TOKEN_ID)); - - sc.init(whitelist); - sc.locked_token() - .set_token_id(managed_token_id!(LOCKED_TOKEN_ID)); - - sc.set_transfer_roles_status(false); - }) - .assert_ok(); - - b_mock.set_esdt_local_roles( - sc_wrapper.address_ref(), - LOCKED_TOKEN_ID, - &[ - EsdtLocalRole::NftCreate, - EsdtLocalRole::NftAddQuantity, - EsdtLocalRole::NftBurn, - ], - ); - - let lock_amount = rust_biguint!(1_000); - b_mock.set_esdt_balance(&user_addr, FREE_TOKEN_ID, &lock_amount); - b_mock.set_esdt_balance(&user_addr, OTHER_TOKEN_ID, &lock_amount); - - // lock wrong token - b_mock - .execute_esdt_transfer( - &user_addr, - &sc_wrapper, - OTHER_TOKEN_ID, - 0, - &lock_amount, - |sc| { - let _ = sc.lock_tokens_endpoint(10, OptionalValue::None); - }, - ) - .assert_user_error("Invalid payments"); - - // lock ok - b_mock - .execute_esdt_transfer( - &user_addr, - &sc_wrapper, - FREE_TOKEN_ID, - 0, - &lock_amount, - |sc| { - let _ = sc.lock_tokens_endpoint(10, OptionalValue::None); - }, - ) - .assert_ok(); - - DebugApi::dummy(); - b_mock.check_nft_balance( - &user_addr, - LOCKED_TOKEN_ID, - 1, - &lock_amount, - Some(&LockedTokenAttributes:: { - original_token_id: managed_token_id_wrapped!(FREE_TOKEN_ID), - original_token_nonce: 0, - unlock_epoch: 10, - }), - ); -} diff --git a/locked-asset/simple-lock-whitelist/wasm/src/lib.rs b/locked-asset/simple-lock-whitelist/wasm/src/lib.rs deleted file mode 100644 index aa78142e1..000000000 --- a/locked-asset/simple-lock-whitelist/wasm/src/lib.rs +++ /dev/null @@ -1,52 +0,0 @@ -// Code generated by the multiversx-sc build system. DO NOT EDIT. - -//////////////////////////////////////////////////// -////////////////// AUTO-GENERATED ////////////////// -//////////////////////////////////////////////////// - -// Init: 1 -// Endpoints: 26 -// Async Callback: 1 -// Total number of exported functions: 28 - -#![no_std] -#![allow(internal_features)] -#![feature(lang_items)] - -multiversx_sc_wasm_adapter::allocator!(); -multiversx_sc_wasm_adapter::panic_handler!(); - -multiversx_sc_wasm_adapter::endpoints! { - simple_lock_whitelist - ( - init => init - upgrade => upgrade - setTransferRoleLockedToken => set_transfer_role - setTransferRolesStatus => set_transfer_roles_status - setTransferRoleProxyLpToken => set_transfer_role_proxy_lp - setTransferRoleProxyFarmToken => set_transfer_role_proxy_farm - lockTokens => lock_tokens_endpoint - unlockTokens => unlock_tokens_endpoint - getTokenWhitelist => token_whitelist - getTransferRolesNotSet => transfer_roles_not_set - 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 } From 981866bf5d44bfd7866e1314144332ffe6a49902 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Wed, 22 May 2024 18:02:57 +0300 Subject: [PATCH 11/15] simple lock legacy tests & fixes --- .../simple-lock-legacy/src/lib.rs | 2 +- .../simple-lock-legacy/src/proxy_farm.rs | 6 - .../simple-lock-legacy/src/proxy_lp.rs | 3 +- .../simple-lock-legacy/tests/rust_test.rs | 575 ++++++++++++++++++ 4 files changed, 577 insertions(+), 9 deletions(-) create mode 100644 legacy-contracts/simple-lock-legacy/tests/rust_test.rs diff --git a/legacy-contracts/simple-lock-legacy/src/lib.rs b/legacy-contracts/simple-lock-legacy/src/lib.rs index 14bf6f447..4f0abbe0c 100644 --- a/legacy-contracts/simple-lock-legacy/src/lib.rs +++ b/legacy-contracts/simple-lock-legacy/src/lib.rs @@ -9,7 +9,7 @@ pub mod proxy_farm; pub mod proxy_lp; #[multiversx_sc::contract] -pub trait SimpleLock: +pub trait SimpleLockLegacy: basic_lock_unlock::BasicLockUnlock + locked_token::LockedTokenModule + proxy_lp::ProxyLpModule diff --git a/legacy-contracts/simple-lock-legacy/src/proxy_farm.rs b/legacy-contracts/simple-lock-legacy/src/proxy_farm.rs index c17cdfd7f..e2dc5931a 100644 --- a/legacy-contracts/simple-lock-legacy/src/proxy_farm.rs +++ b/legacy-contracts/simple-lock-legacy/src/proxy_farm.rs @@ -45,12 +45,6 @@ pub trait ProxyFarmModule: &payment.amount, ); - self.send().esdt_local_burn( - &payment.token_identifier, - payment.token_nonce, - &payment.amount, - ); - let output_token_payment = EsdtTokenPayment::new( farm_proxy_token_attributes.farm_token_id, farm_proxy_token_attributes.farm_token_nonce, diff --git a/legacy-contracts/simple-lock-legacy/src/proxy_lp.rs b/legacy-contracts/simple-lock-legacy/src/proxy_lp.rs index 4f5f120eb..902683567 100644 --- a/legacy-contracts/simple-lock-legacy/src/proxy_lp.rs +++ b/legacy-contracts/simple-lock-legacy/src/proxy_lp.rs @@ -30,7 +30,6 @@ pub trait ProxyLpModule: crate::locked_token::LockedTokenModule { ); let output_token_payment = EsdtTokenPayment::new(unlocked_lp_token_id, 0, payment.amount); - self.send().direct_esdt( &caller, &output_token_payment.token_identifier, @@ -59,7 +58,7 @@ pub trait ProxyLpModule: crate::locked_token::LockedTokenModule { .get_token_attributes(lp_proxy_token_attributes.first_token_locked_nonce); require!( - token_attributes.unlock_epoch >= current_epoch, + current_epoch >= token_attributes.unlock_epoch, CANNOT_UNLOCK_YET_ERR_MSG ); } diff --git a/legacy-contracts/simple-lock-legacy/tests/rust_test.rs b/legacy-contracts/simple-lock-legacy/tests/rust_test.rs new file mode 100644 index 000000000..4d6089744 --- /dev/null +++ b/legacy-contracts/simple-lock-legacy/tests/rust_test.rs @@ -0,0 +1,575 @@ +#![allow(deprecated)] + +use common_structs::FarmTokenAttributes; +use multiversx_sc::codec::multi_types::OptionalValue; +use multiversx_sc::imports::ContractBase; +use multiversx_sc::types::EsdtLocalRole; +use multiversx_sc_scenario::{ + managed_address, managed_biguint, managed_token_id, rust_biguint, DebugApi, +}; +use multiversx_sc_scenario::{managed_token_id_wrapped, whitebox_legacy::*}; + +use multiversx_sc::storage::mappers::StorageTokenWrapper; +use simple_lock_legacy::proxy_farm::{FarmProxyTokenAttributes, FarmType, ProxyFarmModule}; +use simple_lock_legacy::proxy_lp::{LpProxyTokenAttributes, ProxyLpModule}; +use simple_lock_legacy::{locked_token::*, SimpleLockLegacy}; + +const FREE_TOKEN_ID: &[u8] = b"FREEEEE-123456"; +const WEGLD_TOKEN_ID: &[u8] = b"WEGLD-123456"; +const LOCKED_TOKEN_ID: &[u8] = b"NOOO0-123456"; +const LP_TOKEN_ID: &[u8] = b"LPTOK-123456"; +const LP_PROXY_TOKEN_ID: &[u8] = b"LPPROXY-123456"; +const FARM_TOKEN_ID: &[u8] = b"FARMTOK-123456"; +const FARM_PROXY_TOKEN_ID: &[u8] = b"FARMPROXY-123456"; + +#[test] +fn unlock_token_test() { + let rust_zero = rust_biguint!(0); + let mut b_mock = BlockchainStateWrapper::new(); + + let user_addr = b_mock.create_user_account(&rust_zero); + let owner_addr = b_mock.create_user_account(&rust_zero); + let sc_wrapper = b_mock.create_sc_account( + &rust_zero, + Some(&owner_addr), + simple_lock_legacy::contract_obj, + "Some path", + ); + + b_mock.set_block_epoch(5); + + b_mock + .execute_tx(&owner_addr, &sc_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!(LP_PROXY_TOKEN_ID)); + sc.farm_proxy_token() + .set_token_id(managed_token_id!(FARM_PROXY_TOKEN_ID)); + }) + .assert_ok(); + + b_mock.set_esdt_local_roles( + sc_wrapper.address_ref(), + LOCKED_TOKEN_ID, + &[ + EsdtLocalRole::NftCreate, + EsdtLocalRole::NftAddQuantity, + EsdtLocalRole::NftBurn, + ], + ); + b_mock.set_esdt_local_roles( + sc_wrapper.address_ref(), + LP_PROXY_TOKEN_ID, + &[ + EsdtLocalRole::NftCreate, + EsdtLocalRole::NftAddQuantity, + EsdtLocalRole::NftBurn, + ], + ); + b_mock.set_esdt_local_roles( + sc_wrapper.address_ref(), + FARM_PROXY_TOKEN_ID, + &[ + EsdtLocalRole::NftCreate, + EsdtLocalRole::NftAddQuantity, + EsdtLocalRole::NftBurn, + ], + ); + + let lock_token_nonce = 1u64; + let lock_amount = rust_biguint!(1_000); + + DebugApi::dummy(); + b_mock.set_esdt_balance(sc_wrapper.address_ref(), FREE_TOKEN_ID, &lock_amount); + let locked_token_attributes: LockedTokenAttributes = LockedTokenAttributes { + original_token_id: managed_token_id_wrapped!(FREE_TOKEN_ID), + original_token_nonce: 0, + unlock_epoch: 10u64, + }; + b_mock.set_nft_balance( + &user_addr, + LOCKED_TOKEN_ID, + lock_token_nonce, + &lock_amount, + &locked_token_attributes, + ); + + b_mock.check_nft_balance( + &user_addr, + LOCKED_TOKEN_ID, + lock_token_nonce, + &lock_amount, + Some(&locked_token_attributes), + ); + b_mock.check_esdt_balance(sc_wrapper.address_ref(), FREE_TOKEN_ID, &lock_amount); + b_mock.check_esdt_balance(&user_addr, FREE_TOKEN_ID, &rust_zero); + + // try unlock too early + b_mock + .execute_esdt_transfer( + &user_addr, + &sc_wrapper, + LOCKED_TOKEN_ID, + lock_token_nonce, + &lock_amount, + |sc| { + sc.unlock_tokens_endpoint(OptionalValue::None); + }, + ) + .assert_user_error("Cannot unlock yet"); + + // unlock ok + b_mock.set_block_epoch(10); + b_mock + .execute_esdt_transfer( + &user_addr, + &sc_wrapper, + LOCKED_TOKEN_ID, + lock_token_nonce, + &lock_amount, + |sc| { + sc.unlock_tokens_endpoint(OptionalValue::None); + }, + ) + .assert_ok(); + b_mock.check_esdt_balance(&user_addr, FREE_TOKEN_ID, &lock_amount); + b_mock.check_nft_balance( + &user_addr, + LOCKED_TOKEN_ID, + lock_token_nonce, + &rust_zero, + Some(&locked_token_attributes), + ); + b_mock.check_esdt_balance(sc_wrapper.address_ref(), FREE_TOKEN_ID, &rust_zero); + b_mock.check_nft_balance( + sc_wrapper.address_ref(), + LOCKED_TOKEN_ID, + lock_token_nonce, + &rust_zero, + Some(&locked_token_attributes), + ); +} + +#[test] +fn exit_lp_test() { + let rust_zero = rust_biguint!(0); + let mut b_mock = BlockchainStateWrapper::new(); + + let user_addr = b_mock.create_user_account(&rust_zero); + let owner_addr = b_mock.create_user_account(&rust_zero); + let sc_wrapper = b_mock.create_sc_account( + &rust_zero, + Some(&owner_addr), + simple_lock_legacy::contract_obj, + "Some path", + ); + + b_mock.set_block_epoch(5); + + b_mock + .execute_tx(&owner_addr, &sc_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!(LP_PROXY_TOKEN_ID)); + sc.farm_proxy_token() + .set_token_id(managed_token_id!(FARM_PROXY_TOKEN_ID)); + }) + .assert_ok(); + + b_mock.set_esdt_local_roles( + sc_wrapper.address_ref(), + LOCKED_TOKEN_ID, + &[ + EsdtLocalRole::NftCreate, + EsdtLocalRole::NftAddQuantity, + EsdtLocalRole::NftBurn, + ], + ); + b_mock.set_esdt_local_roles( + sc_wrapper.address_ref(), + LP_PROXY_TOKEN_ID, + &[ + EsdtLocalRole::NftCreate, + EsdtLocalRole::NftAddQuantity, + EsdtLocalRole::NftBurn, + ], + ); + b_mock.set_esdt_local_roles( + sc_wrapper.address_ref(), + FARM_PROXY_TOKEN_ID, + &[ + EsdtLocalRole::NftCreate, + EsdtLocalRole::NftAddQuantity, + EsdtLocalRole::NftBurn, + ], + ); + + let lock_token_nonce = 1u64; + let lock_amount = rust_biguint!(1_000); + + DebugApi::dummy(); + // Simulate the user add liquidity step by setting the SC balance manually + b_mock.set_esdt_balance(sc_wrapper.address_ref(), LP_TOKEN_ID, &lock_amount); + + b_mock + .execute_tx(&owner_addr, &sc_wrapper, &rust_zero, |sc| { + let lp_proxy_token_amount = managed_biguint!(1_000u64); + // Needed to be able to read the token attributes + sc.send().esdt_nft_create_compact( + &managed_token_id!(LOCKED_TOKEN_ID), + &managed_biguint!(1u64), + &LockedTokenAttributes:: { + original_token_id: managed_token_id_wrapped!(FREE_TOKEN_ID), + original_token_nonce: 0, + unlock_epoch: 10, + }, + ); + let lp_proxy_token_nonce = sc.send().esdt_nft_create_compact( + &managed_token_id!(LP_PROXY_TOKEN_ID), + &lp_proxy_token_amount, + &LpProxyTokenAttributes:: { + lp_token_id: managed_token_id!(LP_TOKEN_ID), + first_token_id: managed_token_id!(FREE_TOKEN_ID), + first_token_locked_nonce: 1, + second_token_id: managed_token_id!(WEGLD_TOKEN_ID), + second_token_locked_nonce: 0, + }, + ); + + sc.send().direct_esdt( + &managed_address!(&user_addr), + &managed_token_id!(LP_PROXY_TOKEN_ID), + lp_proxy_token_nonce, + &lp_proxy_token_amount, + ); + }) + .assert_ok(); + + let locked_lp_token_attributes: LpProxyTokenAttributes = LpProxyTokenAttributes { + lp_token_id: managed_token_id!(LP_TOKEN_ID), + first_token_id: managed_token_id!(FREE_TOKEN_ID), + first_token_locked_nonce: 1, + second_token_id: managed_token_id!(WEGLD_TOKEN_ID), + second_token_locked_nonce: 0, + }; + b_mock.check_nft_balance( + &user_addr, + LP_PROXY_TOKEN_ID, + lock_token_nonce, + &lock_amount, + Some(&locked_lp_token_attributes), + ); + + // try unlock too early + b_mock + .execute_esdt_transfer( + &user_addr, + &sc_wrapper, + LP_PROXY_TOKEN_ID, + lock_token_nonce, + &lock_amount, + |sc| { + sc.remove_liquidity_locked_token(); + }, + ) + .assert_user_error("Cannot unlock yet"); + + // unlock ok + b_mock.set_block_epoch(10); + b_mock + .execute_esdt_transfer( + &user_addr, + &sc_wrapper, + LP_PROXY_TOKEN_ID, + lock_token_nonce, + &lock_amount, + |sc| { + sc.remove_liquidity_locked_token(); + }, + ) + .assert_ok(); + b_mock.check_esdt_balance(&user_addr, LP_TOKEN_ID, &lock_amount); + b_mock.check_esdt_balance(sc_wrapper.address_ref(), LP_TOKEN_ID, &rust_zero); + b_mock.check_nft_balance( + &user_addr, + LP_PROXY_TOKEN_ID, + lock_token_nonce, + &rust_zero, + Some(&locked_lp_token_attributes), + ); + b_mock.check_nft_balance( + sc_wrapper.address_ref(), + LP_PROXY_TOKEN_ID, + lock_token_nonce, + &rust_zero, + Some(&locked_lp_token_attributes), + ); +} + +#[test] +fn exit_farm_test() { + let rust_zero = rust_biguint!(0); + let mut b_mock = BlockchainStateWrapper::new(); + + let user_addr = b_mock.create_user_account(&rust_zero); + let owner_addr = b_mock.create_user_account(&rust_zero); + let sc_wrapper = b_mock.create_sc_account( + &rust_zero, + Some(&owner_addr), + simple_lock_legacy::contract_obj, + "Some path", + ); + + b_mock.set_block_epoch(5); + + b_mock + .execute_tx(&owner_addr, &sc_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!(LP_PROXY_TOKEN_ID)); + sc.farm_proxy_token() + .set_token_id(managed_token_id!(FARM_PROXY_TOKEN_ID)); + }) + .assert_ok(); + + b_mock.set_esdt_local_roles( + sc_wrapper.address_ref(), + LOCKED_TOKEN_ID, + &[ + EsdtLocalRole::NftCreate, + EsdtLocalRole::NftAddQuantity, + EsdtLocalRole::NftBurn, + ], + ); + b_mock.set_esdt_local_roles( + sc_wrapper.address_ref(), + LP_PROXY_TOKEN_ID, + &[ + EsdtLocalRole::NftCreate, + EsdtLocalRole::NftAddQuantity, + EsdtLocalRole::NftBurn, + ], + ); + b_mock.set_esdt_local_roles( + sc_wrapper.address_ref(), + FARM_PROXY_TOKEN_ID, + &[ + EsdtLocalRole::NftCreate, + EsdtLocalRole::NftAddQuantity, + EsdtLocalRole::NftBurn, + ], + ); + + let lock_token_nonce = 1u64; + let lock_amount = rust_biguint!(2_000u64); + + DebugApi::dummy(); + b_mock + .execute_tx(&owner_addr, &sc_wrapper, &rust_zero, |sc| { + let farm_proxy_token_amount = managed_biguint!(2_000u64); + // Needed to be able to read the token attributes + sc.send().esdt_nft_create_compact( + &managed_token_id!(LOCKED_TOKEN_ID), + &managed_biguint!(1u64), + &LockedTokenAttributes:: { + original_token_id: managed_token_id_wrapped!(FREE_TOKEN_ID), + original_token_nonce: 0, + unlock_epoch: 10, + }, + ); + sc.send().esdt_nft_create_compact( + &managed_token_id!(LP_PROXY_TOKEN_ID), + &farm_proxy_token_amount, + &LpProxyTokenAttributes:: { + lp_token_id: managed_token_id!(LP_TOKEN_ID), + first_token_id: managed_token_id!(FREE_TOKEN_ID), + first_token_locked_nonce: 1, + second_token_id: managed_token_id!(WEGLD_TOKEN_ID), + second_token_locked_nonce: 0, + }, + ); + let farm_proxy_token_nonce = sc.send().esdt_nft_create_compact( + &managed_token_id!(FARM_PROXY_TOKEN_ID), + &farm_proxy_token_amount, + &FarmProxyTokenAttributes:: { + farm_type: FarmType::FarmWithLockedRewards, + 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, + }, + ); + + sc.send().direct_esdt( + &managed_address!(&user_addr), + &managed_token_id!(FARM_PROXY_TOKEN_ID), + farm_proxy_token_nonce, + &farm_proxy_token_amount, + ); + }) + .assert_ok(); + + let locked_farm_token_attributes: FarmProxyTokenAttributes = + FarmProxyTokenAttributes { + farm_type: FarmType::FarmWithLockedRewards, + 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, + }; + b_mock.check_nft_balance( + &user_addr, + FARM_PROXY_TOKEN_ID, + lock_token_nonce, + &lock_amount, + Some(&locked_farm_token_attributes), + ); + + let farm_attributes: FarmTokenAttributes = FarmTokenAttributes { + reward_per_share: managed_biguint!(0u64), + entering_epoch: 5u64, + compounded_reward: managed_biguint!(0u64), + current_farm_amount: managed_biguint!(2_000u64), + original_owner: managed_address!(&user_addr), + }; + b_mock.set_nft_balance( + sc_wrapper.address_ref(), + FARM_TOKEN_ID, + 1, + &lock_amount, + &farm_attributes, + ); + b_mock.check_nft_balance::>( + &user_addr, + FARM_TOKEN_ID, + 1, + &rust_zero, + None, + ); + b_mock.check_nft_balance( + sc_wrapper.address_ref(), + FARM_TOKEN_ID, + 1, + &lock_amount, + Some(&farm_attributes), + ); + + // try unlock too early + b_mock + .execute_esdt_transfer( + &user_addr, + &sc_wrapper, + FARM_PROXY_TOKEN_ID, + lock_token_nonce, + &lock_amount, + |sc| { + sc.farm_claim_rewards_locked_token(); + }, + ) + .assert_user_error("Cannot unlock yet"); + b_mock + .execute_esdt_transfer( + &user_addr, + &sc_wrapper, + FARM_PROXY_TOKEN_ID, + lock_token_nonce, + &lock_amount, + |sc| { + sc.exit_farm_locked_token(); + }, + ) + .assert_user_error("Cannot unlock yet"); + + // unlock ok + let half_lock_amount = rust_biguint!(1_000u64); + b_mock.set_block_epoch(10); + b_mock + .execute_esdt_transfer( + &user_addr, + &sc_wrapper, + FARM_PROXY_TOKEN_ID, + lock_token_nonce, + &half_lock_amount, + |sc| { + sc.farm_claim_rewards_locked_token(); + }, + ) + .assert_ok(); + + b_mock.check_nft_balance::>( + sc_wrapper.address_ref(), + FARM_TOKEN_ID, + lock_token_nonce, + &half_lock_amount, + Some(&farm_attributes), + ); + b_mock.check_nft_balance( + &user_addr, + FARM_TOKEN_ID, + lock_token_nonce, + &half_lock_amount, + Some(&farm_attributes), + ); + b_mock.check_nft_balance::>( + sc_wrapper.address_ref(), + FARM_PROXY_TOKEN_ID, + lock_token_nonce, + &rust_zero, + None, + ); + b_mock.check_nft_balance::>( + &user_addr, + FARM_PROXY_TOKEN_ID, + lock_token_nonce, + &half_lock_amount, + Some(&locked_farm_token_attributes), + ); + + b_mock + .execute_esdt_transfer( + &user_addr, + &sc_wrapper, + FARM_PROXY_TOKEN_ID, + lock_token_nonce, + &half_lock_amount, + |sc| { + sc.exit_farm_locked_token(); + }, + ) + .assert_ok(); + + b_mock.check_nft_balance::>( + sc_wrapper.address_ref(), + FARM_TOKEN_ID, + lock_token_nonce, + &rust_zero, + None, + ); + b_mock.check_nft_balance( + &user_addr, + FARM_TOKEN_ID, + lock_token_nonce, + &lock_amount, + Some(&farm_attributes), + ); + b_mock.check_nft_balance::>( + sc_wrapper.address_ref(), + FARM_PROXY_TOKEN_ID, + lock_token_nonce, + &rust_zero, + None, + ); + b_mock.check_nft_balance::>( + &user_addr, + FARM_PROXY_TOKEN_ID, + lock_token_nonce, + &rust_zero, + None, + ); +} From efbd326e701149ebf6a15629719ddbeeab15f903 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Wed, 22 May 2024 18:14:29 +0300 Subject: [PATCH 12/15] add initial endpoints parameters --- legacy-contracts/simple-lock-legacy/src/proxy_lp.rs | 6 +++++- legacy-contracts/simple-lock-legacy/tests/rust_test.rs | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/legacy-contracts/simple-lock-legacy/src/proxy_lp.rs b/legacy-contracts/simple-lock-legacy/src/proxy_lp.rs index 902683567..5617219d5 100644 --- a/legacy-contracts/simple-lock-legacy/src/proxy_lp.rs +++ b/legacy-contracts/simple-lock-legacy/src/proxy_lp.rs @@ -16,7 +16,11 @@ pub struct LpProxyTokenAttributes { pub trait ProxyLpModule: crate::locked_token::LockedTokenModule { #[payable("*")] #[endpoint(removeLiquidityLockedToken)] - fn remove_liquidity_locked_token(&self) -> EsdtTokenPayment { + fn remove_liquidity_locked_token( + &self, + _first_token_amount_min: BigUint, + _second_token_amount_min: BigUint, + ) -> EsdtTokenPayment { let payment = self.call_value().single_esdt(); let caller = self.blockchain().get_caller(); diff --git a/legacy-contracts/simple-lock-legacy/tests/rust_test.rs b/legacy-contracts/simple-lock-legacy/tests/rust_test.rs index 4d6089744..31fe17235 100644 --- a/legacy-contracts/simple-lock-legacy/tests/rust_test.rs +++ b/legacy-contracts/simple-lock-legacy/tests/rust_test.rs @@ -273,7 +273,7 @@ fn exit_lp_test() { lock_token_nonce, &lock_amount, |sc| { - sc.remove_liquidity_locked_token(); + sc.remove_liquidity_locked_token(managed_biguint!(0u64), managed_biguint!(0u64)); }, ) .assert_user_error("Cannot unlock yet"); @@ -288,7 +288,7 @@ fn exit_lp_test() { lock_token_nonce, &lock_amount, |sc| { - sc.remove_liquidity_locked_token(); + sc.remove_liquidity_locked_token(managed_biguint!(0u64), managed_biguint!(0u64)); }, ) .assert_ok(); From d11cdc27c70cce25608938d3e295f79039ac2a6b Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Tue, 28 May 2024 22:27:18 +0300 Subject: [PATCH 13/15] simple lock legacy check fix --- legacy-contracts/simple-lock-legacy/src/proxy_lp.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/legacy-contracts/simple-lock-legacy/src/proxy_lp.rs b/legacy-contracts/simple-lock-legacy/src/proxy_lp.rs index 5617219d5..2d384a1f3 100644 --- a/legacy-contracts/simple-lock-legacy/src/proxy_lp.rs +++ b/legacy-contracts/simple-lock-legacy/src/proxy_lp.rs @@ -72,7 +72,7 @@ pub trait ProxyLpModule: crate::locked_token::LockedTokenModule { .get_token_attributes(lp_proxy_token_attributes.second_token_locked_nonce); require!( - token_attributes.unlock_epoch >= current_epoch, + current_epoch >= token_attributes.unlock_epoch, CANNOT_UNLOCK_YET_ERR_MSG ); } From 7b75780ea242c63b5d351d02048b1dc755b59e33 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Wed, 29 May 2024 00:40:20 +0300 Subject: [PATCH 14/15] build fix --- .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 eb7e44644..6becbecc0 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@v3.1.0 + uses: multiversx/mx-sc-actions/.github/workflows/contracts.yml@v3.2.0 with: - rust-toolchain: nightly-2023-12-11 + rust-toolchain: nightly-2024-05-22 coverage-args: --ignore-filename-regex='/.cargo/git' --output ./coverage.md secrets: token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a19b5ed98..352ab4397 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.5 + uses: multiversx/mx-sc-actions/.github/workflows/reproducible-build.yml@v3.2.0 with: - image_tag: v6.0.0 + image_tag: v7.0.0 attach_to_existing_release: true From 04eff5af2579972d2ae50953ff69e13f273b72ea Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Wed, 29 May 2024 00:47:15 +0300 Subject: [PATCH 15/15] build fix --- .../workflows/on_pull_request_build_contracts.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .github/workflows/on_pull_request_build_contracts.yml diff --git a/.github/workflows/on_pull_request_build_contracts.yml b/.github/workflows/on_pull_request_build_contracts.yml new file mode 100644 index 000000000..dd4b3713c --- /dev/null +++ b/.github/workflows/on_pull_request_build_contracts.yml @@ -0,0 +1,14 @@ +name: On pull request, build contracts + +on: + pull_request: + +permissions: + contents: write + +jobs: + build: + uses: multiversx/mx-sc-actions/.github/workflows/reproducible-build.yml@v3.2.0 + with: + image_tag: v7.0.0 + package_whole_project_src: true \ No newline at end of file