From dd4cb715ad51a06be03b2c20b06c8c5406db27d4 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Tue, 9 Apr 2024 13:55:00 +0300 Subject: [PATCH 01/55] Github actions on rc branches --- .github/workflows/actions.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 56d357593..afa63aa92 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -2,9 +2,9 @@ name: CI on: push: - branches: [ main, feat/* ] + branches: [ main, feat/*, rc/* ] pull_request: - branches: [ main, feat/* ] + branches: [ main, feat/*, rc/* ] workflow_dispatch: permissions: From b21ea70bf19ffbdaea84585ce279e21c7e3fd126 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Wed, 10 Apr 2024 16:28:52 +0300 Subject: [PATCH 02/55] Router check pair refactor --- dex/router/src/config.rs | 39 +++++++++++++++++++++++----- dex/router/src/contract.rs | 25 ------------------ dex/router/src/factory.rs | 14 ---------- dex/router/tests/router_setup/mod.rs | 13 ---------- dex/router/tests/router_test.rs | 5 ---- dex/router/wasm/src/lib.rs | 8 +++--- 6 files changed, 36 insertions(+), 68 deletions(-) diff --git a/dex/router/src/config.rs b/dex/router/src/config.rs index 25c96a3e6..925725959 100644 --- a/dex/router/src/config.rs +++ b/dex/router/src/config.rs @@ -10,10 +10,29 @@ pub trait ConfigModule { } fn check_is_pair_sc(&self, pair_address: &ManagedAddress) { - require!( - self.address_pair_map().contains_key(pair_address), - "Not a pair SC" - ); + let first_token_id = self.first_token_id().get_from_address(&pair_address); + let second_token_id = self.second_token_id().get_from_address(&pair_address); + + let pair_tokens = PairTokens { + first_token_id: first_token_id.clone(), + second_token_id: second_token_id.clone(), + }; + + let mut pair_map_address_opt = self.pair_map().get(&pair_tokens); + if pair_map_address_opt.is_none() { + let reverse_pair_tokens = PairTokens { + first_token_id: second_token_id.clone(), + second_token_id: first_token_id.clone(), + }; + pair_map_address_opt = self.pair_map().get(&reverse_pair_tokens); + } + + require!(pair_map_address_opt.is_some(), "Not a pair SC"); + + unsafe { + let pair_map_address = pair_map_address_opt.unwrap_unchecked(); + require!(&pair_map_address == pair_address, "Not a pair SC"); + } } #[view(getPairCreationEnabled)] @@ -43,9 +62,6 @@ pub trait ConfigModule { #[storage_mapper("pair_map")] fn pair_map(&self) -> MapMapper, ManagedAddress>; - #[storage_mapper("address_pair_map")] - fn address_pair_map(&self) -> MapMapper>; - #[view(getPairTemplateAddress)] #[storage_mapper("pair_template_address")] fn pair_template_address(&self) -> SingleValueMapper; @@ -66,4 +82,13 @@ pub trait ConfigModule { #[view(getCommonTokensForUserPairs)] #[storage_mapper("commonTokensForUserPairs")] fn common_tokens_for_user_pairs(&self) -> UnorderedSetMapper; + + // read from other storage + #[view(getFirstTokenId)] + #[storage_mapper("first_token_id")] + fn first_token_id(&self) -> SingleValueMapper; + + #[view(getSecondTokenId)] + #[storage_mapper("second_token_id")] + fn second_token_id(&self) -> SingleValueMapper; } diff --git a/dex/router/src/contract.rs b/dex/router/src/contract.rs index 04b787a03..f90416226 100644 --- a/dex/router/src/contract.rs +++ b/dex/router/src/contract.rs @@ -64,10 +64,6 @@ pub trait Router: #[endpoint] fn resume(&self, address: ManagedAddress) { if address == self.blockchain().get_sc_address() { - require!( - self.pair_map().len() == self.address_pair_map().len(), - "The size of the 2 pair maps is not the same" - ); self.state().set(true); } else { self.check_is_pair_sc(&address); @@ -317,8 +313,6 @@ pub trait Router: .unwrap_or_else(ManagedAddress::zero); } - self.address_pair_map().remove(&pair_address); - pair_address } @@ -385,23 +379,4 @@ pub trait Router: fn set_pair_creation_enabled(&self, enabled: bool) { self.pair_creation_enabled().set(enabled); } - - #[only_owner] - #[endpoint(migratePairMap)] - fn migrate_pair_map(&self) { - let pair_map = self.pair_map(); - let mut address_pair_map = self.address_pair_map(); - require!( - address_pair_map.is_empty(), - "The destination mapper must be empty" - ); - for (pair_tokens, address) in pair_map.iter() { - address_pair_map.insert(address, pair_tokens); - } - - require!( - pair_map.len() == address_pair_map.len(), - "The size of the 2 pair maps is not the same" - ); - } } diff --git a/dex/router/src/factory.rs b/dex/router/src/factory.rs index 4994db235..37a476a8d 100644 --- a/dex/router/src/factory.rs +++ b/dex/router/src/factory.rs @@ -71,13 +71,6 @@ pub trait FactoryModule: config::ConfigModule { }, new_address.clone(), ); - self.address_pair_map().insert( - new_address.clone(), - PairTokens { - first_token_id: first_token_id.clone(), - second_token_id: second_token_id.clone(), - }, - ); self.pair_temporary_owner().insert( new_address.clone(), ( @@ -174,13 +167,6 @@ pub trait FactoryModule: config::ConfigModule { address } - #[view(getPairTokens)] - fn get_pair_tokens(&self, pair_address: ManagedAddress) -> PairTokens { - let pair_tokens_opt = self.address_pair_map().get(&pair_address); - require!(pair_tokens_opt.is_some(), "Pair address not found"); - pair_tokens_opt.unwrap() - } - fn get_pair_temporary_owner(&self, pair_address: &ManagedAddress) -> Option { let result = self.pair_temporary_owner().get(pair_address); diff --git a/dex/router/tests/router_setup/mod.rs b/dex/router/tests/router_setup/mod.rs index c72b6a971..4339d502d 100644 --- a/dex/router/tests/router_setup/mod.rs +++ b/dex/router/tests/router_setup/mod.rs @@ -284,17 +284,4 @@ where ) .assert_ok(); } - - pub fn migrate_pair_map(&mut self) { - self.blockchain_wrapper - .execute_tx( - &self.owner_address, - &self.router_wrapper, - &rust_biguint!(0u64), - |sc| { - sc.migrate_pair_map(); - }, - ) - .assert_ok(); - } } diff --git a/dex/router/tests/router_test.rs b/dex/router/tests/router_test.rs index 54c73c838..54765f2c4 100644 --- a/dex/router/tests/router_test.rs +++ b/dex/router/tests/router_test.rs @@ -134,7 +134,6 @@ fn test_router_upgrade_pair() { #[test] fn test_multi_pair_swap() { let mut router_setup = RouterSetup::new(router::contract_obj, pair::contract_obj); - router_setup.migrate_pair_map(); router_setup.add_liquidity(); @@ -255,8 +254,6 @@ fn user_enable_pair_swaps_through_router_test() { managed_address!(pair_wrapper.address_ref()), ); - sc.migrate_pair_map(); - sc.add_common_tokens_for_user_pairs(MultiValueEncoded::from(ManagedVec::from(vec![ managed_token_id!(USDC_TOKEN_ID), ]))); @@ -442,8 +439,6 @@ fn user_enable_pair_swaps_fail_test() { managed_address!(pair_wrapper.address_ref()), ); - sc.migrate_pair_map(); - sc.add_common_tokens_for_user_pairs(MultiValueEncoded::from(ManagedVec::from(vec![ managed_token_id!(USDC_TOKEN_ID), ]))); diff --git a/dex/router/wasm/src/lib.rs b/dex/router/wasm/src/lib.rs index e840498ec..ee22e6ba5 100644 --- a/dex/router/wasm/src/lib.rs +++ b/dex/router/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 33 +// Endpoints: 32 // Async Callback: 1 -// Total number of exported functions: 35 +// Total number of exported functions: 34 #![no_std] #![allow(internal_features)] @@ -31,7 +31,6 @@ multiversx_sc_wasm_adapter::endpoints! { setFeeOn => set_fee_on setFeeOff => set_fee_off setPairCreationEnabled => set_pair_creation_enabled - migratePairMap => migrate_pair_map getPairCreationEnabled => pair_creation_enabled getState => state getOwner => owner @@ -40,11 +39,12 @@ multiversx_sc_wasm_adapter::endpoints! { getPairTemplateAddress => pair_template_address getTemporaryOwnerPeriod => temporary_owner_period getCommonTokensForUserPairs => common_tokens_for_user_pairs + getFirstTokenId => first_token_id + getSecondTokenId => second_token_id getAllPairsManagedAddresses => get_all_pairs_addresses getAllPairTokens => get_all_token_pairs getAllPairContractMetadata => get_all_pair_contract_metadata getPair => get_pair - getPairTokens => get_pair_tokens clearPairTemporaryOwnerStorage => clear_pair_temporary_owner_storage multiPairSwap => multi_pair_swap configEnableByUserParameters => config_enable_by_user_parameters From 16f0d725d1d6717612023e349450d6bed79bf0de Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Wed, 10 Apr 2024 17:04:13 +0300 Subject: [PATCH 03/55] clippy fixes --- dex/router/src/config.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dex/router/src/config.rs b/dex/router/src/config.rs index 925725959..388bc0a44 100644 --- a/dex/router/src/config.rs +++ b/dex/router/src/config.rs @@ -10,8 +10,8 @@ pub trait ConfigModule { } fn check_is_pair_sc(&self, pair_address: &ManagedAddress) { - let first_token_id = self.first_token_id().get_from_address(&pair_address); - let second_token_id = self.second_token_id().get_from_address(&pair_address); + let first_token_id = self.first_token_id().get_from_address(pair_address); + let second_token_id = self.second_token_id().get_from_address(pair_address); let pair_tokens = PairTokens { first_token_id: first_token_id.clone(), From b01507b6a36397b717ac491835ff7d1a7ccbac70 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Thu, 11 Apr 2024 12:25:54 +0300 Subject: [PATCH 04/55] add check on enable swap by user --- dex/router/src/enable_swap_by_user.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/dex/router/src/enable_swap_by_user.rs b/dex/router/src/enable_swap_by_user.rs index 7c77036c1..f5929f4f7 100644 --- a/dex/router/src/enable_swap_by_user.rs +++ b/dex/router/src/enable_swap_by_user.rs @@ -83,6 +83,7 @@ pub trait EnableSwapByUserModule: #[payable("*")] #[endpoint(setSwapEnabledByUser)] fn set_swap_enabled_by_user(&self, pair_address: ManagedAddress) { + require!(self.is_active(), "Not active"); self.check_is_pair_sc(&pair_address); self.require_state_active_no_swaps(&pair_address); From 19e8ce328a1d06cba9d9d6ba07a593354e0f5d2d Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Fri, 12 Apr 2024 02:55:16 +0300 Subject: [PATCH 05/55] Farm staking merge fix + unit tests --- farm-staking/farm-staking/src/lib.rs | 29 +- .../farm-staking/src/token_attributes.rs | 4 +- .../tests/farm_staking_energy_test.rs | 626 +++++++++++++++++- .../tests/farm_staking_setup/mod.rs | 217 +++++- .../farm-staking/tests/farm_staking_test.rs | 74 ++- 5 files changed, 890 insertions(+), 60 deletions(-) diff --git a/farm-staking/farm-staking/src/lib.rs b/farm-staking/farm-staking/src/lib.rs index c210d080c..e4f0a6533 100644 --- a/farm-staking/farm-staking/src/lib.rs +++ b/farm-staking/farm-staking/src/lib.rs @@ -119,8 +119,35 @@ pub trait FarmStaking: let payments = self.get_non_empty_payments(); let token_mapper = self.farm_token(); - let output_attributes: StakingFarmTokenAttributes = + + for farm_position in &payments { + if self.is_old_farm_position(farm_position.token_nonce) { + continue; + } + + let token_attributes: StakingFarmTokenAttributes = + token_mapper.get_token_attributes(farm_position.token_nonce); + + if token_attributes.original_owner != caller { + self.user_total_farm_position(&token_attributes.original_owner) + .update(|user_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(); + } + }); + self.user_total_farm_position(&caller) + .update(|user_total_farm_position| { + user_total_farm_position.total_farm_position += &farm_position.amount; + }); + } + } + + let mut output_attributes: StakingFarmTokenAttributes = self.merge_from_payments_and_burn(payments, &token_mapper); + output_attributes.original_owner = caller.clone(); + let new_token_amount = output_attributes.get_total_supply(); let merged_farm_token = token_mapper.nft_create(new_token_amount, &output_attributes); diff --git a/farm-staking/farm-staking/src/token_attributes.rs b/farm-staking/farm-staking/src/token_attributes.rs index 54074a958..59f8c6326 100644 --- a/farm-staking/farm-staking/src/token_attributes.rs +++ b/farm-staking/farm-staking/src/token_attributes.rs @@ -108,8 +108,8 @@ impl FixedSupplyToken for StakingFarmTokenAttributes { impl Mergeable for StakingFarmTokenAttributes { #[inline] - fn can_merge_with(&self, other: &Self) -> bool { - self.original_owner == other.original_owner + fn can_merge_with(&self, _other: &Self) -> bool { + true } fn merge_with(&mut self, other: Self) { diff --git a/farm-staking/farm-staking/tests/farm_staking_energy_test.rs b/farm-staking/farm-staking/tests/farm_staking_energy_test.rs index 230d84747..8b51dee1b 100644 --- a/farm-staking/farm-staking/tests/farm_staking_energy_test.rs +++ b/farm-staking/farm-staking/tests/farm_staking_energy_test.rs @@ -2,12 +2,17 @@ pub mod farm_staking_setup; use farm_staking::{ - claim_stake_farm_rewards::ClaimStakeFarmRewardsModule, stake_farm::StakeFarmModule, + claim_stake_farm_rewards::ClaimStakeFarmRewardsModule, + stake_farm::StakeFarmModule, + token_attributes::{StakingFarmTokenAttributes, UnbondSftAttributes}, unstake_farm::UnstakeFarmModule, + FarmStaking, }; use farm_staking_setup::*; use multiversx_sc::codec::multi_types::OptionalValue; -use multiversx_sc_scenario::{rust_biguint, DebugApi}; +use multiversx_sc_scenario::{ + managed_address, managed_biguint, rust_biguint, testing_framework::TxTokenTransfer, DebugApi, +}; #[test] fn farm_staking_with_energy_setup_test() { @@ -24,12 +29,21 @@ fn farm_staking_boosted_rewards_no_energy_test() { let mut fs_setup = FarmStakingSetup::new(farm_staking::contract_obj, energy_factory::contract_obj); + let user_address = fs_setup.user_address.clone(); + fs_setup.set_boosted_yields_factors(); fs_setup.set_boosted_yields_rewards_percentage(BOOSTED_YIELDS_PERCENTAGE); let farm_in_amount = 100_000_000; let expected_farm_token_nonce = 1; - fs_setup.stake_farm(farm_in_amount, &[], expected_farm_token_nonce, 0, 0); + fs_setup.stake_farm( + &user_address, + farm_in_amount, + &[], + expected_farm_token_nonce, + 0, + 0, + ); fs_setup.check_farm_token_supply(farm_in_amount); fs_setup.set_block_epoch(5); @@ -43,6 +57,7 @@ fn farm_staking_boosted_rewards_no_energy_test() { rust_biguint!(USER_TOTAL_RIDE_TOKENS - farm_in_amount + expected_reward_token_out); let expected_reward_per_share = 300_000; // from 400_000 -> 300_000 fs_setup.claim_rewards( + &user_address, farm_in_amount, expected_farm_token_nonce, expected_reward_token_out, @@ -54,26 +69,203 @@ fn farm_staking_boosted_rewards_no_energy_test() { fs_setup.check_farm_token_supply(farm_in_amount); } +#[test] +fn farm_staking_other_user_enter_negative_test() { + DebugApi::dummy(); + let mut fs_setup = + FarmStakingSetup::new(farm_staking::contract_obj, energy_factory::contract_obj); + + let user_address = fs_setup.user_address.clone(); + let rand_user = fs_setup.b_mock.create_user_account(&rust_biguint!(0)); + + fs_setup.set_boosted_yields_factors(); + fs_setup.set_boosted_yields_rewards_percentage(BOOSTED_YIELDS_PERCENTAGE); + + let farm_in_amount = 100_000_000; + fs_setup + .stake_farm_for_other_user(&rand_user, &user_address, farm_in_amount, &vec![]) + .assert_error(4, "Item not whitelisted"); + + let expected_farm_token_nonce = 1; + fs_setup.stake_farm( + &user_address, + farm_in_amount, + &[], + expected_farm_token_nonce, + 0, + 0, + ); + + fs_setup + .claim_farm_for_other_user( + &rand_user, + &user_address, + expected_farm_token_nonce, + farm_in_amount, + ) + .assert_error(4, "Item not whitelisted"); + + fs_setup + .unstake_farm_for_other_user( + &rand_user, + &user_address, + expected_farm_token_nonce, + farm_in_amount, + ) + .assert_error(4, "Item not whitelisted"); +} + #[test] fn farm_staking_boosted_rewards_with_energy_test() { DebugApi::dummy(); let mut fs_setup = FarmStakingSetup::new(farm_staking::contract_obj, energy_factory::contract_obj); + let user_address = fs_setup.user_address.clone(); + let user_address2 = fs_setup.user_address2.clone(); + fs_setup.set_boosted_yields_factors(); fs_setup.set_boosted_yields_rewards_percentage(BOOSTED_YIELDS_PERCENTAGE); - fs_setup.set_user_energy(&fs_setup.user_address.clone(), 10_000, 0, 10); + fs_setup.set_user_energy(&user_address, 10_000, 0, 10); + fs_setup.set_user_energy(&user_address2, 5_000, 0, 10); let farm_in_amount = 100_000_000; - fs_setup.stake_farm(farm_in_amount, &[], 1, 0, 0); + fs_setup.stake_farm(&user_address, farm_in_amount, &[], 1, 0, 0); + fs_setup.stake_farm(&user_address2, farm_in_amount, &[], 2, 0, 0); + fs_setup.check_farm_token_supply(farm_in_amount * 2); + + // claim to get energy registered + fs_setup + .b_mock + .execute_esdt_transfer( + &user_address, + &fs_setup.farm_wrapper, + FARM_TOKEN_ID, + 1, + &rust_biguint!(farm_in_amount), + |sc| { + let _ = sc.claim_rewards(OptionalValue::None); + }, + ) + .assert_ok(); + + fs_setup + .b_mock + .execute_esdt_transfer( + &user_address2, + &fs_setup.farm_wrapper, + FARM_TOKEN_ID, + 2, + &rust_biguint!(farm_in_amount), + |sc| { + let _ = sc.claim_rewards(OptionalValue::None); + }, + ) + .assert_ok(); + + fs_setup.set_block_nonce(10); + + // random user tx to collect rewards + + let rand_user = fs_setup.b_mock.create_user_account(&rust_biguint!(0)); + fs_setup.b_mock.set_esdt_balance( + &rand_user, + FARMING_TOKEN_ID, + &rust_biguint!(USER_TOTAL_RIDE_TOKENS), + ); + + fs_setup.set_user_energy(&rand_user, 1, 5, 1); + fs_setup.set_block_epoch(5); + + fs_setup + .b_mock + .execute_esdt_transfer( + &rand_user, + &fs_setup.farm_wrapper, + FARMING_TOKEN_ID, + 0, + &rust_biguint!(10), + |sc| { + let _ = sc.stake_farm_endpoint(OptionalValue::None); + }, + ) + .assert_ok(); + + fs_setup + .b_mock + .execute_esdt_transfer( + &rand_user, + &fs_setup.farm_wrapper, + FARM_TOKEN_ID, + 5, + &rust_biguint!(10), + |sc| { + let _ = sc.unstake_farm(OptionalValue::None); + }, + ) + .assert_ok(); + + fs_setup.set_block_epoch(8); + + fs_setup.set_user_energy(&user_address, 10_000, 8, 10); + fs_setup.set_user_energy(&user_address2, 5_000, 8, 10); + + let base_rewards = 34; + let boosted_rewards_user = 13; + let boosted_rewards_user2 = 8; + let expected_reward_token_out_user = base_rewards + boosted_rewards_user; + let expected_reward_token_out_user2 = base_rewards + boosted_rewards_user2; + let expected_farming_token_balance_user = + rust_biguint!(USER_TOTAL_RIDE_TOKENS - farm_in_amount + expected_reward_token_out_user); + let expected_farming_token_balance_user2 = + rust_biguint!(USER_TOTAL_RIDE_TOKENS - farm_in_amount + expected_reward_token_out_user2); + let expected_reward_per_share = 340_000; + fs_setup.claim_rewards( + &user_address, + farm_in_amount, + 3, + expected_reward_token_out_user, + &expected_farming_token_balance_user, + &expected_farming_token_balance_user, + 7, + expected_reward_per_share, + ); + fs_setup.claim_rewards( + &user_address2, + farm_in_amount, + 4, + expected_reward_token_out_user2, + &expected_farming_token_balance_user2, + &expected_farming_token_balance_user2, + 8, + expected_reward_per_share, + ); + fs_setup.check_farm_token_supply(farm_in_amount * 2); +} + +#[test] +fn farm_staking_partial_position_handling_test() { + DebugApi::dummy(); + let mut fs_setup = + FarmStakingSetup::new(farm_staking::contract_obj, energy_factory::contract_obj); + + let user_address = fs_setup.user_address.clone(); + + fs_setup.set_boosted_yields_factors(); + fs_setup.set_boosted_yields_rewards_percentage(BOOSTED_YIELDS_PERCENTAGE); + + fs_setup.set_user_energy(&user_address, 10_000, 0, 10); + + let farm_in_amount = 100_000_000; + fs_setup.stake_farm(&user_address, farm_in_amount, &[], 1, 0, 0); fs_setup.check_farm_token_supply(farm_in_amount); // claim to get energy registered fs_setup .b_mock .execute_esdt_transfer( - &fs_setup.user_address, + &user_address, &fs_setup.farm_wrapper, FARM_TOKEN_ID, 1, @@ -128,27 +320,90 @@ fn farm_staking_boosted_rewards_with_energy_test() { fs_setup.set_block_epoch(8); - fs_setup.set_user_energy(&fs_setup.user_address.clone(), 10_000, 8, 10); + fs_setup.set_user_energy(&user_address, 10_000, 8, 10); - // value taken from the "test_unstake_farm" test - // originally, it was 40, but since 25% of the rewards go to boosted yields - // rewards are now only 3/4 * 40 = 30 - // - // 10 reserved for boosted yields -> 30 + 10 - let expected_reward_token_out = 40; - let expected_farming_token_balance = - rust_biguint!(USER_TOTAL_RIDE_TOKENS - farm_in_amount + expected_reward_token_out); - let expected_reward_per_share = 300_000; // from 400_000 -> 300_000 - fs_setup.claim_rewards( - farm_in_amount, + let full_position_base_rewards = 30; + let boosted_rewards_user = 10; + let half_position_expected_rewards = full_position_base_rewards / 2 + boosted_rewards_user; + let expected_farming_token_balance_user = + rust_biguint!(USER_TOTAL_RIDE_TOKENS - farm_in_amount + half_position_expected_rewards); + + fs_setup.unstake_farm( + &user_address, + farm_in_amount / 2, 2, - expected_reward_token_out, - &expected_farming_token_balance, - &expected_farming_token_balance, + half_position_expected_rewards, + &expected_farming_token_balance_user, + &expected_farming_token_balance_user, 5, + farm_in_amount / 2, + &UnbondSftAttributes { + unlock_epoch: 8 + MIN_UNBOND_EPOCHS, + }, + ); + + fs_setup.set_block_nonce(20); + + // random user tx to collect rewards + + let rand_user = fs_setup.b_mock.create_user_account(&rust_biguint!(0)); + fs_setup.b_mock.set_esdt_balance( + &rand_user, + FARMING_TOKEN_ID, + &rust_biguint!(USER_TOTAL_RIDE_TOKENS), + ); + + fs_setup.set_user_energy(&rand_user, 1, 12, 1); + fs_setup.set_block_epoch(12); + + fs_setup + .b_mock + .execute_esdt_transfer( + &rand_user, + &fs_setup.farm_wrapper, + FARMING_TOKEN_ID, + 0, + &rust_biguint!(10), + |sc| { + let _ = sc.stake_farm_endpoint(OptionalValue::None); + }, + ) + .assert_ok(); + + fs_setup + .b_mock + .execute_esdt_transfer( + &rand_user, + &fs_setup.farm_wrapper, + FARM_TOKEN_ID, + 6, + &rust_biguint!(10), + |sc| { + let _ = sc.unstake_farm(OptionalValue::None); + }, + ) + .assert_ok(); + + fs_setup.set_block_epoch(15); + + fs_setup.set_user_energy(&user_address, 10_000, 15, 10); + + let expected_rewards_amount = full_position_base_rewards / 2 * 2; // half remaining position * 2 times the 10 block period + let half_position_boosted_rewards = boosted_rewards_user / 2; + let remaining_expected_rewards = expected_rewards_amount + half_position_boosted_rewards; + let final_expected_farming_token_balance_user = + expected_farming_token_balance_user + rust_biguint!(remaining_expected_rewards); + let expected_reward_per_share = 600_000; + fs_setup.claim_rewards( + &user_address, + farm_in_amount / 2, + 2, + remaining_expected_rewards, + &final_expected_farming_token_balance_user, + &final_expected_farming_token_balance_user, + 8, expected_reward_per_share, ); - fs_setup.check_farm_token_supply(farm_in_amount); } #[test] @@ -157,13 +412,15 @@ fn farm_staking_claim_boosted_rewards_for_user_test() { let mut fs_setup = FarmStakingSetup::new(farm_staking::contract_obj, energy_factory::contract_obj); + let user_address = fs_setup.user_address.clone(); + fs_setup.set_boosted_yields_factors(); fs_setup.set_boosted_yields_rewards_percentage(BOOSTED_YIELDS_PERCENTAGE); fs_setup.set_user_energy(&fs_setup.user_address.clone(), 10_000, 0, 10); let farm_in_amount = 100_000_000; - fs_setup.stake_farm(farm_in_amount, &[], 1, 0, 0); + fs_setup.stake_farm(&user_address, farm_in_amount, &[], 1, 0, 0); fs_setup.check_farm_token_supply(farm_in_amount); // claim to get energy registered @@ -185,6 +442,7 @@ fn farm_staking_claim_boosted_rewards_for_user_test() { // random user tx to collect rewards let rand_user = fs_setup.b_mock.create_user_account(&rust_biguint!(0)); + let user_address = fs_setup.user_address.clone(); fs_setup.b_mock.set_esdt_balance( &rand_user, FARMING_TOKEN_ID, @@ -224,7 +482,7 @@ fn farm_staking_claim_boosted_rewards_for_user_test() { fs_setup.set_block_epoch(8); - fs_setup.set_user_energy(&fs_setup.user_address.clone(), 10_000, 8, 10); + fs_setup.set_user_energy(&user_address, 10_000, 8, 10); // value taken from the "test_unstake_farm" test // originally, it was 40, but since 25% of the rewards go to boosted yields @@ -236,14 +494,30 @@ fn farm_staking_claim_boosted_rewards_for_user_test() { rust_biguint!(USER_TOTAL_RIDE_TOKENS - farm_in_amount + expected_boosted_reward_token_out); // Random_user claim boosted rewards for user - fs_setup.allow_external_claim_rewards(&fs_setup.user_address.clone()); + let rand_user_reward_balance = 4_999_999_990u64; + fs_setup.b_mock.check_esdt_balance( + &rand_user, + REWARD_TOKEN_ID, + &rust_biguint!(rand_user_reward_balance), + ); + fs_setup.allow_external_claim_rewards(&user_address, true); fs_setup.claim_boosted_rewards_for_user( - &fs_setup.user_address.clone(), + &user_address, &rand_user, expected_boosted_reward_token_out, &expected_farming_token_balance, ); + fs_setup.b_mock.check_esdt_balance( + &rand_user, + REWARD_TOKEN_ID, + &rust_biguint!(rand_user_reward_balance), + ); + fs_setup.check_farm_token_supply(farm_in_amount); + + // User removes the allowance of claim boosted rewards + fs_setup.allow_external_claim_rewards(&user_address, false); + fs_setup.claim_boosted_rewards_for_user_expect_error(&user_address, &rand_user); } #[test] @@ -252,14 +526,16 @@ fn farm_staking_full_position_boosted_rewards_test() { let mut fs_setup = FarmStakingSetup::new(farm_staking::contract_obj, energy_factory::contract_obj); + let user_address = fs_setup.user_address.clone(); + fs_setup.set_boosted_yields_factors(); fs_setup.set_boosted_yields_rewards_percentage(BOOSTED_YIELDS_PERCENTAGE); fs_setup.set_user_energy(&fs_setup.user_address.clone(), 10_000, 0, 10); let farm_in_amount = 50_000_000; - fs_setup.stake_farm(farm_in_amount, &[], 1, 0, 0); - fs_setup.stake_farm(farm_in_amount, &[], 2, 0, 0); + fs_setup.stake_farm(&user_address, farm_in_amount, &[], 1, 0, 0); + fs_setup.stake_farm(&user_address, farm_in_amount, &[], 2, 0, 0); fs_setup.check_farm_token_supply(farm_in_amount * 2); // claim to get energy registered @@ -334,6 +610,7 @@ fn farm_staking_full_position_boosted_rewards_test() { // Should receive half base rewards and full boosted rewards fs_setup.claim_rewards( + &user_address, farm_in_amount, 2, expected_base_rewards + expected_boosted_rewards, @@ -346,6 +623,7 @@ fn farm_staking_full_position_boosted_rewards_test() { // Should receive half base rewards and no boosted rewards expected_farming_token_balance += expected_base_rewards; fs_setup.claim_rewards( + &user_address, farm_in_amount, 3, expected_base_rewards, @@ -356,3 +634,295 @@ fn farm_staking_full_position_boosted_rewards_test() { ); fs_setup.check_farm_token_supply(farm_in_amount * 2); } + +#[test] +fn position_owner_change_test() { + DebugApi::dummy(); + let mut fs_setup = + FarmStakingSetup::new(farm_staking::contract_obj, energy_factory::contract_obj); + + let first_user = fs_setup.user_address.clone(); + let second_user = fs_setup.user_address2.clone(); + + fs_setup.set_boosted_yields_factors(); + fs_setup.set_boosted_yields_rewards_percentage(BOOSTED_YIELDS_PERCENTAGE); + + fs_setup.set_user_energy(&first_user, 10_000, 0, 10); + fs_setup.set_user_energy(&second_user, 5_000, 0, 10); + + let farm_in_amount = 10_000_000; + let half_farm_in_amount = farm_in_amount / 2; + fs_setup.stake_farm(&first_user, farm_in_amount, &[], 1, 0, 0); + fs_setup.stake_farm(&first_user, farm_in_amount, &[], 2, 0, 0); + fs_setup.stake_farm(&first_user, farm_in_amount, &[], 3, 0, 0); + fs_setup.stake_farm(&first_user, farm_in_amount, &[], 4, 0, 0); + fs_setup.stake_farm(&first_user, farm_in_amount, &[], 5, 0, 0); + + fs_setup.check_farm_token_supply(farm_in_amount * 5); + + fs_setup.check_user_total_farm_position(&first_user, farm_in_amount * 5); + fs_setup.check_user_total_farm_position(&second_user, 0); + + // First user transfers 5 position to second user + fs_setup.send_position(&first_user, &second_user, 1, farm_in_amount, 0); + fs_setup.send_position(&first_user, &second_user, 2, farm_in_amount, 0); + fs_setup.send_position(&first_user, &second_user, 3, farm_in_amount, 0); + fs_setup.send_position(&first_user, &second_user, 4, farm_in_amount, 0); + fs_setup.send_position(&first_user, &second_user, 5, farm_in_amount, 0); + + // Total farm position unchanged as users only transfered the farm positions + fs_setup.check_user_total_farm_position(&first_user, half_farm_in_amount * 10); + fs_setup.check_user_total_farm_position(&second_user, 0); + + let additional_farm_tokens = [TxTokenTransfer { + token_identifier: FARM_TOKEN_ID.to_vec(), + nonce: 1, + value: rust_biguint!(half_farm_in_amount), + }]; + + fs_setup.stake_farm( + &second_user, + farm_in_amount, + &additional_farm_tokens, + 6, + 0, + 0, + ); + + fs_setup.check_user_total_farm_position(&first_user, half_farm_in_amount * 9); + fs_setup.check_user_total_farm_position(&second_user, farm_in_amount + half_farm_in_amount); + + let rand_user = fs_setup.b_mock.create_user_account(&rust_biguint!(0)); + fs_setup.b_mock.set_esdt_balance( + &rand_user, + FARMING_TOKEN_ID, + &rust_biguint!(USER_TOTAL_RIDE_TOKENS), + ); + + // random user tx to collect rewards + + fs_setup.set_user_energy(&rand_user, 1, 5, 1); + fs_setup.set_block_epoch(5); + fs_setup.set_block_nonce(10); + + fs_setup + .b_mock + .execute_esdt_transfer( + &rand_user, + &fs_setup.farm_wrapper, + FARMING_TOKEN_ID, + 0, + &rust_biguint!(10), + |sc| { + let _ = sc.stake_farm_endpoint(OptionalValue::None); + }, + ) + .assert_ok(); + + fs_setup + .b_mock + .execute_esdt_transfer( + &rand_user, + &fs_setup.farm_wrapper, + FARM_TOKEN_ID, + 7, + &rust_biguint!(10), + |sc| { + let _ = sc.unstake_farm(OptionalValue::None); + }, + ) + .assert_ok(); + + fs_setup.set_block_epoch(8); + + fs_setup.set_user_energy(&first_user, 10_000, 8, 10); + fs_setup.set_user_energy(&second_user, 5_000, 8, 10); + + // Second user claims with half position from first user + let mut rewards = 2; + let mut expected_farming_token_balance = + rust_biguint!(USER_TOTAL_RIDE_TOKENS - farm_in_amount + rewards); + fs_setup.claim_rewards( + &second_user, + half_farm_in_amount, + 2, + rewards, + &expected_farming_token_balance, + &expected_farming_token_balance, + 9, + 250_000, + ); + + fs_setup.check_user_total_farm_position(&first_user, half_farm_in_amount * 8); + fs_setup.check_user_total_farm_position(&second_user, farm_in_amount + half_farm_in_amount * 2); + + // random user tx to collect rewards + fs_setup.set_user_energy(&rand_user, 1, 12, 1); + fs_setup.set_block_epoch(12); + fs_setup.set_block_nonce(20); + + fs_setup + .b_mock + .execute_esdt_transfer( + &rand_user, + &fs_setup.farm_wrapper, + FARMING_TOKEN_ID, + 0, + &rust_biguint!(10), + |sc| { + let _ = sc.stake_farm_endpoint(OptionalValue::None); + }, + ) + .assert_ok(); + + fs_setup + .b_mock + .execute_esdt_transfer( + &rand_user, + &fs_setup.farm_wrapper, + FARM_TOKEN_ID, + 10, + &rust_biguint!(10), + |sc| { + let _ = sc.unstake_farm(OptionalValue::None); + }, + ) + .assert_ok(); + + fs_setup.set_block_epoch(15); + + fs_setup.set_user_energy(&first_user, 10_000, 15, 10); + fs_setup.set_user_energy(&second_user, 5_000, 15, 10); + + // Second user exits with half position from first user + fs_setup + .b_mock + .execute_esdt_transfer( + &second_user, + &fs_setup.farm_wrapper, + FARM_TOKEN_ID, + 3, + &rust_biguint!(half_farm_in_amount), + |sc| { + let _ = sc.unstake_farm(OptionalValue::None); + }, + ) + .assert_ok(); + + rewards += 3; + expected_farming_token_balance = + rust_biguint!(USER_TOTAL_RIDE_TOKENS - farm_in_amount + rewards); + fs_setup.b_mock.check_esdt_balance( + &second_user, + REWARD_TOKEN_ID, + &expected_farming_token_balance, + ); + + fs_setup.check_user_total_farm_position(&first_user, half_farm_in_amount * 7); + fs_setup.check_user_total_farm_position(&second_user, farm_in_amount + half_farm_in_amount * 2); + + // First user claim boosted rewards + let first_user_expected_boosted_reward_token_out = 5; + let first_user_expected_farming_token_balance = rust_biguint!( + USER_TOTAL_RIDE_TOKENS - farm_in_amount * 5 + first_user_expected_boosted_reward_token_out + ); + fs_setup.claim_boosted_rewards_for_user( + &first_user, + &first_user, + first_user_expected_boosted_reward_token_out, + &first_user_expected_farming_token_balance, + ); + + fs_setup.check_user_total_farm_position(&first_user, half_farm_in_amount * 7); + fs_setup.check_user_total_farm_position(&second_user, farm_in_amount + half_farm_in_amount * 2); + + // random user tx to collect rewards + fs_setup.set_user_energy(&rand_user, 1, 12, 1); + fs_setup.set_block_epoch(20); + fs_setup.set_block_nonce(30); + + fs_setup + .b_mock + .execute_esdt_transfer( + &rand_user, + &fs_setup.farm_wrapper, + FARMING_TOKEN_ID, + 0, + &rust_biguint!(10), + |sc| { + let _ = sc.stake_farm_endpoint(OptionalValue::None); + }, + ) + .assert_ok(); + + fs_setup + .b_mock + .execute_esdt_transfer( + &rand_user, + &fs_setup.farm_wrapper, + FARM_TOKEN_ID, + 13, + &rust_biguint!(10), + |sc| { + let _ = sc.unstake_farm(OptionalValue::None); + }, + ) + .assert_ok(); + + fs_setup.set_block_epoch(22); + + fs_setup.set_user_energy(&first_user, 10_000, 22, 10); + fs_setup.set_user_energy(&second_user, 5_000, 22, 10); + + // Second user merges half own position with 2 x half position from first user + // We send the payment from first user first, + // to see that the original caller is correctly updated as second user + let farm_tokens = [ + TxTokenTransfer { + token_identifier: FARM_TOKEN_ID.to_vec(), + nonce: 4, + value: rust_biguint!(half_farm_in_amount), + }, + TxTokenTransfer { + token_identifier: FARM_TOKEN_ID.to_vec(), + nonce: 6, + value: rust_biguint!(half_farm_in_amount), + }, + TxTokenTransfer { + token_identifier: FARM_TOKEN_ID.to_vec(), + nonce: 5, + value: rust_biguint!(half_farm_in_amount), + }, + ]; + fs_setup + .b_mock + .execute_esdt_multi_transfer(&second_user, &fs_setup.farm_wrapper, &farm_tokens, |sc| { + let _ = sc.merge_farm_tokens_endpoint(); + }) + .assert_ok(); + + let expected_attributes = StakingFarmTokenAttributes:: { + reward_per_share: managed_biguint!(0), + compounded_reward: managed_biguint!(0), + current_farm_amount: managed_biguint!(half_farm_in_amount * 3), + original_owner: managed_address!(&second_user), // Check that second user is original owner + }; + fs_setup.b_mock.check_nft_balance( + &second_user, + FARM_TOKEN_ID, + 15, + &rust_biguint!(half_farm_in_amount * 3), + Some(&expected_attributes), + ); + rewards += 1; + expected_farming_token_balance = + rust_biguint!(USER_TOTAL_RIDE_TOKENS - farm_in_amount + rewards); + fs_setup.b_mock.check_esdt_balance( + &second_user, + REWARD_TOKEN_ID, + &expected_farming_token_balance, + ); + + fs_setup.check_user_total_farm_position(&first_user, half_farm_in_amount * 5); + fs_setup.check_user_total_farm_position(&second_user, farm_in_amount + half_farm_in_amount * 4); +} diff --git a/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs b/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs index f9c2b5955..88192dc2f 100644 --- a/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs +++ b/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs @@ -53,6 +53,7 @@ where pub b_mock: BlockchainStateWrapper, pub owner_address: Address, pub user_address: Address, + pub user_address2: Address, pub farm_wrapper: ContractObjWrapper, FarmObjBuilder>, pub energy_factory_wrapper: ContractObjWrapper, EnergyFactoryBuilder>, @@ -145,11 +146,18 @@ where FARMING_TOKEN_ID, &rust_biguint!(USER_TOTAL_RIDE_TOKENS), ); + let user_addr2 = b_mock.create_user_account(&rust_biguint!(100_000_000)); + b_mock.set_esdt_balance( + &user_addr2, + FARMING_TOKEN_ID, + &rust_biguint!(USER_TOTAL_RIDE_TOKENS), + ); FarmStakingSetup { b_mock, owner_address: owner_addr, user_address: user_addr, + user_address2: user_addr2, farm_wrapper, energy_factory_wrapper, } @@ -157,6 +165,7 @@ where pub fn stake_farm( &mut self, + user: &Address, farm_in_amount: u64, additional_farm_tokens: &[TxTokenTransfer], expected_farm_token_nonce: u64, @@ -177,7 +186,7 @@ where } self.b_mock - .execute_esdt_multi_transfer(&self.user_address, &self.farm_wrapper, &payments, |sc| { + .execute_esdt_multi_transfer(user, &self.farm_wrapper, &payments, |sc| { let (new_farm_token_payment, _) = sc.stake_farm_endpoint(OptionalValue::None).into_tuple(); assert_eq!( @@ -199,10 +208,10 @@ where reward_per_share: managed_biguint!(expected_reward_per_share), compounded_reward: managed_biguint!(expected_compounded_reward), current_farm_amount: managed_biguint!(expected_total_out_amount), - original_owner: managed_address!(&self.user_address), + original_owner: managed_address!(&user), }; self.b_mock.check_nft_balance( - &self.user_address, + &user, FARM_TOKEN_ID, expected_farm_token_nonce, &rust_biguint!(expected_total_out_amount), @@ -210,9 +219,74 @@ where ); } + pub fn stake_farm_for_other_user( + &mut self, + user: &Address, + broker: &Address, + farm_in_amount: u64, + additional_farm_tokens: &[TxTokenTransfer], + ) -> TxResult { + let mut payments = Vec::with_capacity(1 + additional_farm_tokens.len()); + payments.push(TxTokenTransfer { + token_identifier: FARMING_TOKEN_ID.to_vec(), + nonce: 0, + value: rust_biguint!(farm_in_amount), + }); + payments.extend_from_slice(additional_farm_tokens); + + self.b_mock + .execute_esdt_multi_transfer(broker, &self.farm_wrapper, &payments, |sc| { + sc.stake_farm_endpoint(OptionalValue::Some(managed_address!(user))) + .into_tuple(); + }) + } + + pub fn claim_farm_for_other_user( + &mut self, + user: &Address, + broker: &Address, + farm_in_nonce: u64, + farm_in_amount: u64, + ) -> TxResult { + let mut payments = vec![]; + payments.push(TxTokenTransfer { + token_identifier: FARM_TOKEN_ID.to_vec(), + nonce: farm_in_nonce, + value: rust_biguint!(farm_in_amount), + }); + + self.b_mock + .execute_esdt_multi_transfer(broker, &self.farm_wrapper, &payments, |sc| { + sc.claim_rewards(OptionalValue::Some(managed_address!(user))) + .into_tuple(); + }) + } + + pub fn unstake_farm_for_other_user( + &mut self, + user: &Address, + broker: &Address, + farm_in_nonce: u64, + farm_in_amount: u64, + ) -> TxResult { + let mut payments = vec![]; + payments.push(TxTokenTransfer { + token_identifier: FARM_TOKEN_ID.to_vec(), + nonce: farm_in_nonce, + value: rust_biguint!(farm_in_amount), + }); + + self.b_mock + .execute_esdt_multi_transfer(broker, &self.farm_wrapper, &payments, |sc| { + sc.unstake_farm(OptionalValue::Some(managed_address!(user))) + .into_tuple(); + }) + } + #[allow(clippy::too_many_arguments)] pub fn claim_rewards( &mut self, + user: &Address, farm_token_amount: u64, farm_token_nonce: u64, expected_reward_token_out: u64, @@ -223,7 +297,7 @@ where ) { self.b_mock .execute_esdt_transfer( - &self.user_address, + user, &self.farm_wrapper, FARM_TOKEN_ID, farm_token_nonce, @@ -256,26 +330,20 @@ where reward_per_share: managed_biguint!(expected_reward_per_share), compounded_reward: managed_biguint!(0), current_farm_amount: managed_biguint!(farm_token_amount), - original_owner: managed_address!(&self.user_address), + original_owner: managed_address!(user), }; self.b_mock.check_nft_balance( - &self.user_address, + user, FARM_TOKEN_ID, expected_farm_token_nonce_out, &rust_biguint!(farm_token_amount), Some(&expected_attributes), ); - self.b_mock.check_esdt_balance( - &self.user_address, - REWARD_TOKEN_ID, - expected_user_reward_token_balance, - ); - self.b_mock.check_esdt_balance( - &self.user_address, - FARMING_TOKEN_ID, - expected_user_farming_token_balance, - ); + self.b_mock + .check_esdt_balance(user, REWARD_TOKEN_ID, expected_user_reward_token_balance); + self.b_mock + .check_esdt_balance(user, FARMING_TOKEN_ID, expected_user_farming_token_balance); } pub fn claim_boosted_rewards_for_user( @@ -309,9 +377,22 @@ where ); } + pub fn claim_boosted_rewards_for_user_expect_error( + &mut self, + owner: &Address, + broker: &Address, + ) { + self.b_mock + .execute_tx(broker, &self.farm_wrapper, &rust_biguint!(0), |sc| { + let _ = sc.claim_boosted_rewards(OptionalValue::Some(managed_address!(owner))); + }) + .assert_error(4, "Cannot claim rewards for this address"); + } + #[allow(clippy::too_many_arguments)] pub fn unstake_farm( &mut self, + user: &Address, farm_token_amount: u64, farm_token_nonce: u64, expected_rewards_out: u64, @@ -323,7 +404,7 @@ where ) { self.b_mock .execute_esdt_transfer( - &self.user_address, + user, &self.farm_wrapper, FARM_TOKEN_ID, farm_token_nonce, @@ -429,14 +510,10 @@ where .assert_ok(); } - pub fn allow_external_claim_rewards(&mut self, user: &Address) { + pub fn allow_external_claim_rewards(&mut self, user: &Address, allow_claim: bool) { self.b_mock .execute_tx(user, &self.farm_wrapper, &rust_biguint!(0), |sc| { - sc.user_total_farm_position(&managed_address!(user)).update( - |user_total_farm_position| { - user_total_farm_position.allow_external_claim_boosted_rewards = true; - }, - ); + sc.allow_external_claim_boosted_rewards(allow_claim); }) .assert_ok(); } @@ -534,4 +611,98 @@ where ) .assert_error(expected_status, expected_message) } + + pub fn send_position( + &mut self, + sender: &Address, + receiver: &Address, + nonce: u64, + amount: u64, + attr_reward_per_share: u64, + ) { + self.b_mock.check_nft_balance( + sender, + FARM_TOKEN_ID, + nonce, + &rust_biguint!(amount), + Some(&StakingFarmTokenAttributes:: { + reward_per_share: managed_biguint!(attr_reward_per_share), + compounded_reward: managed_biguint!(0), + current_farm_amount: managed_biguint!(amount), + original_owner: managed_address!(&sender), + }), + ); + + self.b_mock + .check_nft_balance::>( + receiver, + FARM_TOKEN_ID, + nonce, + &rust_biguint!(0), + None, + ); + + self.b_mock.set_nft_balance( + sender, + FARM_TOKEN_ID, + nonce, + &rust_biguint!(0), + &StakingFarmTokenAttributes:: { + reward_per_share: managed_biguint!(attr_reward_per_share), + compounded_reward: managed_biguint!(0), + current_farm_amount: managed_biguint!(amount), + original_owner: managed_address!(&sender), + }, + ); + + self.b_mock.set_nft_balance( + receiver, + FARM_TOKEN_ID, + nonce, + &rust_biguint!(amount), + &StakingFarmTokenAttributes:: { + reward_per_share: managed_biguint!(attr_reward_per_share), + compounded_reward: managed_biguint!(0), + current_farm_amount: managed_biguint!(amount), + original_owner: managed_address!(&sender), + }, + ); + + self.b_mock + .check_nft_balance::>( + sender, + FARM_TOKEN_ID, + nonce, + &rust_biguint!(0), + None, + ); + + self.b_mock.check_nft_balance( + receiver, + FARM_TOKEN_ID, + nonce, + &rust_biguint!(amount), + Some(&StakingFarmTokenAttributes:: { + reward_per_share: managed_biguint!(attr_reward_per_share), + compounded_reward: managed_biguint!(0), + current_farm_amount: managed_biguint!(amount), + original_owner: managed_address!(&sender), + }), + ); + } + + pub fn check_user_total_farm_position(&mut self, user_addr: &Address, expected_amount: u64) { + self.b_mock + .execute_query(&self.farm_wrapper, |sc| { + let user_total_farm_position_mapper = + sc.user_total_farm_position(&managed_address!(user_addr)); + if expected_amount > 0 && !user_total_farm_position_mapper.is_empty() { + assert_eq!( + managed_biguint!(expected_amount), + user_total_farm_position_mapper.get().total_farm_position + ); + } + }) + .assert_ok(); + } } diff --git a/farm-staking/farm-staking/tests/farm_staking_test.rs b/farm-staking/farm-staking/tests/farm_staking_test.rs index 89192a6a1..26a9d065b 100644 --- a/farm-staking/farm-staking/tests/farm_staking_test.rs +++ b/farm-staking/farm-staking/tests/farm_staking_test.rs @@ -20,9 +20,18 @@ fn test_enter_farm() { let mut farm_setup = FarmStakingSetup::new(farm_staking::contract_obj, energy_factory::contract_obj); + let user_address = farm_setup.user_address.clone(); + let farm_in_amount = 100_000_000; let expected_farm_token_nonce = 1; - farm_setup.stake_farm(farm_in_amount, &[], expected_farm_token_nonce, 0, 0); + farm_setup.stake_farm( + &user_address, + farm_in_amount, + &[], + expected_farm_token_nonce, + 0, + 0, + ); farm_setup.check_farm_token_supply(farm_in_amount); } @@ -32,9 +41,18 @@ fn test_unstake_farm() { let mut farm_setup = FarmStakingSetup::new(farm_staking::contract_obj, energy_factory::contract_obj); + let user_address = farm_setup.user_address.clone(); + let farm_in_amount = 100_000_000; let expected_farm_token_nonce = 1; - farm_setup.stake_farm(farm_in_amount, &[], expected_farm_token_nonce, 0, 0); + farm_setup.stake_farm( + &user_address, + farm_in_amount, + &[], + expected_farm_token_nonce, + 0, + 0, + ); farm_setup.check_farm_token_supply(farm_in_amount); let current_block = 10; @@ -54,6 +72,7 @@ fn test_unstake_farm() { let expected_ride_token_balance = rust_biguint!(USER_TOTAL_RIDE_TOKENS) - farm_in_amount + expected_rewards; farm_setup.unstake_farm( + &user_address, farm_in_amount, expected_farm_token_nonce, expected_rewards, @@ -74,9 +93,18 @@ fn test_claim_rewards() { let mut farm_setup = FarmStakingSetup::new(farm_staking::contract_obj, energy_factory::contract_obj); + let user_address = farm_setup.user_address.clone(); + let farm_in_amount = 100_000_000; let expected_farm_token_nonce = 1; - farm_setup.stake_farm(farm_in_amount, &[], expected_farm_token_nonce, 0, 0); + farm_setup.stake_farm( + &user_address, + farm_in_amount, + &[], + expected_farm_token_nonce, + 0, + 0, + ); farm_setup.check_farm_token_supply(farm_in_amount); farm_setup.set_block_epoch(5); @@ -88,6 +116,7 @@ fn test_claim_rewards() { rust_biguint!(USER_TOTAL_RIDE_TOKENS - farm_in_amount + expected_reward_token_out); let expected_reward_per_share = 400_000; farm_setup.claim_rewards( + &user_address, farm_in_amount, expected_farm_token_nonce, expected_reward_token_out, @@ -109,9 +138,18 @@ where { let mut farm_setup = FarmStakingSetup::new(farm_builder, energy_factory_builder); + let user_address = farm_setup.user_address.clone(); + let farm_in_amount = 100_000_000; let expected_farm_token_nonce = 1; - farm_setup.stake_farm(farm_in_amount, &[], expected_farm_token_nonce, 0, 0); + farm_setup.stake_farm( + &user_address, + farm_in_amount, + &[], + expected_farm_token_nonce, + 0, + 0, + ); farm_setup.check_farm_token_supply(farm_in_amount); farm_setup.set_block_epoch(5); @@ -134,6 +172,7 @@ where / total_amount; farm_setup.stake_farm( + &user_address, second_farm_in_amount, &prev_farm_tokens, expected_farm_token_nonce + 1, @@ -156,6 +195,9 @@ fn test_exit_farm_after_enter_twice() { DebugApi::dummy(); let mut farm_setup = steps_enter_farm_twice(farm_staking::contract_obj, energy_factory::contract_obj); + + let user_address = farm_setup.user_address.clone(); + let farm_in_amount = 100_000_000; let second_farm_in_amount = 200_000_000; @@ -167,6 +209,7 @@ fn test_exit_farm_after_enter_twice() { rust_biguint!(USER_TOTAL_RIDE_TOKENS) - farm_in_amount - second_farm_in_amount + expected_rewards; farm_setup.unstake_farm( + &user_address, farm_in_amount, 2, expected_rewards, @@ -187,9 +230,18 @@ fn test_unbond() { let mut farm_setup = FarmStakingSetup::new(farm_staking::contract_obj, energy_factory::contract_obj); + let user_address = farm_setup.user_address.clone(); + let farm_in_amount = 100_000_000; let expected_farm_token_nonce = 1; - farm_setup.stake_farm(farm_in_amount, &[], expected_farm_token_nonce, 0, 0); + farm_setup.stake_farm( + &user_address, + farm_in_amount, + &[], + expected_farm_token_nonce, + 0, + 0, + ); farm_setup.check_farm_token_supply(farm_in_amount); let current_block = 10; @@ -209,6 +261,7 @@ fn test_unbond() { let expected_ride_token_balance = rust_biguint!(USER_TOTAL_RIDE_TOKENS) - farm_in_amount + expected_rewards; farm_setup.unstake_farm( + &user_address, farm_in_amount, expected_farm_token_nonce, expected_rewards, @@ -254,12 +307,21 @@ fn test_withdraw_after_produced_rewards() { let mut farm_setup = FarmStakingSetup::new(farm_staking::contract_obj, energy_factory::contract_obj); + let user_address = farm_setup.user_address.clone(); + let initial_rewards_capacity = 1_000_000_000_000u64; farm_setup.check_rewards_capacity(initial_rewards_capacity); let farm_in_amount = 100_000_000; let expected_farm_token_nonce = 1; - farm_setup.stake_farm(farm_in_amount, &[], expected_farm_token_nonce, 0, 0); + farm_setup.stake_farm( + &user_address, + farm_in_amount, + &[], + expected_farm_token_nonce, + 0, + 0, + ); farm_setup.check_farm_token_supply(farm_in_amount); farm_setup.set_block_epoch(5); From 74c16af4fc574a92e10fdd7b4eb15f23b6cc0999 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Fri, 12 Apr 2024 03:18:43 +0300 Subject: [PATCH 06/55] use FarmStakingWrapper for merge endpoint --- farm-staking/farm-staking/src/lib.rs | 46 ++++++------------- .../tests/farm_staking_energy_test.rs | 2 +- .../tests/farm_staking_setup/mod.rs | 2 +- 3 files changed, 17 insertions(+), 33 deletions(-) diff --git a/farm-staking/farm-staking/src/lib.rs b/farm-staking/farm-staking/src/lib.rs index e4f0a6533..3d85132cf 100644 --- a/farm-staking/farm-staking/src/lib.rs +++ b/farm-staking/farm-staking/src/lib.rs @@ -117,46 +117,30 @@ pub trait FarmStaking: let boosted_rewards_payment = EsdtTokenPayment::new(self.reward_token_id().get(), 0, boosted_rewards); - let payments = self.get_non_empty_payments(); - let token_mapper = self.farm_token(); - - for farm_position in &payments { - if self.is_old_farm_position(farm_position.token_nonce) { - continue; - } - - let token_attributes: StakingFarmTokenAttributes = - token_mapper.get_token_attributes(farm_position.token_nonce); - - if token_attributes.original_owner != caller { - self.user_total_farm_position(&token_attributes.original_owner) - .update(|user_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(); - } - }); - self.user_total_farm_position(&caller) - .update(|user_total_farm_position| { - user_total_farm_position.total_farm_position += &farm_position.amount; - }); - } - } - - let mut output_attributes: StakingFarmTokenAttributes = - self.merge_from_payments_and_burn(payments, &token_mapper); + let mut output_attributes = self.merge_farm_tokens::>(); output_attributes.original_owner = caller.clone(); let new_token_amount = output_attributes.get_total_supply(); - - let merged_farm_token = token_mapper.nft_create(new_token_amount, &output_attributes); + let merged_farm_token = self + .farm_token() + .nft_create(new_token_amount, &output_attributes); self.send_payment_non_zero(&caller, &merged_farm_token); self.send_payment_non_zero(&caller, &boosted_rewards_payment); (merged_farm_token, boosted_rewards_payment).into() } + fn merge_farm_tokens>(&self) -> FC::AttributesType { + let payments = self.get_non_empty_payments(); + let token_mapper = self.farm_token(); + token_mapper.require_all_same_token(&payments); + + let caller = self.blockchain().get_caller(); + FC::check_and_update_user_farm_position(self, &caller, &payments); + + self.merge_from_payments_and_burn(payments, &token_mapper) + } + #[endpoint(setBoostedYieldsRewardsPercentage)] fn set_boosted_yields_rewards_percentage(&self, percentage: u64) { self.require_caller_has_admin_permissions(); diff --git a/farm-staking/farm-staking/tests/farm_staking_energy_test.rs b/farm-staking/farm-staking/tests/farm_staking_energy_test.rs index 8b51dee1b..b2c2f03ba 100644 --- a/farm-staking/farm-staking/tests/farm_staking_energy_test.rs +++ b/farm-staking/farm-staking/tests/farm_staking_energy_test.rs @@ -83,7 +83,7 @@ fn farm_staking_other_user_enter_negative_test() { let farm_in_amount = 100_000_000; fs_setup - .stake_farm_for_other_user(&rand_user, &user_address, farm_in_amount, &vec![]) + .stake_farm_for_other_user(&rand_user, &user_address, farm_in_amount, &[]) .assert_error(4, "Item not whitelisted"); let expected_farm_token_nonce = 1; diff --git a/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs b/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs index 88192dc2f..c0329a2f6 100644 --- a/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs +++ b/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs @@ -211,7 +211,7 @@ where original_owner: managed_address!(&user), }; self.b_mock.check_nft_balance( - &user, + user, FARM_TOKEN_ID, expected_farm_token_nonce, &rust_biguint!(expected_total_out_amount), From 88ab1ca365e190dd9334820c739861aecd9cbcb4 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Sat, 13 Apr 2024 00:46:26 +0300 Subject: [PATCH 07/55] router fix after framework upgrade --- dex/router/src/config.rs | 7 ++++--- dex/router/src/contract.rs | 3 ++- dex/router/src/enable_swap_by_user.rs | 7 +++++-- dex/router/src/factory.rs | 3 ++- dex/router/src/multi_pair_swap.rs | 11 ++++++----- 5 files changed, 19 insertions(+), 12 deletions(-) diff --git a/dex/router/src/config.rs b/dex/router/src/config.rs index 388bc0a44..c4f89c440 100644 --- a/dex/router/src/config.rs +++ b/dex/router/src/config.rs @@ -2,16 +2,17 @@ multiversx_sc::imports!(); multiversx_sc::derive_imports!(); use crate::{enable_swap_by_user::EnableSwapByUserConfig, factory::PairTokens}; +use pair::read_pair_storage; #[multiversx_sc::module] -pub trait ConfigModule { +pub trait ConfigModule: read_pair_storage::ReadPairStorageModule { fn is_active(&self) -> bool { self.state().get() } fn check_is_pair_sc(&self, pair_address: &ManagedAddress) { - let first_token_id = self.first_token_id().get_from_address(pair_address); - let second_token_id = self.second_token_id().get_from_address(pair_address); + let first_token_id = self.get_first_token_id_mapper(pair_address.clone()).get(); + let second_token_id = self.get_second_token_id_mapper(pair_address.clone()).get(); let pair_tokens = PairTokens { first_token_id: first_token_id.clone(), diff --git a/dex/router/src/contract.rs b/dex/router/src/contract.rs index 6c425aa6c..e23d0f12f 100644 --- a/dex/router/src/contract.rs +++ b/dex/router/src/contract.rs @@ -12,7 +12,7 @@ pub mod multi_pair_swap; use factory::PairTokens; use pair::config::ProxyTrait as _; use pair::fee::ProxyTrait as _; -use pair::ProxyTrait as _; +use pair::{read_pair_storage, ProxyTrait as _}; use pausable::ProxyTrait as _; const LP_TOKEN_DECIMALS: usize = 18; @@ -26,6 +26,7 @@ const USER_DEFINED_TOTAL_FEE_PERCENT: u64 = 1_000; #[multiversx_sc::contract] pub trait Router: config::ConfigModule + + read_pair_storage::ReadPairStorageModule + factory::FactoryModule + events::EventsModule + multi_pair_swap::MultiPairSwap diff --git a/dex/router/src/enable_swap_by_user.rs b/dex/router/src/enable_swap_by_user.rs index f5929f4f7..1a8c40770 100644 --- a/dex/router/src/enable_swap_by_user.rs +++ b/dex/router/src/enable_swap_by_user.rs @@ -1,7 +1,7 @@ multiversx_sc::imports!(); multiversx_sc::derive_imports!(); -use pair::{config::ProxyTrait as _, pair_actions::views::ProxyTrait as _}; +use pair::{config::ProxyTrait as _, pair_actions::views::ProxyTrait as _, read_pair_storage}; use pausable::{ProxyTrait as _, State}; use simple_lock::locked_token::LockedTokenAttributes; @@ -27,7 +27,10 @@ pub struct SafePriceResult { #[multiversx_sc::module] pub trait EnableSwapByUserModule: - config::ConfigModule + crate::factory::FactoryModule + crate::events::EventsModule + config::ConfigModule + + read_pair_storage::ReadPairStorageModule + + crate::factory::FactoryModule + + crate::events::EventsModule { #[only_owner] #[endpoint(configEnableByUserParameters)] diff --git a/dex/router/src/factory.rs b/dex/router/src/factory.rs index 37a476a8d..fea434703 100644 --- a/dex/router/src/factory.rs +++ b/dex/router/src/factory.rs @@ -2,6 +2,7 @@ multiversx_sc::imports!(); multiversx_sc::derive_imports!(); use crate::config; +use pair::read_pair_storage; const TEMPORARY_OWNER_PERIOD_BLOCKS: u64 = 50; @@ -19,7 +20,7 @@ pub struct PairContractMetadata { } #[multiversx_sc::module] -pub trait FactoryModule: config::ConfigModule { +pub trait FactoryModule: config::ConfigModule + read_pair_storage::ReadPairStorageModule { #[proxy] fn pair_contract_deploy_proxy(&self) -> pair::Proxy; diff --git a/dex/router/src/multi_pair_swap.rs b/dex/router/src/multi_pair_swap.rs index dc5492f9d..1e47378f9 100644 --- a/dex/router/src/multi_pair_swap.rs +++ b/dex/router/src/multi_pair_swap.rs @@ -1,11 +1,9 @@ multiversx_sc::imports!(); multiversx_sc::derive_imports!(); -use pair::pair_actions::swap::ProxyTrait as _; - -use crate::config; - use super::factory; +use crate::config; +use pair::{pair_actions::swap::ProxyTrait as _, read_pair_storage}; type SwapOperationType = MultiValue4, ManagedBuffer, TokenIdentifier, BigUint>; @@ -15,7 +13,10 @@ pub const SWAP_TOKENS_FIXED_OUTPUT_FUNC_NAME: &[u8] = b"swapTokensFixedOutput"; #[multiversx_sc::module] pub trait MultiPairSwap: - config::ConfigModule + factory::FactoryModule + token_send::TokenSendModule + config::ConfigModule + + read_pair_storage::ReadPairStorageModule + + factory::FactoryModule + + token_send::TokenSendModule { #[payable("*")] #[endpoint(multiPairSwap)] From c572908d3070ef52ec814abe40fa38937c4ee0f5 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Sat, 13 Apr 2024 01:33:25 +0300 Subject: [PATCH 08/55] energy factory tests --- .../tests/energy_factory_setup/mod.rs | 11 ++++++- .../tests/simple_lock_energy_test.rs | 32 +++++++++++++++++-- 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/locked-asset/energy-factory/tests/energy_factory_setup/mod.rs b/locked-asset/energy-factory/tests/energy_factory_setup/mod.rs index de10068c0..7d2c17b79 100644 --- a/locked-asset/energy-factory/tests/energy_factory_setup/mod.rs +++ b/locked-asset/energy-factory/tests/energy_factory_setup/mod.rs @@ -173,6 +173,7 @@ where token_nonce: u64, amount: u64, lock_epochs: u64, + opt_address: Option
, ) -> TxResult { self.b_mock.execute_esdt_transfer( caller, @@ -181,7 +182,15 @@ where token_nonce, &rust_biguint!(amount), |sc| { - sc.lock_tokens_endpoint(lock_epochs, OptionalValue::None); + if opt_address.is_some() { + let address = opt_address.unwrap(); + sc.lock_tokens_endpoint( + lock_epochs, + OptionalValue::Some(managed_address!(&address)), + ); + } else { + sc.lock_tokens_endpoint(lock_epochs, OptionalValue::None); + } }, ) } 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 823a8eb56..6d23bd1ef 100644 --- a/locked-asset/energy-factory/tests/simple_lock_energy_test.rs +++ b/locked-asset/energy-factory/tests/simple_lock_energy_test.rs @@ -315,6 +315,7 @@ fn reduce_lock_period_test() { fn extend_locking_period_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 half_balance = USER_BALANCE / 2; let current_epoch = 1; @@ -329,7 +330,7 @@ fn extend_locking_period_test() { ) .assert_ok(); - // extend to 3 years - unsupported option + // extend to a random period - unsupported option setup .extend_locking_period( &first_user, @@ -337,10 +338,11 @@ fn extend_locking_period_test() { 1, half_balance, 3 * EPOCHS_IN_YEAR, + None, ) .assert_user_error("Invalid lock choice"); - // extend to 10 years + // extend to a whitelisted period, but for a different user setup .extend_locking_period( &first_user, @@ -348,8 +350,33 @@ fn extend_locking_period_test() { 1, half_balance, LOCK_OPTIONS[1], + Some(random_user), + ) + .assert_user_error("May not use the optional destination argument here"); + + // extend to the second option - should work as intended + // 1 epoch has passed + let energy_per_epoch = rust_biguint!(500_000_000_000_000_000u64); + let energy_before = setup.get_user_energy(&first_user); // 179_500_000_000_000_000_000 + assert_eq!( + energy_before, + LOCK_OPTIONS[0] * energy_per_epoch.clone() - energy_per_epoch.clone() + ); + setup + .extend_locking_period( + &first_user, + LOCKED_TOKEN_ID, + 1, + half_balance, + LOCK_OPTIONS[1], + None, ) .assert_ok(); + let energy_after = setup.get_user_energy(&first_user); // 359_500_000_000_000_000_000 + assert_eq!( + energy_after, + LOCK_OPTIONS[1] * energy_per_epoch.clone() - energy_per_epoch.clone() + ); let new_unlock_epoch = to_start_of_month(current_epoch + LOCK_OPTIONS[1]); setup.b_mock.check_nft_balance( @@ -376,6 +403,7 @@ fn extend_locking_period_test() { 2, half_balance, LOCK_OPTIONS[0], + None, ) .assert_user_error("New lock period must be longer than the current one"); } From ef126033b1d4c7276636561c96e65fa89c19796c Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Mon, 15 Apr 2024 14:07:14 +0300 Subject: [PATCH 09/55] remove unneeded check --- dex/router/src/config.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/dex/router/src/config.rs b/dex/router/src/config.rs index c4f89c440..21a433084 100644 --- a/dex/router/src/config.rs +++ b/dex/router/src/config.rs @@ -19,15 +19,7 @@ pub trait ConfigModule: read_pair_storage::ReadPairStorageModule { second_token_id: second_token_id.clone(), }; - let mut pair_map_address_opt = self.pair_map().get(&pair_tokens); - if pair_map_address_opt.is_none() { - let reverse_pair_tokens = PairTokens { - first_token_id: second_token_id.clone(), - second_token_id: first_token_id.clone(), - }; - pair_map_address_opt = self.pair_map().get(&reverse_pair_tokens); - } - + let pair_map_address_opt = self.pair_map().get(&pair_tokens); require!(pair_map_address_opt.is_some(), "Not a pair SC"); unsafe { From 6b5442e49fea971c2d372d3015b18b647b7bea99 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Tue, 16 Apr 2024 00:44:36 +0300 Subject: [PATCH 10/55] total farm position through simple lock test --- dex/farm/tests/total_farm_position_test.rs | 240 ++++++++++++++++++++- 1 file changed, 238 insertions(+), 2 deletions(-) diff --git a/dex/farm/tests/total_farm_position_test.rs b/dex/farm/tests/total_farm_position_test.rs index 47518da0c..fd6c0fa15 100644 --- a/dex/farm/tests/total_farm_position_test.rs +++ b/dex/farm/tests/total_farm_position_test.rs @@ -8,9 +8,13 @@ use farm_setup::multi_user_farm_setup::{ MultiUserFarmSetup, NonceAmountPair, BOOSTED_YIELDS_PERCENTAGE, MAX_PERCENTAGE, PER_BLOCK_REWARD_AMOUNT, }; -use multiversx_sc_scenario::{managed_address, managed_biguint, rust_biguint, DebugApi}; +use multiversx_sc::types::EsdtLocalRole; +use multiversx_sc_scenario::{ + managed_address, managed_biguint, managed_token_id, rust_biguint, DebugApi, +}; +use sc_whitelist_module::SCWhitelistModule; -use crate::farm_setup::multi_user_farm_setup::{FARM_TOKEN_ID, REWARD_TOKEN_ID}; +use crate::farm_setup::multi_user_farm_setup::{FARMING_TOKEN_ID, FARM_TOKEN_ID, REWARD_TOKEN_ID}; #[test] fn total_farm_position_claim_test() { @@ -936,3 +940,235 @@ fn total_farm_position_owner_change_test() { farm_setup.check_user_total_farm_position(&first_user, farm_token_amount); farm_setup.check_user_total_farm_position(&second_user, farm_token_amount * 5); } + +#[test] +fn total_farm_position_through_simple_lock_test() { + use multiversx_sc::storage::mappers::StorageTokenWrapper; + use simple_lock::locked_token::LockedTokenModule; + use simple_lock::proxy_farm::ProxyFarmModule; + use simple_lock::proxy_farm::*; + use simple_lock::proxy_lp::{LpProxyTokenAttributes, ProxyLpModule}; + use simple_lock::SimpleLock; + + const LOCKED_TOKEN_ID: &[u8] = b"NOOOO-123456"; + const LOCKED_LP_TOKEN_ID: &[u8] = b"LKLP-123456"; + const FARM_PROXY_TOKEN_ID: &[u8] = b"PROXY-123456"; + const WEGLD_TOKEN_ID: &[u8] = b"WEGLD-abcdef"; + const MEX_TOKEN_ID: &[u8] = b"MEX-abcdef"; // reward token ID + + DebugApi::dummy(); + let mut farm_setup = MultiUserFarmSetup::new( + farm::contract_obj, + energy_factory_mock::contract_obj, + energy_update::contract_obj, + ); + let rust_zero = rust_biguint!(0); + + // setup simple lock SC + let lock_wrapper = farm_setup.b_mock.create_sc_account( + &rust_zero, + Some(&farm_setup.owner), + simple_lock::contract_obj, + "Simple Lock Path", + ); + + let farm_addr = farm_setup.farm_wrapper.address_ref().clone(); + farm_setup + .b_mock + .execute_tx(&farm_setup.owner, &lock_wrapper, &rust_zero, |sc| { + sc.init(); + sc.locked_token() + .set_token_id(managed_token_id!(LOCKED_TOKEN_ID)); + sc.lp_proxy_token() + .set_token_id(managed_token_id!(LOCKED_LP_TOKEN_ID)); + sc.farm_proxy_token() + .set_token_id(managed_token_id!(FARM_PROXY_TOKEN_ID)); + sc.add_farm_to_whitelist( + managed_address!(&farm_addr), + managed_token_id!(FARMING_TOKEN_ID), + FarmType::SimpleFarm, + ); + }) + .assert_ok(); + + // change farming token for farm + whitelist simple lock contract + farm_setup + .b_mock + .execute_tx( + &farm_setup.owner, + &farm_setup.farm_wrapper, + &rust_zero, + |sc| { + sc.farming_token_id() + .set(&managed_token_id!(FARMING_TOKEN_ID)); + sc.add_sc_address_to_whitelist(managed_address!(lock_wrapper.address_ref())); + }, + ) + .assert_ok(); + + farm_setup.b_mock.set_esdt_local_roles( + lock_wrapper.address_ref(), + LOCKED_LP_TOKEN_ID, + &[ + EsdtLocalRole::NftCreate, + EsdtLocalRole::NftAddQuantity, + EsdtLocalRole::NftBurn, + ], + ); + farm_setup.b_mock.set_esdt_local_roles( + lock_wrapper.address_ref(), + FARM_PROXY_TOKEN_ID, + &[ + EsdtLocalRole::NftCreate, + EsdtLocalRole::NftAddQuantity, + EsdtLocalRole::NftBurn, + ], + ); + + // user lock tokens + let user_addr = farm_setup.first_user.clone(); + + let lp_proxy_token_attributes: LpProxyTokenAttributes = LpProxyTokenAttributes { + lp_token_id: managed_token_id!(FARMING_TOKEN_ID), + first_token_id: managed_token_id!(WEGLD_TOKEN_ID), + first_token_locked_nonce: 1, + second_token_id: managed_token_id!(MEX_TOKEN_ID), + second_token_locked_nonce: 2, + }; + + farm_setup.b_mock.set_nft_balance( + &user_addr, + LOCKED_LP_TOKEN_ID, + 1, + &rust_biguint!(1_000_000_000), + &lp_proxy_token_attributes, + ); + + farm_setup.b_mock.set_esdt_balance( + lock_wrapper.address_ref(), + FARMING_TOKEN_ID, + &rust_biguint!(1_000_000_000), + ); + + farm_setup.set_boosted_yields_rewards_percentage(BOOSTED_YIELDS_PERCENTAGE); + farm_setup.set_boosted_yields_factors(); + farm_setup.b_mock.set_block_epoch(2); + + let temp_user = farm_setup.third_user.clone(); + + farm_setup.check_user_total_farm_position(&user_addr, 0); + + // first user enter farm twice (normal & through simple lock contract) + // enter farm through simple lock contract + let farm_in_amount = 50_000_000; + farm_setup.last_farm_token_nonce += 1; + farm_setup + .b_mock + .execute_esdt_transfer( + &user_addr, + &lock_wrapper, + LOCKED_LP_TOKEN_ID, + 1, + &rust_biguint!(farm_in_amount), + |sc| { + let enter_farm_result = sc.enter_farm_locked_token(FarmType::SimpleFarm); + let (out_farm_token, _reward_token) = enter_farm_result.into_tuple(); + assert_eq!( + out_farm_token.token_identifier, + managed_token_id!(FARM_PROXY_TOKEN_ID) + ); + assert_eq!(out_farm_token.token_nonce, farm_setup.last_farm_token_nonce); + assert_eq!(out_farm_token.amount, managed_biguint!(farm_in_amount)); + }, + ) + .assert_ok(); + + farm_setup.b_mock.check_nft_balance( + &user_addr, + FARM_PROXY_TOKEN_ID, + 1, + &rust_biguint!(farm_in_amount), + Some(&FarmProxyTokenAttributes:: { + farm_type: FarmType::SimpleFarm, + farm_token_id: managed_token_id!(FARM_TOKEN_ID), + farm_token_nonce: 1, + farming_token_id: managed_token_id!(FARMING_TOKEN_ID), + farming_token_locked_nonce: 1, + }), + ); + + farm_setup.check_user_total_farm_position(&user_addr, farm_in_amount); + + // enter farm directly + farm_setup.set_user_energy(&user_addr, 1_000, 2, 1); + farm_setup.enter_farm(&user_addr, farm_in_amount); + + farm_setup.b_mock.check_nft_balance( + &user_addr, + FARM_TOKEN_ID, + farm_setup.last_farm_token_nonce, + &rust_biguint!(farm_in_amount), + Some(&FarmTokenAttributes:: { + reward_per_share: managed_biguint!(0), + compounded_reward: managed_biguint!(0), + entering_epoch: 2, + current_farm_amount: managed_biguint!(farm_in_amount), + original_owner: managed_address!(&user_addr), + }), + ); + + farm_setup.check_user_total_farm_position(&user_addr, farm_in_amount * 2); + farm_setup.check_farm_token_supply(farm_in_amount * 2); + + // users claim rewards to get their energy registered + let _ = farm_setup.claim_rewards(&user_addr, 2, farm_in_amount); + + // advance blocks - 10 blocks - 10 * 1_000 = 10_000 total rewards + // 7_500 base farm, 2_500 boosted yields + farm_setup.b_mock.set_block_nonce(10); + + // random tx on end of week 1, to cummulate rewards + farm_setup.b_mock.set_block_epoch(6); + farm_setup.set_user_energy(&user_addr, 1_000, 6, 1); + farm_setup.set_user_energy(&temp_user, 1, 6, 1); + farm_setup.enter_farm(&temp_user, 1); + farm_setup.exit_farm(&temp_user, 4, 1); + + // advance 1 week + farm_setup.b_mock.set_block_epoch(10); + farm_setup.set_user_energy(&user_addr, 1_000, 10, 1); + + let total_farm_tokens = farm_in_amount * 2; + + // first user claim with half total position + let first_base_farm_amt = farm_in_amount * 7_500 / total_farm_tokens; + + // Boosted yields rewards formula + // total_boosted_rewards * (energy_const * user_energy / total_energy + farm_const * user_farm / total_farm) / (energy_const + farm_const) + // (total_boosted_rewards * energy_const * user_energy / total_energy + total_boosted_rewards * farm_const * user_farm / total_farm) / (energy_const + farm_const) + // (2_500 * 3 * 1_000 / 1_000 + 2_500 * 2 * 100_000_000 / 100_000_000) / (3 + 2) + // (7_500 + 2_500) / (5) = 2_500 + let first_boosted_amt = 2_500; // 1000 energy & 100_000_000 farm tokens + let first_total_rewards = first_base_farm_amt + first_boosted_amt; + + let first_received_reward_amt = farm_setup.claim_rewards(&user_addr, 3, farm_in_amount); + + // Should be equal to half base generated rewards + full boosted generated rewards + assert_eq!(first_received_reward_amt, first_total_rewards); + + farm_setup + .b_mock + .check_nft_balance::>( + &user_addr, + FARM_TOKEN_ID, + 5, + &rust_biguint!(farm_in_amount), + None, + ); + + farm_setup.b_mock.check_esdt_balance( + &user_addr, + REWARD_TOKEN_ID, + &rust_biguint!(first_received_reward_amt), + ); +} From f9b5a0d19787e4eb636ca5e86e9578613b100554 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Tue, 16 Apr 2024 02:00:19 +0300 Subject: [PATCH 11/55] farm updated tests --- dex/farm/tests/total_farm_position_test.rs | 123 ++++++++++++--------- 1 file changed, 72 insertions(+), 51 deletions(-) diff --git a/dex/farm/tests/total_farm_position_test.rs b/dex/farm/tests/total_farm_position_test.rs index fd6c0fa15..b7ca1be7b 100644 --- a/dex/farm/tests/total_farm_position_test.rs +++ b/dex/farm/tests/total_farm_position_test.rs @@ -529,15 +529,20 @@ fn farm_total_position_on_claim_migration_test() { farm_setup.check_farm_token_supply(farm_in_amount * 2); // claim rewards with both positions - let total_farm_tokens = farm_in_amount * 2; + let first_payment_amount = farm_in_amount / 2; + let second_payment_amount = farm_in_amount / 4 * 3; + let total_farm_amount = farm_in_amount * 2; + let total_farm_position = farm_in_amount + first_payment_amount; // only the first is migrated by being an old position + let total_claim_payment = first_payment_amount + second_payment_amount; + let payments = vec![ NonceAmountPair { nonce: 1, - amount: farm_in_amount, + amount: first_payment_amount, }, NonceAmountPair { nonce: 2, - amount: farm_in_amount, + amount: second_payment_amount, }, ]; @@ -546,7 +551,7 @@ fn farm_total_position_on_claim_migration_test() { farm_setup.check_user_total_farm_position(&first_user, farm_in_amount); let _ = farm_setup.claim_rewards_with_multiple_payments(&first_user, payments); - farm_setup.check_user_total_farm_position(&first_user, total_farm_tokens); + farm_setup.check_user_total_farm_position(&first_user, total_farm_position); farm_setup .b_mock @@ -554,7 +559,7 @@ fn farm_total_position_on_claim_migration_test() { &first_user, FARM_TOKEN_ID, 3, - &rust_biguint!(total_farm_tokens), + &rust_biguint!(total_claim_payment), None, ); @@ -562,8 +567,8 @@ fn farm_total_position_on_claim_migration_test() { let expected_user_rewards = block_nonce * PER_BLOCK_REWARD_AMOUNT * (MAX_PERCENTAGE - BOOSTED_YIELDS_PERCENTAGE) - * farm_in_amount - / total_farm_tokens + * first_payment_amount + / total_farm_amount / MAX_PERCENTAGE; farm_setup.b_mock.check_esdt_balance( &first_user, @@ -617,31 +622,38 @@ fn farm_total_position_on_merge_migration_test() { farm_setup.check_farm_token_supply(total_farm_tokens); // merge all 4 farm positions + let first_payment_amount = farm_in_amount / 2; + let second_payment_amount = farm_in_amount / 4 * 3; + let third_payment_amount = farm_in_amount / 2; + let forth_payment_amount = farm_in_amount / 4; + let total_payment_amount = + first_payment_amount + second_payment_amount + third_payment_amount + forth_payment_amount; + let total_user_position = farm_in_amount * 2 + first_payment_amount + second_payment_amount; let payments = vec![ NonceAmountPair { nonce: 1, - amount: farm_in_amount, + amount: first_payment_amount, }, NonceAmountPair { nonce: 2, - amount: farm_in_amount, + amount: second_payment_amount, }, NonceAmountPair { nonce: 3, - amount: farm_in_amount, + amount: third_payment_amount, }, NonceAmountPair { nonce: 4, - amount: farm_in_amount, + amount: forth_payment_amount, }, ]; let block_nonce = 10; farm_setup.b_mock.set_block_nonce(block_nonce); - farm_setup.check_user_total_farm_position(&first_user, farm_in_amount * 2); + farm_setup.check_user_total_farm_position(&first_user, farm_in_amount * 2); // last 2 positions farm_setup.merge_farm_tokens(&first_user, payments); - farm_setup.check_user_total_farm_position(&first_user, total_farm_tokens); + farm_setup.check_user_total_farm_position(&first_user, total_user_position); farm_setup .b_mock @@ -649,7 +661,7 @@ fn farm_total_position_on_merge_migration_test() { &first_user, FARM_TOKEN_ID, 5, - &rust_biguint!(total_farm_tokens), + &rust_biguint!(total_payment_amount), None, ); @@ -754,6 +766,7 @@ fn total_farm_position_owner_change_test() { // first user enters farm 6 times let farm_token_amount = 10_000_000; + let half_token_amount = farm_token_amount / 2; let first_user = farm_setup.first_user.clone(); let second_user = farm_setup.second_user.clone(); let third_user = farm_setup.third_user.clone(); @@ -766,8 +779,10 @@ fn total_farm_position_owner_change_test() { farm_setup.enter_farm(&first_user, farm_token_amount); farm_setup.enter_farm(&first_user, farm_token_amount); - farm_setup.check_user_total_farm_position(&first_user, farm_token_amount * 6); - farm_setup.check_user_total_farm_position(&second_user, 0); + let mut first_user_total_position = farm_token_amount * 6; + let mut second_user_total_position = 0; + farm_setup.check_user_total_farm_position(&first_user, first_user_total_position); + farm_setup.check_user_total_farm_position(&second_user, second_user_total_position); assert_eq!(farm_setup.last_farm_token_nonce, 6); @@ -779,21 +794,23 @@ fn total_farm_position_owner_change_test() { farm_setup.send_farm_position(&first_user, &second_user, 5, farm_token_amount, 0, 2); // Total farm position unchanged as users only transfered the farm positions - farm_setup.check_user_total_farm_position(&first_user, farm_token_amount * 6); - farm_setup.check_user_total_farm_position(&second_user, 0); + farm_setup.check_user_total_farm_position(&first_user, first_user_total_position); + farm_setup.check_user_total_farm_position(&second_user, second_user_total_position); - // second user enter farm + // second user enter farm with LP token + 50% the position from another user farm_setup.set_user_energy(&second_user, 4_000, 2, 1); farm_setup.enter_farm_with_additional_payment( &second_user, farm_token_amount, 1, - farm_token_amount, + half_token_amount, ); - // 1 farm position was removed from first user and added to the second user (who entered the farm with a position of his own) - farm_setup.check_user_total_farm_position(&first_user, farm_token_amount * 5); - farm_setup.check_user_total_farm_position(&second_user, farm_token_amount * 2); + // 1 half farm position was removed from first user and added to the second user (who entered the farm with a position of his own) + first_user_total_position -= half_token_amount; + second_user_total_position += farm_token_amount + half_token_amount; + farm_setup.check_user_total_farm_position(&first_user, first_user_total_position); + farm_setup.check_user_total_farm_position(&second_user, second_user_total_position); // users claim rewards to get their energy registered let _ = farm_setup.claim_rewards(&first_user, 6, farm_token_amount); @@ -813,12 +830,12 @@ fn total_farm_position_owner_change_test() { farm_setup.set_user_energy(&first_user, 1_000, 10, 1); farm_setup.set_user_energy(&second_user, 4_000, 10, 1); - // Second user claims with a position from the first user - let base_rewards_amount = 1071; - let boosted_rewards_amount = 1485; + // Second user claims with half a position from the first user + let base_rewards_amount = 535; + let boosted_rewards_amount = 1414; let mut second_user_reward_balance = base_rewards_amount + boosted_rewards_amount; - let second_received_reward_amt = farm_setup.claim_rewards(&second_user, 2, farm_token_amount); + let second_received_reward_amt = farm_setup.claim_rewards(&second_user, 2, half_token_amount); assert_eq!(second_received_reward_amt, second_user_reward_balance); farm_setup.b_mock.check_esdt_balance( @@ -826,24 +843,25 @@ fn total_farm_position_owner_change_test() { REWARD_TOKEN_ID, &rust_biguint!(second_user_reward_balance), ); - farm_setup.b_mock.check_nft_balance( &second_user, FARM_TOKEN_ID, 11, - &rust_biguint!(farm_token_amount), + &rust_biguint!(half_token_amount), Some(&FarmTokenAttributes:: { reward_per_share: managed_biguint!(107142857), entering_epoch: 2, compounded_reward: managed_biguint!(0), - current_farm_amount: managed_biguint!(farm_token_amount), + current_farm_amount: managed_biguint!(half_token_amount), original_owner: managed_address!(&second_user), }), ); // Check users positions after claim - farm_setup.check_user_total_farm_position(&first_user, farm_token_amount * 4); - farm_setup.check_user_total_farm_position(&second_user, farm_token_amount * 3); + first_user_total_position -= half_token_amount; + second_user_total_position += half_token_amount; + farm_setup.check_user_total_farm_position(&first_user, first_user_total_position); + farm_setup.check_user_total_farm_position(&second_user, second_user_total_position); // random tx on end of week 2, to cummulate rewards farm_setup.b_mock.set_block_nonce(20); @@ -859,17 +877,18 @@ fn total_farm_position_owner_change_test() { farm_setup.set_user_energy(&first_user, 1_000, 15, 1); farm_setup.set_user_energy(&second_user, 4_000, 15, 1); - // Second user exits farm with a position previously owned by user 1 - second_user_reward_balance += 2142; // base rewards - second_user_reward_balance += 1630; // boosted rewards - farm_setup.exit_farm(&second_user, 3, farm_token_amount); + // Second user exits farm with half of a position previously owned by user 1 + second_user_reward_balance += 1071; // base rewards + second_user_reward_balance += 1487; // boosted rewards + farm_setup.exit_farm(&second_user, 3, half_token_amount); farm_setup .b_mock - .check_esdt_balance(&second_user, REWARD_TOKEN_ID, &rust_biguint!(6328)); + .check_esdt_balance(&second_user, REWARD_TOKEN_ID, &rust_biguint!(4507)); // Check users positions after exit - farm_setup.check_user_total_farm_position(&first_user, farm_token_amount * 3); - farm_setup.check_user_total_farm_position(&second_user, farm_token_amount * 3); + first_user_total_position -= half_token_amount; + farm_setup.check_user_total_farm_position(&first_user, first_user_total_position); + farm_setup.check_user_total_farm_position(&second_user, second_user_total_position); // random tx on end of week 3, to cummulate rewards farm_setup.b_mock.set_block_nonce(30); @@ -888,25 +907,25 @@ fn total_farm_position_owner_change_test() { // First user claims rewards let first_user_received_reward_amt = farm_setup.claim_rewards(&first_user, 8, farm_token_amount); - assert_eq!(first_user_received_reward_amt, 5642); + assert_eq!(first_user_received_reward_amt, 6167); // Check users positions after first user claim - farm_setup.check_user_total_farm_position(&first_user, farm_token_amount * 3); - farm_setup.check_user_total_farm_position(&second_user, farm_token_amount * 3); + farm_setup.check_user_total_farm_position(&first_user, first_user_total_position); + farm_setup.check_user_total_farm_position(&second_user, second_user_total_position); - // Second user merges his tokens with first user initial token + // Second user merges half from one of his original position with 2 position halves from the first user let farm_tokens = vec![ NonceAmountPair { nonce: 4, - amount: farm_token_amount, + amount: half_token_amount, }, NonceAmountPair { nonce: 5, - amount: farm_token_amount, + amount: half_token_amount, }, NonceAmountPair { nonce: 11, - amount: farm_token_amount, + amount: half_token_amount, }, ]; @@ -916,7 +935,7 @@ fn total_farm_position_owner_change_test() { &rust_biguint!(second_user_reward_balance), ); farm_setup.merge_farm_tokens(&second_user, farm_tokens); - second_user_reward_balance += 1703; // boosted rewards + second_user_reward_balance += 1510; // boosted rewards farm_setup.b_mock.check_esdt_balance( &second_user, REWARD_TOKEN_ID, @@ -926,19 +945,21 @@ fn total_farm_position_owner_change_test() { &second_user, FARM_TOKEN_ID, 15, - &rust_biguint!(farm_token_amount * 3), + &rust_biguint!(half_token_amount * 3), Some(&FarmTokenAttributes:: { reward_per_share: managed_biguint!(35714286), entering_epoch: 2, compounded_reward: managed_biguint!(0), - current_farm_amount: managed_biguint!(farm_token_amount * 3), + current_farm_amount: managed_biguint!(half_token_amount * 3), original_owner: managed_address!(&second_user), }), ); // Check users positions after merge - farm_setup.check_user_total_farm_position(&first_user, farm_token_amount); - farm_setup.check_user_total_farm_position(&second_user, farm_token_amount * 5); + first_user_total_position -= 2 * half_token_amount; + second_user_total_position += 2 * half_token_amount; + farm_setup.check_user_total_farm_position(&first_user, first_user_total_position); + farm_setup.check_user_total_farm_position(&second_user, second_user_total_position); } #[test] From ec4b55003a00f36d21522d7cdab0df24b2c6e39e Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Tue, 16 Apr 2024 12:25:59 +0300 Subject: [PATCH 12/55] add back the router reverse check pair logic --- dex/router/src/config.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dex/router/src/config.rs b/dex/router/src/config.rs index 21a433084..c4f89c440 100644 --- a/dex/router/src/config.rs +++ b/dex/router/src/config.rs @@ -19,7 +19,15 @@ pub trait ConfigModule: read_pair_storage::ReadPairStorageModule { second_token_id: second_token_id.clone(), }; - let pair_map_address_opt = self.pair_map().get(&pair_tokens); + let mut pair_map_address_opt = self.pair_map().get(&pair_tokens); + if pair_map_address_opt.is_none() { + let reverse_pair_tokens = PairTokens { + first_token_id: second_token_id.clone(), + second_token_id: first_token_id.clone(), + }; + pair_map_address_opt = self.pair_map().get(&reverse_pair_tokens); + } + require!(pair_map_address_opt.is_some(), "Not a pair SC"); unsafe { From 954d65ce9e9bd888197392085a0db7fa5b2190d0 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Tue, 16 Apr 2024 13:45:56 +0300 Subject: [PATCH 13/55] code cleanup --- dex/router/src/config.rs | 9 --------- dex/router/wasm/src/lib.rs | 6 ++---- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/dex/router/src/config.rs b/dex/router/src/config.rs index c4f89c440..830d301c8 100644 --- a/dex/router/src/config.rs +++ b/dex/router/src/config.rs @@ -83,13 +83,4 @@ pub trait ConfigModule: read_pair_storage::ReadPairStorageModule { #[view(getCommonTokensForUserPairs)] #[storage_mapper("commonTokensForUserPairs")] fn common_tokens_for_user_pairs(&self) -> UnorderedSetMapper; - - // read from other storage - #[view(getFirstTokenId)] - #[storage_mapper("first_token_id")] - fn first_token_id(&self) -> SingleValueMapper; - - #[view(getSecondTokenId)] - #[storage_mapper("second_token_id")] - fn second_token_id(&self) -> SingleValueMapper; } diff --git a/dex/router/wasm/src/lib.rs b/dex/router/wasm/src/lib.rs index ee22e6ba5..ee424764b 100644 --- a/dex/router/wasm/src/lib.rs +++ b/dex/router/wasm/src/lib.rs @@ -5,9 +5,9 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 32 +// Endpoints: 30 // Async Callback: 1 -// Total number of exported functions: 34 +// Total number of exported functions: 32 #![no_std] #![allow(internal_features)] @@ -39,8 +39,6 @@ multiversx_sc_wasm_adapter::endpoints! { getPairTemplateAddress => pair_template_address getTemporaryOwnerPeriod => temporary_owner_period getCommonTokensForUserPairs => common_tokens_for_user_pairs - getFirstTokenId => first_token_id - getSecondTokenId => second_token_id getAllPairsManagedAddresses => get_all_pairs_addresses getAllPairTokens => get_all_token_pairs getAllPairContractMetadata => get_all_pair_contract_metadata From 1f7d912d05b3a498cb54acf8dafebd6424a50b49 Mon Sep 17 00:00:00 2001 From: Mihai Calin Luca Date: Tue, 16 Apr 2024 14:32:38 +0200 Subject: [PATCH 14/55] send calls migration, new proxy for pair in router and build --- Cargo.lock | 2 + .../src/permissions_module.rs | 2 +- common/modules/token_send/src/token_send.rs | 10 +- dex/farm-with-locked-rewards/wasm/Cargo.lock | 16 +- dex/farm-with-locked-rewards/wasm/src/lib.rs | 5 +- dex/farm/wasm/Cargo.lock | 16 +- dex/farm/wasm/src/lib.rs | 5 +- dex/governance/src/proposal.rs | 9 +- dex/governance/src/weight.rs | 10 +- dex/governance/wasm/Cargo.lock | 12 +- dex/governance/wasm/src/lib.rs | 5 +- dex/pair-mock/src/pair.rs | 7 +- dex/pair-mock/wasm/Cargo.lock | 12 +- dex/pair/sc-config.toml | 5 +- dex/pair/src/lib.rs | 23 +- dex/pair/src/pair_actions/initial_liq.rs | 3 +- dex/pair/wasm-pair-full/Cargo.lock | 16 +- dex/pair/wasm-pair-full/src/lib.rs | 5 +- dex/pair/wasm-safe-price-view/Cargo.lock | 16 +- dex/pair/wasm/Cargo.lock | 16 +- dex/pair/wasm/src/lib.rs | 5 +- dex/price-discovery/src/lib.rs | 6 +- dex/price-discovery/wasm/Cargo.lock | 16 +- dex/price-discovery/wasm/src/lib.rs | 5 +- dex/proxy-deployer/wasm/Cargo.lock | 16 +- dex/proxy-deployer/wasm/src/lib.rs | 5 +- dex/router/Cargo.toml | 6 + dex/router/src/contract.rs | 6 +- dex/router/src/enable_swap_by_user.rs | 14 +- dex/router/src/factory.rs | 33 +- dex/router/src/multi_pair_swap.rs | 2 +- dex/router/src/pair_proxy.rs | 977 ++++++++++++++++++ dex/router/wasm/Cargo.lock | 18 +- dex/router/wasm/src/lib.rs | 5 +- energy-integration/fees-collector/src/lib.rs | 2 +- energy-integration/governance-v2/src/lib.rs | 14 +- farm-staking/farm-staking/src/unstake_farm.rs | 6 +- farm-staking/metabonding-staking/src/lib.rs | 15 +- locked-asset/energy-factory/src/lib.rs | 39 +- locked-asset/energy-factory/src/migration.rs | 2 +- .../energy-factory/src/unlock_with_penalty.rs | 14 +- .../energy-factory/src/virtual_lock.rs | 15 +- .../energy_factory_setup/unbond_sc_mock.rs | 14 +- locked-asset/factory/src/locked_asset.rs | 19 +- locked-asset/lkmex-transfer/src/lib.rs | 7 +- locked-asset/locked-token-wrapper/src/lib.rs | 14 +- .../locked-token-wrapper/src/wrapped_token.rs | 2 +- .../simple-lock/src/basic_lock_unlock.rs | 28 +- locked-asset/simple-lock/src/locked_token.rs | 14 +- locked-asset/simple-lock/src/proxy_farm.rs | 56 +- .../token-unstake/src/cancel_unstake.rs | 2 +- .../token-unstake/src/unbond_tokens.rs | 2 +- 52 files changed, 1322 insertions(+), 252 deletions(-) create mode 100644 dex/router/src/pair_proxy.rs diff --git a/Cargo.lock b/Cargo.lock index fa70ba69b..76d4fbf4a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2315,11 +2315,13 @@ dependencies = [ name = "router" version = "0.0.0" dependencies = [ + "common_structs", "locking_module", "multiversx-sc", "multiversx-sc-scenario", "pair", "pausable", + "permissions_module", "simple-lock", "token_send", ] diff --git a/common/modules/permissions_module/src/permissions_module.rs b/common/modules/permissions_module/src/permissions_module.rs index 5853ca0da..38eab7fdd 100644 --- a/common/modules/permissions_module/src/permissions_module.rs +++ b/common/modules/permissions_module/src/permissions_module.rs @@ -1,6 +1,6 @@ #![no_std] -mod permissions; +pub mod permissions; use common_errors::ERROR_PERMISSION_DENIED; diff --git a/common/modules/token_send/src/token_send.rs b/common/modules/token_send/src/token_send.rs index aefee5cb3..19ef58030 100644 --- a/common/modules/token_send/src/token_send.rs +++ b/common/modules/token_send/src/token_send.rs @@ -18,7 +18,10 @@ pub trait TokenSendModule { } if !non_zero_payments.is_empty() { - self.send().direct_multi(destination, &non_zero_payments) + self.tx() + .to(destination) + .payment(non_zero_payments) + .transfer(); } } @@ -33,7 +36,10 @@ pub trait TokenSendModule { return; } - self.send().direct_esdt(to, token_id, token_nonce, amount); + self.tx() + .to(to) + .single_esdt(token_id, token_nonce, amount) + .transfer(); } fn send_payment_non_zero(&self, to: &ManagedAddress, payment: &EsdtTokenPayment) { diff --git a/dex/farm-with-locked-rewards/wasm/Cargo.lock b/dex/farm-with-locked-rewards/wasm/Cargo.lock index 04273a9ea..662cc7e91 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.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" dependencies = [ "bitflags", "hex-literal", @@ -350,9 +350,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" dependencies = [ "hex", "proc-macro2", @@ -363,18 +363,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" dependencies = [ "multiversx-sc", ] diff --git a/dex/farm-with-locked-rewards/wasm/src/lib.rs b/dex/farm-with-locked-rewards/wasm/src/lib.rs index c3aaf7509..9d1cdb109 100644 --- a/dex/farm-with-locked-rewards/wasm/src/lib.rs +++ b/dex/farm-with-locked-rewards/wasm/src/lib.rs @@ -5,9 +5,10 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 68 +// Upgrade: 1 +// Endpoints: 67 // Async Callback: 1 -// Total number of exported functions: 70 +// Total number of exported functions: 69 #![no_std] #![allow(internal_features)] diff --git a/dex/farm/wasm/Cargo.lock b/dex/farm/wasm/Cargo.lock index 2dacef823..76c4c498c 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.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" dependencies = [ "bitflags", "hex-literal", @@ -320,9 +320,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" dependencies = [ "hex", "proc-macro2", @@ -333,18 +333,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" dependencies = [ "multiversx-sc", ] diff --git a/dex/farm/wasm/src/lib.rs b/dex/farm/wasm/src/lib.rs index c129590b3..807d71f10 100644 --- a/dex/farm/wasm/src/lib.rs +++ b/dex/farm/wasm/src/lib.rs @@ -5,9 +5,10 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 65 +// Upgrade: 1 +// Endpoints: 64 // Async Callback: 1 -// Total number of exported functions: 67 +// Total number of exported functions: 66 #![no_std] #![allow(internal_features)] diff --git a/dex/governance/src/proposal.rs b/dex/governance/src/proposal.rs index 3a80c60bd..2c641d688 100644 --- a/dex/governance/src/proposal.rs +++ b/dex/governance/src/proposal.rs @@ -103,10 +103,11 @@ pub trait ProposalHelper: config::Config { } fn execute_action(&self, action: &Action) -> Result<(), &'static [u8]> { - self.send() - .contract_call::<()>(action.dest_address.clone(), action.endpoint_name.clone()) - .with_raw_arguments(ManagedArgBuffer::from(action.arguments.clone())) - .with_gas_limit(action.gas_limit) + self.tx() + .to(&action.dest_address) + .raw_call(action.endpoint_name.clone()) + .arguments_raw(action.arguments.clone().into()) + .gas(action.gas_limit) .transfer_execute(); Result::Ok(()) // ContractCallNoPayment::new() diff --git a/dex/governance/src/weight.rs b/dex/governance/src/weight.rs index 07b075f95..2ce06ef20 100644 --- a/dex/governance/src/weight.rs +++ b/dex/governance/src/weight.rs @@ -44,12 +44,10 @@ pub trait Lib: config::Config { } fn send_back(&self, payment: EsdtTokenPayment) { - self.send().direct_esdt( - &self.blockchain().get_caller(), - &payment.token_identifier, - payment.token_nonce, - &payment.amount, - ); + self.tx() + .to(&self.blockchain().get_caller()) + .payment(payment) + .transfer(); } #[proxy] diff --git a/dex/governance/wasm/Cargo.lock b/dex/governance/wasm/Cargo.lock index 5104abd3f..6dc5fff54 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.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" dependencies = [ "bitflags", "hex-literal", @@ -90,9 +90,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" dependencies = [ "hex", "proc-macro2", @@ -103,9 +103,9 @@ dependencies = [ [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" dependencies = [ "multiversx-sc", ] diff --git a/dex/governance/wasm/src/lib.rs b/dex/governance/wasm/src/lib.rs index 913c84bba..2837cd15e 100644 --- a/dex/governance/wasm/src/lib.rs +++ b/dex/governance/wasm/src/lib.rs @@ -5,9 +5,10 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 22 +// Upgrade: 1 +// Endpoints: 21 // Async Callback (empty): 1 -// Total number of exported functions: 24 +// Total number of exported functions: 23 #![no_std] #![allow(internal_features)] diff --git a/dex/pair-mock/src/pair.rs b/dex/pair-mock/src/pair.rs index 1f073c215..991a070ab 100644 --- a/dex/pair-mock/src/pair.rs +++ b/dex/pair-mock/src/pair.rs @@ -110,8 +110,11 @@ pub trait PairMock { let caller = self.blockchain().get_caller(); let lp_token_amount = liquidity - MINIMUM_LIQUIDITY; - self.send() - .direct_esdt(&caller, &lp_token_id, 0, &lp_token_amount); + + self.tx() + .to(&caller) + .single_esdt(&lp_token_id, 0, &lp_token_amount) + .transfer(); ( EsdtTokenPayment::new(lp_token_id, 0, lp_token_amount), diff --git a/dex/pair-mock/wasm/Cargo.lock b/dex/pair-mock/wasm/Cargo.lock index 6e83ea775..b73e70b7b 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.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" dependencies = [ "bitflags", "hex-literal", @@ -97,9 +97,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" dependencies = [ "hex", "proc-macro2", @@ -110,9 +110,9 @@ dependencies = [ [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" dependencies = [ "multiversx-sc", ] diff --git a/dex/pair/sc-config.toml b/dex/pair/sc-config.toml index 738e43967..0d0c13baa 100644 --- a/dex/pair/sc-config.toml +++ b/dex/pair/sc-config.toml @@ -14,4 +14,7 @@ add-labels = ["safe-price-view"] [contracts.full] name = "pair-full" add-unlabelled = true -add-labels = ["safe-price-view"] \ No newline at end of file +add-labels = ["safe-price-view"] + +[[proxy]] +path = "../router/src/pair_proxy.rs" diff --git a/dex/pair/src/lib.rs b/dex/pair/src/lib.rs index e67010d67..77c798cda 100644 --- a/dex/pair/src/lib.rs +++ b/dex/pair/src/lib.rs @@ -102,7 +102,28 @@ pub trait Pair: } #[upgrade] - fn upgrade(&self) {} + fn upgrade( + &self, + first_token_id: TokenIdentifier, + second_token_id: TokenIdentifier, + router_address: ManagedAddress, + router_owner_address: ManagedAddress, + total_fee_percent: u64, + special_fee_percent: u64, + initial_liquidity_adder: ManagedAddress, + admins: MultiValueEncoded, + ) { + self.init( + first_token_id, + second_token_id, + router_address, + router_owner_address, + total_fee_percent, + special_fee_percent, + initial_liquidity_adder, + admins, + ); + } #[endpoint(setLpTokenIdentifier)] fn set_lp_token_identifier(&self, token_identifier: TokenIdentifier) { diff --git a/dex/pair/src/pair_actions/initial_liq.rs b/dex/pair/src/pair_actions/initial_liq.rs index b418fec2a..ab20a3565 100644 --- a/dex/pair/src/pair_actions/initial_liq.rs +++ b/dex/pair/src/pair_actions/initial_liq.rs @@ -69,8 +69,7 @@ pub trait InitialLiquidityModule: let lp_payment = EsdtTokenPayment::new(storage_cache.lp_token_id.clone(), 0, liq_added.clone()); - self.send() - .direct_non_zero_esdt_payment(&caller, &lp_payment); + self.tx().to(&caller).payment(lp_payment).transfer(); self.state().set(State::PartialActive); diff --git a/dex/pair/wasm-pair-full/Cargo.lock b/dex/pair/wasm-pair-full/Cargo.lock index 9ca48d0d0..a7b75403d 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.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" dependencies = [ "bitflags", "hex-literal", @@ -196,9 +196,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" dependencies = [ "hex", "proc-macro2", @@ -209,18 +209,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" dependencies = [ "multiversx-sc", ] diff --git a/dex/pair/wasm-pair-full/src/lib.rs b/dex/pair/wasm-pair-full/src/lib.rs index 149c4a91b..9b34ff9b2 100644 --- a/dex/pair/wasm-pair-full/src/lib.rs +++ b/dex/pair/wasm-pair-full/src/lib.rs @@ -5,9 +5,10 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 64 +// Upgrade: 1 +// Endpoints: 63 // Async Callback (empty): 1 -// Total number of exported functions: 66 +// Total number of exported functions: 65 #![no_std] #![allow(internal_features)] diff --git a/dex/pair/wasm-safe-price-view/Cargo.lock b/dex/pair/wasm-safe-price-view/Cargo.lock index 929875e3f..633555b27 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.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" dependencies = [ "bitflags", "hex-literal", @@ -196,9 +196,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" dependencies = [ "hex", "proc-macro2", @@ -209,18 +209,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" dependencies = [ "multiversx-sc", ] diff --git a/dex/pair/wasm/Cargo.lock b/dex/pair/wasm/Cargo.lock index 26d648185..bb78c7a4d 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.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" dependencies = [ "bitflags", "hex-literal", @@ -196,9 +196,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" dependencies = [ "hex", "proc-macro2", @@ -209,18 +209,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" dependencies = [ "multiversx-sc", ] diff --git a/dex/pair/wasm/src/lib.rs b/dex/pair/wasm/src/lib.rs index 82a357b8a..bceaa24db 100644 --- a/dex/pair/wasm/src/lib.rs +++ b/dex/pair/wasm/src/lib.rs @@ -5,9 +5,10 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 55 +// Upgrade: 1 +// Endpoints: 54 // Async Callback (empty): 1 -// Total number of exported functions: 57 +// Total number of exported functions: 56 #![no_std] #![allow(internal_features)] diff --git a/dex/price-discovery/src/lib.rs b/dex/price-discovery/src/lib.rs index b0c430e52..81d60afd4 100644 --- a/dex/price-discovery/src/lib.rs +++ b/dex/price-discovery/src/lib.rs @@ -200,8 +200,10 @@ pub trait PriceDiscovery: require!(current_price >= min_price, BELOW_MIN_PRICE_ERR_MSG); let caller = self.blockchain().get_caller(); - self.send() - .direct(&caller, &refund_token_id, 0, &withdraw_amount); + self.tx() + .to(&caller) + .egld_or_single_esdt(&refund_token_id, 0, &withdraw_amount) + .transfer(); self.emit_withdraw_event( refund_token_id.clone(), diff --git a/dex/price-discovery/wasm/Cargo.lock b/dex/price-discovery/wasm/Cargo.lock index 65c5b9037..d72671b35 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.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" dependencies = [ "bitflags", "hex-literal 0.4.1", @@ -154,9 +154,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" dependencies = [ "hex", "proc-macro2", @@ -167,18 +167,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" dependencies = [ "multiversx-sc", ] diff --git a/dex/price-discovery/wasm/src/lib.rs b/dex/price-discovery/wasm/src/lib.rs index c29196d8a..bad7eb4e4 100644 --- a/dex/price-discovery/wasm/src/lib.rs +++ b/dex/price-discovery/wasm/src/lib.rs @@ -5,9 +5,10 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 28 +// Upgrade: 1 +// Endpoints: 27 // Async Callback: 1 -// Total number of exported functions: 30 +// Total number of exported functions: 29 #![no_std] #![allow(internal_features)] diff --git a/dex/proxy-deployer/wasm/Cargo.lock b/dex/proxy-deployer/wasm/Cargo.lock index 02b775cc5..589d0f39b 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.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" dependencies = [ "bitflags", "hex-literal", @@ -312,9 +312,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" dependencies = [ "hex", "proc-macro2", @@ -325,18 +325,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" dependencies = [ "multiversx-sc", ] diff --git a/dex/proxy-deployer/wasm/src/lib.rs b/dex/proxy-deployer/wasm/src/lib.rs index b8f3493f8..14253ba21 100644 --- a/dex/proxy-deployer/wasm/src/lib.rs +++ b/dex/proxy-deployer/wasm/src/lib.rs @@ -5,9 +5,10 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 5 +// Upgrade: 1 +// Endpoints: 4 // Async Callback (empty): 1 -// Total number of exported functions: 7 +// Total number of exported functions: 6 #![no_std] #![allow(internal_features)] diff --git a/dex/router/Cargo.toml b/dex/router/Cargo.toml index 09cef8d97..850d408c1 100644 --- a/dex/router/Cargo.toml +++ b/dex/router/Cargo.toml @@ -8,6 +8,12 @@ publish = false [lib] path = "src/contract.rs" +[dependencies.common_structs] +path = "../../common/common_structs" + +[dependencies.permissions_module] +path = "../../common/modules/permissions_module" + [dependencies.token_send] path = "../../common/modules/token_send" diff --git a/dex/router/src/contract.rs b/dex/router/src/contract.rs index 094e61f07..a1bc634b8 100644 --- a/dex/router/src/contract.rs +++ b/dex/router/src/contract.rs @@ -8,6 +8,7 @@ pub mod enable_swap_by_user; mod events; pub mod factory; pub mod multi_pair_swap; +mod pair_proxy; use factory::PairTokens; use pair::config::ProxyTrait as _; @@ -274,8 +275,7 @@ pub trait Router: self.send() .esdt_system_sc_proxy() .set_special_roles(&pair_address, &pair_token, roles.iter().cloned()) - .async_call() - .call_and_exit() + .async_call_and_exit() } #[only_owner] @@ -374,7 +374,7 @@ pub trait Router: } ManagedAsyncCallResult::Err(_) => { if token_id.is_egld() && returned_tokens > 0u64 { - self.send().direct_egld(caller, &returned_tokens); + self.tx().to(caller).egld(&returned_tokens).transfer(); } } } diff --git a/dex/router/src/enable_swap_by_user.rs b/dex/router/src/enable_swap_by_user.rs index 7c77036c1..200bdf43d 100644 --- a/dex/router/src/enable_swap_by_user.rs +++ b/dex/router/src/enable_swap_by_user.rs @@ -133,12 +133,14 @@ pub trait EnableSwapByUserModule: self.set_fee_percents(pair_address.clone()); self.pair_resume(pair_address.clone()); - self.send().direct_esdt( - &caller, - &payment.token_identifier, - payment.token_nonce, - &payment.amount, - ); + self.tx() + .to(&caller) + .single_esdt( + &payment.token_identifier, + payment.token_nonce, + &payment.amount, + ) + .transfer(); self.emit_user_swaps_enabled_event( caller, diff --git a/dex/router/src/factory.rs b/dex/router/src/factory.rs index 4994db235..72121fa2d 100644 --- a/dex/router/src/factory.rs +++ b/dex/router/src/factory.rs @@ -1,7 +1,7 @@ multiversx_sc::imports!(); multiversx_sc::derive_imports!(); -use crate::config; +use crate::{config, pair_proxy}; const TEMPORARY_OWNER_PERIOD_BLOCKS: u64 = 50; @@ -20,9 +20,6 @@ pub struct PairContractMetadata { #[multiversx_sc::module] pub trait FactoryModule: config::ConfigModule { - #[proxy] - fn pair_contract_deploy_proxy(&self) -> pair::Proxy; - fn init_factory(&self, pair_template_address_opt: Option) { if let Some(addr) = pair_template_address_opt { self.pair_template_address().set(&addr); @@ -46,9 +43,9 @@ pub trait FactoryModule: config::ConfigModule { !self.pair_template_address().is_empty(), "pair contract template is empty" ); - - let (new_address, ()) = self - .pair_contract_deploy_proxy() + let new_address = self + .tx() + .typed(pair_proxy::PairProxy) .init( first_token_id, second_token_id, @@ -59,10 +56,12 @@ pub trait FactoryModule: config::ConfigModule { initial_liquidity_adder, admins, ) - .deploy_from_source( - &self.pair_template_address().get(), + .from_source(self.pair_template_address().get()) + .code_metadata( CodeMetadata::UPGRADEABLE | CodeMetadata::READABLE | CodeMetadata::PAYABLE_BY_SC, - ); + ) + .returns(ReturnsNewManagedAddress) + .sync_call(); self.pair_map().insert( PairTokens { @@ -98,9 +97,10 @@ pub trait FactoryModule: config::ConfigModule { total_fee_percent: u64, special_fee_percent: u64, ) { - self.pair_contract_deploy_proxy() - .contract(pair_address) - .init( + self.tx() + .to(pair_address) + .typed(pair_proxy::PairProxy) + .upgrade( first_token_id, second_token_id, self.blockchain().get_sc_address(), @@ -110,10 +110,11 @@ pub trait FactoryModule: config::ConfigModule { ManagedAddress::zero(), MultiValueEncoded::new(), ) - .upgrade_from_source( - &self.pair_template_address().get(), + .from_source(self.pair_template_address().get()) + .code_metadata( CodeMetadata::UPGRADEABLE | CodeMetadata::READABLE | CodeMetadata::PAYABLE_BY_SC, - ); + ) + .upgrade_async_call_and_exit(); } #[view(getAllPairsManagedAddresses)] diff --git a/dex/router/src/multi_pair_swap.rs b/dex/router/src/multi_pair_swap.rs index dc5492f9d..7d44f50ac 100644 --- a/dex/router/src/multi_pair_swap.rs +++ b/dex/router/src/multi_pair_swap.rs @@ -69,7 +69,7 @@ pub trait MultiPairSwap: } payments.push(last_payment); - self.send().direct_multi(&caller, &payments); + self.tx().to(&caller).payment(&payments).transfer(); payments } diff --git a/dex/router/src/pair_proxy.rs b/dex/router/src/pair_proxy.rs new file mode 100644 index 000000000..bb10a12aa --- /dev/null +++ b/dex/router/src/pair_proxy.rs @@ -0,0 +1,977 @@ +// Code generated by the multiversx-sc proxy generator. DO NOT EDIT. + +//////////////////////////////////////////////////// +////////////////// AUTO-GENERATED ////////////////// +//////////////////////////////////////////////////// + +#![allow(dead_code)] +#![allow(clippy::all)] + +use multiversx_sc::proxy_imports::*; + +pub struct PairProxy; + +impl TxProxyTrait for PairProxy +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + type TxProxyMethods = PairProxyMethods; + + fn proxy_methods(self, tx: Tx) -> Self::TxProxyMethods { + PairProxyMethods { wrapped_tx: tx } + } +} + +pub struct PairProxyMethods +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + wrapped_tx: Tx, +} + +#[rustfmt::skip] +impl PairProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + Gas: TxGas, +{ + pub fn init< + Arg0: CodecInto>, + Arg1: CodecInto>, + Arg2: CodecInto>, + Arg3: CodecInto>, + Arg4: CodecInto, + Arg5: CodecInto, + Arg6: CodecInto>, + Arg7: CodecInto>>, + >( + self, + first_token_id: Arg0, + second_token_id: Arg1, + router_address: Arg2, + router_owner_address: Arg3, + total_fee_percent: Arg4, + special_fee_percent: Arg5, + initial_liquidity_adder: Arg6, + admins: Arg7, + ) -> TxProxyDeploy { + self.wrapped_tx + .raw_deploy() + .argument(&first_token_id) + .argument(&second_token_id) + .argument(&router_address) + .argument(&router_owner_address) + .argument(&total_fee_percent) + .argument(&special_fee_percent) + .argument(&initial_liquidity_adder) + .argument(&admins) + .original_result() + } +} + +#[rustfmt::skip] +impl PairProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + pub fn upgrade< + Arg0: CodecInto>, + Arg1: CodecInto>, + Arg2: CodecInto>, + Arg3: CodecInto>, + Arg4: CodecInto, + Arg5: CodecInto, + Arg6: CodecInto>, + Arg7: CodecInto>>, + >( + self, + first_token_id: Arg0, + second_token_id: Arg1, + router_address: Arg2, + router_owner_address: Arg3, + total_fee_percent: Arg4, + special_fee_percent: Arg5, + initial_liquidity_adder: Arg6, + admins: Arg7, + ) -> TxProxyUpgrade { + self.wrapped_tx + .raw_upgrade() + .argument(&first_token_id) + .argument(&second_token_id) + .argument(&router_address) + .argument(&router_owner_address) + .argument(&total_fee_percent) + .argument(&special_fee_percent) + .argument(&initial_liquidity_adder) + .argument(&admins) + .original_result() + } +} + +#[rustfmt::skip] +impl PairProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + pub fn set_lp_token_identifier< + Arg0: CodecInto>, + >( + self, + token_identifier: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setLpTokenIdentifier") + .argument(&token_identifier) + .original_result() + } + + pub fn is_fee_enabled( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getFeeState") + .original_result() + } + + pub fn whitelist_endpoint< + Arg0: CodecInto>, + >( + self, + address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("whitelist") + .argument(&address) + .original_result() + } + + pub fn remove_whitelist< + Arg0: CodecInto>, + >( + self, + address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("removeWhitelist") + .argument(&address) + .original_result() + } + + pub fn add_trusted_swap_pair< + Arg0: CodecInto>, + Arg1: CodecInto>, + Arg2: CodecInto>, + >( + self, + pair_address: Arg0, + first_token: Arg1, + second_token: Arg2, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("addTrustedSwapPair") + .argument(&pair_address) + .argument(&first_token) + .argument(&second_token) + .original_result() + } + + pub fn remove_trusted_swap_pair< + Arg0: CodecInto>, + Arg1: CodecInto>, + >( + self, + first_token: Arg0, + second_token: Arg1, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("removeTrustedSwapPair") + .argument(&first_token) + .argument(&second_token) + .original_result() + } + + /// `fees_collector_cut_percentage` of the special fees are sent to the fees_collector_address SC + /// + /// For example, if special fees is 5%, and fees_collector_cut_percentage is 10%, + /// then of the 5%, 10% are reserved, and only the rest are split between other pair contracts. + pub fn setup_fees_collector< + Arg0: CodecInto>, + Arg1: CodecInto, + >( + self, + fees_collector_address: Arg0, + fees_collector_cut_percentage: Arg1, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setupFeesCollector") + .argument(&fees_collector_address) + .argument(&fees_collector_cut_percentage) + .original_result() + } + + pub fn set_fee_on< + Arg0: CodecInto, + Arg1: CodecInto>, + Arg2: CodecInto>, + >( + self, + enabled: Arg0, + fee_to_address: Arg1, + fee_token: Arg2, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setFeeOn") + .argument(&enabled) + .argument(&fee_to_address) + .argument(&fee_token) + .original_result() + } + + pub fn get_fee_destinations( + self, + ) -> TxProxyCall, TokenIdentifier)>> { + self.wrapped_tx + .raw_call("getFeeDestinations") + .original_result() + } + + pub fn get_trusted_swap_pairs( + self, + ) -> TxProxyCall, ManagedAddress)>> { + self.wrapped_tx + .raw_call("getTrustedSwapPairs") + .original_result() + } + + pub fn get_whitelisted_managed_addresses( + self, + ) -> TxProxyCall>> { + self.wrapped_tx + .raw_call("getWhitelistedManagedAddresses") + .original_result() + } + + pub fn fees_collector_address( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getFeesCollectorAddress") + .original_result() + } + + pub fn fees_collector_cut_percentage( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getFeesCollectorCutPercentage") + .original_result() + } + + pub fn set_state_active_no_swaps( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setStateActiveNoSwaps") + .original_result() + } + + pub fn set_fee_percent< + Arg0: CodecInto, + Arg1: CodecInto, + >( + self, + total_fee_percent: Arg0, + special_fee_percent: Arg1, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setFeePercents") + .argument(&total_fee_percent) + .argument(&special_fee_percent) + .original_result() + } + + pub fn get_lp_token_identifier( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getLpTokenIdentifier") + .original_result() + } + + pub fn total_fee_percent( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getTotalFeePercent") + .original_result() + } + + pub fn special_fee_percent( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getSpecialFee") + .original_result() + } + + pub fn router_address( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getRouterManagedAddress") + .original_result() + } + + pub fn first_token_id( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getFirstTokenId") + .original_result() + } + + pub fn second_token_id( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getSecondTokenId") + .original_result() + } + + pub fn lp_token_supply( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getTotalSupply") + .original_result() + } + + pub fn initial_liquidity_adder( + self, + ) -> TxProxyCall>> { + self.wrapped_tx + .raw_call("getInitialLiquidtyAdder") + .original_result() + } + + pub fn pair_reserve< + Arg0: CodecInto>, + >( + self, + token_id: Arg0, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getReserve") + .argument(&token_id) + .original_result() + } + + pub fn safe_price_current_index( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getSafePriceCurrentIndex") + .original_result() + } + + pub fn get_lp_tokens_safe_price_by_default_offset< + Arg0: CodecInto>, + Arg1: CodecInto>, + >( + self, + pair_address: Arg0, + liquidity: Arg1, + ) -> TxProxyCall, EsdtTokenPayment>> { + self.wrapped_tx + .raw_call("getLpTokensSafePriceByDefaultOffset") + .argument(&pair_address) + .argument(&liquidity) + .original_result() + } + + pub fn get_lp_tokens_safe_price_by_round_offset< + Arg0: CodecInto>, + Arg1: CodecInto, + Arg2: CodecInto>, + >( + self, + pair_address: Arg0, + round_offset: Arg1, + liquidity: Arg2, + ) -> TxProxyCall, EsdtTokenPayment>> { + self.wrapped_tx + .raw_call("getLpTokensSafePriceByRoundOffset") + .argument(&pair_address) + .argument(&round_offset) + .argument(&liquidity) + .original_result() + } + + pub fn get_lp_tokens_safe_price_by_timestamp_offset< + Arg0: CodecInto>, + Arg1: CodecInto, + Arg2: CodecInto>, + >( + self, + pair_address: Arg0, + timestamp_offset: Arg1, + liquidity: Arg2, + ) -> TxProxyCall, EsdtTokenPayment>> { + self.wrapped_tx + .raw_call("getLpTokensSafePriceByTimestampOffset") + .argument(&pair_address) + .argument(×tamp_offset) + .argument(&liquidity) + .original_result() + } + + pub fn get_lp_tokens_safe_price< + Arg0: CodecInto>, + Arg1: CodecInto, + Arg2: CodecInto, + Arg3: CodecInto>, + >( + self, + pair_address: Arg0, + start_round: Arg1, + end_round: Arg2, + liquidity: Arg3, + ) -> TxProxyCall, EsdtTokenPayment>> { + self.wrapped_tx + .raw_call("getLpTokensSafePrice") + .argument(&pair_address) + .argument(&start_round) + .argument(&end_round) + .argument(&liquidity) + .original_result() + } + + pub fn get_safe_price_by_default_offset< + Arg0: CodecInto>, + Arg1: CodecInto>, + >( + self, + pair_address: Arg0, + input_payment: Arg1, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getSafePriceByDefaultOffset") + .argument(&pair_address) + .argument(&input_payment) + .original_result() + } + + pub fn get_safe_price_by_round_offset< + Arg0: CodecInto>, + Arg1: CodecInto, + Arg2: CodecInto>, + >( + self, + pair_address: Arg0, + round_offset: Arg1, + input_payment: Arg2, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getSafePriceByRoundOffset") + .argument(&pair_address) + .argument(&round_offset) + .argument(&input_payment) + .original_result() + } + + pub fn get_safe_price_by_timestamp_offset< + Arg0: CodecInto>, + Arg1: CodecInto, + Arg2: CodecInto>, + >( + self, + pair_address: Arg0, + timestamp_offset: Arg1, + input_payment: Arg2, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getSafePriceByTimestampOffset") + .argument(&pair_address) + .argument(×tamp_offset) + .argument(&input_payment) + .original_result() + } + + pub fn get_safe_price< + Arg0: CodecInto>, + Arg1: CodecInto, + Arg2: CodecInto, + Arg3: CodecInto>, + >( + self, + pair_address: Arg0, + start_round: Arg1, + end_round: Arg2, + input_payment: Arg3, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getSafePrice") + .argument(&pair_address) + .argument(&start_round) + .argument(&end_round) + .argument(&input_payment) + .original_result() + } + + pub fn get_price_observation_view< + Arg0: CodecInto>, + Arg1: CodecInto, + >( + self, + pair_address: Arg0, + search_round: Arg1, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getPriceObservation") + .argument(&pair_address) + .argument(&search_round) + .original_result() + } + + pub fn update_and_get_tokens_for_given_position_with_safe_price< + Arg0: CodecInto>, + >( + self, + liquidity: Arg0, + ) -> TxProxyCall, EsdtTokenPayment>> { + self.wrapped_tx + .raw_call("updateAndGetTokensForGivenPositionWithSafePrice") + .argument(&liquidity) + .original_result() + } + + pub fn update_and_get_safe_price< + Arg0: CodecInto>, + >( + self, + input: Arg0, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("updateAndGetSafePrice") + .argument(&input) + .original_result() + } + + pub fn set_locking_deadline_epoch< + Arg0: CodecInto, + >( + self, + new_deadline: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setLockingDeadlineEpoch") + .argument(&new_deadline) + .original_result() + } + + pub fn set_locking_sc_address< + Arg0: CodecInto>, + >( + self, + new_address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setLockingScAddress") + .argument(&new_address) + .original_result() + } + + pub fn set_unlock_epoch< + Arg0: CodecInto, + >( + self, + new_epoch: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setUnlockEpoch") + .argument(&new_epoch) + .original_result() + } + + pub fn locking_sc_address( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getLockingScAddress") + .original_result() + } + + pub fn unlock_epoch( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getUnlockEpoch") + .original_result() + } + + pub fn locking_deadline_epoch( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getLockingDeadlineEpoch") + .original_result() + } + + pub fn add_admin_endpoint< + Arg0: CodecInto>, + >( + self, + address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("addAdmin") + .argument(&address) + .original_result() + } + + pub fn remove_admin_endpoint< + Arg0: CodecInto>, + >( + self, + address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("removeAdmin") + .argument(&address) + .original_result() + } + + pub fn update_owner_or_admin_endpoint< + Arg0: CodecInto>, + >( + self, + previous_owner: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("updateOwnerOrAdmin") + .argument(&previous_owner) + .original_result() + } + + pub fn permissions< + Arg0: CodecInto>, + >( + self, + address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getPermissions") + .argument(&address) + .original_result() + } + + pub fn add_to_pause_whitelist< + Arg0: CodecInto>>, + >( + self, + address_list: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("addToPauseWhitelist") + .argument(&address_list) + .original_result() + } + + pub fn remove_from_pause_whitelist< + Arg0: CodecInto>>, + >( + self, + address_list: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("removeFromPauseWhitelist") + .argument(&address_list) + .original_result() + } + + pub fn pause( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("pause") + .original_result() + } + + pub fn resume( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("resume") + .original_result() + } + + pub fn state( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getState") + .original_result() + } + + pub fn add_initial_liquidity( + self, + ) -> TxProxyCall, EsdtTokenPayment, EsdtTokenPayment>> { + self.wrapped_tx + .raw_call("addInitialLiquidity") + .original_result() + } + + pub fn add_liquidity< + Arg0: CodecInto>, + Arg1: CodecInto>, + >( + self, + first_token_amount_min: Arg0, + second_token_amount_min: Arg1, + ) -> TxProxyCall, EsdtTokenPayment, EsdtTokenPayment>> { + self.wrapped_tx + .raw_call("addLiquidity") + .argument(&first_token_amount_min) + .argument(&second_token_amount_min) + .original_result() + } + + pub fn remove_liquidity< + Arg0: CodecInto>, + Arg1: CodecInto>, + >( + self, + first_token_amount_min: Arg0, + second_token_amount_min: Arg1, + ) -> TxProxyCall, EsdtTokenPayment>> { + self.wrapped_tx + .raw_call("removeLiquidity") + .argument(&first_token_amount_min) + .argument(&second_token_amount_min) + .original_result() + } + + pub fn remove_liquidity_and_burn_token< + Arg0: CodecInto>, + >( + self, + token_to_buyback_and_burn: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("removeLiquidityAndBuyBackAndBurnToken") + .argument(&token_to_buyback_and_burn) + .original_result() + } + + pub fn swap_no_fee< + Arg0: CodecInto>, + Arg1: CodecInto>, + >( + self, + token_out: Arg0, + destination_address: Arg1, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("swapNoFeeAndForward") + .argument(&token_out) + .argument(&destination_address) + .original_result() + } + + pub fn swap_tokens_fixed_input< + Arg0: CodecInto>, + Arg1: CodecInto>, + >( + self, + token_out: Arg0, + amount_out_min: Arg1, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("swapTokensFixedInput") + .argument(&token_out) + .argument(&amount_out_min) + .original_result() + } + + pub fn swap_tokens_fixed_output< + Arg0: CodecInto>, + Arg1: CodecInto>, + >( + self, + token_out: Arg0, + amount_out: Arg1, + ) -> TxProxyCall, EsdtTokenPayment>> { + self.wrapped_tx + .raw_call("swapTokensFixedOutput") + .argument(&token_out) + .argument(&amount_out) + .original_result() + } + + pub fn get_tokens_for_given_position< + Arg0: CodecInto>, + >( + self, + liquidity: Arg0, + ) -> TxProxyCall, EsdtTokenPayment>> { + self.wrapped_tx + .raw_call("getTokensForGivenPosition") + .argument(&liquidity) + .original_result() + } + + pub fn get_reserves_and_total_supply( + self, + ) -> TxProxyCall, BigUint, BigUint>> { + self.wrapped_tx + .raw_call("getReservesAndTotalSupply") + .original_result() + } + + pub fn get_amount_out_view< + Arg0: CodecInto>, + Arg1: CodecInto>, + >( + self, + token_in: Arg0, + amount_in: Arg1, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getAmountOut") + .argument(&token_in) + .argument(&amount_in) + .original_result() + } + + pub fn get_amount_in_view< + Arg0: CodecInto>, + Arg1: CodecInto>, + >( + self, + token_wanted: Arg0, + amount_wanted: Arg1, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getAmountIn") + .argument(&token_wanted) + .argument(&amount_wanted) + .original_result() + } + + pub fn get_equivalent< + Arg0: CodecInto>, + Arg1: CodecInto>, + >( + self, + token_in: Arg0, + amount_in: Arg1, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getEquivalent") + .argument(&token_in) + .argument(&amount_in) + .original_result() + } +} + +#[derive(TopEncode, TopDecode)] +pub struct SwapEvent +where + Api: ManagedTypeApi, +{ + pub caller: ManagedAddress, + pub token_id_in: TokenIdentifier, + pub token_amount_in: BigUint, + pub token_id_out: TokenIdentifier, + pub token_amount_out: BigUint, + pub fee_amount: BigUint, + pub token_in_reserve: BigUint, + pub token_out_reserve: BigUint, + pub block: u64, + pub epoch: u64, + pub timestamp: u64, +} + +#[derive(TopEncode, TopDecode)] +pub struct SwapNoFeeAndForwardEvent +where + Api: ManagedTypeApi, +{ + pub caller: ManagedAddress, + pub token_id_in: TokenIdentifier, + pub token_amount_in: BigUint, + pub token_id_out: TokenIdentifier, + pub token_amount_out: BigUint, + pub destination: ManagedAddress, + pub block: u64, + pub epoch: u64, + pub timestamp: u64, +} + +#[derive(TopEncode, TopDecode)] +pub struct AddLiquidityEvent +where + Api: ManagedTypeApi, +{ + pub caller: ManagedAddress, + pub first_token_id: TokenIdentifier, + pub first_token_amount: BigUint, + pub second_token_id: TokenIdentifier, + pub second_token_amount: BigUint, + pub lp_token_id: TokenIdentifier, + pub lp_token_amount: BigUint, + pub lp_supply: BigUint, + pub first_token_reserves: BigUint, + pub second_token_reserves: BigUint, + pub block: u64, + pub epoch: u64, + pub timestamp: u64, +} + +#[derive(TopEncode, TopDecode)] +pub struct RemoveLiquidityEvent +where + Api: ManagedTypeApi, +{ + pub caller: ManagedAddress, + pub first_token_id: TokenIdentifier, + pub first_token_amount: BigUint, + pub second_token_id: TokenIdentifier, + pub second_token_amount: BigUint, + pub lp_token_id: TokenIdentifier, + pub lp_token_amount: BigUint, + pub lp_supply: BigUint, + pub first_token_reserves: BigUint, + pub second_token_reserves: BigUint, + pub block: u64, + pub epoch: u64, + pub timestamp: u64, +} + +#[derive(TopEncode, TopDecode)] +pub struct PriceObservation +where + Api: ManagedTypeApi, +{ + pub first_token_reserve_accumulated: BigUint, + pub second_token_reserve_accumulated: BigUint, + pub weight_accumulated: u64, + pub recording_round: u64, + pub lp_supply_accumulated: BigUint, +} diff --git a/dex/router/wasm/Cargo.lock b/dex/router/wasm/Cargo.lock index 6b2344040..f8a588292 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.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" dependencies = [ "bitflags", "hex-literal", @@ -196,9 +196,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" dependencies = [ "hex", "proc-macro2", @@ -209,18 +209,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" dependencies = [ "multiversx-sc", ] @@ -308,10 +308,12 @@ dependencies = [ name = "router" version = "0.0.0" dependencies = [ + "common_structs", "locking_module", "multiversx-sc", "pair", "pausable", + "permissions_module", "simple-lock", "token_send", ] diff --git a/dex/router/wasm/src/lib.rs b/dex/router/wasm/src/lib.rs index df0c8feb5..995274940 100644 --- a/dex/router/wasm/src/lib.rs +++ b/dex/router/wasm/src/lib.rs @@ -5,9 +5,10 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 32 +// Upgrade: 1 +// Endpoints: 31 // Async Callback: 1 -// Total number of exported functions: 34 +// Total number of exported functions: 33 #![no_std] #![allow(internal_features)] diff --git a/energy-integration/fees-collector/src/lib.rs b/energy-integration/fees-collector/src/lib.rs index e78ed6812..3e0fbc48b 100644 --- a/energy-integration/fees-collector/src/lib.rs +++ b/energy-integration/fees-collector/src/lib.rs @@ -111,7 +111,7 @@ pub trait FeesCollector: } if !rewards.is_empty() { - self.send().direct_multi(&caller, &rewards); + self.tx().to(&caller).payment(&rewards).transfer(); } if total_locked_token_rewards_amount > 0 { diff --git a/energy-integration/governance-v2/src/lib.rs b/energy-integration/governance-v2/src/lib.rs index 2014b3a53..48a9212fe 100644 --- a/energy-integration/governance-v2/src/lib.rs +++ b/energy-integration/governance-v2/src/lib.rs @@ -305,13 +305,13 @@ pub trait GovernanceV2: proposal: &GovernanceProposal, refund_amount: &BigUint, ) { - self.send().direct_non_zero_esdt_payment( - &proposal.proposer, - &EsdtTokenPayment::new( - proposal.fee_payment.token_identifier.clone(), + self.tx() + .to(&proposal.proposer) + .single_esdt( + &proposal.fee_payment.token_identifier, proposal.fee_payment.token_nonce, - refund_amount.clone(), - ), - ); + refund_amount, + ) + .transfer(); } } diff --git a/farm-staking/farm-staking/src/unstake_farm.rs b/farm-staking/farm-staking/src/unstake_farm.rs index e40642b4f..052d00e85 100644 --- a/farm-staking/farm-staking/src/unstake_farm.rs +++ b/farm-staking/farm-staking/src/unstake_farm.rs @@ -118,8 +118,10 @@ pub trait UnstakeFarmModule: unlock_epoch: current_epoch + min_unbond_epochs, }, ); - self.send() - .direct_esdt(to, &farm_token_id, nft_nonce, &amount); + self.tx() + .to(to) + .single_esdt(&farm_token_id, nft_nonce, &amount) + .transfer(); EsdtTokenPayment::new(farm_token_id, nft_nonce, amount) } diff --git a/farm-staking/metabonding-staking/src/lib.rs b/farm-staking/metabonding-staking/src/lib.rs index d15ce3c90..9f4f89723 100644 --- a/farm-staking/metabonding-staking/src/lib.rs +++ b/farm-staking/metabonding-staking/src/lib.rs @@ -103,12 +103,15 @@ pub trait MetabondingStaking: }; let locked_asset_token_id = self.locked_asset_token_id().get(); - self.send().direct_esdt( - &caller, - &locked_asset_token_id, - user_entry.token_nonce, - &unstake_amount, - ); + + self.tx() + .to(&caller) + .single_esdt( + &locked_asset_token_id, + user_entry.token_nonce, + &unstake_amount, + ) + .transfer(); self.unbond_event(&caller, opt_entry_after_action); } diff --git a/locked-asset/energy-factory/src/lib.rs b/locked-asset/energy-factory/src/lib.rs index f38c2e0e7..4b67d402b 100644 --- a/locked-asset/energy-factory/src/lib.rs +++ b/locked-asset/energy-factory/src/lib.rs @@ -129,12 +129,14 @@ pub trait SimpleLockEnergy: let output_tokens = self.lock_by_token_type(&dest_address, payment, unlock_epoch, current_epoch); - self.send().direct_esdt( - &dest_address, - &output_tokens.token_identifier, - output_tokens.token_nonce, - &output_tokens.amount, - ); + self.tx() + .to(&dest_address) + .single_esdt( + &output_tokens.token_identifier, + output_tokens.token_nonce, + &output_tokens.amount, + ) + .transfer(); output_tokens } @@ -177,12 +179,11 @@ pub trait SimpleLockEnergy: self.send() .esdt_local_mint(&output_payment.token_identifier, 0, &output_payment.amount); - self.send().direct_esdt( - &caller, - &output_payment.token_identifier, - 0, - &output_payment.amount, - ); + + self.tx() + .to(&caller) + .single_esdt(&output_payment.token_identifier, 0, &output_payment.amount) + .transfer(); output_payment } @@ -221,12 +222,14 @@ pub trait SimpleLockEnergy: &payment.amount, ); - self.send().direct_esdt( - &caller, - &output_tokens.token_identifier, - output_tokens.token_nonce, - &output_tokens.amount, - ); + self.tx() + .to(&caller) + .single_esdt( + &output_tokens.token_identifier, + output_tokens.token_nonce, + &output_tokens.amount, + ) + .transfer(); output_tokens } diff --git a/locked-asset/energy-factory/src/migration.rs b/locked-asset/energy-factory/src/migration.rs index 473d28c98..62c83df51 100644 --- a/locked-asset/energy-factory/src/migration.rs +++ b/locked-asset/energy-factory/src/migration.rs @@ -103,7 +103,7 @@ pub trait SimpleLockMigrationModule: } }); - self.send().direct_multi(&caller, &output_payments); + self.tx().to(&caller).payment(&output_payments).transfer(); output_payments.into() } diff --git a/locked-asset/energy-factory/src/unlock_with_penalty.rs b/locked-asset/energy-factory/src/unlock_with_penalty.rs index 102565ed5..00d840213 100644 --- a/locked-asset/energy-factory/src/unlock_with_penalty.rs +++ b/locked-asset/energy-factory/src/unlock_with_penalty.rs @@ -94,12 +94,14 @@ pub trait UnlockWithPenaltyModule: energy.add_after_token_lock(&new_locked_tokens.amount, new_unlock_epoch, current_epoch); self.set_energy_entry(&caller, energy); - self.send().direct( - &caller, - &new_locked_tokens.token_identifier, - new_locked_tokens.token_nonce, - &new_locked_tokens.amount, - ); + self.tx() + .to(&caller) + .egld_or_single_esdt( + &new_locked_tokens.token_identifier, + new_locked_tokens.token_nonce, + &new_locked_tokens.amount, + ) + .transfer(); self.to_esdt_payment(new_locked_tokens) } diff --git a/locked-asset/energy-factory/src/virtual_lock.rs b/locked-asset/energy-factory/src/virtual_lock.rs index 94aa0abf5..fe1edb7b5 100644 --- a/locked-asset/energy-factory/src/virtual_lock.rs +++ b/locked-asset/energy-factory/src/virtual_lock.rs @@ -57,12 +57,15 @@ pub trait VirtualLockModule: energy, ) }); - self.send().direct_esdt( - &dest_address, - &locked_tokens.token_identifier, - locked_tokens.token_nonce, - &locked_tokens.amount, - ); + + self.tx() + .to(&dest_address) + .single_esdt( + &locked_tokens.token_identifier, + locked_tokens.token_nonce, + &locked_tokens.amount, + ) + .transfer(); locked_tokens } diff --git a/locked-asset/energy-factory/tests/energy_factory_setup/unbond_sc_mock.rs b/locked-asset/energy-factory/tests/energy_factory_setup/unbond_sc_mock.rs index c993b7e24..94ac162bb 100644 --- a/locked-asset/energy-factory/tests/energy_factory_setup/unbond_sc_mock.rs +++ b/locked-asset/energy-factory/tests/energy_factory_setup/unbond_sc_mock.rs @@ -45,11 +45,13 @@ impl UnbondScMock { let (dest_user, ()) = load_endpoint_args::, ())>(("dest_user", ())); - self.send().direct_esdt( - &dest_user, - &unlocked_tokens.token_identifier, - unlocked_tokens.token_nonce, - &unlocked_tokens.amount, - ); + self.tx() + .to(&dest_user) + .single_esdt( + &unlocked_tokens.token_identifier, + unlocked_tokens.token_nonce, + &unlocked_tokens.amount, + ) + .transfer(); } } diff --git a/locked-asset/factory/src/locked_asset.rs b/locked-asset/factory/src/locked_asset.rs index 85eb51636..2d7868daa 100644 --- a/locked-asset/factory/src/locked_asset.rs +++ b/locked-asset/factory/src/locked_asset.rs @@ -30,12 +30,14 @@ pub trait LockedAssetModule: .nft_create(total_amount, attributes); created_tokens.amount -= additional_amount_to_create; - self.send().direct_esdt( - address, - &created_tokens.token_identifier, - created_tokens.token_nonce, - &created_tokens.amount, - ); + self.tx() + .to(address) + .single_esdt( + &created_tokens.token_identifier, + created_tokens.token_nonce, + &created_tokens.amount, + ) + .transfer(); created_tokens } @@ -180,7 +182,10 @@ pub trait LockedAssetModule: if amount > &0 { let asset_token_id = self.asset_token_id().get(); self.send().esdt_local_mint(&asset_token_id, 0, amount); - self.send().direct_esdt(dest, &asset_token_id, 0, amount); + self.tx() + .to(dest) + .single_esdt(&asset_token_id, 0, amount) + .transfer(); } } diff --git a/locked-asset/lkmex-transfer/src/lib.rs b/locked-asset/lkmex-transfer/src/lib.rs index 126e740b8..4e07277f8 100644 --- a/locked-asset/lkmex-transfer/src/lib.rs +++ b/locked-asset/lkmex-transfer/src/lib.rs @@ -66,7 +66,7 @@ pub trait LkmexTransfer: self.check_address_on_cooldown(&receiver_last_transfer_mapper); let funds = self.get_unlocked_funds(&receiver, &sender); self.add_energy_to_destination(receiver.clone(), &funds); - self.send().direct_multi(&receiver, &funds); + self.tx().to(&receiver).payment(&funds).transfer(); self.locked_funds(&receiver, &sender).clear(); self.all_senders(&receiver).swap_remove(&sender); @@ -92,7 +92,10 @@ pub trait LkmexTransfer: self.sender_last_transfer_epoch(&sender).clear(); self.add_energy_to_destination(sender.clone(), &locked_funds.funds); - self.send().direct_multi(&sender, &locked_funds.funds); + self.tx() + .to(&sender) + .payment(&locked_funds.funds) + .transfer(); self.emit_cancel_transfer_event(sender, receiver, locked_funds); } diff --git a/locked-asset/locked-token-wrapper/src/lib.rs b/locked-asset/locked-token-wrapper/src/lib.rs index 5398cc42a..575652770 100644 --- a/locked-asset/locked-token-wrapper/src/lib.rs +++ b/locked-asset/locked-token-wrapper/src/lib.rs @@ -53,12 +53,14 @@ pub trait LockedTokenWrapper: &ManagedVec::from_single_item(original_locked_tokens.clone()), ); - self.send().direct_esdt( - &caller, - &original_locked_tokens.token_identifier, - original_locked_tokens.token_nonce, - &original_locked_tokens.amount, - ); + self.tx() + .to(&caller) + .single_esdt( + &original_locked_tokens.token_identifier, + original_locked_tokens.token_nonce, + &original_locked_tokens.amount, + ) + .transfer(); original_locked_tokens } diff --git a/locked-asset/locked-token-wrapper/src/wrapped_token.rs b/locked-asset/locked-token-wrapper/src/wrapped_token.rs index ae3fce50a..3e618cfd6 100644 --- a/locked-asset/locked-token-wrapper/src/wrapped_token.rs +++ b/locked-asset/locked-token-wrapper/src/wrapped_token.rs @@ -57,7 +57,7 @@ pub trait WrappedTokenModule: #[endpoint(unsetTransferRoleWrappedToken)] fn unset_transfer_role(&self, address: ManagedAddress) { let wrapped_token_id = self.wrapped_token().get_token_id(); - let system_sc_proxy = ESDTSystemSmartContractProxy::new_proxy_obj(); + let system_sc_proxy = self.send().esdt_system_sc_proxy(); system_sc_proxy .unset_special_roles( &address, diff --git a/locked-asset/simple-lock/src/basic_lock_unlock.rs b/locked-asset/simple-lock/src/basic_lock_unlock.rs index 5f3a46aa8..4277b3cc7 100644 --- a/locked-asset/simple-lock/src/basic_lock_unlock.rs +++ b/locked-asset/simple-lock/src/basic_lock_unlock.rs @@ -47,12 +47,14 @@ pub trait BasicLockUnlock: unlock_epoch: u64, ) -> EgldOrEsdtTokenPayment { let out_payment = self.lock_tokens(payment, unlock_epoch); - self.send().direct( - to, - &out_payment.token_identifier, - out_payment.token_nonce, - &out_payment.amount, - ); + self.tx() + .to(to) + .egld_or_single_esdt( + &out_payment.token_identifier, + out_payment.token_nonce, + &out_payment.amount, + ) + .transfer(); out_payment } @@ -97,12 +99,14 @@ pub trait BasicLockUnlock: 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, - ); + self.tx() + .to(to) + .egld_or_single_esdt( + &out_payment.token_identifier, + out_payment.token_nonce, + &out_payment.amount, + ) + .transfer(); out_payment } diff --git a/locked-asset/simple-lock/src/locked_token.rs b/locked-asset/simple-lock/src/locked_token.rs index dbb9c1a5d..f0e83ed54 100644 --- a/locked-asset/simple-lock/src/locked_token.rs +++ b/locked-asset/simple-lock/src/locked_token.rs @@ -105,12 +105,14 @@ pub trait LockedTokenModule: } } - self.send().direct_esdt( - to, - &payment.token_identifier, - payment.token_nonce, - &payment.amount, - ); + self.tx() + .to(to) + .single_esdt( + &payment.token_identifier, + payment.token_nonce, + &payment.amount, + ) + .transfer(); payment } diff --git a/locked-asset/simple-lock/src/proxy_farm.rs b/locked-asset/simple-lock/src/proxy_farm.rs index 1d1a918d2..6ca92342e 100644 --- a/locked-asset/simple-lock/src/proxy_farm.rs +++ b/locked-asset/simple-lock/src/proxy_farm.rs @@ -179,12 +179,14 @@ pub trait ProxyFarmModule: ); if enter_farm_result.reward_tokens.amount > 0 { - self.send().direct_esdt( - &caller, - &enter_farm_result.reward_tokens.token_identifier, - enter_farm_result.reward_tokens.token_nonce, - &enter_farm_result.reward_tokens.amount, - ); + self.tx() + .to(&caller) + .single_esdt( + &enter_farm_result.reward_tokens.token_identifier, + enter_farm_result.reward_tokens.token_nonce, + &enter_farm_result.reward_tokens.amount, + ) + .transfer(); } (farm_tokens, enter_farm_result.reward_tokens).into() @@ -229,20 +231,24 @@ pub trait ProxyFarmModule: farm_proxy_token_attributes.farming_token_locked_nonce, exit_farm_result.initial_farming_tokens.amount, ); - self.send().direct_esdt( - &caller, - &lp_proxy_token_payment.token_identifier, - lp_proxy_token_payment.token_nonce, - &lp_proxy_token_payment.amount, - ); + self.tx() + .to(&caller) + .single_esdt( + &lp_proxy_token_payment.token_identifier, + lp_proxy_token_payment.token_nonce, + &lp_proxy_token_payment.amount, + ) + .transfer(); if exit_farm_result.reward_tokens.amount > 0 { - self.send().direct_esdt( - &caller, - &exit_farm_result.reward_tokens.token_identifier, - exit_farm_result.reward_tokens.token_nonce, - &exit_farm_result.reward_tokens.amount, - ); + self.tx() + .to(&caller) + .single_esdt( + &exit_farm_result.reward_tokens.token_identifier, + exit_farm_result.reward_tokens.token_nonce, + &exit_farm_result.reward_tokens.amount, + ) + .transfer(); } (lp_proxy_token_payment, exit_farm_result.reward_tokens).into() @@ -292,12 +298,14 @@ pub trait ProxyFarmModule: ); if claim_rewards_result.reward_tokens.amount > 0 { - self.send().direct_esdt( - &caller, - &claim_rewards_result.reward_tokens.token_identifier, - claim_rewards_result.reward_tokens.token_nonce, - &claim_rewards_result.reward_tokens.amount, - ); + self.tx() + .to(&caller) + .single_esdt( + &claim_rewards_result.reward_tokens.token_identifier, + claim_rewards_result.reward_tokens.token_nonce, + &claim_rewards_result.reward_tokens.amount, + ) + .transfer(); } (new_proxy_token_payment, claim_rewards_result.reward_tokens).into() diff --git a/locked-asset/token-unstake/src/cancel_unstake.rs b/locked-asset/token-unstake/src/cancel_unstake.rs index 0d6150ff4..84a3af84c 100644 --- a/locked-asset/token-unstake/src/cancel_unstake.rs +++ b/locked-asset/token-unstake/src/cancel_unstake.rs @@ -54,7 +54,7 @@ pub trait CancelUnstakeModule: entries_mapper.clear(); - self.send().direct_multi(&caller, &output_payments); + self.tx().to(&caller).payment(&output_payments).transfer(); let sc_address = self.energy_factory_address().get(); let _: IgnoreValue = self diff --git a/locked-asset/token-unstake/src/unbond_tokens.rs b/locked-asset/token-unstake/src/unbond_tokens.rs index 20aeb1843..1955a26cf 100644 --- a/locked-asset/token-unstake/src/unbond_tokens.rs +++ b/locked-asset/token-unstake/src/unbond_tokens.rs @@ -57,7 +57,7 @@ pub trait UnbondTokensModule: self.burn_penalty(token); } - self.send().direct_multi(&caller, &output_payments); + self.tx().to(&caller).payment(&output_payments).transfer(); let new_unlocked_tokens = self.unlocked_tokens_for_user(&caller).get(); self.emit_unlocked_tokens_event(&caller, new_unlocked_tokens); From e2b6ce73f3445cf4abe0a5982419cead2447e22a Mon Sep 17 00:00:00 2001 From: Mihai Calin Luca Date: Tue, 16 Apr 2024 16:09:05 +0200 Subject: [PATCH 15/55] reverted upgrade function back to no arguments + removed old proxies in router --- dex/pair/src/lib.rs | 23 +------------------ dex/router/src/enable_swap_by_user.rs | 33 ++++++++++++++------------- dex/router/src/factory.rs | 23 ++++++++++--------- dex/router/src/pair_proxy.rs | 27 +--------------------- 4 files changed, 31 insertions(+), 75 deletions(-) diff --git a/dex/pair/src/lib.rs b/dex/pair/src/lib.rs index 77c798cda..e67010d67 100644 --- a/dex/pair/src/lib.rs +++ b/dex/pair/src/lib.rs @@ -102,28 +102,7 @@ pub trait Pair: } #[upgrade] - fn upgrade( - &self, - first_token_id: TokenIdentifier, - second_token_id: TokenIdentifier, - router_address: ManagedAddress, - router_owner_address: ManagedAddress, - total_fee_percent: u64, - special_fee_percent: u64, - initial_liquidity_adder: ManagedAddress, - admins: MultiValueEncoded, - ) { - self.init( - first_token_id, - second_token_id, - router_address, - router_owner_address, - total_fee_percent, - special_fee_percent, - initial_liquidity_adder, - admins, - ); - } + fn upgrade(&self) {} #[endpoint(setLpTokenIdentifier)] fn set_lp_token_identifier(&self, token_identifier: TokenIdentifier) { diff --git a/dex/router/src/enable_swap_by_user.rs b/dex/router/src/enable_swap_by_user.rs index 200bdf43d..3672dedde 100644 --- a/dex/router/src/enable_swap_by_user.rs +++ b/dex/router/src/enable_swap_by_user.rs @@ -1,11 +1,10 @@ multiversx_sc::imports!(); multiversx_sc::derive_imports!(); -use pair::{config::ProxyTrait as _, pair_actions::views::ProxyTrait as _}; -use pausable::{ProxyTrait as _, State}; +use pausable::State; use simple_lock::locked_token::LockedTokenAttributes; -use crate::{config, DEFAULT_SPECIAL_FEE_PERCENT, USER_DEFINED_TOTAL_FEE_PERCENT}; +use crate::{config, pair_proxy, DEFAULT_SPECIAL_FEE_PERCENT, USER_DEFINED_TOTAL_FEE_PERCENT}; static PAIR_LP_TOKEN_ID_STORAGE_KEY: &[u8] = b"lpTokenIdentifier"; static PAIR_INITIAL_LIQ_ADDER_STORAGE_KEY: &[u8] = b"initial_liquidity_adder"; @@ -174,10 +173,13 @@ pub trait EnableSwapByUserModule: pair_address: ManagedAddress, lp_token_amount: BigUint, ) -> SafePriceResult { - let multi_value: MultiValue2, EsdtTokenPayment> = - self.user_pair_proxy(pair_address) - .get_tokens_for_given_position(lp_token_amount) - .execute_on_dest_context(); + let multi_value = self + .tx() + .to(&pair_address) + .typed(pair_proxy::PairProxy) + .get_tokens_for_given_position(lp_token_amount) + .returns(ReturnsResult) + .sync_call(); let (first_result, second_result) = multi_value.into_tuple(); let mut safe_price_result = SafePriceResult { @@ -227,17 +229,19 @@ pub trait EnableSwapByUserModule: } fn set_fee_percents(&self, pair_address: ManagedAddress) { - let _: IgnoreValue = self - .user_pair_proxy(pair_address) + self.tx() + .to(&pair_address) + .typed(pair_proxy::PairProxy) .set_fee_percent(USER_DEFINED_TOTAL_FEE_PERCENT, DEFAULT_SPECIAL_FEE_PERCENT) - .execute_on_dest_context(); + .sync_call(); } fn pair_resume(&self, pair_address: ManagedAddress) { - let _: IgnoreValue = self - .user_pair_proxy(pair_address) + self.tx() + .to(&pair_address) + .typed(pair_proxy::PairProxy) .resume() - .execute_on_dest_context(); + .sync_call(); } fn read_storage_from_pair( @@ -249,7 +253,4 @@ pub trait EnableSwapByUserModule: self.storage_raw() .read_from_address(pair_address, key_buffer) } - - #[proxy] - fn user_pair_proxy(&self, to: ManagedAddress) -> pair::Proxy; } diff --git a/dex/router/src/factory.rs b/dex/router/src/factory.rs index 72121fa2d..dbf1206ae 100644 --- a/dex/router/src/factory.rs +++ b/dex/router/src/factory.rs @@ -97,23 +97,24 @@ pub trait FactoryModule: config::ConfigModule { total_fee_percent: u64, special_fee_percent: u64, ) { + let mut args = ManagedArgBuffer::new(); + args.push_arg(first_token_id); + args.push_arg(second_token_id); + args.push_arg(&self.blockchain().get_sc_address()); + args.push_arg(owner); + args.push_arg(total_fee_percent); + args.push_arg(special_fee_percent); + args.push_arg(ManagedAddress::zero()); + args.push_multi_arg(&MultiValueEncoded::::new()); + self.tx() .to(pair_address) - .typed(pair_proxy::PairProxy) - .upgrade( - first_token_id, - second_token_id, - self.blockchain().get_sc_address(), - owner, - total_fee_percent, - special_fee_percent, - ManagedAddress::zero(), - MultiValueEncoded::new(), - ) + .raw_upgrade() .from_source(self.pair_template_address().get()) .code_metadata( CodeMetadata::UPGRADEABLE | CodeMetadata::READABLE | CodeMetadata::PAYABLE_BY_SC, ) + .arguments_raw(args) .upgrade_async_call_and_exit(); } diff --git a/dex/router/src/pair_proxy.rs b/dex/router/src/pair_proxy.rs index bb10a12aa..ac257139b 100644 --- a/dex/router/src/pair_proxy.rs +++ b/dex/router/src/pair_proxy.rs @@ -86,36 +86,11 @@ where To: TxTo, Gas: TxGas, { - pub fn upgrade< - Arg0: CodecInto>, - Arg1: CodecInto>, - Arg2: CodecInto>, - Arg3: CodecInto>, - Arg4: CodecInto, - Arg5: CodecInto, - Arg6: CodecInto>, - Arg7: CodecInto>>, - >( + pub fn upgrade( self, - first_token_id: Arg0, - second_token_id: Arg1, - router_address: Arg2, - router_owner_address: Arg3, - total_fee_percent: Arg4, - special_fee_percent: Arg5, - initial_liquidity_adder: Arg6, - admins: Arg7, ) -> TxProxyUpgrade { self.wrapped_tx .raw_upgrade() - .argument(&first_token_id) - .argument(&second_token_id) - .argument(&router_address) - .argument(&router_owner_address) - .argument(&total_fee_percent) - .argument(&special_fee_percent) - .argument(&initial_liquidity_adder) - .argument(&admins) .original_result() } } From 6c2a6083e797eca93ca711e7c1828247a91aa8cf Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Tue, 16 Apr 2024 23:04:29 +0300 Subject: [PATCH 16/55] farm staking proxy unit tests --- .../tests/staking_farm_with_lp.rs | 380 +++++++++++++++++- .../mod.rs | 189 ++++++++- .../mod.rs | 17 + 3 files changed, 583 insertions(+), 3 deletions(-) diff --git a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp.rs b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp.rs index d7ee78e8d..03d7ce263 100644 --- a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp.rs +++ b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp.rs @@ -7,13 +7,21 @@ pub mod staking_farm_with_lp_staking_contract_setup; multiversx_sc::imports!(); +use config::ConfigModule; use constants::*; use farm_staking_proxy::dual_yield_token::DualYieldTokenAttributes; use farm_staking_proxy::proxy_actions::unstake::ProxyUnstakeModule; +use farm_staking::{ + claim_only_boosted_staking_rewards::ClaimOnlyBoostedStakingRewardsModule, FarmStaking, +}; +use farm_with_locked_rewards::Farm; use multiversx_sc::codec::Empty; -use multiversx_sc_scenario::{managed_biguint, managed_token_id, rust_biguint, DebugApi}; +use multiversx_sc_scenario::{ + managed_address, managed_biguint, managed_token_id, rust_biguint, DebugApi, +}; +use simple_lock::locked_token::LockedTokenAttributes; use staking_farm_with_lp_staking_contract_interactions::*; #[test] @@ -625,3 +633,373 @@ fn test_farm_stake_proxy_merging_boosted_rewards() { ) }); } + +#[test] +fn original_caller_negative_test() { + let mut setup = FarmStakingSetup::new( + pair::contract_obj, + farm_with_locked_rewards::contract_obj, + energy_factory::contract_obj, + farm_staking::contract_obj, + farm_staking_proxy::contract_obj, + ); + + let user = setup.user_addr.clone(); + let random_user = setup.b_mock.create_user_account(&rust_biguint!(0u64)); + setup + .stake_farm_for_other_user(&user, &random_user, 1, USER_TOTAL_LP_TOKENS) + .assert_error(4, "Item not whitelisted"); + + setup + .stake_farm_for_other_user(&user, &user, 1, USER_TOTAL_LP_TOKENS) + .assert_ok(); + + setup + .b_mock + .set_block_nonce(BLOCK_NONCE_AFTER_PAIR_SETUP + 20); + setup.b_mock.set_block_epoch(20); + + setup + .claim_dual_yield_for_other_user(&user, &random_user, 1, USER_TOTAL_LP_TOKENS) + .assert_error(4, "Item not whitelisted"); + + setup + .claim_dual_yield_for_other_user(&user, &user, 1, USER_TOTAL_LP_TOKENS) + .assert_ok(); + + setup + .unstake_dual_yield_for_other_user(&user, &random_user, 2, USER_TOTAL_LP_TOKENS) + .assert_error(4, "Item not whitelisted"); + + setup + .unstake_dual_yield_for_other_user(&user, &user, 2, USER_TOTAL_LP_TOKENS) + .assert_ok(); +} + +#[test] +fn claim_for_others_positive_test() { + let mut setup = FarmStakingSetup::new( + pair::contract_obj, + farm_with_locked_rewards::contract_obj, + energy_factory::contract_obj, + farm_staking::contract_obj, + farm_staking_proxy::contract_obj, + ); + + // Boosted rewards setup + setup + .b_mock + .execute_tx( + &setup.owner_addr, + &setup.staking_farm_wrapper, + &rust_biguint!(0), + |sc| { + sc.set_boosted_yields_rewards_percentage(BOOSTED_YIELDS_PERCENTAGE); + }, + ) + .assert_ok(); + + setup.set_lp_farm_boosted_yields_rewards_percentage(BOOSTED_YIELDS_PERCENTAGE); + let farm_amount = 50_000_000u64; + let user_address = setup.user_addr.clone(); + let temp_user = setup + .b_mock + .create_user_account(&rust_biguint!(100_000_000)); + setup.exit_lp_farm(&user_address, 1, USER_TOTAL_LP_TOKENS); + setup.b_mock.set_esdt_balance( + &setup.user_addr, + LP_TOKEN_ID, + &rust_biguint!(farm_amount * 2), + ); + setup + .b_mock + .set_esdt_balance(&temp_user, LP_TOKEN_ID, &rust_biguint!(1)); + + setup.b_mock.set_block_epoch(2); + + setup.set_user_energy(&user_address, 1_000, 2, 1); + let farm_token_nonce = setup.enter_lp_farm(&user_address, farm_amount); + + // User enters Metastaking + let first_dual_yield_token_nonce = + setup.stake_farm_lp_proxy(farm_token_nonce, farm_amount, 1, farm_amount); + setup.b_mock.execute_in_managed_environment(|| { + setup.b_mock.check_nft_balance( + &setup.user_addr, + DUAL_YIELD_TOKEN_ID, + first_dual_yield_token_nonce, + &rust_biguint!(farm_amount), + Some(&DualYieldTokenAttributes:: { + lp_farm_token_nonce: farm_token_nonce, + lp_farm_token_amount: managed_biguint!(farm_amount), + staking_farm_token_nonce: 1, + staking_farm_token_amount: managed_biguint!(farm_amount), + }), + ) + }); + // User claims rewards to get his energy registered + setup + .claim_dual_yield_for_other_user(&user_address, &user_address, 1, farm_amount) + .assert_ok(); + + // advance blocks - 10 blocks - 10 * 5_000 = 50_000 total rewards + // 37_500 base farm, 12_500 boosted yields + let boosted_rewards = 12_500u64; + setup.b_mock.set_block_nonce(110); + + // farm staking boosted rewards + let farm_staking_boosted_rewards = 10u64; + + // random tx on end of week 1, to cummulate rewards + setup.b_mock.set_block_epoch(6); + setup.set_user_energy(&user_address, 1_000, 6, 1); + setup.set_user_energy(&temp_user, 1, 6, 1); + let temp_user_farm_token_nonce = setup.enter_lp_farm(&temp_user, 1); + setup.exit_lp_farm(&temp_user, temp_user_farm_token_nonce, 1); + + setup.stake_farm(9000000, 9000000); + setup.staking_farm_unstake(3, 9000000, 0, 9000000); + + // advance 1 week + setup.b_mock.set_block_epoch(10); + setup.set_user_energy(&user_address, 1_000, 10, 1); + + // User allows claiming of boosted rewards by other users + setup + .b_mock + .execute_tx( + &user_address, + &setup.lp_farm_wrapper, + &rust_biguint!(0), + |sc| { + sc.allow_external_claim_boosted_rewards(true); + }, + ) + .assert_ok(); + + setup + .b_mock + .execute_tx( + &user_address, + &setup.staking_farm_wrapper, + &rust_biguint!(0), + |sc| { + sc.allow_external_claim_boosted_rewards(true); + }, + ) + .assert_ok(); + + // Random user claims boosted rewards for the user + let user_initial_farm_staking_tokens_balance = 990000000; + setup + .b_mock + .check_esdt_balance(&temp_user, RIDE_TOKEN_ID, &rust_biguint!(0)); + setup.b_mock.check_esdt_balance( + &user_address, + RIDE_TOKEN_ID, + &rust_biguint!(user_initial_farm_staking_tokens_balance), + ); + setup + .b_mock + .check_nft_balance::>( + &temp_user, + LOCKED_TOKEN_ID, + 1, + &rust_biguint!(0), + None, + ); + setup + .b_mock + .check_nft_balance::>( + &user_address, + LOCKED_TOKEN_ID, + 1, + &rust_biguint!(0), + None, + ); + + setup + .b_mock + .execute_tx( + &temp_user, + &setup.lp_farm_wrapper, + &rust_biguint!(0), + |sc| { + sc.claim_boosted_rewards(OptionalValue::Some(managed_address!(&user_address))); + }, + ) + .assert_ok(); + + setup + .b_mock + .execute_tx( + &temp_user, + &setup.staking_farm_wrapper, + &rust_biguint!(0), + |sc| { + sc.claim_boosted_rewards(OptionalValue::Some(managed_address!(&user_address))); + }, + ) + .assert_ok(); + + setup + .b_mock + .check_esdt_balance(&temp_user, RIDE_TOKEN_ID, &rust_biguint!(0)); + setup.b_mock.check_esdt_balance( + &user_address, + RIDE_TOKEN_ID, + &rust_biguint!(user_initial_farm_staking_tokens_balance + farm_staking_boosted_rewards), + ); + setup + .b_mock + .check_nft_balance::>( + &temp_user, + LOCKED_TOKEN_ID, + 1, + &rust_biguint!(0), + None, + ); + setup + .b_mock + .check_nft_balance::>( + &user_address, + LOCKED_TOKEN_ID, + 1, + &rust_biguint!(boosted_rewards), + None, + ); +} + +#[test] +fn stake_farm_through_proxy_migration_test() { + let mut setup = FarmStakingSetup::new( + pair::contract_obj, + farm_with_locked_rewards::contract_obj, + energy_factory::contract_obj, + farm_staking::contract_obj, + farm_staking_proxy::contract_obj, + ); + + let user = setup.user_addr.clone(); + let mut user_total_staking_farm_position = 0; + let mut user_total_lp_farm_position = 0; + let farm_amount = 100_000_000; + + setup.check_user_total_staking_farm_position(&user, user_total_staking_farm_position); + setup.check_user_total_lp_farm_position(&user, user_total_lp_farm_position); + let dual_yield_token_nonce1 = setup.stake_farm_lp_proxy(1, farm_amount, 1, farm_amount); + let dual_yield_token_nonce2 = setup.stake_farm_lp_proxy(1, farm_amount, 2, farm_amount); + let dual_yield_token_nonce3 = setup.stake_farm_lp_proxy(1, farm_amount, 3, farm_amount); + + setup.b_mock.execute_in_managed_environment(|| { + setup.b_mock.check_nft_balance( + &user, + DUAL_YIELD_TOKEN_ID, + dual_yield_token_nonce1, + &rust_biguint!(farm_amount), + Some(&DualYieldTokenAttributes:: { + lp_farm_token_nonce: 1, + lp_farm_token_amount: managed_biguint!(farm_amount), + staking_farm_token_nonce: 1, + staking_farm_token_amount: managed_biguint!(farm_amount), + }), + ) + }); + + user_total_staking_farm_position += farm_amount * 3; + user_total_lp_farm_position += 1001000000; + setup.check_user_total_staking_farm_position(&user, user_total_staking_farm_position); + setup.check_user_total_lp_farm_position(&user, user_total_lp_farm_position); + + // Simulate the current position as old positions + setup.set_user_total_staking_farm_position(&user, 0); + setup.set_user_total_lp_farm_position(&user, 0); + setup.set_staking_farm_migration_nonce(4); + setup.set_lp_farm_migration_nonce(2); + + user_total_staking_farm_position = 0; + user_total_lp_farm_position = 0; + setup.check_user_total_staking_farm_position(&user, user_total_staking_farm_position); + setup.check_user_total_lp_farm_position(&user, user_total_lp_farm_position); + + let dual_yield_token_payments = vec![NonceAmountPair { + nonce: dual_yield_token_nonce1, + amount: farm_amount, + }]; + + // User enters with new farming tokens + 1 old position + let enter_dual_yield_token_nonce = + setup.stake_farm_lp_proxy_multiple(1, farm_amount, dual_yield_token_payments); + + // check user staking farm tokens + setup.b_mock.execute_in_managed_environment(|| { + setup.b_mock.check_nft_balance( + &user, + DUAL_YIELD_TOKEN_ID, + enter_dual_yield_token_nonce, + &rust_biguint!(farm_amount * 2), + Some(&DualYieldTokenAttributes:: { + lp_farm_token_nonce: 2, + lp_farm_token_amount: managed_biguint!(farm_amount * 2), + staking_farm_token_nonce: 4, + staking_farm_token_amount: managed_biguint!(farm_amount * 2), + }), + ) + }); + + // check proxy SC tokens + setup.b_mock.execute_in_managed_environment(|| { + setup.b_mock.check_nft_balance::( + setup.proxy_wrapper.address_ref(), + LP_FARM_TOKEN_ID, + 2, + &rust_biguint!(farm_amount * 2), + None, //current attributes + ) + }); + + user_total_staking_farm_position += farm_amount * 2; + user_total_lp_farm_position += farm_amount * 2; + setup.check_user_total_staking_farm_position(&user, user_total_staking_farm_position); + setup.check_user_total_lp_farm_position(&user, user_total_lp_farm_position); + + // User claim with 1 old position + let claim_dual_yield_token_nonce = + setup.claim_rewards_proxy(dual_yield_token_nonce2, farm_amount, 0, 0, farm_amount); + + // check user staking farm tokens + setup.b_mock.execute_in_managed_environment(|| { + setup.b_mock.check_nft_balance( + &user, + DUAL_YIELD_TOKEN_ID, + claim_dual_yield_token_nonce, + &rust_biguint!(farm_amount), + Some(&DualYieldTokenAttributes:: { + lp_farm_token_nonce: 3, + lp_farm_token_amount: managed_biguint!(farm_amount), + staking_farm_token_nonce: 5, + staking_farm_token_amount: managed_biguint!(farm_amount), + }), + ) + }); + + user_total_staking_farm_position += farm_amount; + user_total_lp_farm_position += farm_amount; + setup.check_user_total_staking_farm_position(&user, user_total_staking_farm_position); + setup.check_user_total_lp_farm_position(&user, user_total_lp_farm_position); + + // User exits with 1 half old position + setup.unstake_proxy( + dual_yield_token_nonce3, + farm_amount / 2, + 49950000, + 0, + 0, + 49950000, + 10, + ); + + // Total positions should remain the same + setup.check_user_total_staking_farm_position(&user, user_total_staking_farm_position); + setup.check_user_total_lp_farm_position(&user, user_total_lp_farm_position); +} diff --git a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_interactions/mod.rs b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_interactions/mod.rs index dca88dce5..703bfe2f7 100644 --- a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_interactions/mod.rs +++ b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_interactions/mod.rs @@ -1,5 +1,6 @@ #![allow(deprecated)] +use config::{ConfigModule, UserTotalFarmPosition}; use energy_factory::energy::EnergyModule; use energy_query::Energy; use farm_with_locked_rewards::Farm; @@ -9,6 +10,7 @@ use multiversx_sc::{ }; use multiversx_sc_scenario::{ managed_address, managed_biguint, managed_token_id, rust_biguint, + testing_framework::TxResult, whitebox_legacy::TxTokenTransfer, whitebox_legacy::{BlockchainStateWrapper, ContractObjWrapper}, DebugApi, @@ -111,8 +113,12 @@ where lp_farm_builder, USER_TOTAL_LP_TOKENS, ); - let staking_farm_wrapper = - setup_staking_farm(&owner_addr, &mut b_mock, staking_farm_builder); + let staking_farm_wrapper = setup_staking_farm( + &owner_addr, + energy_factory_wrapper.address_ref(), + &mut b_mock, + staking_farm_builder, + ); let proxy_wrapper = setup_proxy( &owner_addr, lp_farm_wrapper.address_ref(), @@ -518,6 +524,85 @@ where new_farm_token_nonce } + pub fn stake_farm_for_other_user( + &mut self, + caller: &Address, + original_caller: &Address, + lp_farm_token_nonce: u64, + lp_farm_token_stake_amount: u64, + ) -> TxResult { + self.b_mock.execute_esdt_transfer( + &caller, + &self.proxy_wrapper, + LP_FARM_TOKEN_ID, + lp_farm_token_nonce, + &rust_biguint!(lp_farm_token_stake_amount), + |sc| { + if caller == original_caller { + sc.stake_farm_tokens(OptionalValue::None); + } else { + sc.stake_farm_tokens(OptionalValue::Some(managed_address!(original_caller))); + } + }, + ) + } + + pub fn claim_dual_yield_for_other_user( + &mut self, + caller: &Address, + original_caller: &Address, + dual_yield_token_nonce: u64, + dual_yield_token_amount: u64, + ) -> TxResult { + self.b_mock.execute_esdt_transfer( + &caller, + &self.proxy_wrapper, + DUAL_YIELD_TOKEN_ID, + dual_yield_token_nonce, + &rust_biguint!(dual_yield_token_amount), + |sc| { + if caller == original_caller { + sc.claim_dual_yield_endpoint(OptionalValue::None); + } else { + sc.claim_dual_yield_endpoint(OptionalValue::Some(managed_address!( + original_caller + ))); + } + }, + ) + } + + pub fn unstake_dual_yield_for_other_user( + &mut self, + caller: &Address, + original_caller: &Address, + dual_yield_token_nonce: u64, + dual_yield_token_amount: u64, + ) -> TxResult { + self.b_mock.execute_esdt_transfer( + &caller, + &self.proxy_wrapper, + DUAL_YIELD_TOKEN_ID, + dual_yield_token_nonce, + &rust_biguint!(dual_yield_token_amount), + |sc| { + if caller == original_caller { + sc.unstake_farm_tokens( + managed_biguint!(1u64), + managed_biguint!(1u64), + OptionalValue::None, + ); + } else { + sc.unstake_farm_tokens( + managed_biguint!(1u64), + managed_biguint!(1u64), + OptionalValue::Some(managed_address!(original_caller)), + ); + } + }, + ) + } + pub fn set_user_energy( &mut self, user: &Address, @@ -556,4 +641,104 @@ where ) .assert_ok(); } + + pub fn set_staking_farm_migration_nonce(&mut self, migration_nonce: u64) { + self.b_mock + .execute_tx( + &self.owner_addr, + &self.staking_farm_wrapper, + &rust_biguint!(0), + |sc| { + sc.farm_position_migration_nonce().set(migration_nonce); + }, + ) + .assert_ok(); + } + + pub fn set_lp_farm_migration_nonce(&mut self, migration_nonce: u64) { + self.b_mock + .execute_tx( + &self.owner_addr, + &self.lp_farm_wrapper, + &rust_biguint!(0), + |sc| { + sc.farm_position_migration_nonce().set(migration_nonce); + }, + ) + .assert_ok(); + } + + pub fn set_user_total_staking_farm_position( + &mut self, + user_addr: &Address, + new_farm_position: u64, + ) { + self.b_mock + .execute_tx( + &self.owner_addr, + &self.staking_farm_wrapper, + &rust_biguint!(0), + |sc| { + let user_farm_position = UserTotalFarmPosition { + total_farm_position: managed_biguint!(new_farm_position), + ..Default::default() + }; + sc.user_total_farm_position(&managed_address!(user_addr)) + .set(user_farm_position); + }, + ) + .assert_ok(); + } + + pub fn set_user_total_lp_farm_position(&mut self, user_addr: &Address, new_farm_position: u64) { + self.b_mock + .execute_tx( + &self.owner_addr, + &self.lp_farm_wrapper, + &rust_biguint!(0), + |sc| { + let user_farm_position = UserTotalFarmPosition { + total_farm_position: managed_biguint!(new_farm_position), + ..Default::default() + }; + sc.user_total_farm_position(&managed_address!(user_addr)) + .set(user_farm_position); + }, + ) + .assert_ok(); + } + + pub fn check_user_total_staking_farm_position( + &mut self, + user_addr: &Address, + expected_amount: u64, + ) { + self.b_mock + .execute_query(&self.staking_farm_wrapper, |sc| { + let user_total_farm_position_mapper = + sc.user_total_farm_position(&managed_address!(user_addr)); + if expected_amount > 0 && !user_total_farm_position_mapper.is_empty() { + assert_eq!( + managed_biguint!(expected_amount), + user_total_farm_position_mapper.get().total_farm_position + ); + } + }) + .assert_ok(); + } + + pub fn check_user_total_lp_farm_position(&mut self, user_addr: &Address, expected_amount: u64) { + self.b_mock + .execute_query(&self.lp_farm_wrapper, |sc| { + let user_total_farm_position_mapper = + sc.user_total_farm_position(&managed_address!(user_addr)); + if expected_amount > 0 && !user_total_farm_position_mapper.is_empty() { + assert_eq!( + managed_biguint!(expected_amount), + user_total_farm_position_mapper.get().total_farm_position + ); + } + }) + .assert_ok(); + } } diff --git a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_setup/mod.rs b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_setup/mod.rs index 2c67d2714..81bb78dbd 100644 --- a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_setup/mod.rs +++ b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_setup/mod.rs @@ -1,5 +1,7 @@ #![allow(deprecated)] +use energy_query::EnergyQueryModule; +use farm_boosted_yields::boosted_yields_factors::BoostedYieldsFactorsModule; use multiversx_sc::storage::mappers::StorageTokenWrapper; use multiversx_sc::types::{Address, EsdtLocalRole, ManagedAddress, MultiValueEncoded}; use multiversx_sc_scenario::{ @@ -24,6 +26,7 @@ use crate::constants::*; pub fn setup_staking_farm( owner_addr: &Address, + energy_factory_address: &Address, b_mock: &mut BlockchainStateWrapper, builder: StakingContractObjBuilder, ) -> ContractObjWrapper, StakingContractObjBuilder> @@ -49,6 +52,8 @@ where MultiValueEncoded::new(), ); + sc.energy_factory_address() + .set(managed_address!(energy_factory_address)); sc.farm_token() .set_token_id(managed_token_id!(STAKING_FARM_TOKEN_ID)); @@ -62,6 +67,18 @@ where }) .assert_ok(); + b_mock + .execute_tx(owner_addr, &farm_staking_wrapper, &rust_zero, |sc| { + sc.set_boosted_yields_factors( + managed_biguint!(USER_REWARDS_BASE_CONST), + managed_biguint!(USER_REWARDS_ENERGY_CONST), + managed_biguint!(USER_REWARDS_FARM_CONST), + managed_biguint!(MIN_ENERGY_AMOUNT_FOR_BOOSTED_YIELDS), + managed_biguint!(MIN_FARM_AMOUNT_FOR_BOOSTED_YIELDS), + ); + }) + .assert_ok(); + b_mock.set_esdt_balance( farm_staking_wrapper.address_ref(), STAKING_REWARD_TOKEN_ID, From 4544a92ed4f135e987b370b9764785e371b0254b Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Tue, 16 Apr 2024 23:44:07 +0300 Subject: [PATCH 17/55] merge logic update orig owner in a separate fn for safer future impl (audit request) --- dex/farm-with-locked-rewards/src/lib.rs | 17 ++++++++++------- dex/farm/src/lib.rs | 17 ++++++++++------- farm-staking/farm-staking/src/lib.rs | 16 ++++++++++------ 3 files changed, 30 insertions(+), 20 deletions(-) diff --git a/dex/farm-with-locked-rewards/src/lib.rs b/dex/farm-with-locked-rewards/src/lib.rs index 6b5b334a2..a8abdade2 100644 --- a/dex/farm-with-locked-rewards/src/lib.rs +++ b/dex/farm-with-locked-rewards/src/lib.rs @@ -199,13 +199,7 @@ pub trait Farm: self.migrate_old_farm_positions(&orig_caller); let boosted_rewards = self.claim_only_boosted_payment(&orig_caller); - let mut output_attributes = self.merge_and_return_attributes::>(); - output_attributes.original_owner = orig_caller.clone(); - - let new_token_amount = output_attributes.get_total_supply(); - let merged_farm_token = self - .farm_token() - .nft_create(new_token_amount, &output_attributes); + let merged_farm_token = self.merge_and_update_farm_tokens(orig_caller.clone()); self.send_payment_non_zero(&caller, &merged_farm_token); let locked_rewards_payment = self.send_to_lock_contract_non_zero( @@ -218,6 +212,15 @@ pub trait Farm: (merged_farm_token, locked_rewards_payment).into() } + fn merge_and_update_farm_tokens(&self, orig_caller: ManagedAddress) -> EsdtTokenPayment { + let mut output_attributes = self.merge_and_return_attributes::>(); + output_attributes.original_owner = orig_caller; + + let new_token_amount = output_attributes.get_total_supply(); + self.farm_token() + .nft_create(new_token_amount, &output_attributes) + } + #[endpoint(claimBoostedRewards)] fn claim_boosted_rewards( &self, diff --git a/dex/farm/src/lib.rs b/dex/farm/src/lib.rs index 97163efb0..f7d69572b 100644 --- a/dex/farm/src/lib.rs +++ b/dex/farm/src/lib.rs @@ -196,13 +196,7 @@ pub trait Farm: let boosted_rewards_payment = EsdtTokenPayment::new(self.reward_token_id().get(), 0, boosted_rewards); - let mut output_attributes = self.merge_and_return_attributes::>(); - output_attributes.original_owner = orig_caller; - - let new_token_amount = output_attributes.get_total_supply(); - let merged_farm_token = self - .farm_token() - .nft_create(new_token_amount, &output_attributes); + let merged_farm_token = self.merge_and_update_farm_tokens(orig_caller); self.send_payment_non_zero(&caller, &merged_farm_token); self.send_payment_non_zero(&caller, &boosted_rewards_payment); @@ -210,6 +204,15 @@ pub trait Farm: (merged_farm_token, boosted_rewards_payment).into() } + fn merge_and_update_farm_tokens(&self, orig_caller: ManagedAddress) -> EsdtTokenPayment { + let mut output_attributes = self.merge_and_return_attributes::>(); + output_attributes.original_owner = orig_caller; + + let new_token_amount = output_attributes.get_total_supply(); + self.farm_token() + .nft_create(new_token_amount, &output_attributes) + } + #[endpoint(claimBoostedRewards)] fn claim_boosted_rewards( &self, diff --git a/farm-staking/farm-staking/src/lib.rs b/farm-staking/farm-staking/src/lib.rs index 60e398256..ddc12f53b 100644 --- a/farm-staking/farm-staking/src/lib.rs +++ b/farm-staking/farm-staking/src/lib.rs @@ -117,19 +117,23 @@ pub trait FarmStaking: let boosted_rewards_payment = EsdtTokenPayment::new(self.reward_token_id().get(), 0, boosted_rewards); - let mut output_attributes = self.merge_farm_tokens::>(); - output_attributes.original_owner = caller.clone(); + let merged_farm_token = self.merge_and_update_farm_tokens(caller.clone()); - let new_token_amount = output_attributes.get_total_supply(); - let merged_farm_token = self - .farm_token() - .nft_create(new_token_amount, &output_attributes); self.send_payment_non_zero(&caller, &merged_farm_token); self.send_payment_non_zero(&caller, &boosted_rewards_payment); (merged_farm_token, boosted_rewards_payment).into() } + fn merge_and_update_farm_tokens(&self, orig_caller: ManagedAddress) -> EsdtTokenPayment { + let mut output_attributes = self.merge_farm_tokens::>(); + output_attributes.original_owner = orig_caller; + + let new_token_amount = output_attributes.get_total_supply(); + self.farm_token() + .nft_create(new_token_amount, &output_attributes) + } + fn merge_farm_tokens>(&self) -> FC::AttributesType { let payments = self.get_non_empty_payments(); let token_mapper = self.farm_token(); From c519ccaebce970056cdfad461cae28a31c94b6e4 Mon Sep 17 00:00:00 2001 From: Andrei Marinica Date: Wed, 17 Apr 2024 09:28:55 +0300 Subject: [PATCH 18/55] fixed router upgrade_pair --- dex/router/src/contract.rs | 19 +----------------- dex/router/src/factory.rs | 25 +++--------------------- dex/router/tests/router_test.rs | 8 +------- dex/scenarios/upgrade_contract.scen.json | 5 +---- 4 files changed, 6 insertions(+), 51 deletions(-) diff --git a/dex/router/src/contract.rs b/dex/router/src/contract.rs index a1bc634b8..eefd868af 100644 --- a/dex/router/src/contract.rs +++ b/dex/router/src/contract.rs @@ -160,9 +160,6 @@ pub trait Router: &self, first_token_id: TokenIdentifier, second_token_id: TokenIdentifier, - initial_liquidity_adder: ManagedAddress, - total_fee_percent_requested: u64, - special_fee_percent_requested: u64, ) { require!(self.is_active(), "Not active"); @@ -178,21 +175,7 @@ pub trait Router: let pair_address = self.get_pair(first_token_id.clone(), second_token_id.clone()); require!(!pair_address.is_zero(), "Pair does not exists"); - require!( - total_fee_percent_requested >= special_fee_percent_requested - && total_fee_percent_requested < MAX_TOTAL_FEE_PERCENT, - "Bad percents" - ); - - self.upgrade_pair( - pair_address, - &first_token_id, - &second_token_id, - &self.owner().get(), - &initial_liquidity_adder, - total_fee_percent_requested, - special_fee_percent_requested, - ); + self.upgrade_pair(pair_address); } #[payable("EGLD")] diff --git a/dex/router/src/factory.rs b/dex/router/src/factory.rs index dbf1206ae..95c765161 100644 --- a/dex/router/src/factory.rs +++ b/dex/router/src/factory.rs @@ -87,34 +87,15 @@ pub trait FactoryModule: config::ConfigModule { new_address } - fn upgrade_pair( - &self, - pair_address: ManagedAddress, - first_token_id: &TokenIdentifier, - second_token_id: &TokenIdentifier, - owner: &ManagedAddress, - _initial_liquidity_adder: &ManagedAddress, - total_fee_percent: u64, - special_fee_percent: u64, - ) { - let mut args = ManagedArgBuffer::new(); - args.push_arg(first_token_id); - args.push_arg(second_token_id); - args.push_arg(&self.blockchain().get_sc_address()); - args.push_arg(owner); - args.push_arg(total_fee_percent); - args.push_arg(special_fee_percent); - args.push_arg(ManagedAddress::zero()); - args.push_multi_arg(&MultiValueEncoded::::new()); - + fn upgrade_pair(&self, pair_address: ManagedAddress) { self.tx() .to(pair_address) - .raw_upgrade() + .typed(pair_proxy::PairProxy) + .upgrade() .from_source(self.pair_template_address().get()) .code_metadata( CodeMetadata::UPGRADEABLE | CodeMetadata::READABLE | CodeMetadata::PAYABLE_BY_SC, ) - .arguments_raw(args) .upgrade_async_call_and_exit(); } diff --git a/dex/router/tests/router_test.rs b/dex/router/tests/router_test.rs index 54c73c838..e11efa15e 100644 --- a/dex/router/tests/router_test.rs +++ b/dex/router/tests/router_test.rs @@ -113,13 +113,7 @@ fn test_router_upgrade_pair() { .execute_tx(&owner, &router_wrapper, &rust_zero, |sc| { let first_token_id = managed_token_id!(CUSTOM_TOKEN_ID); let second_token_id = managed_token_id!(USDC_TOKEN_ID); - sc.upgrade_pair_endpoint( - first_token_id, - second_token_id, - managed_address!(&user), - 300, - 50, - ); + sc.upgrade_pair_endpoint(first_token_id, second_token_id); }) .assert_ok(); diff --git a/dex/scenarios/upgrade_contract.scen.json b/dex/scenarios/upgrade_contract.scen.json index cdadc752b..9a9c88fe2 100644 --- a/dex/scenarios/upgrade_contract.scen.json +++ b/dex/scenarios/upgrade_contract.scen.json @@ -14,10 +14,7 @@ "function": "upgradePair", "arguments": [ "str:ALC-abcdef", - "str:WEGLD-abcdef", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "300", - "100" + "str:WEGLD-abcdef" ], "gasLimit": "1,000,000,000", "gasPrice": "0" From 2061fae520b4e1d16ef39002640d67e370957713 Mon Sep 17 00:00:00 2001 From: Andrei Marinica Date: Wed, 17 Apr 2024 09:40:59 +0300 Subject: [PATCH 19/55] new pair proxy cleanup --- common/modules/permissions_module/src/permissions_module.rs | 2 +- dex/pair/sc-config.toml | 4 ++++ dex/router/src/pair_proxy.rs | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/common/modules/permissions_module/src/permissions_module.rs b/common/modules/permissions_module/src/permissions_module.rs index 38eab7fdd..5853ca0da 100644 --- a/common/modules/permissions_module/src/permissions_module.rs +++ b/common/modules/permissions_module/src/permissions_module.rs @@ -1,6 +1,6 @@ #![no_std] -pub mod permissions; +mod permissions; use common_errors::ERROR_PERMISSION_DENIED; diff --git a/dex/pair/sc-config.toml b/dex/pair/sc-config.toml index 0d0c13baa..812f93140 100644 --- a/dex/pair/sc-config.toml +++ b/dex/pair/sc-config.toml @@ -18,3 +18,7 @@ add-labels = ["safe-price-view"] [[proxy]] path = "../router/src/pair_proxy.rs" + +[[proxy.path-rename]] +from = "permissions::Permissions" +to = "Permissions" diff --git a/dex/router/src/pair_proxy.rs b/dex/router/src/pair_proxy.rs index ac257139b..0a483e199 100644 --- a/dex/router/src/pair_proxy.rs +++ b/dex/router/src/pair_proxy.rs @@ -649,7 +649,7 @@ where >( self, address: Arg0, - ) -> TxProxyCall { + ) -> TxProxyCall { self.wrapped_tx .raw_call("getPermissions") .argument(&address) From aa1c7688581d3633d3a7278bd36a86db0b43f840 Mon Sep 17 00:00:00 2001 From: Mihai Calin Luca Date: Wed, 17 Apr 2024 14:34:38 +0200 Subject: [PATCH 20/55] energy-factory --- .../src/energy_factory_lock_proxy.rs | 89 +++++++++++++++++++ common/modules/locking_module/src/lib.rs | 1 + .../src/lock_with_energy_module.rs | 20 +++-- .../locking_module/src/locking_module.rs | 24 +++-- dex/pair/src/energy_factory_lock_proxy.rs | 65 ++++++++++++++ dex/pair/src/lib.rs | 1 + dex/pair/src/locking_wrapper.rs | 25 +++--- locked-asset/energy-factory/src/lib.rs | 1 + .../energy-factory/src/token_unstake_proxy.rs | 57 ++++++++++++ locked-asset/energy-factory/src/unstake.rs | 43 +++------ locked-asset/energy-factory/wasm/src/lib.rs | 5 +- .../src/energy_factory_migration_proxy.rs | 55 ++++++++++++ locked-asset/factory/src/lib.rs | 1 + locked-asset/factory/src/migration.rs | 16 ++-- 14 files changed, 330 insertions(+), 73 deletions(-) create mode 100644 common/modules/locking_module/src/energy_factory_lock_proxy.rs create mode 100644 dex/pair/src/energy_factory_lock_proxy.rs create mode 100644 locked-asset/energy-factory/src/token_unstake_proxy.rs create mode 100644 locked-asset/factory/src/energy_factory_migration_proxy.rs diff --git a/common/modules/locking_module/src/energy_factory_lock_proxy.rs b/common/modules/locking_module/src/energy_factory_lock_proxy.rs new file mode 100644 index 000000000..8cbe4403f --- /dev/null +++ b/common/modules/locking_module/src/energy_factory_lock_proxy.rs @@ -0,0 +1,89 @@ +use multiversx_sc::proxy_imports::*; + +pub struct SimpleLockEnergyProxy; + +impl TxProxyTrait for SimpleLockEnergyProxy +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + type TxProxyMethods = SimpleLockEnergyProxyMethods; + + fn proxy_methods(self, tx: Tx) -> Self::TxProxyMethods { + SimpleLockEnergyProxyMethods { wrapped_tx: tx } + } +} + +pub struct SimpleLockEnergyProxyMethods +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + wrapped_tx: Tx, +} + +#[rustfmt::skip] +impl SimpleLockEnergyProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + /// Locks a whitelisted token until `unlock_epoch` and receive meta ESDT LOCKED tokens + /// on a 1:1 ratio. Accepted input tokens: + /// - base asset token + /// - old factory token -> extends all periods to the provided option + /// - previously locked token -> extends period to the provided option + /// + /// Arguments: + /// - lock_epochs - Number of epochs for which the tokens are locked for. + /// Caller may only choose from the available options, + /// which can be seen by querying getLockOptions + /// - opt_destination - OPTIONAL: destination address for the LOCKED tokens. Default is caller. + /// + /// Output payment: LOCKED tokens + pub fn lock_tokens_endpoint< + Arg0: CodecInto, + Arg1: CodecInto>>, + >( + self, + lock_epochs: Arg0, + opt_destination: Arg1, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("lockTokens") + .argument(&lock_epochs) + .argument(&opt_destination) + .original_result() + } + + pub fn lock_virtual< + Arg0: CodecInto>, + Arg1: CodecInto>, + Arg2: CodecInto, + Arg3: CodecInto>, + Arg4: CodecInto>, + >( + self, + token_id: Arg0, + amount: Arg1, + lock_epochs: Arg2, + dest_address: Arg3, + energy_address: Arg4, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("lockVirtual") + .argument(&token_id) + .argument(&amount) + .argument(&lock_epochs) + .argument(&dest_address) + .argument(&energy_address) + .original_result() + } +} diff --git a/common/modules/locking_module/src/lib.rs b/common/modules/locking_module/src/lib.rs index c567533d2..a7eb80fc3 100644 --- a/common/modules/locking_module/src/lib.rs +++ b/common/modules/locking_module/src/lib.rs @@ -1,4 +1,5 @@ #![no_std] +mod energy_factory_lock_proxy; pub mod lock_with_energy_module; pub mod locking_module; diff --git a/common/modules/locking_module/src/lock_with_energy_module.rs b/common/modules/locking_module/src/lock_with_energy_module.rs index 7569c4f61..522ec8e13 100644 --- a/common/modules/locking_module/src/lock_with_energy_module.rs +++ b/common/modules/locking_module/src/lock_with_energy_module.rs @@ -1,6 +1,6 @@ -multiversx_sc::imports!(); +use crate::energy_factory_lock_proxy::{self, SimpleLockEnergyProxyMethods}; -use energy_factory::virtual_lock::ProxyTrait as _; +multiversx_sc::imports!(); #[multiversx_sc::module] pub trait LockWithEnergyModule { @@ -29,21 +29,23 @@ pub trait LockWithEnergyModule { energy_address: ManagedAddress, ) -> EsdtTokenPayment { let lock_epochs = self.lock_epochs().get(); - let mut proxy_instance = self.get_locking_sc_proxy_instance(); + let proxy_instance = self.get_locking_sc_proxy_instance(); proxy_instance .lock_virtual(token_id, amount, lock_epochs, dest_address, energy_address) - .execute_on_dest_context() + .returns(ReturnsResult) + .sync_call() } - fn get_locking_sc_proxy_instance(&self) -> energy_factory::ProxyTo { + fn get_locking_sc_proxy_instance( + &self, + ) -> SimpleLockEnergyProxyMethods, (), ManagedAddress, ()> { let locking_sc_address = self.locking_sc_address().get(); - self.locking_sc_proxy_obj(locking_sc_address) + self.tx() + .to(locking_sc_address) + .typed(energy_factory_lock_proxy::SimpleLockEnergyProxy) } - #[proxy] - fn locking_sc_proxy_obj(&self, sc_address: ManagedAddress) -> energy_factory::Proxy; - #[view(getLockingScAddress)] #[storage_mapper("lockingScAddress")] fn locking_sc_address(&self) -> SingleValueMapper; diff --git a/common/modules/locking_module/src/locking_module.rs b/common/modules/locking_module/src/locking_module.rs index a484ea500..654b7bcc9 100644 --- a/common/modules/locking_module/src/locking_module.rs +++ b/common/modules/locking_module/src/locking_module.rs @@ -1,3 +1,5 @@ +use crate::energy_factory_lock_proxy::{self, SimpleLockEnergyProxyMethods}; + multiversx_sc::imports!(); #[multiversx_sc::module] @@ -45,22 +47,26 @@ pub trait LockingModule { amount: BigUint, ) -> EgldOrEsdtTokenPayment { let unlock_epoch = self.unlock_epoch().get(); - let mut proxy_instance = self.get_locking_sc_proxy_instance(); + let proxy_instance = self.get_locking_sc_proxy_instance(); - proxy_instance + let tokens = proxy_instance .lock_tokens_endpoint(unlock_epoch, opt_dest) - .with_egld_or_single_esdt_transfer((token_id, 0, amount)) - .execute_on_dest_context() + .egld_or_single_esdt(&token_id, 0, &amount) + .returns(ReturnsResult) + .sync_call(); + + EgldOrEsdtTokenPayment::from(tokens) } - fn get_locking_sc_proxy_instance(&self) -> simple_lock::ProxyTo { + fn get_locking_sc_proxy_instance( + &self, + ) -> SimpleLockEnergyProxyMethods, (), ManagedAddress, ()> { let locking_sc_address = self.locking_sc_address().get(); - self.locking_sc_proxy_obj(locking_sc_address) + self.tx() + .to(locking_sc_address) + .typed(energy_factory_lock_proxy::SimpleLockEnergyProxy) } - #[proxy] - fn locking_sc_proxy_obj(&self, sc_address: ManagedAddress) -> simple_lock::Proxy; - #[view(getLockingScAddress)] #[storage_mapper("lockingScAddress")] fn locking_sc_address(&self) -> SingleValueMapper; diff --git a/dex/pair/src/energy_factory_lock_proxy.rs b/dex/pair/src/energy_factory_lock_proxy.rs new file mode 100644 index 000000000..58d2cf76e --- /dev/null +++ b/dex/pair/src/energy_factory_lock_proxy.rs @@ -0,0 +1,65 @@ +use multiversx_sc::proxy_imports::*; + +pub struct SimpleLockEnergyProxy; + +impl TxProxyTrait for SimpleLockEnergyProxy +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + type TxProxyMethods = SimpleLockEnergyProxyMethods; + + fn proxy_methods(self, tx: Tx) -> Self::TxProxyMethods { + SimpleLockEnergyProxyMethods { wrapped_tx: tx } + } +} + +pub struct SimpleLockEnergyProxyMethods +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + wrapped_tx: Tx, +} + +#[rustfmt::skip] +impl SimpleLockEnergyProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + /// Locks a whitelisted token until `unlock_epoch` and receive meta ESDT LOCKED tokens + /// on a 1:1 ratio. Accepted input tokens: + /// - base asset token + /// - old factory token -> extends all periods to the provided option + /// - previously locked token -> extends period to the provided option + /// + /// Arguments: + /// - lock_epochs - Number of epochs for which the tokens are locked for. + /// Caller may only choose from the available options, + /// which can be seen by querying getLockOptions + /// - opt_destination - OPTIONAL: destination address for the LOCKED tokens. Default is caller. + /// + /// Output payment: LOCKED tokens + pub fn lock_tokens_endpoint< + Arg0: CodecInto, + Arg1: CodecInto>>, + >( + self, + lock_epochs: Arg0, + opt_destination: Arg1, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("lockTokens") + .argument(&lock_epochs) + .argument(&opt_destination) + .original_result() + } +} diff --git a/dex/pair/src/lib.rs b/dex/pair/src/lib.rs index e67010d67..85cd48f10 100644 --- a/dex/pair/src/lib.rs +++ b/dex/pair/src/lib.rs @@ -6,6 +6,7 @@ multiversx_sc::derive_imports!(); mod amm; pub mod config; mod contexts; +mod energy_factory_lock_proxy; pub mod errors; mod events; pub mod fee; diff --git a/dex/pair/src/locking_wrapper.rs b/dex/pair/src/locking_wrapper.rs index 88d056044..c21207b66 100644 --- a/dex/pair/src/locking_wrapper.rs +++ b/dex/pair/src/locking_wrapper.rs @@ -1,3 +1,5 @@ +use crate::energy_factory_lock_proxy::{self, SimpleLockEnergyProxyMethods}; + multiversx_sc::imports!(); #[multiversx_sc::module] @@ -56,15 +58,13 @@ pub trait LockingWrapperModule: amount: BigUint, ) -> EsdtTokenPayment { let unlock_epoch = self.unlock_epoch().get(); - let mut proxy_instance = self.get_locking_sc_proxy_instance(); + let proxy_instance = self.get_locking_sc_proxy_instance(); - let payment: EgldOrEsdtTokenPayment = proxy_instance + proxy_instance .lock_tokens_endpoint(unlock_epoch, opt_dest) - .with_esdt_transfer((token_id, 0, amount)) - .execute_on_dest_context(); - let (token_id, token_nonce, amount) = payment.into_tuple(); - - EsdtTokenPayment::new(token_id.unwrap_esdt(), token_nonce, amount) + .single_esdt(&token_id, 0, &amount) + .returns(ReturnsResult) + .sync_call() } fn should_generate_locked_asset(&self) -> bool { @@ -74,14 +74,15 @@ pub trait LockingWrapperModule: current_epoch < locking_deadline_epoch } - fn get_locking_sc_proxy_instance(&self) -> simple_lock::ProxyTo { + fn get_locking_sc_proxy_instance( + &self, + ) -> SimpleLockEnergyProxyMethods, (), ManagedAddress, ()> { let locking_sc_address = self.locking_sc_address().get(); - self.locking_sc_proxy_obj(locking_sc_address) + self.tx() + .to(locking_sc_address) + .typed(energy_factory_lock_proxy::SimpleLockEnergyProxy) } - #[proxy] - fn locking_sc_proxy_obj(&self, sc_address: ManagedAddress) -> simple_lock::Proxy; - #[view(getLockingScAddress)] #[storage_mapper("lockingScAddress")] fn locking_sc_address(&self) -> SingleValueMapper; diff --git a/locked-asset/energy-factory/src/lib.rs b/locked-asset/energy-factory/src/lib.rs index 4b67d402b..152455697 100644 --- a/locked-asset/energy-factory/src/lib.rs +++ b/locked-asset/energy-factory/src/lib.rs @@ -12,6 +12,7 @@ pub mod locked_token_transfer; pub mod migration; pub mod penalty; pub mod token_merging; +mod token_unstake_proxy; pub mod token_whitelist; pub mod unlock_with_penalty; pub mod unstake; diff --git a/locked-asset/energy-factory/src/token_unstake_proxy.rs b/locked-asset/energy-factory/src/token_unstake_proxy.rs new file mode 100644 index 000000000..9046e156c --- /dev/null +++ b/locked-asset/energy-factory/src/token_unstake_proxy.rs @@ -0,0 +1,57 @@ +use multiversx_sc::proxy_imports::*; + +pub struct TokenUnstakeProxy; + +impl TxProxyTrait for TokenUnstakeProxy +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + type TxProxyMethods = TokenUnstakeProxyMethods; + + fn proxy_methods(self, tx: Tx) -> Self::TxProxyMethods { + TokenUnstakeProxyMethods { wrapped_tx: tx } + } +} + +pub struct TokenUnstakeProxyMethods +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + wrapped_tx: Tx, +} + +#[rustfmt::skip] +impl TokenUnstakeProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + pub fn deposit_user_tokens< + Arg0: CodecInto>, + >( + self, + user: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("depositUserTokens") + .argument(&user) + .original_result() + } + + pub fn deposit_fees( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("depositFees") + .original_result() + } +} diff --git a/locked-asset/energy-factory/src/unstake.rs b/locked-asset/energy-factory/src/unstake.rs index 9d9df5f8d..8c51c5eec 100644 --- a/locked-asset/energy-factory/src/unstake.rs +++ b/locked-asset/energy-factory/src/unstake.rs @@ -1,21 +1,6 @@ multiversx_sc::imports!(); -use crate::energy::Energy; - -mod token_unstake_proxy { - multiversx_sc::imports!(); - - #[multiversx_sc::proxy] - pub trait TokenUnstakeProxy { - #[payable("*")] - #[endpoint(depositUserTokens)] - fn deposit_user_tokens(&self, user: ManagedAddress); - - #[payable("*")] - #[endpoint(depositFees)] - fn deposit_fees(&self); - } -} +use crate::{energy::Energy, token_unstake_proxy}; #[multiversx_sc::module] pub trait UnstakeModule: @@ -62,20 +47,22 @@ pub trait UnstakeModule: payments.push(locked_tokens); payments.push(unlocked_tokens); - let _: IgnoreValue = self - .token_unstake_sc_proxy_obj(locking_sc_address) - .deposit_user_tokens(caller) - .with_multi_token_transfer(payments) - .execute_on_dest_context(); + self.tx() + .to(&locking_sc_address) + .typed(token_unstake_proxy::TokenUnstakeProxy) + .deposit_user_tokens(&caller) + .payment(payments) + .sync_call(); } fn send_fees_to_unstake_sc(&self, fees: EsdtTokenPayment) { let locking_sc_address = self.token_unstake_sc_address().get(); - let _: IgnoreValue = self - .token_unstake_sc_proxy_obj(locking_sc_address) + self.tx() + .to(&locking_sc_address) + .typed(token_unstake_proxy::TokenUnstakeProxy) .deposit_fees() - .with_esdt_transfer(fees) - .execute_on_dest_context(); + .payment(fees) + .sync_call(); } fn require_caller_unstake_sc(&self) { @@ -87,12 +74,6 @@ pub trait UnstakeModule: ); } - #[proxy] - fn token_unstake_sc_proxy_obj( - &self, - sc_address: ManagedAddress, - ) -> token_unstake_proxy::Proxy; - #[view(getTokenUnstakeScAddress)] #[storage_mapper("tokenUnstakeScAddress")] fn token_unstake_sc_address(&self) -> SingleValueMapper; diff --git a/locked-asset/energy-factory/wasm/src/lib.rs b/locked-asset/energy-factory/wasm/src/lib.rs index 7393a9e97..fcae7f6f1 100644 --- a/locked-asset/energy-factory/wasm/src/lib.rs +++ b/locked-asset/energy-factory/wasm/src/lib.rs @@ -5,9 +5,10 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 34 +// Upgrade: 1 +// Endpoints: 33 // Async Callback: 1 -// Total number of exported functions: 36 +// Total number of exported functions: 35 #![no_std] #![allow(internal_features)] diff --git a/locked-asset/factory/src/energy_factory_migration_proxy.rs b/locked-asset/factory/src/energy_factory_migration_proxy.rs new file mode 100644 index 000000000..dde858d57 --- /dev/null +++ b/locked-asset/factory/src/energy_factory_migration_proxy.rs @@ -0,0 +1,55 @@ +use multiversx_sc::proxy_imports::*; + +pub struct SimpleLockEnergyProxy; + +impl TxProxyTrait for SimpleLockEnergyProxy +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + type TxProxyMethods = SimpleLockEnergyProxyMethods; + + fn proxy_methods(self, tx: Tx) -> Self::TxProxyMethods { + SimpleLockEnergyProxyMethods { wrapped_tx: tx } + } +} + +pub struct SimpleLockEnergyProxyMethods +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + wrapped_tx: Tx, +} + +#[rustfmt::skip] +impl SimpleLockEnergyProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + pub fn update_energy_after_old_token_unlock< + Arg0: CodecInto>, + Arg1: CodecInto>, + Arg2: CodecInto>, + >( + self, + original_caller: Arg0, + initial_epoch_amount_pairs: Arg1, + final_epoch_amount_pairs: Arg2, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("updateEnergyAfterOldTokenUnlock") + .argument(&original_caller) + .argument(&initial_epoch_amount_pairs) + .argument(&final_epoch_amount_pairs) + .original_result() + } +} diff --git a/locked-asset/factory/src/lib.rs b/locked-asset/factory/src/lib.rs index b826bb14b..8cbf8b36c 100644 --- a/locked-asset/factory/src/lib.rs +++ b/locked-asset/factory/src/lib.rs @@ -3,6 +3,7 @@ mod attr_ex_helper; mod cache; +mod energy_factory_migration_proxy; mod events; pub mod locked_asset; pub mod locked_asset_token_merge; diff --git a/locked-asset/factory/src/migration.rs b/locked-asset/factory/src/migration.rs index 590af2e3a..1c6141c21 100644 --- a/locked-asset/factory/src/migration.rs +++ b/locked-asset/factory/src/migration.rs @@ -1,7 +1,7 @@ multiversx_sc::imports!(); +use crate::energy_factory_migration_proxy; use common_structs::UnlockEpochAmountPairs; -use energy_factory::migration::ProxyTrait as _; #[multiversx_sc::module] pub trait LockedTokenMigrationModule: @@ -54,22 +54,18 @@ pub trait LockedTokenMigrationModule: final_epoch_amount_pairs: UnlockEpochAmountPairs, ) { let new_factory_address = self.new_factory_address().get(); - let _: IgnoreValue = self - .new_factory_proxy_builder(new_factory_address) + + self.tx() + .to(new_factory_address) + .typed(energy_factory_migration_proxy::SimpleLockEnergyProxy) .update_energy_after_old_token_unlock( caller, initial_epoch_amount_pairs, final_epoch_amount_pairs, ) - .execute_on_dest_context(); + .sync_call(); } - #[proxy] - fn new_factory_proxy_builder( - &self, - sc_address: ManagedAddress, - ) -> energy_factory::Proxy; - #[storage_mapper("newFactoryAddress")] fn new_factory_address(&self) -> SingleValueMapper; } From 5bc682035d26ec0d87cf7b072876193b57606e54 Mon Sep 17 00:00:00 2001 From: Mihai Calin Luca Date: Wed, 17 Apr 2024 15:24:45 +0200 Subject: [PATCH 21/55] more energy-factory proxy migration --- .../common-modules/energy-query/src/lib.rs | 3 - .../energy_factory_token_transfer_proxy.rs | 53 +++++++++++++++ .../lkmex-transfer/src/energy_transfer.rs | 9 +-- locked-asset/lkmex-transfer/src/lib.rs | 1 + .../energy_factory_token_transfer_proxy.rs | 68 +++++++++++++++++++ locked-asset/proxy_dex/src/energy_update.rs | 19 ++++-- locked-asset/proxy_dex/src/lib.rs | 1 + .../token-unstake/src/cancel_unstake.rs | 10 +-- .../src/energy_factory_unstake_proxy.rs | 53 +++++++++++++++ locked-asset/token-unstake/src/lib.rs | 1 + 10 files changed, 199 insertions(+), 19 deletions(-) create mode 100644 locked-asset/lkmex-transfer/src/energy_factory_token_transfer_proxy.rs create mode 100644 locked-asset/proxy_dex/src/energy_factory_token_transfer_proxy.rs create mode 100644 locked-asset/token-unstake/src/energy_factory_unstake_proxy.rs diff --git a/energy-integration/common-modules/energy-query/src/lib.rs b/energy-integration/common-modules/energy-query/src/lib.rs index 4f4e2e7af..00ee89507 100644 --- a/energy-integration/common-modules/energy-query/src/lib.rs +++ b/energy-integration/common-modules/energy-query/src/lib.rs @@ -77,9 +77,6 @@ pub trait EnergyQueryModule { .read_from_address(&energy_factory_address, key) } - #[proxy] - fn energy_factory_proxy(&self, sc_address: ManagedAddress) -> energy_factory::Proxy; - #[view(getEnergyFactoryAddress)] #[storage_mapper("energyFactoryAddress")] fn energy_factory_address(&self) -> SingleValueMapper; diff --git a/locked-asset/lkmex-transfer/src/energy_factory_token_transfer_proxy.rs b/locked-asset/lkmex-transfer/src/energy_factory_token_transfer_proxy.rs new file mode 100644 index 000000000..bc6b73769 --- /dev/null +++ b/locked-asset/lkmex-transfer/src/energy_factory_token_transfer_proxy.rs @@ -0,0 +1,53 @@ +use energy_query::Energy; +use multiversx_sc::proxy_imports::*; + +pub struct SimpleLockEnergyProxy; + +impl TxProxyTrait for SimpleLockEnergyProxy +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + type TxProxyMethods = SimpleLockEnergyProxyMethods; + + fn proxy_methods(self, tx: Tx) -> Self::TxProxyMethods { + SimpleLockEnergyProxyMethods { wrapped_tx: tx } + } +} + +pub struct SimpleLockEnergyProxyMethods +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + wrapped_tx: Tx, +} + +#[rustfmt::skip] +impl SimpleLockEnergyProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + pub fn set_user_energy_after_locked_token_transfer< + Arg0: CodecInto>, + Arg1: CodecInto>, + >( + self, + user: Arg0, + energy: Arg1, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setUserEnergyAfterLockedTokenTransfer") + .argument(&user) + .argument(&energy) + .original_result() + } +} diff --git a/locked-asset/lkmex-transfer/src/energy_transfer.rs b/locked-asset/lkmex-transfer/src/energy_transfer.rs index 008517e80..b4552ee92 100644 --- a/locked-asset/lkmex-transfer/src/energy_transfer.rs +++ b/locked-asset/lkmex-transfer/src/energy_transfer.rs @@ -1,7 +1,7 @@ multiversx_sc::imports!(); +use crate::energy_factory_token_transfer_proxy; use common_structs::PaymentsVec; -use energy_factory::locked_token_transfer::ProxyTrait as _; use energy_query::Energy; use simple_lock::locked_token::LockedTokenAttributes; @@ -62,9 +62,10 @@ pub trait EnergyTransferModule: fn set_energy_in_factory(&self, user: ManagedAddress, energy: Energy) { let sc_address = self.energy_factory_address().get(); - let _: () = self - .energy_factory_proxy(sc_address) + self.tx() + .to(&sc_address) + .typed(energy_factory_token_transfer_proxy::SimpleLockEnergyProxy) .set_user_energy_after_locked_token_transfer(user, energy) - .execute_on_dest_context(); + .sync_call(); } } diff --git a/locked-asset/lkmex-transfer/src/lib.rs b/locked-asset/lkmex-transfer/src/lib.rs index 4e07277f8..214ff820e 100644 --- a/locked-asset/lkmex-transfer/src/lib.rs +++ b/locked-asset/lkmex-transfer/src/lib.rs @@ -5,6 +5,7 @@ multiversx_sc::imports!(); multiversx_sc::derive_imports!(); pub mod constants; +pub mod energy_factory_token_transfer_proxy; pub mod energy_transfer; pub mod events; diff --git a/locked-asset/proxy_dex/src/energy_factory_token_transfer_proxy.rs b/locked-asset/proxy_dex/src/energy_factory_token_transfer_proxy.rs new file mode 100644 index 000000000..7874ee3cc --- /dev/null +++ b/locked-asset/proxy_dex/src/energy_factory_token_transfer_proxy.rs @@ -0,0 +1,68 @@ +use energy_query::Energy; +use multiversx_sc::proxy_imports::*; + +pub struct SimpleLockEnergyProxy; + +impl TxProxyTrait for SimpleLockEnergyProxy +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + type TxProxyMethods = SimpleLockEnergyProxyMethods; + + fn proxy_methods(self, tx: Tx) -> Self::TxProxyMethods { + SimpleLockEnergyProxyMethods { wrapped_tx: tx } + } +} + +pub struct SimpleLockEnergyProxyMethods +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + wrapped_tx: Tx, +} + +#[rustfmt::skip] +impl SimpleLockEnergyProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + pub fn extend_lock_period< + Arg0: CodecInto, + Arg1: CodecInto>, + >( + self, + lock_epochs: Arg0, + user: Arg1, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("extendLockPeriod") + .argument(&lock_epochs) + .argument(&user) + .original_result() + } + + pub fn set_user_energy_after_locked_token_transfer< + Arg0: CodecInto>, + Arg1: CodecInto>, + >( + self, + user: Arg0, + energy: Arg1, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setUserEnergyAfterLockedTokenTransfer") + .argument(&user) + .argument(&energy) + .original_result() + } +} diff --git a/locked-asset/proxy_dex/src/energy_update.rs b/locked-asset/proxy_dex/src/energy_update.rs index 0c62e34f7..da24a6c1d 100644 --- a/locked-asset/proxy_dex/src/energy_update.rs +++ b/locked-asset/proxy_dex/src/energy_update.rs @@ -1,10 +1,11 @@ multiversx_sc::imports!(); use common_structs::{Epoch, Nonce}; -use energy_factory::{locked_token_transfer::ProxyTrait as _, ProxyTrait as _}; use energy_query::Energy; use simple_lock::locked_token::LockedTokenAttributes; +use crate::energy_factory_token_transfer_proxy; + #[multiversx_sc::module] pub trait EnergyUpdateModule: energy_query::EnergyQueryModule @@ -70,10 +71,13 @@ pub trait EnergyUpdateModule: lock_epochs: Epoch, energy_factory_addr: ManagedAddress, ) -> EsdtTokenPayment { - self.energy_factory_proxy(energy_factory_addr) + self.tx() + .to(&energy_factory_addr) + .typed(energy_factory_token_transfer_proxy::SimpleLockEnergyProxy) .extend_lock_period(lock_epochs, user) - .with_esdt_transfer(old_tokens) - .execute_on_dest_context() + .payment(old_tokens) + .returns(ReturnsResult) + .sync_call() } fn set_energy_in_factory( @@ -82,9 +86,10 @@ pub trait EnergyUpdateModule: energy: Energy, energy_factory_addr: ManagedAddress, ) { - let _: () = self - .energy_factory_proxy(energy_factory_addr) + self.tx() + .to(&energy_factory_addr) + .typed(energy_factory_token_transfer_proxy::SimpleLockEnergyProxy) .set_user_energy_after_locked_token_transfer(user, energy) - .execute_on_dest_context(); + .sync_call(); } } diff --git a/locked-asset/proxy_dex/src/lib.rs b/locked-asset/proxy_dex/src/lib.rs index 3e03c2f06..3681a88e2 100644 --- a/locked-asset/proxy_dex/src/lib.rs +++ b/locked-asset/proxy_dex/src/lib.rs @@ -5,6 +5,7 @@ multiversx_sc::imports!(); multiversx_sc::derive_imports!(); +pub mod energy_factory_token_transfer_proxy; pub mod energy_update; pub mod events; pub mod external_merging; diff --git a/locked-asset/token-unstake/src/cancel_unstake.rs b/locked-asset/token-unstake/src/cancel_unstake.rs index 84a3af84c..a6ee93f3c 100644 --- a/locked-asset/token-unstake/src/cancel_unstake.rs +++ b/locked-asset/token-unstake/src/cancel_unstake.rs @@ -1,9 +1,8 @@ multiversx_sc::imports!(); -use energy_factory::unstake::ProxyTrait as _; use simple_lock::locked_token::LockedTokenAttributes; -use crate::events; +use crate::{energy_factory_unstake_proxy, events}; #[multiversx_sc::module] pub trait CancelUnstakeModule: @@ -57,10 +56,11 @@ pub trait CancelUnstakeModule: self.tx().to(&caller).payment(&output_payments).transfer(); let sc_address = self.energy_factory_address().get(); - let _: IgnoreValue = self - .energy_factory_proxy(sc_address) + self.tx() + .to(&sc_address) + .typed(energy_factory_unstake_proxy::SimpleLockEnergyProxy) .revert_unstake(caller.clone(), energy) - .execute_on_dest_context(); + .sync_call(); self.emit_unlocked_tokens_event(&caller, ManagedVec::new()); output_payments.into() diff --git a/locked-asset/token-unstake/src/energy_factory_unstake_proxy.rs b/locked-asset/token-unstake/src/energy_factory_unstake_proxy.rs new file mode 100644 index 000000000..9dbc6d3d2 --- /dev/null +++ b/locked-asset/token-unstake/src/energy_factory_unstake_proxy.rs @@ -0,0 +1,53 @@ +use energy_query::Energy; +use multiversx_sc::proxy_imports::*; + +pub struct SimpleLockEnergyProxy; + +impl TxProxyTrait for SimpleLockEnergyProxy +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + type TxProxyMethods = SimpleLockEnergyProxyMethods; + + fn proxy_methods(self, tx: Tx) -> Self::TxProxyMethods { + SimpleLockEnergyProxyMethods { wrapped_tx: tx } + } +} + +pub struct SimpleLockEnergyProxyMethods +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + wrapped_tx: Tx, +} + +#[rustfmt::skip] +impl SimpleLockEnergyProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + pub fn revert_unstake< + Arg0: CodecInto>, + Arg1: CodecInto>, + >( + self, + user: Arg0, + new_energy: Arg1, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("revertUnstake") + .argument(&user) + .argument(&new_energy) + .original_result() + } +} diff --git a/locked-asset/token-unstake/src/lib.rs b/locked-asset/token-unstake/src/lib.rs index 985e91be9..eec55f376 100644 --- a/locked-asset/token-unstake/src/lib.rs +++ b/locked-asset/token-unstake/src/lib.rs @@ -3,6 +3,7 @@ multiversx_sc::imports!(); pub mod cancel_unstake; +pub mod energy_factory_unstake_proxy; pub mod events; pub mod fees_handler; pub mod tokens_per_user; From 40390e85d75838816f1da061012bf411bba1c52d Mon Sep 17 00:00:00 2001 From: Mihai Calin Luca Date: Wed, 17 Apr 2024 18:39:47 +0200 Subject: [PATCH 22/55] small cleanup --- Cargo.lock | 2 -- common/modules/locking_module/Cargo.toml | 6 ------ .../src/lock_with_energy_module.rs | 17 +++++------------ .../locking_module/src/locking_module.rs | 18 ++++++------------ dex/pair/src/locking_wrapper.rs | 17 +++++------------ 5 files changed, 16 insertions(+), 44 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 76d4fbf4a..8c29a59d7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1471,9 +1471,7 @@ dependencies = [ name = "locking_module" version = "0.0.0" dependencies = [ - "energy-factory", "multiversx-sc", - "simple-lock", ] [[package]] diff --git a/common/modules/locking_module/Cargo.toml b/common/modules/locking_module/Cargo.toml index b675cbe3d..2d318d8e3 100644 --- a/common/modules/locking_module/Cargo.toml +++ b/common/modules/locking_module/Cargo.toml @@ -10,9 +10,3 @@ path = "src/lib.rs" [dependencies.multiversx-sc] version = "=0.49.0-alpha.3" features = ["esdt-token-payment-legacy-decode"] - -[dependencies.simple-lock] -path = "../../../locked-asset/simple-lock" - -[dependencies.energy-factory] -path = "../../../locked-asset/energy-factory" diff --git a/common/modules/locking_module/src/lock_with_energy_module.rs b/common/modules/locking_module/src/lock_with_energy_module.rs index 522ec8e13..02503ab65 100644 --- a/common/modules/locking_module/src/lock_with_energy_module.rs +++ b/common/modules/locking_module/src/lock_with_energy_module.rs @@ -1,4 +1,4 @@ -use crate::energy_factory_lock_proxy::{self, SimpleLockEnergyProxyMethods}; +use crate::energy_factory_lock_proxy; multiversx_sc::imports!(); @@ -29,21 +29,14 @@ pub trait LockWithEnergyModule { energy_address: ManagedAddress, ) -> EsdtTokenPayment { let lock_epochs = self.lock_epochs().get(); - let proxy_instance = self.get_locking_sc_proxy_instance(); - - proxy_instance - .lock_virtual(token_id, amount, lock_epochs, dest_address, energy_address) - .returns(ReturnsResult) - .sync_call() - } - - fn get_locking_sc_proxy_instance( - &self, - ) -> SimpleLockEnergyProxyMethods, (), ManagedAddress, ()> { let locking_sc_address = self.locking_sc_address().get(); + self.tx() .to(locking_sc_address) .typed(energy_factory_lock_proxy::SimpleLockEnergyProxy) + .lock_virtual(token_id, amount, lock_epochs, dest_address, energy_address) + .returns(ReturnsResult) + .sync_call() } #[view(getLockingScAddress)] diff --git a/common/modules/locking_module/src/locking_module.rs b/common/modules/locking_module/src/locking_module.rs index 654b7bcc9..2d4a941ad 100644 --- a/common/modules/locking_module/src/locking_module.rs +++ b/common/modules/locking_module/src/locking_module.rs @@ -1,4 +1,4 @@ -use crate::energy_factory_lock_proxy::{self, SimpleLockEnergyProxyMethods}; +use crate::energy_factory_lock_proxy; multiversx_sc::imports!(); @@ -47,9 +47,12 @@ pub trait LockingModule { amount: BigUint, ) -> EgldOrEsdtTokenPayment { let unlock_epoch = self.unlock_epoch().get(); - let proxy_instance = self.get_locking_sc_proxy_instance(); + let locking_sc_address = self.locking_sc_address().get(); - let tokens = proxy_instance + let tokens = self + .tx() + .to(locking_sc_address) + .typed(energy_factory_lock_proxy::SimpleLockEnergyProxy) .lock_tokens_endpoint(unlock_epoch, opt_dest) .egld_or_single_esdt(&token_id, 0, &amount) .returns(ReturnsResult) @@ -58,15 +61,6 @@ pub trait LockingModule { EgldOrEsdtTokenPayment::from(tokens) } - fn get_locking_sc_proxy_instance( - &self, - ) -> SimpleLockEnergyProxyMethods, (), ManagedAddress, ()> { - let locking_sc_address = self.locking_sc_address().get(); - self.tx() - .to(locking_sc_address) - .typed(energy_factory_lock_proxy::SimpleLockEnergyProxy) - } - #[view(getLockingScAddress)] #[storage_mapper("lockingScAddress")] fn locking_sc_address(&self) -> SingleValueMapper; diff --git a/dex/pair/src/locking_wrapper.rs b/dex/pair/src/locking_wrapper.rs index c21207b66..460353d50 100644 --- a/dex/pair/src/locking_wrapper.rs +++ b/dex/pair/src/locking_wrapper.rs @@ -1,4 +1,4 @@ -use crate::energy_factory_lock_proxy::{self, SimpleLockEnergyProxyMethods}; +use crate::energy_factory_lock_proxy; multiversx_sc::imports!(); @@ -58,9 +58,11 @@ pub trait LockingWrapperModule: amount: BigUint, ) -> EsdtTokenPayment { let unlock_epoch = self.unlock_epoch().get(); - let proxy_instance = self.get_locking_sc_proxy_instance(); + let locking_sc_address = self.locking_sc_address().get(); - proxy_instance + self.tx() + .to(locking_sc_address) + .typed(energy_factory_lock_proxy::SimpleLockEnergyProxy) .lock_tokens_endpoint(unlock_epoch, opt_dest) .single_esdt(&token_id, 0, &amount) .returns(ReturnsResult) @@ -74,15 +76,6 @@ pub trait LockingWrapperModule: current_epoch < locking_deadline_epoch } - fn get_locking_sc_proxy_instance( - &self, - ) -> SimpleLockEnergyProxyMethods, (), ManagedAddress, ()> { - let locking_sc_address = self.locking_sc_address().get(); - self.tx() - .to(locking_sc_address) - .typed(energy_factory_lock_proxy::SimpleLockEnergyProxy) - } - #[view(getLockingScAddress)] #[storage_mapper("lockingScAddress")] fn locking_sc_address(&self) -> SingleValueMapper; From 5f81d8b45f992aee27685feded2aa27517990e7a Mon Sep 17 00:00:00 2001 From: Mihai Calin Luca Date: Wed, 17 Apr 2024 23:57:08 +0200 Subject: [PATCH 23/55] pair proxy --- dex/farm-with-locked-rewards/wasm/Cargo.lock | 2 - dex/farm/src/exit_penalty.rs | 15 ++- dex/farm/src/lib.rs | 1 + dex/farm/src/pair_proxy.rs | 46 ++++++++ dex/farm/wasm/Cargo.lock | 2 - dex/pair/src/fee.rs | 25 ++--- dex/pair/src/lib.rs | 1 + dex/pair/src/self_proxy.rs | 51 +++++++++ dex/pair/wasm-pair-full/Cargo.lock | 2 - dex/pair/wasm-safe-price-view/Cargo.lock | 2 - dex/pair/wasm/Cargo.lock | 2 - dex/price-discovery/wasm/Cargo.lock | 100 ------------------ dex/proxy-deployer/wasm/Cargo.lock | 2 - dex/router/src/contract.rs | 59 ++++++----- dex/router/src/multi_pair_swap.rs | 33 +++--- dex/router/wasm/Cargo.lock | 2 - .../src/external_contracts_interactions.rs | 31 +++--- farm-staking/farm-staking-proxy/src/lib.rs | 1 + .../farm-staking-proxy/src/pair_proxy.rs | 77 ++++++++++++++ locked-asset/proxy_dex/src/lib.rs | 1 + .../proxy_dex/src/pair_interactions.rs | 33 +++--- locked-asset/proxy_dex/src/pair_proxy.rs | 79 ++++++++++++++ 22 files changed, 354 insertions(+), 213 deletions(-) create mode 100644 dex/farm/src/pair_proxy.rs create mode 100644 dex/pair/src/self_proxy.rs create mode 100644 farm-staking/farm-staking-proxy/src/pair_proxy.rs create mode 100644 locked-asset/proxy_dex/src/pair_proxy.rs diff --git a/dex/farm-with-locked-rewards/wasm/Cargo.lock b/dex/farm-with-locked-rewards/wasm/Cargo.lock index 662cc7e91..8d8f36b03 100644 --- a/dex/farm-with-locked-rewards/wasm/Cargo.lock +++ b/dex/farm-with-locked-rewards/wasm/Cargo.lock @@ -294,9 +294,7 @@ dependencies = [ name = "locking_module" version = "0.0.0" dependencies = [ - "energy-factory", "multiversx-sc", - "simple-lock", ] [[package]] diff --git a/dex/farm/src/exit_penalty.rs b/dex/farm/src/exit_penalty.rs index 19f101a26..1c4c34ea1 100644 --- a/dex/farm/src/exit_penalty.rs +++ b/dex/farm/src/exit_penalty.rs @@ -2,9 +2,8 @@ multiversx_sc::imports!(); use common_errors::ERROR_PARAMETERS; use common_structs::Epoch; -use pair::pair_actions::remove_liq::ProxyTrait as _; -use crate::MAX_PERCENT; +use crate::{pair_proxy, MAX_PERCENT}; pub const DEFAULT_PENALTY_PERCENT: u64 = 100; pub const DEFAULT_MINUMUM_FARMING_EPOCHS: u64 = 3; @@ -47,17 +46,17 @@ pub trait ExitPenaltyModule: permissions_module::PermissionsModule { .esdt_local_burn(farming_token_id, 0, farming_amount); } else { let gas_limit = self.burn_gas_limit().get(); - self.pair_contract_proxy(pair_contract_address) + + self.tx() + .to(&pair_contract_address) + .typed(pair_proxy::PairProxy) .remove_liquidity_and_burn_token(reward_token_id.clone()) - .with_esdt_transfer((farming_token_id.clone(), 0, farming_amount.clone())) - .with_gas_limit(gas_limit) + .single_esdt(farming_token_id, 0, farming_amount) + .gas(gas_limit) .transfer_execute(); } } - #[proxy] - fn pair_contract_proxy(&self, to: ManagedAddress) -> pair::Proxy; - #[view(getPenaltyPercent)] #[storage_mapper("penalty_percent")] fn penalty_percent(&self) -> SingleValueMapper; diff --git a/dex/farm/src/lib.rs b/dex/farm/src/lib.rs index 97163efb0..0472872bf 100644 --- a/dex/farm/src/lib.rs +++ b/dex/farm/src/lib.rs @@ -7,6 +7,7 @@ multiversx_sc::derive_imports!(); pub mod base_functions; pub mod exit_penalty; +pub mod pair_proxy; use base_functions::{ClaimRewardsResultType, DoubleMultiPayment, Wrapper}; use common_structs::FarmTokenAttributes; diff --git a/dex/farm/src/pair_proxy.rs b/dex/farm/src/pair_proxy.rs new file mode 100644 index 000000000..95f3dd107 --- /dev/null +++ b/dex/farm/src/pair_proxy.rs @@ -0,0 +1,46 @@ +use multiversx_sc::proxy_imports::*; + +pub struct PairProxy; + +impl TxProxyTrait for PairProxy +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + type TxProxyMethods = PairProxyMethods; + + fn proxy_methods(self, tx: Tx) -> Self::TxProxyMethods { + PairProxyMethods { wrapped_tx: tx } + } +} + +pub struct PairProxyMethods +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + wrapped_tx: Tx, +} + +impl PairProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + pub fn remove_liquidity_and_burn_token>>( + self, + token_to_buyback_and_burn: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("removeLiquidityAndBuyBackAndBurnToken") + .argument(&token_to_buyback_and_burn) + .original_result() + } +} diff --git a/dex/farm/wasm/Cargo.lock b/dex/farm/wasm/Cargo.lock index 76c4c498c..f67ee256a 100644 --- a/dex/farm/wasm/Cargo.lock +++ b/dex/farm/wasm/Cargo.lock @@ -264,9 +264,7 @@ dependencies = [ name = "locking_module" version = "0.0.0" dependencies = [ - "energy-factory", "multiversx-sc", - "simple-lock", ] [[package]] diff --git a/dex/pair/src/fee.rs b/dex/pair/src/fee.rs index 45df09f82..4d4f098ec 100644 --- a/dex/pair/src/fee.rs +++ b/dex/pair/src/fee.rs @@ -9,20 +9,10 @@ use crate::config::MAX_PERCENTAGE; use crate::contexts::base::StorageCache; use crate::contexts::base::SwapTokensOrder; +use crate::self_proxy; use common_structs::TokenPair; use fees_collector::fees_accumulation::ProxyTrait as _; -mod self_proxy { - multiversx_sc::imports!(); - - #[multiversx_sc::proxy] - pub trait PairProxy { - #[payable("*")] - #[endpoint(swapNoFeeAndForward)] - fn swap_no_fee(&self, token_out: TokenIdentifier, destination_address: ManagedAddress); - } -} - #[multiversx_sc::module] pub trait FeeModule: config::ConfigModule @@ -296,12 +286,12 @@ pub trait FeeModule: ) { let pair_address = self.get_extern_swap_pair_address(available_token, requested_token); - let _: IgnoreValue = self - .pair_proxy() - .contract(pair_address) + self.tx() + .to(&pair_address) + .typed(self_proxy::PairProxy) .swap_no_fee(requested_token.clone(), destination_address.clone()) - .with_esdt_transfer((available_token.clone(), 0, available_amount.clone())) - .execute_on_dest_context(); + .single_esdt(available_token, 0, available_amount) + .sync_call(); } #[inline] @@ -397,9 +387,6 @@ pub trait FeeModule: result } - #[proxy] - fn pair_proxy(&self) -> self_proxy::Proxy; - #[proxy] fn fees_collector_proxy(&self, sc_address: ManagedAddress) -> fees_collector::Proxy; diff --git a/dex/pair/src/lib.rs b/dex/pair/src/lib.rs index 85cd48f10..bb8af39d2 100644 --- a/dex/pair/src/lib.rs +++ b/dex/pair/src/lib.rs @@ -16,6 +16,7 @@ pub mod pair_actions; pub mod read_pair_storage; pub mod safe_price; pub mod safe_price_view; +pub mod self_proxy; use crate::errors::*; diff --git a/dex/pair/src/self_proxy.rs b/dex/pair/src/self_proxy.rs new file mode 100644 index 000000000..04e44d7df --- /dev/null +++ b/dex/pair/src/self_proxy.rs @@ -0,0 +1,51 @@ +use multiversx_sc::proxy_imports::*; + +pub struct PairProxy; + +impl TxProxyTrait for PairProxy +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + type TxProxyMethods = PairProxyMethods; + + fn proxy_methods(self, tx: Tx) -> Self::TxProxyMethods { + PairProxyMethods { wrapped_tx: tx } + } +} + +pub struct PairProxyMethods +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + wrapped_tx: Tx, +} + +impl PairProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + pub fn swap_no_fee< + Arg0: CodecInto>, + Arg1: CodecInto>, + >( + self, + token_out: Arg0, + destination_address: Arg1, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("swapNoFeeAndForward") + .argument(&token_out) + .argument(&destination_address) + .original_result() + } +} diff --git a/dex/pair/wasm-pair-full/Cargo.lock b/dex/pair/wasm-pair-full/Cargo.lock index a7b75403d..c47139c93 100644 --- a/dex/pair/wasm-pair-full/Cargo.lock +++ b/dex/pair/wasm-pair-full/Cargo.lock @@ -140,9 +140,7 @@ dependencies = [ name = "locking_module" version = "0.0.0" dependencies = [ - "energy-factory", "multiversx-sc", - "simple-lock", ] [[package]] diff --git a/dex/pair/wasm-safe-price-view/Cargo.lock b/dex/pair/wasm-safe-price-view/Cargo.lock index 633555b27..1a65d0de5 100644 --- a/dex/pair/wasm-safe-price-view/Cargo.lock +++ b/dex/pair/wasm-safe-price-view/Cargo.lock @@ -140,9 +140,7 @@ dependencies = [ name = "locking_module" version = "0.0.0" dependencies = [ - "energy-factory", "multiversx-sc", - "simple-lock", ] [[package]] diff --git a/dex/pair/wasm/Cargo.lock b/dex/pair/wasm/Cargo.lock index bb78c7a4d..24fb477df 100644 --- a/dex/pair/wasm/Cargo.lock +++ b/dex/pair/wasm/Cargo.lock @@ -140,9 +140,7 @@ dependencies = [ name = "locking_module" version = "0.0.0" dependencies = [ - "energy-factory", "multiversx-sc", - "simple-lock", ] [[package]] diff --git a/dex/price-discovery/wasm/Cargo.lock b/dex/price-discovery/wasm/Cargo.lock index d72671b35..3cabb7d63 100644 --- a/dex/price-discovery/wasm/Cargo.lock +++ b/dex/price-discovery/wasm/Cargo.lock @@ -20,53 +20,12 @@ version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - [[package]] name = "endian-type" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - [[package]] name = "hex" version = "0.4.3" @@ -85,34 +44,9 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - [[package]] name = "locking_module" version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", - "simple-lock", -] - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" dependencies = [ "multiversx-sc", ] @@ -247,23 +181,6 @@ dependencies = [ "nibble_vec", ] -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - [[package]] name = "smallvec" version = "1.11.2" @@ -286,20 +203,3 @@ name = "unicode-ident" version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] diff --git a/dex/proxy-deployer/wasm/Cargo.lock b/dex/proxy-deployer/wasm/Cargo.lock index 589d0f39b..7067da6a8 100644 --- a/dex/proxy-deployer/wasm/Cargo.lock +++ b/dex/proxy-deployer/wasm/Cargo.lock @@ -256,9 +256,7 @@ dependencies = [ name = "locking_module" version = "0.0.0" dependencies = [ - "energy-factory", "multiversx-sc", - "simple-lock", ] [[package]] diff --git a/dex/router/src/contract.rs b/dex/router/src/contract.rs index eefd868af..716b313f3 100644 --- a/dex/router/src/contract.rs +++ b/dex/router/src/contract.rs @@ -11,10 +11,6 @@ pub mod multi_pair_swap; mod pair_proxy; use factory::PairTokens; -use pair::config::ProxyTrait as _; -use pair::fee::ProxyTrait as _; -use pair::ProxyTrait as _; -use pausable::ProxyTrait as _; const LP_TOKEN_DECIMALS: usize = 18; const LP_TOKEN_INITIAL_SUPPLY: u64 = 1000; @@ -54,10 +50,11 @@ pub trait Router: self.state().set(false); } else { self.check_is_pair_sc(&address); - let _: IgnoreValue = self - .pair_contract_proxy(address) + self.tx() + .to(&address) + .typed(pair_proxy::PairProxy) .pause() - .execute_on_dest_context(); + .sync_call(); } } @@ -72,10 +69,11 @@ pub trait Router: self.state().set(true); } else { self.check_is_pair_sc(&address); - let _: IgnoreValue = self - .pair_contract_proxy(address) + self.tx() + .to(&address) + .typed(pair_proxy::PairProxy) .resume() - .execute_on_dest_context(); + .sync_call(); } } @@ -206,10 +204,14 @@ pub trait Router: } }; - let result: TokenIdentifier = self - .pair_contract_proxy(pair_address.clone()) + let result = self + .tx() + .to(&pair_address) + .typed(pair_proxy::PairProxy) .get_lp_token_identifier() - .execute_on_dest_context(); + .returns(ReturnsResult) + .sync_call(); + require!( !result.is_valid_esdt_identifier(), "LP Token already issued" @@ -247,10 +249,14 @@ pub trait Router: require!(self.is_active(), "Not active"); self.check_is_pair_sc(&pair_address); - let pair_token: TokenIdentifier = self - .pair_contract_proxy(pair_address.clone()) + let pair_token = self + .tx() + .to(&pair_address) + .typed(pair_proxy::PairProxy) .get_lp_token_identifier() - .execute_on_dest_context(); + .returns(ReturnsResult) + .sync_call(); + require!(pair_token.is_valid_esdt_identifier(), "LP token not issued"); let roles = [EsdtLocalRole::Mint, EsdtLocalRole::Burn]; @@ -316,10 +322,11 @@ pub trait Router: require!(self.is_active(), "Not active"); self.check_is_pair_sc(&pair_address); - let _: IgnoreValue = self - .pair_contract_proxy(pair_address) + self.tx() + .to(&pair_address) + .typed(pair_proxy::PairProxy) .set_fee_on(true, fee_to_address, fee_token) - .execute_on_dest_context(); + .sync_call(); } #[only_owner] @@ -333,10 +340,11 @@ pub trait Router: require!(self.is_active(), "Not active"); self.check_is_pair_sc(&pair_address); - let _: IgnoreValue = self - .pair_contract_proxy(pair_address) + self.tx() + .to(&pair_address) + .typed(pair_proxy::PairProxy) .set_fee_on(false, fee_to_address, fee_token) - .execute_on_dest_context(); + .sync_call(); } #[callback] @@ -350,10 +358,11 @@ pub trait Router: match result { ManagedAsyncCallResult::Ok(()) => { self.pair_temporary_owner().remove(address); - let _: IgnoreValue = self - .pair_contract_proxy(address.clone()) + self.tx() + .to(address) + .typed(pair_proxy::PairProxy) .set_lp_token_identifier(token_id.unwrap_esdt()) - .execute_on_dest_context(); + .sync_call(); } ManagedAsyncCallResult::Err(_) => { if token_id.is_egld() && returned_tokens > 0u64 { diff --git a/dex/router/src/multi_pair_swap.rs b/dex/router/src/multi_pair_swap.rs index 7d44f50ac..8345838cf 100644 --- a/dex/router/src/multi_pair_swap.rs +++ b/dex/router/src/multi_pair_swap.rs @@ -1,11 +1,9 @@ multiversx_sc::imports!(); multiversx_sc::derive_imports!(); -use pair::pair_actions::swap::ProxyTrait as _; - -use crate::config; - use super::factory; +use crate::config; +use crate::pair_proxy; type SwapOperationType = MultiValue4, ManagedBuffer, TokenIdentifier, BigUint>; @@ -82,10 +80,13 @@ pub trait MultiPairSwap: token_out: TokenIdentifier, amount_out_min: BigUint, ) -> EsdtTokenPayment { - self.pair_contract_proxy(pair_address) + self.tx() + .to(&pair_address) + .typed(pair_proxy::PairProxy) .swap_tokens_fixed_input(token_out, amount_out_min) - .with_esdt_transfer((token_in, 0, amount_in)) - .execute_on_dest_context() + .single_esdt(&token_in, 0, &amount_in) + .returns(ReturnsResult) + .sync_call() } fn actual_swap_fixed_output( @@ -96,15 +97,13 @@ pub trait MultiPairSwap: token_out: TokenIdentifier, amount_out: BigUint, ) -> (EsdtTokenPayment, EsdtTokenPayment) { - let call_result: MultiValue2, EsdtTokenPayment> = - self.pair_contract_proxy(pair_address) - .swap_tokens_fixed_output(token_out, amount_out) - .with_esdt_transfer((token_in, 0, amount_in_max)) - .execute_on_dest_context(); - - call_result.into_tuple() + self.tx() + .to(&pair_address) + .typed(pair_proxy::PairProxy) + .swap_tokens_fixed_output(token_out, amount_out) + .single_esdt(&token_in, 0, &amount_in_max) + .returns(ReturnsResult) + .sync_call() + .into_tuple() } - - #[proxy] - fn pair_contract_proxy(&self, to: ManagedAddress) -> pair::Proxy; } diff --git a/dex/router/wasm/Cargo.lock b/dex/router/wasm/Cargo.lock index f8a588292..0bac012f7 100644 --- a/dex/router/wasm/Cargo.lock +++ b/dex/router/wasm/Cargo.lock @@ -140,9 +140,7 @@ dependencies = [ name = "locking_module" version = "0.0.0" dependencies = [ - "energy-factory", "multiversx-sc", - "simple-lock", ] [[package]] diff --git a/farm-staking/farm-staking-proxy/src/external_contracts_interactions.rs b/farm-staking/farm-staking-proxy/src/external_contracts_interactions.rs index f8048d66b..3c71ec22f 100644 --- a/farm-staking/farm-staking-proxy/src/external_contracts_interactions.rs +++ b/farm-staking/farm-staking-proxy/src/external_contracts_interactions.rs @@ -9,10 +9,8 @@ use farm_staking::{ unstake_farm::ProxyTrait as _, }; use farm_with_locked_rewards::ProxyTrait as _; -use pair::{ - pair_actions::{common_result_types::RemoveLiquidityResultType, remove_liq::ProxyTrait as _}, - safe_price_view::ProxyTrait as _, -}; + +use crate::pair_proxy; use crate::result_types::*; @@ -173,11 +171,15 @@ pub trait ExternalContractsInteractionsModule: pair_second_token_min_amount: BigUint, ) -> PairRemoveLiquidityResult { let pair_address = self.pair_address().get(); - let pair_withdraw_result: RemoveLiquidityResultType = self - .pair_proxy_obj(pair_address) + let pair_withdraw_result = self + .tx() + .to(&pair_address) + .typed(pair_proxy::PairProxy) .remove_liquidity(pair_first_token_min_amount, pair_second_token_min_amount) - .with_esdt_transfer(lp_tokens) - .execute_on_dest_context(); + .payment(lp_tokens) + .returns(ReturnsResult) + .sync_call(); + let (pair_first_token_payment, pair_second_token_payment) = pair_withdraw_result.into_tuple(); @@ -199,10 +201,14 @@ pub trait ExternalContractsInteractionsModule: fn get_lp_tokens_safe_price(&self, lp_tokens_amount: BigUint) -> BigUint { let pair_address = self.pair_address().get(); - let result: SafePriceResult = self - .pair_proxy_obj(pair_address) + let result = self + .tx() + .to(&pair_address) + .typed(pair_proxy::PairProxy) .update_and_get_tokens_for_given_position_with_safe_price(lp_tokens_amount) - .execute_on_dest_context(); + .returns(ReturnsResult) + .sync_call(); + let (first_token_info, second_token_info) = result.into_tuple(); let staking_token_id = self.staking_token_id().get(); @@ -226,9 +232,6 @@ pub trait ExternalContractsInteractionsModule: sc_address: ManagedAddress, ) -> farm_with_locked_rewards::Proxy; - #[proxy] - fn pair_proxy_obj(&self, sc_address: ManagedAddress) -> pair::Proxy; - // storage #[view(getLpFarmAddress)] diff --git a/farm-staking/farm-staking-proxy/src/lib.rs b/farm-staking/farm-staking-proxy/src/lib.rs index 7bfc66bab..05743d0ec 100644 --- a/farm-staking/farm-staking-proxy/src/lib.rs +++ b/farm-staking/farm-staking-proxy/src/lib.rs @@ -5,6 +5,7 @@ multiversx_sc::imports!(); pub mod dual_yield_token; pub mod external_contracts_interactions; pub mod lp_farm_token; +pub mod pair_proxy; pub mod proxy_actions; pub mod result_types; diff --git a/farm-staking/farm-staking-proxy/src/pair_proxy.rs b/farm-staking/farm-staking-proxy/src/pair_proxy.rs new file mode 100644 index 000000000..62cee6898 --- /dev/null +++ b/farm-staking/farm-staking-proxy/src/pair_proxy.rs @@ -0,0 +1,77 @@ +#![allow(clippy::type_complexity)] + +use multiversx_sc::proxy_imports::*; + +pub struct PairProxy; + +impl TxProxyTrait for PairProxy +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + type TxProxyMethods = PairProxyMethods; + + fn proxy_methods(self, tx: Tx) -> Self::TxProxyMethods { + PairProxyMethods { wrapped_tx: tx } + } +} + +pub struct PairProxyMethods +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + wrapped_tx: Tx, +} + +impl PairProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + pub fn remove_liquidity< + Arg0: CodecInto>, + Arg1: CodecInto>, + >( + self, + first_token_amount_min: Arg0, + second_token_amount_min: Arg1, + ) -> TxProxyCall< + Env, + From, + To, + Gas, + MultiValue2, EsdtTokenPayment>, + > { + self.wrapped_tx + .raw_call("removeLiquidity") + .argument(&first_token_amount_min) + .argument(&second_token_amount_min) + .original_result() + } + + pub fn update_and_get_tokens_for_given_position_with_safe_price< + Arg0: CodecInto>, + >( + self, + liquidity: Arg0, + ) -> TxProxyCall< + Env, + From, + To, + Gas, + MultiValue2, EsdtTokenPayment>, + > { + self.wrapped_tx + .raw_call("updateAndGetTokensForGivenPositionWithSafePrice") + .argument(&liquidity) + .original_result() + } +} diff --git a/locked-asset/proxy_dex/src/lib.rs b/locked-asset/proxy_dex/src/lib.rs index 3681a88e2..2dc735baf 100644 --- a/locked-asset/proxy_dex/src/lib.rs +++ b/locked-asset/proxy_dex/src/lib.rs @@ -12,6 +12,7 @@ pub mod external_merging; pub mod farm_interactions; pub mod other_sc_whitelist; pub mod pair_interactions; +pub mod pair_proxy; pub mod proxy_common; pub mod proxy_farm; pub mod proxy_pair; diff --git a/locked-asset/proxy_dex/src/pair_interactions.rs b/locked-asset/proxy_dex/src/pair_interactions.rs index 7e959a4e1..360baf791 100644 --- a/locked-asset/proxy_dex/src/pair_interactions.rs +++ b/locked-asset/proxy_dex/src/pair_interactions.rs @@ -1,10 +1,6 @@ multiversx_sc::imports!(); -use pair::pair_actions::{ - add_liq::ProxyTrait as _, - common_result_types::{AddLiquidityResultType, RemoveLiquidityResultType}, - remove_liq::ProxyTrait as _, -}; +use crate::pair_proxy; pub struct AddLiquidityResultWrapper { pub lp_tokens_received: EsdtTokenPayment, @@ -38,11 +34,15 @@ pub trait PairInteractionsModule { all_token_payments.push(first_payment); all_token_payments.push(second_payment); - let raw_result: AddLiquidityResultType = self - .pair_contract_proxy(pair_address) + let raw_result = self + .tx() + .to(&pair_address) + .typed(pair_proxy::PairProxy) .add_liquidity(first_token_amount_min, second_token_amount_min) - .with_multi_token_transfer(all_token_payments) - .execute_on_dest_context(); + .payment(all_token_payments) + .returns(ReturnsResult) + .sync_call(); + let (lp_tokens_received, first_tokens_used, second_tokens_used) = raw_result.into_tuple(); let first_token_leftover_amount = &first_token_amount_desired - &first_tokens_used.amount; let second_token_leftover_amount = @@ -74,11 +74,15 @@ pub trait PairInteractionsModule { first_token_amount_min: BigUint, second_token_amount_min: BigUint, ) -> RemoveLiqudityResultWrapper { - let raw_result: RemoveLiquidityResultType = self - .pair_contract_proxy(pair_address) + let raw_result = self + .tx() + .to(&pair_address) + .typed(pair_proxy::PairProxy) .remove_liquidity(first_token_amount_min, second_token_amount_min) - .with_esdt_transfer((lp_token_id, 0, lp_token_amount)) - .execute_on_dest_context(); + .single_esdt(&lp_token_id, 0, &lp_token_amount) + .returns(ReturnsResult) + .sync_call(); + let (first_token_received, second_token_received) = raw_result.into_tuple(); RemoveLiqudityResultWrapper { @@ -86,7 +90,4 @@ pub trait PairInteractionsModule { second_token_received, } } - - #[proxy] - fn pair_contract_proxy(&self, to: ManagedAddress) -> pair::Proxy; } diff --git a/locked-asset/proxy_dex/src/pair_proxy.rs b/locked-asset/proxy_dex/src/pair_proxy.rs new file mode 100644 index 000000000..c0a49a9be --- /dev/null +++ b/locked-asset/proxy_dex/src/pair_proxy.rs @@ -0,0 +1,79 @@ +use multiversx_sc::proxy_imports::*; + +pub struct PairProxy; + +impl TxProxyTrait for PairProxy +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + type TxProxyMethods = PairProxyMethods; + + fn proxy_methods(self, tx: Tx) -> Self::TxProxyMethods { + PairProxyMethods { wrapped_tx: tx } + } +} + +pub struct PairProxyMethods +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + wrapped_tx: Tx, +} + +impl PairProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + pub fn add_liquidity>, Arg1: CodecInto>>( + self, + first_token_amount_min: Arg0, + second_token_amount_min: Arg1, + ) -> TxProxyCall< + Env, + From, + To, + Gas, + MultiValue3< + EsdtTokenPayment, + EsdtTokenPayment, + EsdtTokenPayment, + >, + > { + self.wrapped_tx + .raw_call("addLiquidity") + .argument(&first_token_amount_min) + .argument(&second_token_amount_min) + .original_result() + } + + pub fn remove_liquidity< + Arg0: CodecInto>, + Arg1: CodecInto>, + >( + self, + first_token_amount_min: Arg0, + second_token_amount_min: Arg1, + ) -> TxProxyCall< + Env, + From, + To, + Gas, + MultiValue2, EsdtTokenPayment>, + > { + self.wrapped_tx + .raw_call("removeLiquidity") + .argument(&first_token_amount_min) + .argument(&second_token_amount_min) + .original_result() + } +} From 4708c52df63d280bf2f3489f07d29e2760271d4b Mon Sep 17 00:00:00 2001 From: Mihai Calin Luca Date: Thu, 18 Apr 2024 00:01:12 +0200 Subject: [PATCH 24/55] clippy --- locked-asset/proxy_dex/src/pair_proxy.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/locked-asset/proxy_dex/src/pair_proxy.rs b/locked-asset/proxy_dex/src/pair_proxy.rs index c0a49a9be..4905a98ca 100644 --- a/locked-asset/proxy_dex/src/pair_proxy.rs +++ b/locked-asset/proxy_dex/src/pair_proxy.rs @@ -1,3 +1,5 @@ +#![allow(clippy::type_complexity)] + use multiversx_sc::proxy_imports::*; pub struct PairProxy; From d76f6ef0a3e0fc6dd5fa87d9217c0d6975cb8060 Mon Sep 17 00:00:00 2001 From: Mihai Calin Luca Date: Thu, 18 Apr 2024 17:14:34 +0200 Subject: [PATCH 25/55] price-provider, fees-collector and pause --- dex/governance/src/lib.rs | 1 + dex/governance/src/price_provider_proxy.rs | 52 ++++++++++++++++++ dex/governance/src/weight.rs | 29 ++++------ dex/pair/src/fee.rs | 15 +++--- dex/pair/src/fees_collector_proxy.rs | 44 +++++++++++++++ dex/pair/src/lib.rs | 1 + .../fees-collector/wasm/src/lib.rs | 5 +- .../governance-v2/src/fees_collector_proxy.rs | 52 ++++++++++++++++++ energy-integration/governance-v2/src/lib.rs | 22 +++++--- energy-integration/governance-v2/src/views.rs | 3 -- .../token-unstake/src/fees_collector_proxy.rs | 44 +++++++++++++++ .../token-unstake/src/fees_handler.rs | 27 +++------- locked-asset/token-unstake/src/lib.rs | 1 + pause-all/src/lib.rs | 29 ++++------ pause-all/src/pause_proxy.rs | 53 +++++++++++++++++++ 15 files changed, 298 insertions(+), 80 deletions(-) create mode 100644 dex/governance/src/price_provider_proxy.rs create mode 100644 dex/pair/src/fees_collector_proxy.rs create mode 100644 energy-integration/governance-v2/src/fees_collector_proxy.rs create mode 100644 locked-asset/token-unstake/src/fees_collector_proxy.rs create mode 100644 pause-all/src/pause_proxy.rs diff --git a/dex/governance/src/lib.rs b/dex/governance/src/lib.rs index 460aabcda..58d9f0088 100644 --- a/dex/governance/src/lib.rs +++ b/dex/governance/src/lib.rs @@ -9,6 +9,7 @@ multiversx_sc::derive_imports!(); pub mod config; pub mod errors; mod events; +pub mod price_provider_proxy; pub mod proposal; mod validation; pub mod vote; diff --git a/dex/governance/src/price_provider_proxy.rs b/dex/governance/src/price_provider_proxy.rs new file mode 100644 index 000000000..9d8ae475b --- /dev/null +++ b/dex/governance/src/price_provider_proxy.rs @@ -0,0 +1,52 @@ +use multiversx_sc::proxy_imports::*; + +pub struct PriceProviderProxy; + +impl TxProxyTrait for PriceProviderProxy +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + type TxProxyMethods = PriceProviderProxyMethods; + + fn proxy_methods(self, tx: Tx) -> Self::TxProxyMethods { + PriceProviderProxyMethods { wrapped_tx: tx } + } +} + +pub struct PriceProviderProxyMethods +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + wrapped_tx: Tx, +} + +impl PriceProviderProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + pub fn get_tokens_for_given_position_with_safe_price>>( + self, + liquidity: Arg0, + ) -> TxProxyCall< + Env, + From, + To, + Gas, + MultiValue2, EsdtTokenPayment>, + > { + self.wrapped_tx + .raw_call("getTokensForGivenPositionWithSafePrice") + .argument(&liquidity) + .original_result() + } +} diff --git a/dex/governance/src/weight.rs b/dex/governance/src/weight.rs index 2ce06ef20..f3c46f5c2 100644 --- a/dex/governance/src/weight.rs +++ b/dex/governance/src/weight.rs @@ -1,19 +1,7 @@ multiversx_sc::imports!(); use crate::config; - -mod price_provider_proxy { - multiversx_sc::imports!(); - - #[multiversx_sc::proxy] - pub trait PriceProvider { - #[endpoint(getTokensForGivenPositionWithSafePrice)] - fn get_tokens_for_given_position_with_safe_price( - &self, - liquidity: BigUint, - ) -> MultiValue2, EsdtTokenPayment>; - } -} +use crate::price_provider_proxy; #[multiversx_sc::module] pub trait Lib: config::Config { @@ -25,10 +13,14 @@ pub trait Lib: config::Config { } if let Some(provider) = self.price_providers().get(&payment.token_identifier) { - let call_result: MultiValue2, EsdtTokenPayment> = - self.price_provider_proxy(provider) - .get_tokens_for_given_position_with_safe_price(payment.amount.clone()) - .execute_on_dest_context(); + let call_result = self + .tx() + .to(&provider) + .typed(price_provider_proxy::PriceProviderProxy) + .get_tokens_for_given_position_with_safe_price(payment.amount.clone()) + .returns(ReturnsResult) + .sync_call(); + let (token1, token2) = call_result.into_tuple(); if token1.token_identifier == mex_token_id { @@ -49,7 +41,4 @@ pub trait Lib: config::Config { .payment(payment) .transfer(); } - - #[proxy] - fn price_provider_proxy(&self, to: ManagedAddress) -> price_provider_proxy::Proxy; } diff --git a/dex/pair/src/fee.rs b/dex/pair/src/fee.rs index 4d4f098ec..5703b1bf8 100644 --- a/dex/pair/src/fee.rs +++ b/dex/pair/src/fee.rs @@ -9,9 +9,9 @@ use crate::config::MAX_PERCENTAGE; use crate::contexts::base::StorageCache; use crate::contexts::base::SwapTokensOrder; +use crate::fees_collector_proxy; use crate::self_proxy; use common_structs::TokenPair; -use fees_collector::fees_accumulation::ProxyTrait as _; #[multiversx_sc::module] pub trait FeeModule: @@ -162,11 +162,13 @@ pub trait FeeModule: fn send_fees_collector_cut(&self, token: TokenIdentifier, cut_amount: BigUint) { let fees_collector_address = self.fees_collector_address().get(); - let _: IgnoreValue = self - .fees_collector_proxy(fees_collector_address) + + self.tx() + .to(&fees_collector_address) + .typed(fees_collector_proxy::FeesCollectorProxy) .deposit_swap_fees() - .with_esdt_transfer((token, 0, cut_amount)) - .execute_on_dest_context(); + .single_esdt(&token, 0, &cut_amount) + .sync_call(); } fn send_fee_slice( @@ -387,9 +389,6 @@ pub trait FeeModule: result } - #[proxy] - fn fees_collector_proxy(&self, sc_address: ManagedAddress) -> fees_collector::Proxy; - #[view(getFeesCollectorAddress)] #[storage_mapper("feesCollectorAddress")] fn fees_collector_address(&self) -> SingleValueMapper; diff --git a/dex/pair/src/fees_collector_proxy.rs b/dex/pair/src/fees_collector_proxy.rs new file mode 100644 index 000000000..fcbadf918 --- /dev/null +++ b/dex/pair/src/fees_collector_proxy.rs @@ -0,0 +1,44 @@ +use multiversx_sc::proxy_imports::*; + +pub struct FeesCollectorProxy; + +impl TxProxyTrait for FeesCollectorProxy +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + type TxProxyMethods = FeesCollectorProxyMethods; + + fn proxy_methods(self, tx: Tx) -> Self::TxProxyMethods { + FeesCollectorProxyMethods { wrapped_tx: tx } + } +} + +pub struct FeesCollectorProxyMethods +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + wrapped_tx: Tx, +} + +impl FeesCollectorProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + /// Pair SC will deposit the fees through this endpoint + /// Deposits for current week are accessible starting next week + pub fn deposit_swap_fees(self) -> TxProxyCall { + self.wrapped_tx + .raw_call("depositSwapFees") + .original_result() + } +} diff --git a/dex/pair/src/lib.rs b/dex/pair/src/lib.rs index bb8af39d2..6f7a2f308 100644 --- a/dex/pair/src/lib.rs +++ b/dex/pair/src/lib.rs @@ -10,6 +10,7 @@ mod energy_factory_lock_proxy; pub mod errors; mod events; pub mod fee; +pub mod fees_collector_proxy; mod liquidity_pool; pub mod locking_wrapper; pub mod pair_actions; diff --git a/energy-integration/fees-collector/wasm/src/lib.rs b/energy-integration/fees-collector/wasm/src/lib.rs index 75812bfb1..1be8d7b4c 100644 --- a/energy-integration/fees-collector/wasm/src/lib.rs +++ b/energy-integration/fees-collector/wasm/src/lib.rs @@ -5,9 +5,10 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 39 +// Upgrade: 1 +// Endpoints: 38 // Async Callback (empty): 1 -// Total number of exported functions: 41 +// Total number of exported functions: 40 #![no_std] #![allow(internal_features)] diff --git a/energy-integration/governance-v2/src/fees_collector_proxy.rs b/energy-integration/governance-v2/src/fees_collector_proxy.rs new file mode 100644 index 000000000..58f967368 --- /dev/null +++ b/energy-integration/governance-v2/src/fees_collector_proxy.rs @@ -0,0 +1,52 @@ +use multiversx_sc::proxy_imports::*; + +pub struct FeesCollectorProxy; + +impl TxProxyTrait for FeesCollectorProxy +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + type TxProxyMethods = FeesCollectorProxyMethods; + + fn proxy_methods(self, tx: Tx) -> Self::TxProxyMethods { + FeesCollectorProxyMethods { wrapped_tx: tx } + } +} + +pub struct FeesCollectorProxyMethods +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + wrapped_tx: Tx, +} + +impl FeesCollectorProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + pub fn last_global_update_week(self) -> TxProxyCall { + self.wrapped_tx + .raw_call("getLastGlobalUpdateWeek") + .original_result() + } + + pub fn total_energy_for_week>( + self, + week: Arg0, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getTotalEnergyForWeek") + .argument(&week) + .original_result() + } +} diff --git a/energy-integration/governance-v2/src/lib.rs b/energy-integration/governance-v2/src/lib.rs index 48a9212fe..3d1abec65 100644 --- a/energy-integration/governance-v2/src/lib.rs +++ b/energy-integration/governance-v2/src/lib.rs @@ -5,14 +5,13 @@ multiversx_sc::imports!(); pub mod configurable; mod errors; pub mod events; +pub mod fees_collector_proxy; pub mod proposal; pub mod proposal_storage; pub mod views; use proposal::*; use proposal_storage::VoteType; -use weekly_rewards_splitting::events::Week; -use weekly_rewards_splitting::global_info::ProxyTrait as _; use crate::configurable::{FULL_PERCENTAGE, MAX_GAS_LIMIT_PER_BLOCK}; use crate::errors::*; @@ -167,15 +166,22 @@ pub trait GovernanceV2: // First voter -> update total_energy if current_quorum == BigUint::zero() { let fees_collector_addr = self.fees_collector_address().get(); - let last_global_update_week: Week = self - .fees_collector_proxy(fees_collector_addr.clone()) + + let last_global_update_week = self + .tx() + .to(&fees_collector_addr) + .typed(fees_collector_proxy::FeesCollectorProxy) .last_global_update_week() - .execute_on_dest_context(); + .returns(ReturnsResult) + .sync_call(); - let total_quorum: BigUint = self - .fees_collector_proxy(fees_collector_addr) + let total_quorum = self + .tx() + .to(&fees_collector_addr) + .typed(fees_collector_proxy::FeesCollectorProxy) .total_energy_for_week(last_global_update_week) - .execute_on_dest_context(); + .returns(ReturnsResult) + .sync_call(); let mut proposal = self.proposals().get(proposal_id); proposal.total_quorum = total_quorum; diff --git a/energy-integration/governance-v2/src/views.rs b/energy-integration/governance-v2/src/views.rs index ec748edd9..d74d7e65f 100644 --- a/energy-integration/governance-v2/src/views.rs +++ b/energy-integration/governance-v2/src/views.rs @@ -100,9 +100,6 @@ pub trait ViewsModule: self.fees_collector_address().set(new_value); } - #[proxy] - fn fees_collector_proxy(&self, sc_address: ManagedAddress) -> fees_collector::Proxy; - #[view(getFeesCollectorAddress)] #[storage_mapper("feesCollectorAddress")] fn fees_collector_address(&self) -> SingleValueMapper; diff --git a/locked-asset/token-unstake/src/fees_collector_proxy.rs b/locked-asset/token-unstake/src/fees_collector_proxy.rs new file mode 100644 index 000000000..fcbadf918 --- /dev/null +++ b/locked-asset/token-unstake/src/fees_collector_proxy.rs @@ -0,0 +1,44 @@ +use multiversx_sc::proxy_imports::*; + +pub struct FeesCollectorProxy; + +impl TxProxyTrait for FeesCollectorProxy +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + type TxProxyMethods = FeesCollectorProxyMethods; + + fn proxy_methods(self, tx: Tx) -> Self::TxProxyMethods { + FeesCollectorProxyMethods { wrapped_tx: tx } + } +} + +pub struct FeesCollectorProxyMethods +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + wrapped_tx: Tx, +} + +impl FeesCollectorProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + /// Pair SC will deposit the fees through this endpoint + /// Deposits for current week are accessible starting next week + pub fn deposit_swap_fees(self) -> TxProxyCall { + self.wrapped_tx + .raw_call("depositSwapFees") + .original_result() + } +} diff --git a/locked-asset/token-unstake/src/fees_handler.rs b/locked-asset/token-unstake/src/fees_handler.rs index 803ef5345..2b66d2877 100644 --- a/locked-asset/token-unstake/src/fees_handler.rs +++ b/locked-asset/token-unstake/src/fees_handler.rs @@ -2,19 +2,9 @@ multiversx_sc::imports!(); pub const MAX_PENALTY_PERCENTAGE: u64 = 10_000; +use crate::fees_collector_proxy; use crate::{events, tokens_per_user::UnstakePair}; -pub mod fees_collector_proxy { - multiversx_sc::imports!(); - - #[multiversx_sc::proxy] - pub trait FeesCollectorProxy { - #[payable("*")] - #[endpoint(depositSwapFees)] - fn deposit_swap_fees(&self); - } -} - #[multiversx_sc::module] pub trait FeesHandlerModule: crate::tokens_per_user::TokensPerUserModule @@ -88,19 +78,14 @@ pub trait FeesHandlerModule: } let fees_collector_addr = self.fees_collector_address().get(); - let _: IgnoreValue = self - .fees_collector_proxy_builder(fees_collector_addr) + self.tx() + .to(&fees_collector_addr) + .typed(fees_collector_proxy::FeesCollectorProxy) .deposit_swap_fees() - .with_esdt_transfer(payment) - .execute_on_dest_context(); + .payment(payment) + .sync_call(); } - #[proxy] - fn fees_collector_proxy_builder( - &self, - sc_address: ManagedAddress, - ) -> fees_collector_proxy::Proxy; - #[view(getFeesBurnPercentage)] #[storage_mapper("feesBurnPercentage")] fn fees_burn_percentage(&self) -> SingleValueMapper; diff --git a/locked-asset/token-unstake/src/lib.rs b/locked-asset/token-unstake/src/lib.rs index eec55f376..e95b9edca 100644 --- a/locked-asset/token-unstake/src/lib.rs +++ b/locked-asset/token-unstake/src/lib.rs @@ -5,6 +5,7 @@ multiversx_sc::imports!(); pub mod cancel_unstake; pub mod energy_factory_unstake_proxy; pub mod events; +pub mod fees_collector_proxy; pub mod fees_handler; pub mod tokens_per_user; pub mod unbond_tokens; diff --git a/pause-all/src/lib.rs b/pause-all/src/lib.rs index 05f7fe541..eea5aea17 100644 --- a/pause-all/src/lib.rs +++ b/pause-all/src/lib.rs @@ -5,20 +5,8 @@ use ongoing_pause_operation::{OngoingOperation, MIN_GAS_TO_SAVE_PROGRESS}; multiversx_sc::imports!(); -mod pause_proxy { - multiversx_sc::imports!(); - - #[multiversx_sc::proxy] - pub trait Pausable { - #[endpoint] - fn pause(&self); - - #[endpoint] - fn resume(&self); - } -} - pub mod ongoing_pause_operation; +pub mod pause_proxy; #[multiversx_sc::contract] pub trait PauseAll: @@ -95,7 +83,11 @@ pub trait PauseAll: } fn call_pause(&self, sc_addr: ManagedAddress) { - let _: IgnoreValue = self.pause_proxy(sc_addr).pause().execute_on_dest_context(); + self.tx() + .to(&sc_addr) + .typed(pause_proxy::PausableProxy) + .pause() + .sync_call(); } /// Will unpause the given list of contracts. @@ -143,12 +135,13 @@ pub trait PauseAll: } fn call_resume(&self, sc_addr: ManagedAddress) { - let _: IgnoreValue = self.pause_proxy(sc_addr).resume().execute_on_dest_context(); + self.tx() + .to(&sc_addr) + .typed(pause_proxy::PausableProxy) + .resume() + .sync_call(); } - #[proxy] - fn pause_proxy(&self, addr: ManagedAddress) -> pause_proxy::Proxy; - #[view(getPausableContracts)] #[storage_mapper("pausableContracts")] fn pausable_contracts(&self) -> UnorderedSetMapper; diff --git a/pause-all/src/pause_proxy.rs b/pause-all/src/pause_proxy.rs new file mode 100644 index 000000000..f00bec1b9 --- /dev/null +++ b/pause-all/src/pause_proxy.rs @@ -0,0 +1,53 @@ +use multiversx_sc::proxy_imports::*; + +pub struct PausableProxy; + +impl TxProxyTrait for PausableProxy +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + type TxProxyMethods = PausableProxyMethods; + + fn proxy_methods(self, tx: Tx) -> Self::TxProxyMethods { + PausableProxyMethods { wrapped_tx: tx } + } +} + +pub struct PausableProxyMethods +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + wrapped_tx: Tx, +} + +#[rustfmt::skip] +impl PausableProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + pub fn pause( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("pause") + .original_result() + } + + pub fn resume( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("resume") + .original_result() + } +} From 399d50998492ce557fb8d9cbd2992aaa15490110 Mon Sep 17 00:00:00 2001 From: Mihai Calin Luca Date: Thu, 18 Apr 2024 21:10:38 +0200 Subject: [PATCH 26/55] the remaining proxies and build --- dex/proxy-deployer/src/farm_deploy.rs | 32 +++--- dex/proxy-deployer/src/farm_proxy.rs | 63 ++++++++++ dex/proxy-deployer/src/lib.rs | 1 + .../energy-factory-mock/wasm/Cargo.lock | 16 +-- .../energy-update/src/farm_proxy.rs | 46 ++++++++ energy-integration/energy-update/src/lib.rs | 13 +-- .../energy-update/wasm/Cargo.lock | 18 ++- .../energy-update/wasm/src/lib.rs | 5 +- .../fees-collector/wasm/Cargo.lock | 18 ++- .../governance-v2/wasm/Cargo.lock | 18 ++- .../governance-v2/wasm/src/lib.rs | 5 +- .../src/external_contracts_interactions.rs | 107 +++++++++-------- .../src/farm_staking_proxy_methods.rs | 96 ++++++++++++++++ .../src/farm_with_locked_rewards_proxy.rs | 86 ++++++++++++++ farm-staking/farm-staking-proxy/src/lib.rs | 2 + .../farm-staking-proxy/wasm/Cargo.lock | 18 ++- .../farm-staking-proxy/wasm/src/lib.rs | 5 +- farm-staking/farm-staking/wasm/Cargo.lock | 18 ++- farm-staking/farm-staking/wasm/src/lib.rs | 5 +- farm-staking/metabonding-staking/src/lib.rs | 1 + .../src/locked_asset_factory_proxy.rs | 45 ++++++++ .../src/locked_asset_token.rs | 18 ++- .../metabonding-staking/wasm/Cargo.lock | 16 +-- .../metabonding-staking/wasm/src/lib.rs | 5 +- locked-asset/distribution/src/lib.rs | 13 +-- .../src/locked_asset_factory_proxy.rs | 58 ++++++++++ locked-asset/distribution/wasm/Cargo.lock | 16 +-- locked-asset/distribution/wasm/src/lib.rs | 5 +- locked-asset/energy-factory/wasm/Cargo.lock | 16 +-- locked-asset/factory/wasm/Cargo.lock | 16 +-- locked-asset/factory/wasm/src/lib.rs | 5 +- locked-asset/lkmex-transfer/wasm/Cargo.lock | 16 +-- locked-asset/lkmex-transfer/wasm/src/lib.rs | 5 +- .../locked-token-wrapper/wasm/Cargo.lock | 16 +-- .../locked-token-wrapper/wasm/src/lib.rs | 5 +- .../proxy_dex/src/farm_interactions.rs | 46 ++++---- .../src/farm_with_locked_rewards_proxy.rs | 86 ++++++++++++++ locked-asset/proxy_dex/src/lib.rs | 1 + locked-asset/proxy_dex/wasm/Cargo.lock | 18 ++- locked-asset/proxy_dex/wasm/src/lib.rs | 5 +- .../simple-lock-whitelist/wasm/Cargo.lock | 16 +-- .../simple-lock-whitelist/wasm/src/lib.rs | 5 +- .../simple-lock/src/farm_interactions.rs | 108 ++++++------------ locked-asset/simple-lock/src/farm_proxy.rs | 75 ++++++++++++ locked-asset/simple-lock/src/lib.rs | 2 + .../simple-lock/src/lp_interactions.rs | 57 +++------ locked-asset/simple-lock/src/lp_proxy.rs | 69 +++++++++++ locked-asset/simple-lock/wasm/Cargo.lock | 16 +-- locked-asset/simple-lock/wasm/src/lib.rs | 5 +- locked-asset/token-unstake/wasm/Cargo.lock | 16 +-- locked-asset/token-unstake/wasm/src/lib.rs | 5 +- pause-all/wasm/Cargo.lock | 16 +-- pause-all/wasm/src/lib.rs | 5 +- 53 files changed, 980 insertions(+), 399 deletions(-) create mode 100644 dex/proxy-deployer/src/farm_proxy.rs create mode 100644 energy-integration/energy-update/src/farm_proxy.rs create mode 100644 farm-staking/farm-staking-proxy/src/farm_staking_proxy_methods.rs create mode 100644 farm-staking/farm-staking-proxy/src/farm_with_locked_rewards_proxy.rs create mode 100644 farm-staking/metabonding-staking/src/locked_asset_factory_proxy.rs create mode 100644 locked-asset/distribution/src/locked_asset_factory_proxy.rs create mode 100644 locked-asset/proxy_dex/src/farm_with_locked_rewards_proxy.rs create mode 100644 locked-asset/simple-lock/src/farm_proxy.rs create mode 100644 locked-asset/simple-lock/src/lp_proxy.rs diff --git a/dex/proxy-deployer/src/farm_deploy.rs b/dex/proxy-deployer/src/farm_deploy.rs index 8500946e8..96dee8056 100644 --- a/dex/proxy-deployer/src/farm_deploy.rs +++ b/dex/proxy-deployer/src/farm_deploy.rs @@ -1,6 +1,6 @@ -multiversx_sc::imports!(); +use crate::farm_proxy; -use farm::ProxyTrait as _; +multiversx_sc::imports!(); const DIVISION_SAFETY_CONST: u64 = 1_000_000_000_000_000_000; @@ -21,8 +21,10 @@ pub trait FarmDeployModule { let farm_template = self.farm_template_address().get(); let code_metadata = CodeMetadata::PAYABLE_BY_SC | CodeMetadata::READABLE | CodeMetadata::UPGRADEABLE; - let (new_farm_address, ()) = self - .farm_deploy_proxy() + + let new_farm_address = self + .tx() + .typed(farm_proxy::FarmProxy) .init( reward_token_id, farming_token_id, @@ -31,7 +33,10 @@ pub trait FarmDeployModule { owner, admins_list, ) - .deploy_from_source(&farm_template, code_metadata); + .from_source(farm_template) + .code_metadata(code_metadata) + .returns(ReturnsNewManagedAddress) + .sync_call(); self.deployer_farm_addresses(&caller) .update(|farm_addresses| { @@ -51,15 +56,13 @@ pub trait FarmDeployModule { args: MultiValueEncoded, ) { let gas_left = self.blockchain().get_gas_left(); - let mut contract_call = self - .send() - .contract_call::<()>(farm_address, function_name) - .with_gas_limit(gas_left); - for arg in args { - contract_call.push_raw_argument(arg); - } - let _: IgnoreValue = contract_call.execute_on_dest_context(); + self.tx() + .to(&farm_address) + .raw_call(function_name) + .gas(gas_left) + .arguments_raw(args.to_arg_buffer()) + .sync_call(); } #[view(getAllDeployedFarms)] @@ -71,9 +74,6 @@ pub trait FarmDeployModule { all_farm_addresses } - #[proxy] - fn farm_deploy_proxy(&self) -> farm::Proxy; - #[storage_mapper("farmTemplateAddress")] fn farm_template_address(&self) -> SingleValueMapper; diff --git a/dex/proxy-deployer/src/farm_proxy.rs b/dex/proxy-deployer/src/farm_proxy.rs new file mode 100644 index 000000000..65b8045fe --- /dev/null +++ b/dex/proxy-deployer/src/farm_proxy.rs @@ -0,0 +1,63 @@ +use multiversx_sc::proxy_imports::*; + +pub struct FarmProxy; + +impl TxProxyTrait for FarmProxy +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + type TxProxyMethods = FarmProxyMethods; + + fn proxy_methods(self, tx: Tx) -> Self::TxProxyMethods { + FarmProxyMethods { wrapped_tx: tx } + } +} + +pub struct FarmProxyMethods +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + wrapped_tx: Tx, +} + +#[rustfmt::skip] +impl FarmProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + Gas: TxGas, +{ + pub fn init< + Arg0: CodecInto>, + Arg1: CodecInto>, + Arg2: CodecInto>, + Arg3: CodecInto>, + Arg4: CodecInto>, + Arg5: CodecInto>>, + >( + self, + reward_token_id: Arg0, + farming_token_id: Arg1, + division_safety_constant: Arg2, + pair_contract_address: Arg3, + owner: Arg4, + admins: Arg5, + ) -> TxProxyDeploy { + self.wrapped_tx + .raw_deploy() + .argument(&reward_token_id) + .argument(&farming_token_id) + .argument(&division_safety_constant) + .argument(&pair_contract_address) + .argument(&owner) + .argument(&admins) + .original_result() + } +} diff --git a/dex/proxy-deployer/src/lib.rs b/dex/proxy-deployer/src/lib.rs index 7f7f0c16a..e2a7acffc 100644 --- a/dex/proxy-deployer/src/lib.rs +++ b/dex/proxy-deployer/src/lib.rs @@ -3,6 +3,7 @@ multiversx_sc::imports!(); pub mod farm_deploy; +pub mod farm_proxy; #[multiversx_sc::contract] pub trait ProxyDeployer: farm_deploy::FarmDeployModule { diff --git a/energy-integration/energy-factory-mock/wasm/Cargo.lock b/energy-integration/energy-factory-mock/wasm/Cargo.lock index 63470f3ab..5e02a9399 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.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" dependencies = [ "bitflags", "hex-literal", @@ -163,9 +163,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" dependencies = [ "hex", "proc-macro2", @@ -176,18 +176,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" dependencies = [ "multiversx-sc", ] diff --git a/energy-integration/energy-update/src/farm_proxy.rs b/energy-integration/energy-update/src/farm_proxy.rs new file mode 100644 index 000000000..853f78d71 --- /dev/null +++ b/energy-integration/energy-update/src/farm_proxy.rs @@ -0,0 +1,46 @@ +use multiversx_sc::proxy_imports::*; + +pub struct FarmProxy; + +impl TxProxyTrait for FarmProxy +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + type TxProxyMethods = FarmProxyMethods; + + fn proxy_methods(self, tx: Tx) -> Self::TxProxyMethods { + FarmProxyMethods { wrapped_tx: tx } + } +} + +pub struct FarmProxyMethods +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + wrapped_tx: Tx, +} + +impl FarmProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + pub fn update_energy_for_user>>( + self, + user: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("updateEnergyForUser") + .argument(&user) + .original_result() + } +} diff --git a/energy-integration/energy-update/src/lib.rs b/energy-integration/energy-update/src/lib.rs index 6cb9a7520..f09a54bc7 100644 --- a/energy-integration/energy-update/src/lib.rs +++ b/energy-integration/energy-update/src/lib.rs @@ -1,8 +1,7 @@ #![no_std] multiversx_sc::imports!(); - -use weekly_rewards_splitting::update_claim_progress_energy::ProxyTrait as _; +mod farm_proxy; #[multiversx_sc::contract] pub trait EnergyUpdate { @@ -19,13 +18,11 @@ pub trait EnergyUpdate { farm_addresses: MultiValueEncoded, ) { for farm_addr in farm_addresses { - let _: IgnoreValue = self - .farm_proxy(farm_addr) + self.tx() + .to(&farm_addr) + .typed(farm_proxy::FarmProxy) .update_energy_for_user(user.clone()) - .execute_on_dest_context(); + .sync_call(); } } - - #[proxy] - fn farm_proxy(&self, user: ManagedAddress) -> farm::Proxy; } diff --git a/energy-integration/energy-update/wasm/Cargo.lock b/energy-integration/energy-update/wasm/Cargo.lock index 9d23276fc..f1d29961e 100644 --- a/energy-integration/energy-update/wasm/Cargo.lock +++ b/energy-integration/energy-update/wasm/Cargo.lock @@ -274,9 +274,7 @@ dependencies = [ name = "locking_module" version = "0.0.0" dependencies = [ - "energy-factory", "multiversx-sc", - "simple-lock", ] [[package]] @@ -295,9 +293,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" dependencies = [ "bitflags", "hex-literal", @@ -330,9 +328,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" dependencies = [ "hex", "proc-macro2", @@ -343,18 +341,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" dependencies = [ "multiversx-sc", ] diff --git a/energy-integration/energy-update/wasm/src/lib.rs b/energy-integration/energy-update/wasm/src/lib.rs index b4de939ec..7c2a439a0 100644 --- a/energy-integration/energy-update/wasm/src/lib.rs +++ b/energy-integration/energy-update/wasm/src/lib.rs @@ -5,9 +5,10 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 2 +// Upgrade: 1 +// Endpoints: 1 // Async Callback (empty): 1 -// Total number of exported functions: 4 +// Total number of exported functions: 3 #![no_std] #![allow(internal_features)] diff --git a/energy-integration/fees-collector/wasm/Cargo.lock b/energy-integration/fees-collector/wasm/Cargo.lock index c91a53592..d29a16c62 100644 --- a/energy-integration/fees-collector/wasm/Cargo.lock +++ b/energy-integration/fees-collector/wasm/Cargo.lock @@ -133,9 +133,7 @@ dependencies = [ name = "locking_module" version = "0.0.0" dependencies = [ - "energy-factory", "multiversx-sc", - "simple-lock", ] [[package]] @@ -154,9 +152,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" dependencies = [ "bitflags", "hex-literal", @@ -189,9 +187,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" dependencies = [ "hex", "proc-macro2", @@ -202,18 +200,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" dependencies = [ "multiversx-sc", ] diff --git a/energy-integration/governance-v2/wasm/Cargo.lock b/energy-integration/governance-v2/wasm/Cargo.lock index 6ff033cc1..a71a95db7 100644 --- a/energy-integration/governance-v2/wasm/Cargo.lock +++ b/energy-integration/governance-v2/wasm/Cargo.lock @@ -144,9 +144,7 @@ dependencies = [ name = "locking_module" version = "0.0.0" dependencies = [ - "energy-factory", "multiversx-sc", - "simple-lock", ] [[package]] @@ -165,9 +163,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" dependencies = [ "bitflags", "hex-literal", @@ -200,9 +198,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" dependencies = [ "hex", "proc-macro2", @@ -213,18 +211,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" dependencies = [ "multiversx-sc", ] diff --git a/energy-integration/governance-v2/wasm/src/lib.rs b/energy-integration/governance-v2/wasm/src/lib.rs index bb977bc97..f01aaec5e 100644 --- a/energy-integration/governance-v2/wasm/src/lib.rs +++ b/energy-integration/governance-v2/wasm/src/lib.rs @@ -5,9 +5,10 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 30 +// Upgrade: 1 +// Endpoints: 29 // Async Callback (empty): 1 -// Total number of exported functions: 32 +// Total number of exported functions: 31 #![no_std] #![allow(internal_features)] diff --git a/farm-staking/farm-staking-proxy/src/external_contracts_interactions.rs b/farm-staking/farm-staking-proxy/src/external_contracts_interactions.rs index 3c71ec22f..3f1213ea7 100644 --- a/farm-staking/farm-staking-proxy/src/external_contracts_interactions.rs +++ b/farm-staking/farm-staking-proxy/src/external_contracts_interactions.rs @@ -1,17 +1,10 @@ multiversx_sc::imports!(); -use farm::{ - base_functions::{ClaimRewardsResultType, DoubleMultiPayment}, - EnterFarmResultType, ExitFarmWithPartialPosResultType, -}; -use farm_staking::{ - claim_stake_farm_rewards::ProxyTrait as _, stake_farm::ProxyTrait as _, - unstake_farm::ProxyTrait as _, -}; -use farm_with_locked_rewards::ProxyTrait as _; +use farm::base_functions::DoubleMultiPayment; +use crate::farm_staking_proxy_methods; +use crate::farm_with_locked_rewards_proxy; use crate::pair_proxy; - use crate::result_types::*; pub type SafePriceResult = MultiValue2, EsdtTokenPayment>; @@ -30,11 +23,19 @@ pub trait ExternalContractsInteractionsModule: lp_farm_token_amount: BigUint, ) -> LpFarmClaimRewardsResult { let lp_farm_address = self.lp_farm_address().get(); - let lp_farm_result: ClaimRewardsResultType = self - .lp_farm_proxy_obj(lp_farm_address) + let lp_farm_result = self + .tx() + .to(&lp_farm_address) + .typed(farm_with_locked_rewards_proxy::FarmProxy) .claim_rewards_endpoint(orig_caller) - .with_esdt_transfer((lp_farm_token_id, lp_farm_token_nonce, lp_farm_token_amount)) - .execute_on_dest_context(); + .single_esdt( + &lp_farm_token_id, + lp_farm_token_nonce, + &lp_farm_token_amount, + ) + .returns(ReturnsResult) + .sync_call(); + let (new_lp_farm_tokens, lp_farm_rewards) = lp_farm_result.into_tuple(); LpFarmClaimRewardsResult { @@ -51,11 +52,19 @@ pub trait ExternalContractsInteractionsModule: ) -> LpFarmExitResult { let lp_farm_token_id = self.lp_farm_token_id().get(); let lp_farm_address = self.lp_farm_address().get(); - let exit_farm_result: ExitFarmWithPartialPosResultType = self - .lp_farm_proxy_obj(lp_farm_address) + let exit_farm_result = self + .tx() + .to(&lp_farm_address) + .typed(farm_with_locked_rewards_proxy::FarmProxy) .exit_farm_endpoint(orig_caller) - .with_esdt_transfer((lp_farm_token_id, lp_farm_token_nonce, lp_farm_token_amount)) - .execute_on_dest_context(); + .single_esdt( + &lp_farm_token_id, + lp_farm_token_nonce, + &lp_farm_token_amount, + ) + .returns(ReturnsResult) + .sync_call(); + let (lp_tokens, lp_farm_rewards) = exit_farm_result.into_tuple(); LpFarmExitResult { @@ -79,10 +88,13 @@ pub trait ExternalContractsInteractionsModule: additional_lp_farm_tokens.push(base_lp_farm_token); let lp_farm_address = self.lp_farm_address().get(); - self.lp_farm_proxy_obj(lp_farm_address) + self.tx() + .to(lp_farm_address) + .typed(farm_with_locked_rewards_proxy::FarmProxy) .merge_farm_tokens_endpoint(orig_caller) - .with_multi_token_transfer(additional_lp_farm_tokens) - .execute_on_dest_context() + .payment(additional_lp_farm_tokens) + .returns(ReturnsResult) + .sync_call() } // staking farm @@ -94,11 +106,15 @@ pub trait ExternalContractsInteractionsModule: staking_farm_tokens: PaymentsVec, ) -> StakingFarmEnterResult { let staking_farm_address = self.staking_farm_address().get(); - let enter_result: EnterFarmResultType = self - .staking_farm_proxy_obj(staking_farm_address) + let enter_result = self + .tx() + .to(&staking_farm_address) + .typed(farm_staking_proxy_methods::FarmStakingProxy) .stake_farm_through_proxy(staking_token_amount, orig_caller) - .with_multi_token_transfer(staking_farm_tokens) - .execute_on_dest_context(); + .payment(staking_farm_tokens) + .returns(ReturnsResult) + .sync_call(); + let (received_staking_farm_token, boosted_rewards) = enter_result.into_tuple(); StakingFarmEnterResult { @@ -116,15 +132,19 @@ pub trait ExternalContractsInteractionsModule: new_staking_farm_value: BigUint, ) -> StakingFarmClaimRewardsResult { let staking_farm_address = self.staking_farm_address().get(); - let staking_farm_result: ClaimRewardsResultType = self - .staking_farm_proxy_obj(staking_farm_address) + let staking_farm_result = self + .tx() + .to(&staking_farm_address) + .typed(farm_staking_proxy_methods::FarmStakingProxy) .claim_rewards_with_new_value(new_staking_farm_value, orig_caller) - .with_esdt_transfer(( - staking_farm_token_id, + .single_esdt( + &staking_farm_token_id, staking_farm_token_nonce, - staking_farm_token_amount, - )) - .execute_on_dest_context(); + &staking_farm_token_amount, + ) + .returns(ReturnsResult) + .sync_call(); + let (new_staking_farm_tokens, staking_farm_rewards) = staking_farm_result.into_tuple(); StakingFarmClaimRewardsResult { @@ -149,11 +169,15 @@ pub trait ExternalContractsInteractionsModule: )); let staking_farm_address = self.staking_farm_address().get(); - let unstake_result: ExitFarmWithPartialPosResultType = self - .staking_farm_proxy_obj(staking_farm_address) + let unstake_result = self + .tx() + .to(&staking_farm_address) + .typed(farm_staking_proxy_methods::FarmStakingProxy) .unstake_farm_through_proxy(orig_caller) - .with_multi_token_transfer(payments) - .execute_on_dest_context(); + .payment(payments) + .returns(ReturnsResult) + .sync_call(); + let (unbond_staking_farm_token, staking_rewards) = unstake_result.into_tuple(); StakingFarmExitResult { @@ -221,17 +245,6 @@ pub trait ExternalContractsInteractionsModule: } } - // proxies - - #[proxy] - fn staking_farm_proxy_obj(&self, sc_address: ManagedAddress) -> farm_staking::Proxy; - - #[proxy] - fn lp_farm_proxy_obj( - &self, - sc_address: ManagedAddress, - ) -> farm_with_locked_rewards::Proxy; - // storage #[view(getLpFarmAddress)] diff --git a/farm-staking/farm-staking-proxy/src/farm_staking_proxy_methods.rs b/farm-staking/farm-staking-proxy/src/farm_staking_proxy_methods.rs new file mode 100644 index 000000000..8f2a35ebc --- /dev/null +++ b/farm-staking/farm-staking-proxy/src/farm_staking_proxy_methods.rs @@ -0,0 +1,96 @@ +#![allow(clippy::type_complexity)] + +use multiversx_sc::proxy_imports::*; + +pub struct FarmStakingProxy; + +impl TxProxyTrait for FarmStakingProxy +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + type TxProxyMethods = FarmStakingProxyMethods; + + fn proxy_methods(self, tx: Tx) -> Self::TxProxyMethods { + FarmStakingProxyMethods { wrapped_tx: tx } + } +} + +pub struct FarmStakingProxyMethods +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + wrapped_tx: Tx, +} + +impl FarmStakingProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + pub fn stake_farm_through_proxy< + Arg0: CodecInto>, + Arg1: CodecInto>, + >( + self, + staked_token_amount: Arg0, + original_caller: Arg1, + ) -> TxProxyCall< + Env, + From, + To, + Gas, + MultiValue2, EsdtTokenPayment>, + > { + self.wrapped_tx + .raw_call("stakeFarmThroughProxy") + .argument(&staked_token_amount) + .argument(&original_caller) + .original_result() + } + + pub fn claim_rewards_with_new_value< + Arg0: CodecInto>, + Arg1: CodecInto>, + >( + self, + new_farming_amount: Arg0, + original_caller: Arg1, + ) -> TxProxyCall< + Env, + From, + To, + Gas, + MultiValue2, EsdtTokenPayment>, + > { + self.wrapped_tx + .raw_call("claimRewardsWithNewValue") + .argument(&new_farming_amount) + .argument(&original_caller) + .original_result() + } + + pub fn unstake_farm_through_proxy>>( + self, + original_caller: Arg0, + ) -> TxProxyCall< + Env, + From, + To, + Gas, + MultiValue2, EsdtTokenPayment>, + > { + self.wrapped_tx + .raw_call("unstakeFarmThroughProxy") + .argument(&original_caller) + .original_result() + } +} diff --git a/farm-staking/farm-staking-proxy/src/farm_with_locked_rewards_proxy.rs b/farm-staking/farm-staking-proxy/src/farm_with_locked_rewards_proxy.rs new file mode 100644 index 000000000..81b3565c0 --- /dev/null +++ b/farm-staking/farm-staking-proxy/src/farm_with_locked_rewards_proxy.rs @@ -0,0 +1,86 @@ +#![allow(clippy::type_complexity)] + +use multiversx_sc::proxy_imports::*; + +pub struct FarmProxy; + +impl TxProxyTrait for FarmProxy +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + type TxProxyMethods = FarmProxyMethods; + + fn proxy_methods(self, tx: Tx) -> Self::TxProxyMethods { + FarmProxyMethods { wrapped_tx: tx } + } +} + +pub struct FarmProxyMethods +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + wrapped_tx: Tx, +} + +impl FarmProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + pub fn exit_farm_endpoint>>>( + self, + opt_orig_caller: Arg0, + ) -> TxProxyCall< + Env, + From, + To, + Gas, + MultiValue2, EsdtTokenPayment>, + > { + self.wrapped_tx + .raw_call("exitFarm") + .argument(&opt_orig_caller) + .original_result() + } + + pub fn claim_rewards_endpoint>>>( + self, + opt_orig_caller: Arg0, + ) -> TxProxyCall< + Env, + From, + To, + Gas, + MultiValue2, EsdtTokenPayment>, + > { + self.wrapped_tx + .raw_call("claimRewards") + .argument(&opt_orig_caller) + .original_result() + } + + pub fn merge_farm_tokens_endpoint>>>( + self, + opt_orig_caller: Arg0, + ) -> TxProxyCall< + Env, + From, + To, + Gas, + MultiValue2, EsdtTokenPayment>, + > { + self.wrapped_tx + .raw_call("mergeFarmTokens") + .argument(&opt_orig_caller) + .original_result() + } +} diff --git a/farm-staking/farm-staking-proxy/src/lib.rs b/farm-staking/farm-staking-proxy/src/lib.rs index 05743d0ec..e565a5407 100644 --- a/farm-staking/farm-staking-proxy/src/lib.rs +++ b/farm-staking/farm-staking-proxy/src/lib.rs @@ -4,6 +4,8 @@ multiversx_sc::imports!(); pub mod dual_yield_token; pub mod external_contracts_interactions; +pub mod farm_staking_proxy_methods; +pub mod farm_with_locked_rewards_proxy; pub mod lp_farm_token; pub mod pair_proxy; pub mod proxy_actions; diff --git a/farm-staking/farm-staking-proxy/wasm/Cargo.lock b/farm-staking/farm-staking-proxy/wasm/Cargo.lock index 4462d4205..4169daf52 100644 --- a/farm-staking/farm-staking-proxy/wasm/Cargo.lock +++ b/farm-staking/farm-staking-proxy/wasm/Cargo.lock @@ -355,9 +355,7 @@ dependencies = [ name = "locking_module" version = "0.0.0" dependencies = [ - "energy-factory", "multiversx-sc", - "simple-lock", ] [[package]] @@ -376,9 +374,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" dependencies = [ "bitflags", "hex-literal 0.4.1", @@ -411,9 +409,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" dependencies = [ "hex", "proc-macro2", @@ -424,18 +422,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" dependencies = [ "multiversx-sc", ] diff --git a/farm-staking/farm-staking-proxy/wasm/src/lib.rs b/farm-staking/farm-staking-proxy/wasm/src/lib.rs index ee8a50b10..4828cb23a 100644 --- a/farm-staking/farm-staking-proxy/wasm/src/lib.rs +++ b/farm-staking/farm-staking-proxy/wasm/src/lib.rs @@ -5,9 +5,10 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 18 +// Upgrade: 1 +// Endpoints: 17 // Async Callback: 1 -// Total number of exported functions: 20 +// Total number of exported functions: 19 #![no_std] #![allow(internal_features)] diff --git a/farm-staking/farm-staking/wasm/Cargo.lock b/farm-staking/farm-staking/wasm/Cargo.lock index 79a0f410b..df6d9c270 100644 --- a/farm-staking/farm-staking/wasm/Cargo.lock +++ b/farm-staking/farm-staking/wasm/Cargo.lock @@ -295,9 +295,7 @@ dependencies = [ name = "locking_module" version = "0.0.0" dependencies = [ - "energy-factory", "multiversx-sc", - "simple-lock", ] [[package]] @@ -316,9 +314,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" dependencies = [ "bitflags", "hex-literal", @@ -351,9 +349,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" dependencies = [ "hex", "proc-macro2", @@ -364,18 +362,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" dependencies = [ "multiversx-sc", ] diff --git a/farm-staking/farm-staking/wasm/src/lib.rs b/farm-staking/farm-staking/wasm/src/lib.rs index 4bc7e0bbb..e0df648cc 100644 --- a/farm-staking/farm-staking/wasm/src/lib.rs +++ b/farm-staking/farm-staking/wasm/src/lib.rs @@ -5,9 +5,10 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 71 +// Upgrade: 1 +// Endpoints: 70 // Async Callback: 1 -// Total number of exported functions: 73 +// Total number of exported functions: 72 #![no_std] #![allow(internal_features)] diff --git a/farm-staking/metabonding-staking/src/lib.rs b/farm-staking/metabonding-staking/src/lib.rs index 9f4f89723..fbe710185 100644 --- a/farm-staking/metabonding-staking/src/lib.rs +++ b/farm-staking/metabonding-staking/src/lib.rs @@ -3,6 +3,7 @@ multiversx_sc::imports!(); pub mod events; +pub mod locked_asset_factory_proxy; pub mod locked_asset_token; use locked_asset_token::UserEntry; diff --git a/farm-staking/metabonding-staking/src/locked_asset_factory_proxy.rs b/farm-staking/metabonding-staking/src/locked_asset_factory_proxy.rs new file mode 100644 index 000000000..d0f49b566 --- /dev/null +++ b/farm-staking/metabonding-staking/src/locked_asset_factory_proxy.rs @@ -0,0 +1,45 @@ +use multiversx_sc::proxy_imports::*; + +pub struct LockedAssetFactoryProxy; + +impl TxProxyTrait for LockedAssetFactoryProxy +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + type TxProxyMethods = LockedAssetFactoryProxyMethods; + + fn proxy_methods(self, tx: Tx) -> Self::TxProxyMethods { + LockedAssetFactoryProxyMethods { wrapped_tx: tx } + } +} + +pub struct LockedAssetFactoryProxyMethods +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + wrapped_tx: Tx, +} + +#[rustfmt::skip] +impl LockedAssetFactoryProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + pub fn merge_tokens( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("mergeTokens") + .original_result() + } +} diff --git a/farm-staking/metabonding-staking/src/locked_asset_token.rs b/farm-staking/metabonding-staking/src/locked_asset_token.rs index c5c354fab..ef19e9a5a 100644 --- a/farm-staking/metabonding-staking/src/locked_asset_token.rs +++ b/farm-staking/metabonding-staking/src/locked_asset_token.rs @@ -1,8 +1,8 @@ +use crate::locked_asset_factory_proxy; + multiversx_sc::imports!(); multiversx_sc::derive_imports!(); -use factory::locked_asset_token_merge::ProxyTrait as _; - pub type PaymentsVec = ManagedVec>; #[derive(TypeAbi, TopEncode, TopDecode, NestedEncode, Debug, PartialEq)] @@ -81,17 +81,15 @@ pub trait LockedAssetTokenModule { } let locked_asset_factory_address = self.locked_asset_factory_address().get(); - self.locked_asset_factory_proxy(locked_asset_factory_address) + self.tx() + .to(&locked_asset_factory_address) + .typed(locked_asset_factory_proxy::LockedAssetFactoryProxy) .merge_tokens() - .with_multi_token_transfer(tokens) - .execute_on_dest_context() + .payment(tokens) + .returns(ReturnsResult) + .sync_call() } - // proxies - - #[proxy] - fn locked_asset_factory_proxy(&self, sc_address: ManagedAddress) -> factory::Proxy; - // storage #[view(getLockedAssetTokenId)] diff --git a/farm-staking/metabonding-staking/wasm/Cargo.lock b/farm-staking/metabonding-staking/wasm/Cargo.lock index 21aba28e9..5a7ca782e 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.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" dependencies = [ "bitflags", "hex-literal", @@ -205,9 +205,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" dependencies = [ "hex", "proc-macro2", @@ -218,18 +218,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" dependencies = [ "multiversx-sc", ] diff --git a/farm-staking/metabonding-staking/wasm/src/lib.rs b/farm-staking/metabonding-staking/wasm/src/lib.rs index b8e948d22..7bdb3be27 100644 --- a/farm-staking/metabonding-staking/wasm/src/lib.rs +++ b/farm-staking/metabonding-staking/wasm/src/lib.rs @@ -5,9 +5,10 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 11 +// Upgrade: 1 +// Endpoints: 10 // Async Callback (empty): 1 -// Total number of exported functions: 13 +// Total number of exported functions: 12 #![no_std] #![allow(internal_features)] diff --git a/locked-asset/distribution/src/lib.rs b/locked-asset/distribution/src/lib.rs index b996701df..8fdda3e46 100644 --- a/locked-asset/distribution/src/lib.rs +++ b/locked-asset/distribution/src/lib.rs @@ -7,6 +7,7 @@ multiversx_sc::imports!(); multiversx_sc::derive_imports!(); mod global_op; +mod locked_asset_factory_proxy; const GAS_THRESHOLD: u64 = 100_000; const MAX_CLAIMABLE_DISTRIBUTION_ROUNDS: usize = 4; @@ -32,9 +33,6 @@ pub struct CommunityDistribution { #[multiversx_sc::contract] pub trait Distribution: global_op::GlobalOperationModule { - #[proxy] - fn locked_asset_factory_proxy(&self, to: ManagedAddress) -> factory::Proxy; - #[init] fn init(&self, asset_token_id: TokenIdentifier, locked_asset_factory_address: ManagedAddress) { require!( @@ -112,16 +110,17 @@ pub trait Distribution: global_op::GlobalOperationModule { for elem in locked_assets.iter() { let amount = elem.biguint; let spread_epoch = elem.epoch; - let _: IgnoreValue = self - .locked_asset_factory_proxy(to.clone()) + self.tx() + .to(&to) + .typed(locked_asset_factory_proxy::LockedAssetFactoryProxy) .create_and_forward_custom_period( amount.clone(), caller.clone(), spread_epoch, unlock_period.clone(), ) - .with_gas_limit(gas_limit_per_execute) - .execute_on_dest_context(); + .gas(gas_limit_per_execute) + .sync_call(); cummulated_amount += amount; } diff --git a/locked-asset/distribution/src/locked_asset_factory_proxy.rs b/locked-asset/distribution/src/locked_asset_factory_proxy.rs new file mode 100644 index 000000000..9dacf6ade --- /dev/null +++ b/locked-asset/distribution/src/locked_asset_factory_proxy.rs @@ -0,0 +1,58 @@ +use multiversx_sc::proxy_imports::*; + +pub struct LockedAssetFactoryProxy; + +impl TxProxyTrait for LockedAssetFactoryProxy +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + type TxProxyMethods = LockedAssetFactoryProxyMethods; + + fn proxy_methods(self, tx: Tx) -> Self::TxProxyMethods { + LockedAssetFactoryProxyMethods { wrapped_tx: tx } + } +} + +pub struct LockedAssetFactoryProxyMethods +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + wrapped_tx: Tx, +} + +#[rustfmt::skip] +impl LockedAssetFactoryProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + pub fn create_and_forward_custom_period< + Arg0: CodecInto>, + Arg1: CodecInto>, + Arg2: CodecInto, + Arg3: CodecInto>, + >( + self, + amount: Arg0, + address: Arg1, + start_epoch: Arg2, + unlock_period: Arg3, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("createAndForwardCustomPeriod") + .argument(&amount) + .argument(&address) + .argument(&start_epoch) + .argument(&unlock_period) + .original_result() + } +} diff --git a/locked-asset/distribution/wasm/Cargo.lock b/locked-asset/distribution/wasm/Cargo.lock index a66da5bfb..cf192200d 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.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" dependencies = [ "bitflags", "hex-literal", @@ -205,9 +205,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" dependencies = [ "hex", "proc-macro2", @@ -218,18 +218,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" dependencies = [ "multiversx-sc", ] diff --git a/locked-asset/distribution/wasm/src/lib.rs b/locked-asset/distribution/wasm/src/lib.rs index 87c728bb7..1e4191e89 100644 --- a/locked-asset/distribution/wasm/src/lib.rs +++ b/locked-asset/distribution/wasm/src/lib.rs @@ -5,9 +5,10 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 16 +// Upgrade: 1 +// Endpoints: 15 // Async Callback (empty): 1 -// Total number of exported functions: 18 +// Total number of exported functions: 17 #![no_std] #![allow(internal_features)] diff --git a/locked-asset/energy-factory/wasm/Cargo.lock b/locked-asset/energy-factory/wasm/Cargo.lock index d25961008..38e0f596c 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.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" dependencies = [ "bitflags", "hex-literal", @@ -147,9 +147,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" dependencies = [ "hex", "proc-macro2", @@ -160,18 +160,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" dependencies = [ "multiversx-sc", ] diff --git a/locked-asset/factory/wasm/Cargo.lock b/locked-asset/factory/wasm/Cargo.lock index 26e60cd35..d3fd72377 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.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" dependencies = [ "bitflags", "hex-literal", @@ -196,9 +196,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" dependencies = [ "hex", "proc-macro2", @@ -209,18 +209,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" dependencies = [ "multiversx-sc", ] diff --git a/locked-asset/factory/wasm/src/lib.rs b/locked-asset/factory/wasm/src/lib.rs index 7ad9e4ac0..970c7303f 100644 --- a/locked-asset/factory/wasm/src/lib.rs +++ b/locked-asset/factory/wasm/src/lib.rs @@ -5,9 +5,10 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 25 +// Upgrade: 1 +// Endpoints: 24 // Async Callback: 1 -// Total number of exported functions: 27 +// Total number of exported functions: 26 #![no_std] #![allow(internal_features)] diff --git a/locked-asset/lkmex-transfer/wasm/Cargo.lock b/locked-asset/lkmex-transfer/wasm/Cargo.lock index b1689bd61..514ce3931 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.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" dependencies = [ "bitflags", "hex-literal", @@ -169,9 +169,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" dependencies = [ "hex", "proc-macro2", @@ -182,18 +182,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" dependencies = [ "multiversx-sc", ] diff --git a/locked-asset/lkmex-transfer/wasm/src/lib.rs b/locked-asset/lkmex-transfer/wasm/src/lib.rs index 6df953b3e..bc20909e1 100644 --- a/locked-asset/lkmex-transfer/wasm/src/lib.rs +++ b/locked-asset/lkmex-transfer/wasm/src/lib.rs @@ -5,9 +5,10 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 12 +// Upgrade: 1 +// Endpoints: 11 // Async Callback (empty): 1 -// Total number of exported functions: 14 +// Total number of exported functions: 13 #![no_std] #![allow(internal_features)] diff --git a/locked-asset/locked-token-wrapper/wasm/Cargo.lock b/locked-asset/locked-token-wrapper/wasm/Cargo.lock index cf219a208..de7509857 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.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" dependencies = [ "bitflags", "hex-literal", @@ -193,9 +193,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" dependencies = [ "hex", "proc-macro2", @@ -206,18 +206,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" dependencies = [ "multiversx-sc", ] diff --git a/locked-asset/locked-token-wrapper/wasm/src/lib.rs b/locked-asset/locked-token-wrapper/wasm/src/lib.rs index 6c59af09c..bba9f768f 100644 --- a/locked-asset/locked-token-wrapper/wasm/src/lib.rs +++ b/locked-asset/locked-token-wrapper/wasm/src/lib.rs @@ -5,9 +5,10 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 9 +// Upgrade: 1 +// Endpoints: 8 // Async Callback: 1 -// Total number of exported functions: 11 +// Total number of exported functions: 10 #![no_std] #![allow(internal_features)] diff --git a/locked-asset/proxy_dex/src/farm_interactions.rs b/locked-asset/proxy_dex/src/farm_interactions.rs index dab9a7825..8c5749a35 100644 --- a/locked-asset/proxy_dex/src/farm_interactions.rs +++ b/locked-asset/proxy_dex/src/farm_interactions.rs @@ -1,10 +1,7 @@ multiversx_sc::imports!(); -use farm::{ - base_functions::{ClaimRewardsResultType, ClaimRewardsResultWrapper}, - EnterFarmResultType, ExitFarmWithPartialPosResultType, -}; -use farm_with_locked_rewards::ProxyTrait as _; +use crate::farm_with_locked_rewards_proxy; +use farm::base_functions::ClaimRewardsResultWrapper; pub struct EnterFarmResultWrapper { pub farm_token: EsdtTokenPayment, @@ -25,11 +22,14 @@ pub trait FarmInteractionsModule { farming_token_id: TokenIdentifier, farming_token_amount: BigUint, ) -> EnterFarmResultWrapper { - let enter_farm_result: EnterFarmResultType = self - .farm_contract_proxy(farm_address) + let enter_farm_result = self + .tx() + .to(&farm_address) + .typed(farm_with_locked_rewards_proxy::FarmProxy) .enter_farm_endpoint(user) - .with_esdt_transfer((farming_token_id, 0, farming_token_amount)) - .execute_on_dest_context(); + .single_esdt(&farming_token_id, 0, &farming_token_amount) + .returns(ReturnsResult) + .sync_call(); let (output_farm_token_payment, rewards_payment) = enter_farm_result.into_tuple(); @@ -45,11 +45,15 @@ pub trait FarmInteractionsModule { farm_address: ManagedAddress, farm_token: EsdtTokenPayment, ) -> ExitFarmResultWrapper { - let raw_result: ExitFarmWithPartialPosResultType = self - .farm_contract_proxy(farm_address) + let raw_result = self + .tx() + .to(&farm_address) + .typed(farm_with_locked_rewards_proxy::FarmProxy) .exit_farm_endpoint(user) - .with_esdt_transfer(farm_token) - .execute_on_dest_context(); + .payment(farm_token) + .returns(ReturnsResult) + .sync_call(); + let (farming_tokens, reward_tokens) = raw_result.into_tuple(); ExitFarmResultWrapper { @@ -64,11 +68,15 @@ pub trait FarmInteractionsModule { farm_address: ManagedAddress, farm_token: EsdtTokenPayment, ) -> ClaimRewardsResultWrapper { - let raw_result: ClaimRewardsResultType = self - .farm_contract_proxy(farm_address) + let raw_result = self + .tx() + .to(&farm_address) + .typed(farm_with_locked_rewards_proxy::FarmProxy) .claim_rewards_endpoint(user) - .with_esdt_transfer(farm_token) - .execute_on_dest_context(); + .payment(farm_token) + .returns(ReturnsResult) + .sync_call(); + let (new_farm_token, rewards) = raw_result.into_tuple(); ClaimRewardsResultWrapper { @@ -76,8 +84,4 @@ pub trait FarmInteractionsModule { rewards, } } - - #[proxy] - fn farm_contract_proxy(&self, to: ManagedAddress) - -> farm_with_locked_rewards::Proxy; } diff --git a/locked-asset/proxy_dex/src/farm_with_locked_rewards_proxy.rs b/locked-asset/proxy_dex/src/farm_with_locked_rewards_proxy.rs new file mode 100644 index 000000000..1dd1279b8 --- /dev/null +++ b/locked-asset/proxy_dex/src/farm_with_locked_rewards_proxy.rs @@ -0,0 +1,86 @@ +#![allow(clippy::type_complexity)] + +use multiversx_sc::proxy_imports::*; + +pub struct FarmProxy; + +impl TxProxyTrait for FarmProxy +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + type TxProxyMethods = FarmProxyMethods; + + fn proxy_methods(self, tx: Tx) -> Self::TxProxyMethods { + FarmProxyMethods { wrapped_tx: tx } + } +} + +pub struct FarmProxyMethods +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + wrapped_tx: Tx, +} + +impl FarmProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + pub fn enter_farm_endpoint>>>( + self, + opt_orig_caller: Arg0, + ) -> TxProxyCall< + Env, + From, + To, + Gas, + MultiValue2, EsdtTokenPayment>, + > { + self.wrapped_tx + .raw_call("enterFarm") + .argument(&opt_orig_caller) + .original_result() + } + + pub fn exit_farm_endpoint>>>( + self, + opt_orig_caller: Arg0, + ) -> TxProxyCall< + Env, + From, + To, + Gas, + MultiValue2, EsdtTokenPayment>, + > { + self.wrapped_tx + .raw_call("exitFarm") + .argument(&opt_orig_caller) + .original_result() + } + + pub fn claim_rewards_endpoint>>>( + self, + opt_orig_caller: Arg0, + ) -> TxProxyCall< + Env, + From, + To, + Gas, + MultiValue2, EsdtTokenPayment>, + > { + self.wrapped_tx + .raw_call("claimRewards") + .argument(&opt_orig_caller) + .original_result() + } +} diff --git a/locked-asset/proxy_dex/src/lib.rs b/locked-asset/proxy_dex/src/lib.rs index 2dc735baf..3fd6d99f7 100644 --- a/locked-asset/proxy_dex/src/lib.rs +++ b/locked-asset/proxy_dex/src/lib.rs @@ -10,6 +10,7 @@ pub mod energy_update; pub mod events; pub mod external_merging; pub mod farm_interactions; +pub mod farm_with_locked_rewards_proxy; pub mod other_sc_whitelist; pub mod pair_interactions; pub mod pair_proxy; diff --git a/locked-asset/proxy_dex/wasm/Cargo.lock b/locked-asset/proxy_dex/wasm/Cargo.lock index d601aa1f1..c8ea129ba 100644 --- a/locked-asset/proxy_dex/wasm/Cargo.lock +++ b/locked-asset/proxy_dex/wasm/Cargo.lock @@ -286,9 +286,7 @@ dependencies = [ name = "locking_module" version = "0.0.0" dependencies = [ - "energy-factory", "multiversx-sc", - "simple-lock", ] [[package]] @@ -307,9 +305,9 @@ dependencies = [ [[package]] name = "multiversx-sc" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" dependencies = [ "bitflags", "hex-literal", @@ -342,9 +340,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" dependencies = [ "hex", "proc-macro2", @@ -355,18 +353,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" dependencies = [ "multiversx-sc", ] diff --git a/locked-asset/proxy_dex/wasm/src/lib.rs b/locked-asset/proxy_dex/wasm/src/lib.rs index 29b3ab709..1ca63b26b 100644 --- a/locked-asset/proxy_dex/wasm/src/lib.rs +++ b/locked-asset/proxy_dex/wasm/src/lib.rs @@ -5,9 +5,10 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 31 +// Upgrade: 1 +// Endpoints: 30 // Async Callback: 1 -// Total number of exported functions: 33 +// Total number of exported functions: 32 #![no_std] #![allow(internal_features)] diff --git a/locked-asset/simple-lock-whitelist/wasm/Cargo.lock b/locked-asset/simple-lock-whitelist/wasm/Cargo.lock index 34b1df932..335c9e3e8 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.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" dependencies = [ "bitflags", "hex-literal", @@ -107,9 +107,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" dependencies = [ "hex", "proc-macro2", @@ -120,18 +120,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" dependencies = [ "multiversx-sc", ] diff --git a/locked-asset/simple-lock-whitelist/wasm/src/lib.rs b/locked-asset/simple-lock-whitelist/wasm/src/lib.rs index aa78142e1..f6d692858 100644 --- a/locked-asset/simple-lock-whitelist/wasm/src/lib.rs +++ b/locked-asset/simple-lock-whitelist/wasm/src/lib.rs @@ -5,9 +5,10 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 26 +// Upgrade: 1 +// Endpoints: 25 // Async Callback: 1 -// Total number of exported functions: 28 +// Total number of exported functions: 27 #![no_std] #![allow(internal_features)] diff --git a/locked-asset/simple-lock/src/farm_interactions.rs b/locked-asset/simple-lock/src/farm_interactions.rs index 2579a7531..991e10b32 100644 --- a/locked-asset/simple-lock/src/farm_interactions.rs +++ b/locked-asset/simple-lock/src/farm_interactions.rs @@ -1,15 +1,9 @@ -use common_structs::{RawResultWrapper, RawResultsType}; +use crate::farm_proxy; +use common_structs::RawResultWrapper; multiversx_sc::imports!(); multiversx_sc::derive_imports!(); -type EnterFarmResultType = - MultiValue2, EsdtTokenPayment>; -type ExitFarmResultType = - MultiValue2, EsdtTokenPayment>; -type ClaimRewardsResultType = - MultiValue2, EsdtTokenPayment>; - const ENTER_FARM_RESULTS_LEN: usize = 2; const EXIT_FARM_RESULTS_LEN: usize = 2; const CLAIM_REWARDS_RESULTS_LEN: usize = 2; @@ -33,35 +27,6 @@ pub struct FarmCompoundRewardsResultWrapper { pub new_farm_tokens: EsdtTokenPayment, } -mod farm_proxy { - multiversx_sc::imports!(); - use super::{ClaimRewardsResultType, EnterFarmResultType, ExitFarmResultType}; - - #[multiversx_sc::proxy] - pub trait FarmProxy { - #[payable("*")] - #[endpoint(enterFarm)] - fn enter_farm( - &self, - opt_orig_caller: OptionalValue, - ) -> EnterFarmResultType; - - #[payable("*")] - #[endpoint(exitFarm)] - fn exit_farm( - &self, - opt_orig_caller: OptionalValue, - ) -> ExitFarmResultType; - - #[payable("*")] - #[endpoint(claimRewards)] - fn claim_rewards( - &self, - opt_orig_caller: OptionalValue, - ) -> ClaimRewardsResultType; - } -} - #[multiversx_sc::module] pub trait FarmInteractionsModule { fn call_farm_enter( @@ -72,21 +37,23 @@ pub trait FarmInteractionsModule { additional_farm_tokens: ManagedVec>, caller: ManagedAddress, ) -> EnterFarmResultWrapper { - let mut contract_call = self - .farm_proxy(farm_address) + let mut payment = ManagedVec::from_single_item(EsdtTokenPayment::new( + farming_token, + 0, + farming_token_amount, + )); + payment.extend(&additional_farm_tokens); + + let raw_results = self + .tx() + .to(&farm_address) + .typed(farm_proxy::FarmProxy) .enter_farm(caller) - .with_esdt_transfer(EsdtTokenPayment::new( - farming_token, - 0, - farming_token_amount, - )); - - for farm_token in &additional_farm_tokens { - contract_call = contract_call.with_esdt_transfer(farm_token); - } + .payment(payment) + .returns(ReturnsRawResult) + .sync_call(); - let raw_results: RawResultsType = contract_call.execute_on_dest_context(); - let mut results_wrapper = RawResultWrapper::new(raw_results); + let mut results_wrapper = RawResultWrapper::new(raw_results.into()); results_wrapper.trim_results_front(ENTER_FARM_RESULTS_LEN); let new_farm_tokens = results_wrapper.decode_next_result(); @@ -106,17 +73,16 @@ pub trait FarmInteractionsModule { farm_token_amount: BigUint, caller: ManagedAddress, ) -> ExitFarmResultWrapper { - let raw_results: RawResultsType = self - .farm_proxy(farm_address) + let raw_results = self + .tx() + .to(&farm_address) + .typed(farm_proxy::FarmProxy) .exit_farm(caller) - .with_esdt_transfer(EsdtTokenPayment::new( - farm_token, - farm_token_nonce, - farm_token_amount, - )) - .execute_on_dest_context(); - - let mut results_wrapper = RawResultWrapper::new(raw_results); + .single_esdt(&farm_token, farm_token_nonce, &farm_token_amount) + .returns(ReturnsRawResult) + .sync_call(); + + let mut results_wrapper = RawResultWrapper::new(raw_results.into()); results_wrapper.trim_results_front(EXIT_FARM_RESULTS_LEN); let initial_farming_tokens = results_wrapper.decode_next_result(); @@ -136,17 +102,16 @@ pub trait FarmInteractionsModule { farm_token_amount: BigUint, caller: ManagedAddress, ) -> FarmClaimRewardsResultWrapper { - let raw_results: RawResultsType = self - .farm_proxy(farm_address) + let raw_results = self + .tx() + .to(&farm_address) + .typed(farm_proxy::FarmProxy) .claim_rewards(caller) - .with_esdt_transfer(EsdtTokenPayment::new( - farm_token, - farm_token_nonce, - farm_token_amount, - )) - .execute_on_dest_context(); - - let mut results_wrapper = RawResultWrapper::new(raw_results); + .single_esdt(&farm_token, farm_token_nonce, &farm_token_amount) + .returns(ReturnsRawResult) + .sync_call(); + + let mut results_wrapper = RawResultWrapper::new(raw_results.into()); results_wrapper.trim_results_front(CLAIM_REWARDS_RESULTS_LEN); let new_farm_tokens = results_wrapper.decode_next_result(); @@ -157,7 +122,4 @@ pub trait FarmInteractionsModule { reward_tokens, } } - - #[proxy] - fn farm_proxy(&self, sc_address: ManagedAddress) -> farm_proxy::Proxy; } diff --git a/locked-asset/simple-lock/src/farm_proxy.rs b/locked-asset/simple-lock/src/farm_proxy.rs new file mode 100644 index 000000000..f3442672b --- /dev/null +++ b/locked-asset/simple-lock/src/farm_proxy.rs @@ -0,0 +1,75 @@ +#![allow(clippy::type_complexity)] + +use multiversx_sc::proxy_imports::*; + +pub struct FarmProxy; + +impl TxProxyTrait for FarmProxy +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + type TxProxyMethods = FarmProxyProxyMethods; + + fn proxy_methods(self, tx: Tx) -> Self::TxProxyMethods { + FarmProxyProxyMethods { wrapped_tx: tx } + } +} + +pub struct FarmProxyProxyMethods +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + wrapped_tx: Tx, +} + +#[rustfmt::skip] +impl FarmProxyProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + pub fn enter_farm< + Arg0: CodecInto>>, + >( + self, + opt_orig_caller: Arg0, + ) -> TxProxyCall, EsdtTokenPayment>> { + self.wrapped_tx + .raw_call("enterFarm") + .argument(&opt_orig_caller) + .original_result() + } + + pub fn exit_farm< + Arg0: CodecInto>>, + >( + self, + opt_orig_caller: Arg0, + ) -> TxProxyCall, EsdtTokenPayment>> { + self.wrapped_tx + .raw_call("exitFarm") + .argument(&opt_orig_caller) + .original_result() + } + + pub fn claim_rewards< + Arg0: CodecInto>>, + >( + self, + opt_orig_caller: Arg0, + ) -> TxProxyCall, EsdtTokenPayment>> { + self.wrapped_tx + .raw_call("claimRewards") + .argument(&opt_orig_caller) + .original_result() + } +} diff --git a/locked-asset/simple-lock/src/lib.rs b/locked-asset/simple-lock/src/lib.rs index fb59b792c..7f8248f21 100644 --- a/locked-asset/simple-lock/src/lib.rs +++ b/locked-asset/simple-lock/src/lib.rs @@ -5,8 +5,10 @@ multiversx_sc::imports!(); pub mod basic_lock_unlock; pub mod error_messages; pub mod farm_interactions; +pub mod farm_proxy; pub mod locked_token; pub mod lp_interactions; +pub mod lp_proxy; pub mod proxy_farm; pub mod proxy_lp; pub mod token_attributes; diff --git a/locked-asset/simple-lock/src/lp_interactions.rs b/locked-asset/simple-lock/src/lp_interactions.rs index 4229cca53..1e71ae8c0 100644 --- a/locked-asset/simple-lock/src/lp_interactions.rs +++ b/locked-asset/simple-lock/src/lp_interactions.rs @@ -1,12 +1,7 @@ multiversx_sc::imports!(); multiversx_sc::derive_imports!(); -use crate::error_messages::*; - -type AddLiquidityResultType = - MultiValue3, EsdtTokenPayment, EsdtTokenPayment>; -type RemoveLiquidityResultType = - MultiValue2, EsdtTokenPayment>; +use crate::{error_messages::*, lp_proxy}; pub struct AddLiquidityResultWrapper { pub lp_tokens: EsdtTokenPayment, @@ -21,30 +16,6 @@ pub struct RemoveLiquidityResultWrapper { // Must manually declare, as Pair SC already depends on simple-lock // This avoids circular dependency -mod lp_proxy { - multiversx_sc::imports!(); - use super::{AddLiquidityResultType, RemoveLiquidityResultType}; - - #[multiversx_sc::proxy] - pub trait LpProxy { - #[payable("*")] - #[endpoint(addLiquidity)] - fn add_liquidity( - &self, - first_token_amount_min: BigUint, - second_token_amount_min: BigUint, - ) -> AddLiquidityResultType; - - #[payable("*")] - #[endpoint(removeLiquidity)] - fn remove_liquidity( - &self, - first_token_amount_min: BigUint, - second_token_amount_min: BigUint, - ) -> RemoveLiquidityResultType; - } -} - #[multiversx_sc::module] pub trait LpInteractionsModule { fn call_pair_add_liquidity( @@ -59,11 +30,15 @@ pub trait LpInteractionsModule { lp_payments_in.push(first_payment.clone()); lp_payments_in.push(second_payment.clone()); - let lp_payments_out: AddLiquidityResultType = self - .lp_proxy(lp_address) + let lp_payments_out = self + .tx() + .to(&lp_address) + .typed(lp_proxy::LpProxy) .add_liquidity(first_token_amount_min, second_token_amount_min) - .with_multi_token_transfer(lp_payments_in) - .execute_on_dest_context(); + .payment(lp_payments_in) + .returns(ReturnsResult) + .sync_call(); + let (lp_tokens, first_token_optimal_payment, second_token_optimal_payment) = lp_payments_out.into_tuple(); @@ -104,11 +79,14 @@ pub trait LpInteractionsModule { expected_first_token_id_out: &TokenIdentifier, expected_second_token_id_out: &TokenIdentifier, ) -> RemoveLiquidityResultWrapper { - let lp_payments_out: RemoveLiquidityResultType = self - .lp_proxy(lp_address) + let lp_payments_out = self + .tx() + .to(&lp_address) + .typed(lp_proxy::LpProxy) .remove_liquidity(first_token_amount_min, second_token_amount_min) - .with_esdt_transfer((lp_token_id, 0, lp_token_amount)) - .execute_on_dest_context(); + .single_esdt(&lp_token_id, 0, &lp_token_amount) + .returns(ReturnsResult) + .sync_call(); let (first_token_payment_out, second_token_payment_out) = lp_payments_out.into_tuple(); require!( @@ -122,7 +100,4 @@ pub trait LpInteractionsModule { second_token_payment_out, } } - - #[proxy] - fn lp_proxy(&self, sc_address: ManagedAddress) -> lp_proxy::Proxy; } diff --git a/locked-asset/simple-lock/src/lp_proxy.rs b/locked-asset/simple-lock/src/lp_proxy.rs new file mode 100644 index 000000000..0251884a6 --- /dev/null +++ b/locked-asset/simple-lock/src/lp_proxy.rs @@ -0,0 +1,69 @@ +#![allow(clippy::type_complexity)] + +use multiversx_sc::proxy_imports::*; + +pub struct LpProxy; + +impl TxProxyTrait for LpProxy +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + type TxProxyMethods = LpProxyProxyMethods; + + fn proxy_methods(self, tx: Tx) -> Self::TxProxyMethods { + LpProxyProxyMethods { wrapped_tx: tx } + } +} + +pub struct LpProxyProxyMethods +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + wrapped_tx: Tx, +} + +#[rustfmt::skip] +impl LpProxyProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + pub fn add_liquidity< + Arg0: CodecInto>, + Arg1: CodecInto>, + >( + self, + first_token_amount_min: Arg0, + second_token_amount_min: Arg1, + ) -> TxProxyCall, EsdtTokenPayment, EsdtTokenPayment>> { + self.wrapped_tx + .raw_call("addLiquidity") + .argument(&first_token_amount_min) + .argument(&second_token_amount_min) + .original_result() + } + + pub fn remove_liquidity< + Arg0: CodecInto>, + Arg1: CodecInto>, + >( + self, + first_token_amount_min: Arg0, + second_token_amount_min: Arg1, + ) -> TxProxyCall, EsdtTokenPayment>> { + self.wrapped_tx + .raw_call("removeLiquidity") + .argument(&first_token_amount_min) + .argument(&second_token_amount_min) + .original_result() + } +} diff --git a/locked-asset/simple-lock/wasm/Cargo.lock b/locked-asset/simple-lock/wasm/Cargo.lock index 102bb0d32..33e108868 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.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" dependencies = [ "bitflags", "hex-literal", @@ -107,9 +107,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" dependencies = [ "hex", "proc-macro2", @@ -120,18 +120,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" dependencies = [ "multiversx-sc", ] diff --git a/locked-asset/simple-lock/wasm/src/lib.rs b/locked-asset/simple-lock/wasm/src/lib.rs index 4e1b87c7d..a5b7adeb3 100644 --- a/locked-asset/simple-lock/wasm/src/lib.rs +++ b/locked-asset/simple-lock/wasm/src/lib.rs @@ -5,9 +5,10 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 20 +// Upgrade: 1 +// Endpoints: 19 // Async Callback: 1 -// Total number of exported functions: 22 +// Total number of exported functions: 21 #![no_std] #![allow(internal_features)] diff --git a/locked-asset/token-unstake/wasm/Cargo.lock b/locked-asset/token-unstake/wasm/Cargo.lock index 415f82989..0e1a9da47 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.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" dependencies = [ "bitflags", "hex-literal", @@ -154,9 +154,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" dependencies = [ "hex", "proc-macro2", @@ -167,18 +167,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" dependencies = [ "multiversx-sc", ] diff --git a/locked-asset/token-unstake/wasm/src/lib.rs b/locked-asset/token-unstake/wasm/src/lib.rs index 396d02ba0..81a2358bf 100644 --- a/locked-asset/token-unstake/wasm/src/lib.rs +++ b/locked-asset/token-unstake/wasm/src/lib.rs @@ -5,9 +5,10 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 11 +// Upgrade: 1 +// Endpoints: 10 // Async Callback (empty): 1 -// Total number of exported functions: 13 +// Total number of exported functions: 12 #![no_std] #![allow(internal_features)] diff --git a/pause-all/wasm/Cargo.lock b/pause-all/wasm/Cargo.lock index 0972422cf..7c380c10e 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.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1291e3712731f4e34775254e9a9b8ff70132d15414f2e51f9bc82c23faf48c" +checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" dependencies = [ "bitflags", "hex-literal", @@ -82,9 +82,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f0331893be2b757401b2deaf7d8b8c90745fa69114000d83fe26d8487d35a5" +checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" dependencies = [ "hex", "proc-macro2", @@ -95,18 +95,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e507a180afcab409cc3d920bc12f3852cf481a6657428879d1a70f6c2666c94" +checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-wasm-adapter" -version = "0.48.0" +version = "0.49.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bd18dbc72c83aa2e9ad3f4a00dcc27c03ada66c13f9056001dc9157055d616" +checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" dependencies = [ "multiversx-sc", ] diff --git a/pause-all/wasm/src/lib.rs b/pause-all/wasm/src/lib.rs index 2302b1e6a..0bd3bc7ff 100644 --- a/pause-all/wasm/src/lib.rs +++ b/pause-all/wasm/src/lib.rs @@ -5,9 +5,10 @@ //////////////////////////////////////////////////// // Init: 1 -// Endpoints: 8 +// Upgrade: 1 +// Endpoints: 7 // Async Callback (empty): 1 -// Total number of exported functions: 10 +// Total number of exported functions: 9 #![no_std] #![allow(internal_features)] From ee10fe1faa0f340f7590d53fc267466d91a4b10b Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Fri, 19 Apr 2024 01:35:09 +0300 Subject: [PATCH 27/55] clippy fixes --- .../mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_interactions/mod.rs b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_interactions/mod.rs index 703bfe2f7..151a4f5ec 100644 --- a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_interactions/mod.rs +++ b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp_staking_contract_interactions/mod.rs @@ -532,7 +532,7 @@ where lp_farm_token_stake_amount: u64, ) -> TxResult { self.b_mock.execute_esdt_transfer( - &caller, + caller, &self.proxy_wrapper, LP_FARM_TOKEN_ID, lp_farm_token_nonce, @@ -555,7 +555,7 @@ where dual_yield_token_amount: u64, ) -> TxResult { self.b_mock.execute_esdt_transfer( - &caller, + caller, &self.proxy_wrapper, DUAL_YIELD_TOKEN_ID, dual_yield_token_nonce, @@ -580,7 +580,7 @@ where dual_yield_token_amount: u64, ) -> TxResult { self.b_mock.execute_esdt_transfer( - &caller, + caller, &self.proxy_wrapper, DUAL_YIELD_TOKEN_ID, dual_yield_token_nonce, From 3e70ead7008cacd122c32d281a86fa719be9652e Mon Sep 17 00:00:00 2001 From: Mihai Calin Luca Date: Mon, 22 Apr 2024 19:23:04 +0200 Subject: [PATCH 28/55] initial impl and swap call to pair sc --- Cargo.lock | 109 +- Cargo.toml | 2 + .../src/permissions_module.rs | 2 +- dex/interactor/.gitignore | 5 + dex/interactor/Cargo.toml | 33 + dex/interactor/config.toml | 1 + dex/interactor/src/dex_interact.rs | 82 ++ dex/interactor/src/dex_interact_cli.rs | 32 + dex/interactor/src/dex_interact_config.rs | 26 + dex/interactor/src/dex_interact_pair.rs | 64 ++ dex/interactor/src/dex_interact_state.rs | 72 ++ dex/interactor/src/pair_proxy.rs | 953 ++++++++++++++++++ dex/interactor/state.toml | 6 + 13 files changed, 1382 insertions(+), 5 deletions(-) create mode 100644 dex/interactor/.gitignore create mode 100644 dex/interactor/Cargo.toml create mode 100644 dex/interactor/config.toml create mode 100644 dex/interactor/src/dex_interact.rs create mode 100644 dex/interactor/src/dex_interact_cli.rs create mode 100644 dex/interactor/src/dex_interact_config.rs create mode 100644 dex/interactor/src/dex_interact_pair.rs create mode 100644 dex/interactor/src/dex_interact_state.rs create mode 100644 dex/interactor/src/pair_proxy.rs create mode 100644 dex/interactor/state.toml diff --git a/Cargo.lock b/Cargo.lock index 8c29a59d7..08269a9aa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -52,9 +52,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.4" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" [[package]] name = "anstyle-parse" @@ -648,6 +648,29 @@ dependencies = [ "multiversx-sc-meta", ] +[[package]] +name = "env_filter" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" +dependencies = [ + "log", + "regex", +] + +[[package]] +name = "env_logger" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b35839ba51819680ba087cd351788c9a3c476841207e0b8cee0b04722343b9" +dependencies = [ + "anstream", + "anstyle", + "env_filter", + "humantime", + "log", +] + [[package]] name = "equivalent" version = "1.0.1" @@ -996,6 +1019,21 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "futures" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + [[package]] name = "futures-channel" version = "0.3.30" @@ -1003,6 +1041,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", + "futures-sink", ] [[package]] @@ -1011,12 +1050,34 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +[[package]] +name = "futures-executor" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + [[package]] name = "futures-io" version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +[[package]] +name = "futures-macro" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "futures-sink" version = "0.3.30" @@ -1035,8 +1096,11 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ + "futures-channel", "futures-core", "futures-io", + "futures-macro", + "futures-sink", "futures-task", "memchr", "pin-project-lite", @@ -1256,6 +1320,12 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + [[package]] name = "hyper" version = "0.14.28" @@ -1329,6 +1399,21 @@ dependencies = [ "hashbrown", ] +[[package]] +name = "interactor" +version = "0.0.0" +dependencies = [ + "clap", + "common_structs", + "multiversx-sc-modules", + "multiversx-sc-scenario", + "multiversx-sc-snippets", + "pausable", + "permissions_module", + "serde", + "toml", +] + [[package]] name = "ipnet" version = "2.9.0" @@ -1476,9 +1561,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "math" @@ -1707,6 +1792,22 @@ dependencies = [ "tokio", ] +[[package]] +name = "multiversx-sc-snippets" +version = "0.49.0-alpha.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5721598414c1867204596d88826fad4923c41b3f927867967095d0a20e6709af" +dependencies = [ + "base64", + "env_logger", + "futures", + "hex", + "log", + "multiversx-sc-scenario", + "multiversx-sdk", + "tokio", +] + [[package]] name = "multiversx-sdk" version = "0.3.2" diff --git a/Cargo.toml b/Cargo.toml index dbdd0d3ec..6e0f25ea0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -59,4 +59,6 @@ members = [ "pause-all", "pause-all/meta", + + "dex/interactor" ] diff --git a/common/modules/permissions_module/src/permissions_module.rs b/common/modules/permissions_module/src/permissions_module.rs index 5853ca0da..38eab7fdd 100644 --- a/common/modules/permissions_module/src/permissions_module.rs +++ b/common/modules/permissions_module/src/permissions_module.rs @@ -1,6 +1,6 @@ #![no_std] -mod permissions; +pub mod permissions; use common_errors::ERROR_PERMISSION_DENIED; diff --git a/dex/interactor/.gitignore b/dex/interactor/.gitignore new file mode 100644 index 000000000..7b3374d58 --- /dev/null +++ b/dex/interactor/.gitignore @@ -0,0 +1,5 @@ +# Pem files are used for interactions, but shouldn't be committed +*.pem + +# Trace file of interactor tooling +interactor*.scen.json diff --git a/dex/interactor/Cargo.toml b/dex/interactor/Cargo.toml new file mode 100644 index 000000000..73ba7dfab --- /dev/null +++ b/dex/interactor/Cargo.toml @@ -0,0 +1,33 @@ +[package] +name = "interactor" +version = "0.0.0" +authors = [""] +edition = "2021" +publish = false + +[[bin]] +name = "interactor" +path = "src/dex_interact.rs" + +[dependencies] +clap = { version = "4.4.7", features = ["derive"] } +serde = { version = "1.0", features = ["derive"] } +toml = "0.8.6" + +[dependencies.multiversx-sc-modules] +version = "=0.49.0-alpha.3" + +[dependencies.multiversx-sc-snippets] +version = "=0.49.0-alpha.3" + +[dependencies.multiversx-sc-scenario] +version = "=0.49.0-alpha.3" + +[dependencies.common_structs] +path = "../../common/common_structs" + +[dependencies.permissions_module] +path = "../../common/modules/permissions_module" + +[dependencies.pausable] +path = "../../common/modules/pausable" diff --git a/dex/interactor/config.toml b/dex/interactor/config.toml new file mode 100644 index 000000000..d3f5add34 --- /dev/null +++ b/dex/interactor/config.toml @@ -0,0 +1 @@ +gateway = 'https://devnet-gateway.multiversx.com' \ No newline at end of file diff --git a/dex/interactor/src/dex_interact.rs b/dex/interactor/src/dex_interact.rs new file mode 100644 index 000000000..01878f7da --- /dev/null +++ b/dex/interactor/src/dex_interact.rs @@ -0,0 +1,82 @@ +mod dex_interact_cli; +mod dex_interact_config; +mod dex_interact_pair; +mod dex_interact_state; +mod pair_proxy; + +use clap::Parser; +use dex_interact_config::Config; +use dex_interact_state::State; +use multiversx_sc_snippets::imports::*; + +const INTERACTOR_SCENARIO_TRACE_PATH: &str = "interactor_trace.scen.json"; + +#[tokio::main] +async fn main() { + env_logger::init(); + + let mut dex_interact = DexInteract::init().await; + dex_interact.register_wallets(); + + let cli = dex_interact_cli::InteractCli::parse(); + match &cli.command { + Some(dex_interact_cli::InteractCliCommand::Pause) => { + dex_interact.pause().await; + } + Some(dex_interact_cli::InteractCliCommand::Swap(args)) => { + dex_interact + .swap_tokens_fixed_input(args.amount, &args.token_identifier, args.min_amount) + .await; + } + None => {} + } +} + +struct DexInteract { + interactor: Interactor, + wallet_address: Bech32Address, + state: State, +} + +impl DexInteract { + async fn init() -> Self { + let config = Config::load_config(); + let mut interactor = Interactor::new(config.gateway()) + .await + .with_tracer(INTERACTOR_SCENARIO_TRACE_PATH) + .await; + let test_address = test_wallets::mike(); + let wallet_address = interactor.register_wallet(test_address); + println!("wallet address: {:#?}", test_address.address()); + + Self { + interactor, + wallet_address: wallet_address.into(), + state: State::load_state(), + } + } + + fn register_wallets(&mut self) { + let carol = test_wallets::carol(); + let dan = test_wallets::dan(); + let eve = test_wallets::eve(); + + for wallet in &[carol, dan, eve] { + self.interactor.register_wallet(*wallet); + } + } + + async fn pause(&mut self) { + println!("Attempting to pause pair contract..."); + + self.interactor + .tx() + .from(&self.wallet_address) + .to(self.state.current_pair_address()) + .typed(pair_proxy::PairProxy) + .pause() + .prepare_async() + .run() + .await; + } +} diff --git a/dex/interactor/src/dex_interact_cli.rs b/dex/interactor/src/dex_interact_cli.rs new file mode 100644 index 000000000..2fd828d4b --- /dev/null +++ b/dex/interactor/src/dex_interact_cli.rs @@ -0,0 +1,32 @@ +use clap::{Args, Parser, Subcommand}; + +/// Dex Interact CLI +#[derive(Default, PartialEq, Eq, Debug, Parser)] +#[command(version, about)] +#[command(propagate_version = true)] +pub struct InteractCli { + #[command(subcommand)] + pub command: Option, +} + +/// Dex Interact CLI Commands +#[derive(Clone, PartialEq, Eq, Debug, Subcommand)] +pub enum InteractCliCommand { + #[command(name = "pause", about = "Pause pair contract")] + Pause, + #[command(name = "swap", about = "Swaps token with a minimum return amount")] + Swap(SwapArgs), +} + +#[derive(Default, Clone, PartialEq, Eq, Debug, Args)] +pub struct SwapArgs { + /// Amount to swap + #[arg(short = 'a', long = "amount", verbatim_doc_comment)] + pub amount: u128, + /// The token id for the swap + #[arg(short = 't', long = "token_identifier", verbatim_doc_comment)] + pub token_identifier: String, + /// Minimum return amount + #[arg(short = 'm', long = "min_amount", verbatim_doc_comment)] + pub min_amount: u128, +} diff --git a/dex/interactor/src/dex_interact_config.rs b/dex/interactor/src/dex_interact_config.rs new file mode 100644 index 000000000..2eddd1bf9 --- /dev/null +++ b/dex/interactor/src/dex_interact_config.rs @@ -0,0 +1,26 @@ +use serde::Deserialize; +use std::io::Read; + +/// Config file +const CONFIG_FILE: &str = "config.toml"; + +/// Multisig Interact configuration +#[derive(Debug, Deserialize)] +pub struct Config { + gateway: String, +} + +impl Config { + // Deserializes config from file + pub fn load_config() -> Self { + let mut file = std::fs::File::open(CONFIG_FILE).unwrap(); + let mut content = String::new(); + file.read_to_string(&mut content).unwrap(); + toml::from_str(&content).unwrap() + } + + // Returns the gateway + pub fn gateway(&self) -> &str { + &self.gateway + } +} diff --git a/dex/interactor/src/dex_interact_pair.rs b/dex/interactor/src/dex_interact_pair.rs new file mode 100644 index 000000000..2acc019a7 --- /dev/null +++ b/dex/interactor/src/dex_interact_pair.rs @@ -0,0 +1,64 @@ +use multiversx_sc_scenario::imports::{BigUint, RustBigUint, TokenIdentifier}; +use multiversx_sc_scenario::imports::{EsdtTokenPayment, ManagedTypeApi, ReturnsResult}; +use multiversx_sc_snippets::InteractorPrepareAsync; + +use crate::pair_proxy; +use crate::DexInteract; + +pub const UTK: &str = "UTK-14d57d"; +pub const _WEGLD: &str = "WEGLD-a28c59"; +pub const GAS: u64 = 100_000_000u64; + +pub struct InteractorToken { + pub token_id: String, + pub nonce: u64, + pub amount: RustBigUint, +} + +impl From> for InteractorToken { + fn from(value: EsdtTokenPayment) -> Self { + InteractorToken { + token_id: value.token_identifier.to_string(), + nonce: value.token_nonce, + amount: RustBigUint::from_bytes_be(value.amount.to_bytes_be().as_slice()), + } + } +} + +impl DexInteract { + pub async fn swap_tokens_fixed_input( + &mut self, + amount_to_swap: u128, + token_id: &str, + min_amount_to_receive: u128, + ) -> InteractorToken { + println!( + "Attempting to swap {amount_to_swap} {UTK} for a min amount {min_amount_to_receive} of {token_id}..." + ); + + let result_token = self + .interactor + .tx() + .from(&self.wallet_address) + .to(self.state.current_pair_address()) + .gas(GAS) + .typed(pair_proxy::PairProxy) + .swap_tokens_fixed_input( + TokenIdentifier::from(token_id), + BigUint::from(min_amount_to_receive), + ) + .payment((TokenIdentifier::from(UTK), 0, BigUint::from(amount_to_swap))) + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + println!("Result token {:#?}", result_token); + + InteractorToken::from(result_token) + } +} + +// 10000000000000000000 ; 10 UTK +// 1000000000000; 0,000001 WEGLD +// cargo run swap -a 10000000000000000000 -t WEGLD-a28c59 -m 1000000000000 diff --git a/dex/interactor/src/dex_interact_state.rs b/dex/interactor/src/dex_interact_state.rs new file mode 100644 index 000000000..f763e58a3 --- /dev/null +++ b/dex/interactor/src/dex_interact_state.rs @@ -0,0 +1,72 @@ +use multiversx_sc_scenario::imports::Bech32Address; +use serde::{Deserialize, Serialize}; +use std::{ + io::{Read, Write}, + path::Path, +}; + +/// State file +const STATE_FILE: &str = "state.toml"; + +/// Multisig Interact state +#[derive(Debug, Default, Serialize, Deserialize)] +pub struct State { + farm_with_locked_rewards: Option, + pair: Option, + router: Option, + farm_staking: Option, + farm_staking_proxy: Option, +} + +impl State { + // Deserializes state from file + pub fn load_state() -> Self { + if Path::new(STATE_FILE).exists() { + let mut file = std::fs::File::open(STATE_FILE).unwrap(); + let mut content = String::new(); + file.read_to_string(&mut content).unwrap(); + toml::from_str(&content).unwrap() + } else { + Self::default() + } + } + + pub fn _current_farm_with_locked_rewards_address(&self) -> &Bech32Address { + self.farm_with_locked_rewards + .as_ref() + .expect("no known farm with locked rewards contract, set first") + } + + pub fn current_pair_address(&self) -> &Bech32Address { + self.pair + .as_ref() + .expect("no known pair contract, set first") + } + + pub fn _current_router_address(&self) -> &Bech32Address { + self.router + .as_ref() + .expect("no known router contract, set first") + } + + pub fn _current_farm_staking_address(&self) -> &Bech32Address { + self.farm_staking + .as_ref() + .expect("no known farm staking contract, set first") + } + + pub fn _current_farm_staking_proxy_address(&self) -> &Bech32Address { + self.farm_staking_proxy + .as_ref() + .expect("no known farm staking proxy contract, set first") + } +} + +impl Drop for State { + // Serializes state to file + fn drop(&mut self) { + let mut file = std::fs::File::create(STATE_FILE).unwrap(); + file.write_all(toml::to_string(self).unwrap().as_bytes()) + .unwrap(); + } +} diff --git a/dex/interactor/src/pair_proxy.rs b/dex/interactor/src/pair_proxy.rs new file mode 100644 index 000000000..77f743b52 --- /dev/null +++ b/dex/interactor/src/pair_proxy.rs @@ -0,0 +1,953 @@ +// Code generated by the multiversx-sc proxy generator. DO NOT EDIT. + +//////////////////////////////////////////////////// +////////////////// AUTO-GENERATED ////////////////// +//////////////////////////////////////////////////// + +#![allow(dead_code)] +#![allow(clippy::all)] + +use multiversx_sc_scenario::multiversx_sc; +use multiversx_sc::proxy_imports::*; + +pub struct PairProxy; + +impl TxProxyTrait for PairProxy +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + type TxProxyMethods = PairProxyMethods; + + fn proxy_methods(self, tx: Tx) -> Self::TxProxyMethods { + PairProxyMethods { wrapped_tx: tx } + } +} + +pub struct PairProxyMethods +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + wrapped_tx: Tx, +} + +#[rustfmt::skip] +impl PairProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + Gas: TxGas, +{ + pub fn init< + Arg0: CodecInto>, + Arg1: CodecInto>, + Arg2: CodecInto>, + Arg3: CodecInto>, + Arg4: CodecInto, + Arg5: CodecInto, + Arg6: CodecInto>, + Arg7: CodecInto>>, + >( + self, + first_token_id: Arg0, + second_token_id: Arg1, + router_address: Arg2, + router_owner_address: Arg3, + total_fee_percent: Arg4, + special_fee_percent: Arg5, + initial_liquidity_adder: Arg6, + admins: Arg7, + ) -> TxProxyDeploy { + self.wrapped_tx + .raw_deploy() + .argument(&first_token_id) + .argument(&second_token_id) + .argument(&router_address) + .argument(&router_owner_address) + .argument(&total_fee_percent) + .argument(&special_fee_percent) + .argument(&initial_liquidity_adder) + .argument(&admins) + .original_result() + } +} + +#[rustfmt::skip] +impl PairProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + pub fn upgrade( + self, + ) -> TxProxyUpgrade { + self.wrapped_tx + .raw_upgrade() + .original_result() + } +} + +#[rustfmt::skip] +impl PairProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + pub fn set_lp_token_identifier< + Arg0: CodecInto>, + >( + self, + token_identifier: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setLpTokenIdentifier") + .argument(&token_identifier) + .original_result() + } + + pub fn is_fee_enabled( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getFeeState") + .original_result() + } + + pub fn whitelist_endpoint< + Arg0: CodecInto>, + >( + self, + address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("whitelist") + .argument(&address) + .original_result() + } + + pub fn remove_whitelist< + Arg0: CodecInto>, + >( + self, + address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("removeWhitelist") + .argument(&address) + .original_result() + } + + pub fn add_trusted_swap_pair< + Arg0: CodecInto>, + Arg1: CodecInto>, + Arg2: CodecInto>, + >( + self, + pair_address: Arg0, + first_token: Arg1, + second_token: Arg2, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("addTrustedSwapPair") + .argument(&pair_address) + .argument(&first_token) + .argument(&second_token) + .original_result() + } + + pub fn remove_trusted_swap_pair< + Arg0: CodecInto>, + Arg1: CodecInto>, + >( + self, + first_token: Arg0, + second_token: Arg1, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("removeTrustedSwapPair") + .argument(&first_token) + .argument(&second_token) + .original_result() + } + + /// `fees_collector_cut_percentage` of the special fees are sent to the fees_collector_address SC + /// + /// For example, if special fees is 5%, and fees_collector_cut_percentage is 10%, + /// then of the 5%, 10% are reserved, and only the rest are split between other pair contracts. + pub fn setup_fees_collector< + Arg0: CodecInto>, + Arg1: CodecInto, + >( + self, + fees_collector_address: Arg0, + fees_collector_cut_percentage: Arg1, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setupFeesCollector") + .argument(&fees_collector_address) + .argument(&fees_collector_cut_percentage) + .original_result() + } + + pub fn set_fee_on< + Arg0: CodecInto, + Arg1: CodecInto>, + Arg2: CodecInto>, + >( + self, + enabled: Arg0, + fee_to_address: Arg1, + fee_token: Arg2, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setFeeOn") + .argument(&enabled) + .argument(&fee_to_address) + .argument(&fee_token) + .original_result() + } + + pub fn get_fee_destinations( + self, + ) -> TxProxyCall, TokenIdentifier)>> { + self.wrapped_tx + .raw_call("getFeeDestinations") + .original_result() + } + + pub fn get_trusted_swap_pairs( + self, + ) -> TxProxyCall, ManagedAddress)>> { + self.wrapped_tx + .raw_call("getTrustedSwapPairs") + .original_result() + } + + pub fn get_whitelisted_managed_addresses( + self, + ) -> TxProxyCall>> { + self.wrapped_tx + .raw_call("getWhitelistedManagedAddresses") + .original_result() + } + + pub fn fees_collector_address( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getFeesCollectorAddress") + .original_result() + } + + pub fn fees_collector_cut_percentage( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getFeesCollectorCutPercentage") + .original_result() + } + + pub fn set_state_active_no_swaps( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setStateActiveNoSwaps") + .original_result() + } + + pub fn set_fee_percent< + Arg0: CodecInto, + Arg1: CodecInto, + >( + self, + total_fee_percent: Arg0, + special_fee_percent: Arg1, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setFeePercents") + .argument(&total_fee_percent) + .argument(&special_fee_percent) + .original_result() + } + + pub fn get_lp_token_identifier( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getLpTokenIdentifier") + .original_result() + } + + pub fn total_fee_percent( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getTotalFeePercent") + .original_result() + } + + pub fn special_fee_percent( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getSpecialFee") + .original_result() + } + + pub fn router_address( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getRouterManagedAddress") + .original_result() + } + + pub fn first_token_id( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getFirstTokenId") + .original_result() + } + + pub fn second_token_id( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getSecondTokenId") + .original_result() + } + + pub fn lp_token_supply( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getTotalSupply") + .original_result() + } + + pub fn initial_liquidity_adder( + self, + ) -> TxProxyCall>> { + self.wrapped_tx + .raw_call("getInitialLiquidtyAdder") + .original_result() + } + + pub fn pair_reserve< + Arg0: CodecInto>, + >( + self, + token_id: Arg0, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getReserve") + .argument(&token_id) + .original_result() + } + + pub fn safe_price_current_index( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getSafePriceCurrentIndex") + .original_result() + } + + pub fn get_lp_tokens_safe_price_by_default_offset< + Arg0: CodecInto>, + Arg1: CodecInto>, + >( + self, + pair_address: Arg0, + liquidity: Arg1, + ) -> TxProxyCall, EsdtTokenPayment>> { + self.wrapped_tx + .raw_call("getLpTokensSafePriceByDefaultOffset") + .argument(&pair_address) + .argument(&liquidity) + .original_result() + } + + pub fn get_lp_tokens_safe_price_by_round_offset< + Arg0: CodecInto>, + Arg1: CodecInto, + Arg2: CodecInto>, + >( + self, + pair_address: Arg0, + round_offset: Arg1, + liquidity: Arg2, + ) -> TxProxyCall, EsdtTokenPayment>> { + self.wrapped_tx + .raw_call("getLpTokensSafePriceByRoundOffset") + .argument(&pair_address) + .argument(&round_offset) + .argument(&liquidity) + .original_result() + } + + pub fn get_lp_tokens_safe_price_by_timestamp_offset< + Arg0: CodecInto>, + Arg1: CodecInto, + Arg2: CodecInto>, + >( + self, + pair_address: Arg0, + timestamp_offset: Arg1, + liquidity: Arg2, + ) -> TxProxyCall, EsdtTokenPayment>> { + self.wrapped_tx + .raw_call("getLpTokensSafePriceByTimestampOffset") + .argument(&pair_address) + .argument(×tamp_offset) + .argument(&liquidity) + .original_result() + } + + pub fn get_lp_tokens_safe_price< + Arg0: CodecInto>, + Arg1: CodecInto, + Arg2: CodecInto, + Arg3: CodecInto>, + >( + self, + pair_address: Arg0, + start_round: Arg1, + end_round: Arg2, + liquidity: Arg3, + ) -> TxProxyCall, EsdtTokenPayment>> { + self.wrapped_tx + .raw_call("getLpTokensSafePrice") + .argument(&pair_address) + .argument(&start_round) + .argument(&end_round) + .argument(&liquidity) + .original_result() + } + + pub fn get_safe_price_by_default_offset< + Arg0: CodecInto>, + Arg1: CodecInto>, + >( + self, + pair_address: Arg0, + input_payment: Arg1, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getSafePriceByDefaultOffset") + .argument(&pair_address) + .argument(&input_payment) + .original_result() + } + + pub fn get_safe_price_by_round_offset< + Arg0: CodecInto>, + Arg1: CodecInto, + Arg2: CodecInto>, + >( + self, + pair_address: Arg0, + round_offset: Arg1, + input_payment: Arg2, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getSafePriceByRoundOffset") + .argument(&pair_address) + .argument(&round_offset) + .argument(&input_payment) + .original_result() + } + + pub fn get_safe_price_by_timestamp_offset< + Arg0: CodecInto>, + Arg1: CodecInto, + Arg2: CodecInto>, + >( + self, + pair_address: Arg0, + timestamp_offset: Arg1, + input_payment: Arg2, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getSafePriceByTimestampOffset") + .argument(&pair_address) + .argument(×tamp_offset) + .argument(&input_payment) + .original_result() + } + + pub fn get_safe_price< + Arg0: CodecInto>, + Arg1: CodecInto, + Arg2: CodecInto, + Arg3: CodecInto>, + >( + self, + pair_address: Arg0, + start_round: Arg1, + end_round: Arg2, + input_payment: Arg3, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getSafePrice") + .argument(&pair_address) + .argument(&start_round) + .argument(&end_round) + .argument(&input_payment) + .original_result() + } + + pub fn get_price_observation_view< + Arg0: CodecInto>, + Arg1: CodecInto, + >( + self, + pair_address: Arg0, + search_round: Arg1, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getPriceObservation") + .argument(&pair_address) + .argument(&search_round) + .original_result() + } + + pub fn update_and_get_tokens_for_given_position_with_safe_price< + Arg0: CodecInto>, + >( + self, + liquidity: Arg0, + ) -> TxProxyCall, EsdtTokenPayment>> { + self.wrapped_tx + .raw_call("updateAndGetTokensForGivenPositionWithSafePrice") + .argument(&liquidity) + .original_result() + } + + pub fn update_and_get_safe_price< + Arg0: CodecInto>, + >( + self, + input: Arg0, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("updateAndGetSafePrice") + .argument(&input) + .original_result() + } + + pub fn set_locking_deadline_epoch< + Arg0: CodecInto, + >( + self, + new_deadline: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setLockingDeadlineEpoch") + .argument(&new_deadline) + .original_result() + } + + pub fn set_locking_sc_address< + Arg0: CodecInto>, + >( + self, + new_address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setLockingScAddress") + .argument(&new_address) + .original_result() + } + + pub fn set_unlock_epoch< + Arg0: CodecInto, + >( + self, + new_epoch: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setUnlockEpoch") + .argument(&new_epoch) + .original_result() + } + + pub fn locking_sc_address( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getLockingScAddress") + .original_result() + } + + pub fn unlock_epoch( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getUnlockEpoch") + .original_result() + } + + pub fn locking_deadline_epoch( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getLockingDeadlineEpoch") + .original_result() + } + + pub fn add_admin_endpoint< + Arg0: CodecInto>, + >( + self, + address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("addAdmin") + .argument(&address) + .original_result() + } + + pub fn remove_admin_endpoint< + Arg0: CodecInto>, + >( + self, + address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("removeAdmin") + .argument(&address) + .original_result() + } + + pub fn update_owner_or_admin_endpoint< + Arg0: CodecInto>, + >( + self, + previous_owner: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("updateOwnerOrAdmin") + .argument(&previous_owner) + .original_result() + } + + pub fn permissions< + Arg0: CodecInto>, + >( + self, + address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getPermissions") + .argument(&address) + .original_result() + } + + pub fn add_to_pause_whitelist< + Arg0: CodecInto>>, + >( + self, + address_list: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("addToPauseWhitelist") + .argument(&address_list) + .original_result() + } + + pub fn remove_from_pause_whitelist< + Arg0: CodecInto>>, + >( + self, + address_list: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("removeFromPauseWhitelist") + .argument(&address_list) + .original_result() + } + + pub fn pause( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("pause") + .original_result() + } + + pub fn resume( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("resume") + .original_result() + } + + pub fn state( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getState") + .original_result() + } + + pub fn add_initial_liquidity( + self, + ) -> TxProxyCall, EsdtTokenPayment, EsdtTokenPayment>> { + self.wrapped_tx + .raw_call("addInitialLiquidity") + .original_result() + } + + pub fn add_liquidity< + Arg0: CodecInto>, + Arg1: CodecInto>, + >( + self, + first_token_amount_min: Arg0, + second_token_amount_min: Arg1, + ) -> TxProxyCall, EsdtTokenPayment, EsdtTokenPayment>> { + self.wrapped_tx + .raw_call("addLiquidity") + .argument(&first_token_amount_min) + .argument(&second_token_amount_min) + .original_result() + } + + pub fn remove_liquidity< + Arg0: CodecInto>, + Arg1: CodecInto>, + >( + self, + first_token_amount_min: Arg0, + second_token_amount_min: Arg1, + ) -> TxProxyCall, EsdtTokenPayment>> { + self.wrapped_tx + .raw_call("removeLiquidity") + .argument(&first_token_amount_min) + .argument(&second_token_amount_min) + .original_result() + } + + pub fn remove_liquidity_and_burn_token< + Arg0: CodecInto>, + >( + self, + token_to_buyback_and_burn: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("removeLiquidityAndBuyBackAndBurnToken") + .argument(&token_to_buyback_and_burn) + .original_result() + } + + pub fn swap_no_fee< + Arg0: CodecInto>, + Arg1: CodecInto>, + >( + self, + token_out: Arg0, + destination_address: Arg1, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("swapNoFeeAndForward") + .argument(&token_out) + .argument(&destination_address) + .original_result() + } + + pub fn swap_tokens_fixed_input< + Arg0: CodecInto>, + Arg1: CodecInto>, + >( + self, + token_out: Arg0, + amount_out_min: Arg1, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("swapTokensFixedInput") + .argument(&token_out) + .argument(&amount_out_min) + .original_result() + } + + pub fn swap_tokens_fixed_output< + Arg0: CodecInto>, + Arg1: CodecInto>, + >( + self, + token_out: Arg0, + amount_out: Arg1, + ) -> TxProxyCall, EsdtTokenPayment>> { + self.wrapped_tx + .raw_call("swapTokensFixedOutput") + .argument(&token_out) + .argument(&amount_out) + .original_result() + } + + pub fn get_tokens_for_given_position< + Arg0: CodecInto>, + >( + self, + liquidity: Arg0, + ) -> TxProxyCall, EsdtTokenPayment>> { + self.wrapped_tx + .raw_call("getTokensForGivenPosition") + .argument(&liquidity) + .original_result() + } + + pub fn get_reserves_and_total_supply( + self, + ) -> TxProxyCall, BigUint, BigUint>> { + self.wrapped_tx + .raw_call("getReservesAndTotalSupply") + .original_result() + } + + pub fn get_amount_out_view< + Arg0: CodecInto>, + Arg1: CodecInto>, + >( + self, + token_in: Arg0, + amount_in: Arg1, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getAmountOut") + .argument(&token_in) + .argument(&amount_in) + .original_result() + } + + pub fn get_amount_in_view< + Arg0: CodecInto>, + Arg1: CodecInto>, + >( + self, + token_wanted: Arg0, + amount_wanted: Arg1, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getAmountIn") + .argument(&token_wanted) + .argument(&amount_wanted) + .original_result() + } + + pub fn get_equivalent< + Arg0: CodecInto>, + Arg1: CodecInto>, + >( + self, + token_in: Arg0, + amount_in: Arg1, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getEquivalent") + .argument(&token_in) + .argument(&amount_in) + .original_result() + } +} + +#[derive(TopEncode, TopDecode)] +pub struct SwapEvent +where + Api: ManagedTypeApi, +{ + pub caller: ManagedAddress, + pub token_id_in: TokenIdentifier, + pub token_amount_in: BigUint, + pub token_id_out: TokenIdentifier, + pub token_amount_out: BigUint, + pub fee_amount: BigUint, + pub token_in_reserve: BigUint, + pub token_out_reserve: BigUint, + pub block: u64, + pub epoch: u64, + pub timestamp: u64, +} + +#[derive(TopEncode, TopDecode)] +pub struct SwapNoFeeAndForwardEvent +where + Api: ManagedTypeApi, +{ + pub caller: ManagedAddress, + pub token_id_in: TokenIdentifier, + pub token_amount_in: BigUint, + pub token_id_out: TokenIdentifier, + pub token_amount_out: BigUint, + pub destination: ManagedAddress, + pub block: u64, + pub epoch: u64, + pub timestamp: u64, +} + +#[derive(TopEncode, TopDecode)] +pub struct AddLiquidityEvent +where + Api: ManagedTypeApi, +{ + pub caller: ManagedAddress, + pub first_token_id: TokenIdentifier, + pub first_token_amount: BigUint, + pub second_token_id: TokenIdentifier, + pub second_token_amount: BigUint, + pub lp_token_id: TokenIdentifier, + pub lp_token_amount: BigUint, + pub lp_supply: BigUint, + pub first_token_reserves: BigUint, + pub second_token_reserves: BigUint, + pub block: u64, + pub epoch: u64, + pub timestamp: u64, +} + +#[derive(TopEncode, TopDecode)] +pub struct RemoveLiquidityEvent +where + Api: ManagedTypeApi, +{ + pub caller: ManagedAddress, + pub first_token_id: TokenIdentifier, + pub first_token_amount: BigUint, + pub second_token_id: TokenIdentifier, + pub second_token_amount: BigUint, + pub lp_token_id: TokenIdentifier, + pub lp_token_amount: BigUint, + pub lp_supply: BigUint, + pub first_token_reserves: BigUint, + pub second_token_reserves: BigUint, + pub block: u64, + pub epoch: u64, + pub timestamp: u64, +} + +#[derive(TopEncode, TopDecode)] +pub struct PriceObservation +where + Api: ManagedTypeApi, +{ + pub first_token_reserve_accumulated: BigUint, + pub second_token_reserve_accumulated: BigUint, + pub weight_accumulated: u64, + pub recording_round: u64, + pub lp_supply_accumulated: BigUint, +} diff --git a/dex/interactor/state.toml b/dex/interactor/state.toml new file mode 100644 index 000000000..4d5afee3e --- /dev/null +++ b/dex/interactor/state.toml @@ -0,0 +1,6 @@ +# SC addresses on the devnet +farm_with_locked_rewards = "erd1qqqqqqqqqqqqqpgql7rysqgxxzhykg3j6vccnx4003z2mcl80n4ste3jh8" +pair = "erd1qqqqqqqqqqqqqpgq4zafu6rzdw7fj07hjh5tkm68jsaj7hl60n4s8py4ra" +router = "erd1qqqqqqqqqqqqqpgqa7hv0nahgsl8tz0psat46x0tchm0wuyc0n4s6q28ad" +farm_staking = "erd1qqqqqqqqqqqqqpgquvklwltnlgyn5w5cd65ey36nw8sc008d0n4s0xpr25" +farm_staking_proxy = "erd1qqqqqqqqqqqqqpgqqwn0qa7ft4tew05r0zcd0c5hay5mp6np0n4ss8jm86" From fe7e92d30049e6fa642ee73ff04063e809d9a6ba Mon Sep 17 00:00:00 2001 From: Costin Carabas Date: Tue, 23 Apr 2024 09:25:08 +0300 Subject: [PATCH 29/55] Proxy-dex: farm: original caller negative test --- .../proxy_dex/tests/proxy_farm_test.rs | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) diff --git a/locked-asset/proxy_dex/tests/proxy_farm_test.rs b/locked-asset/proxy_dex/tests/proxy_farm_test.rs index af6c5f6c4..612bd7093 100644 --- a/locked-asset/proxy_dex/tests/proxy_farm_test.rs +++ b/locked-asset/proxy_dex/tests/proxy_farm_test.rs @@ -1486,3 +1486,102 @@ fn increase_proxy_farm_proxy_lp_energy() { }), ); } + + + +#[test] +fn original_caller_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(); + let user_balance = rust_biguint!(USER_BALANCE); + setup + .b_mock + .set_esdt_balance(&first_user, MEX_TOKEN_ID, &user_balance); + + // users lock tokens + setup + .b_mock + .execute_esdt_transfer( + &first_user, + &setup.simple_lock_wrapper, + MEX_TOKEN_ID, + 0, + &user_balance, + |sc| { + let user_payment = sc.lock_tokens_endpoint(LOCK_OPTIONS[1], OptionalValue::None); + assert_eq!(user_payment.token_nonce, 2); + assert_eq!(user_payment.amount, managed_biguint!(USER_BALANCE)); + }, + ) + .assert_ok(); + + //////////////////////////////////////////// ENTER FARM ///////////////////////////////////// + + setup + .b_mock + .execute_esdt_transfer( + &first_user, + &setup.proxy_wrapper, + LOCKED_TOKEN_ID, + 1, + &rust_biguint!(USER_BALANCE), + |sc| { + sc.enter_farm_proxy_endpoint(managed_address!(&farm_addr), Some(managed_address!(&first_user)).into()); + }, + ) + .assert_error(4, "Item not whitelisted"); + + setup + .b_mock + .execute_esdt_transfer( + &first_user, + &setup.proxy_wrapper, + LOCKED_TOKEN_ID, + 1, + &rust_biguint!(USER_BALANCE), + |sc| { + sc.enter_farm_proxy_endpoint(managed_address!(&farm_addr), OptionalValue::None); + }, + ) + .assert_ok(); + + + // claim rewards with half position + setup + .b_mock + .execute_esdt_transfer( + &first_user, + &setup.proxy_wrapper, + WRAPPED_FARM_TOKEN_ID, + 1, + &rust_biguint!(USER_BALANCE / 2), + |sc| { + sc.claim_rewards_proxy(managed_address!(&farm_addr), Some(managed_address!(&first_user)).into()); + }, + ) + .assert_error(4, "Item not whitelisted"); + + setup + .b_mock + .execute_esdt_transfer( + &first_user, + &setup.proxy_wrapper, + WRAPPED_FARM_TOKEN_ID, + 1, + &rust_biguint!(USER_BALANCE), + |sc| { + let output = sc.exit_farm_proxy(managed_address!(&farm_addr), Some(managed_address!(&first_user)).into()); + let output_lp_token = output.0 .0; + assert_eq!(output_lp_token.token_nonce, 1); + assert_eq!(output_lp_token.amount, USER_BALANCE); + }, + ) + .assert_error(4, "Item not whitelisted"); + +} \ No newline at end of file From 16f3c3155f2c535c4f92eb34c2b942e621974dad Mon Sep 17 00:00:00 2001 From: Mihai Calin Luca Date: Tue, 23 Apr 2024 20:21:53 +0200 Subject: [PATCH 30/55] update to latest wasm, proxy gen and progress on interact --- 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/sc-config.toml | 2 + dex/farm-with-locked-rewards/wasm/Cargo.lock | 566 ------------ 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 | 536 ----------- 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 | 180 ---- dex/governance/wasm/Cargo.toml | 2 +- dex/interactor/Cargo.toml | 16 +- dex/interactor/proxies/Cargo.toml | 35 + .../proxies/src/energy_factory_proxy.rs | 571 ++++++++++++ .../proxies/src/farm_staking_proxy.rs | 859 ++++++++++++++++++ .../src/farm_staking_proxy_sc_proxy.rs | 318 +++++++ .../src/farm_with_locked_rewards_proxy.rs | 817 +++++++++++++++++ dex/interactor/proxies/src/lib.rs | 13 + .../{ => proxies}/src/pair_proxy.rs | 2 +- dex/interactor/proxies/src/router_proxy.rs | 517 +++++++++++ dex/interactor/src/dex_interact.rs | 40 +- dex/interactor/src/dex_interact_cli.rs | 24 +- dex/interactor/src/dex_interact_config.rs | 2 +- .../src/dex_interact_farm_locked.rs | 35 + dex/interactor/src/dex_interact_pair.rs | 71 +- dex/interactor/src/dex_interact_state.rs | 23 +- dex/interactor/state.toml | 4 +- dex/pair-mock/Cargo.toml | 4 +- dex/pair-mock/meta/Cargo.toml | 2 +- dex/pair-mock/wasm/Cargo.lock | 204 ----- 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 | 397 -------- dex/pair/wasm-pair-full/Cargo.toml | 2 +- dex/pair/wasm-pair-full/src/lib.rs | 2 +- dex/pair/wasm-safe-price-view/Cargo.lock | 397 -------- dex/pair/wasm-safe-price-view/Cargo.toml | 2 +- dex/pair/wasm/Cargo.lock | 397 -------- dex/pair/wasm/Cargo.toml | 2 +- dex/pair/wasm/src/lib.rs | 2 +- dex/price-discovery/Cargo.toml | 6 +- dex/price-discovery/meta/Cargo.toml | 2 +- dex/price-discovery/wasm/Cargo.lock | 205 ----- 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 | 547 ----------- dex/proxy-deployer/wasm/Cargo.toml | 2 +- dex/router/Cargo.toml | 4 +- dex/router/meta/Cargo.toml | 2 +- dex/router/sc-config.toml | 2 + dex/router/wasm/Cargo.lock | 411 --------- 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 | 296 ------ .../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 | 546 ----------- .../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 | 340 ------- .../fees-collector/wasm/Cargo.toml | 2 +- energy-integration/governance-v2/Cargo.toml | 4 +- .../governance-v2/meta/Cargo.toml | 2 +- .../governance-v2/wasm/Cargo.lock | 360 -------- .../governance-v2/wasm/Cargo.toml | 2 +- farm-staking/farm-staking-proxy/Cargo.toml | 6 +- .../farm-staking-proxy/meta/Cargo.toml | 2 +- .../farm-staking-proxy/sc-config.toml | 2 + .../farm-staking-proxy/wasm/Cargo.lock | 627 ------------- .../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/sc-config.toml | 2 + farm-staking/farm-staking/wasm/Cargo.lock | 567 ------------ 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 | 389 -------- .../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 | 389 -------- 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/sc-config.toml | 2 + locked-asset/energy-factory/src/energy.rs | 3 +- locked-asset/energy-factory/src/events.rs | 3 +- locked-asset/energy-factory/wasm/Cargo.lock | 280 ------ locked-asset/energy-factory/wasm/Cargo.toml | 2 +- locked-asset/energy-factory/wasm/src/lib.rs | 2 +- locked-asset/factory/Cargo.toml | 6 +- locked-asset/factory/meta/Cargo.toml | 2 +- locked-asset/factory/wasm/Cargo.lock | 380 -------- 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 | 311 ------- 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 | 335 ------- .../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 | 590 ------------ 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 | 250 ----- .../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 | 230 ----- 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 | 317 ------- locked-asset/token-unstake/wasm/Cargo.toml | 2 +- pause-all/Cargo.toml | 6 +- pause-all/meta/Cargo.toml | 2 +- pause-all/wasm/Cargo.lock | 215 ----- pause-all/wasm/Cargo.toml | 2 +- 159 files changed, 3485 insertions(+), 10464 deletions(-) create mode 100644 dex/farm-with-locked-rewards/sc-config.toml delete mode 100644 dex/farm-with-locked-rewards/wasm/Cargo.lock delete mode 100644 dex/farm/wasm/Cargo.lock delete mode 100644 dex/governance/wasm/Cargo.lock create mode 100644 dex/interactor/proxies/Cargo.toml create mode 100644 dex/interactor/proxies/src/energy_factory_proxy.rs create mode 100644 dex/interactor/proxies/src/farm_staking_proxy.rs create mode 100644 dex/interactor/proxies/src/farm_staking_proxy_sc_proxy.rs create mode 100644 dex/interactor/proxies/src/farm_with_locked_rewards_proxy.rs create mode 100644 dex/interactor/proxies/src/lib.rs rename dex/interactor/{ => proxies}/src/pair_proxy.rs (100%) create mode 100644 dex/interactor/proxies/src/router_proxy.rs create mode 100644 dex/interactor/src/dex_interact_farm_locked.rs delete mode 100644 dex/pair-mock/wasm/Cargo.lock delete mode 100644 dex/pair/wasm-pair-full/Cargo.lock delete mode 100644 dex/pair/wasm-safe-price-view/Cargo.lock delete mode 100644 dex/pair/wasm/Cargo.lock delete mode 100644 dex/price-discovery/wasm/Cargo.lock delete mode 100644 dex/proxy-deployer/wasm/Cargo.lock create mode 100644 dex/router/sc-config.toml delete mode 100644 dex/router/wasm/Cargo.lock delete mode 100644 energy-integration/energy-factory-mock/wasm/Cargo.lock delete mode 100644 energy-integration/energy-update/wasm/Cargo.lock delete mode 100644 energy-integration/fees-collector/wasm/Cargo.lock delete mode 100644 energy-integration/governance-v2/wasm/Cargo.lock create mode 100644 farm-staking/farm-staking-proxy/sc-config.toml delete mode 100644 farm-staking/farm-staking-proxy/wasm/Cargo.lock create mode 100644 farm-staking/farm-staking/sc-config.toml delete mode 100644 farm-staking/farm-staking/wasm/Cargo.lock delete mode 100644 farm-staking/metabonding-staking/wasm/Cargo.lock delete mode 100644 locked-asset/distribution/wasm/Cargo.lock create mode 100644 locked-asset/energy-factory/sc-config.toml delete mode 100644 locked-asset/energy-factory/wasm/Cargo.lock delete mode 100644 locked-asset/factory/wasm/Cargo.lock delete mode 100644 locked-asset/lkmex-transfer/wasm/Cargo.lock delete mode 100644 locked-asset/locked-token-wrapper/wasm/Cargo.lock delete mode 100644 locked-asset/proxy_dex/wasm/Cargo.lock delete mode 100644 locked-asset/simple-lock-whitelist/wasm/Cargo.lock delete mode 100644 locked-asset/simple-lock/wasm/Cargo.lock delete mode 100644 locked-asset/token-unstake/wasm/Cargo.lock delete mode 100644 pause-all/wasm/Cargo.lock diff --git a/common/common_errors/Cargo.toml b/common/common_errors/Cargo.toml index 55e635977..044d8fa75 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/common_structs/Cargo.toml b/common/common_structs/Cargo.toml index d8322c7da..140ec1dbb 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" 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 150906ef7..8dff568bd 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/farm/contexts/Cargo.toml b/common/modules/farm/contexts/Cargo.toml index c13f06c85..80afa7345 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" diff --git a/common/modules/farm/events/Cargo.toml b/common/modules/farm/events/Cargo.toml index 829224586..4905a6196 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" 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 b1bf372a6..d7993b38f 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" diff --git a/common/modules/farm/farm_token/Cargo.toml b/common/modules/farm/farm_token/Cargo.toml index 492c96b77..729c2bd1e 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" diff --git a/common/modules/farm/farm_token_merge/Cargo.toml b/common/modules/farm/farm_token_merge/Cargo.toml index e1f3f7d63..bbd9bb2ec 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" [workspace] members = ["."] diff --git a/common/modules/farm/rewards/Cargo.toml b/common/modules/farm/rewards/Cargo.toml index fb93e4052..2a913013e 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" diff --git a/common/modules/legacy_token_decode_module/Cargo.toml b/common/modules/legacy_token_decode_module/Cargo.toml index 9ee52b0b7..3afc5da65 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" 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 2d318d8e3..75d71ae29 100644 --- a/common/modules/locking_module/Cargo.toml +++ b/common/modules/locking_module/Cargo.toml @@ -8,5 +8,5 @@ edition = "2021" path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/math/Cargo.toml b/common/modules/math/Cargo.toml index d6d7c7734..eaf6a6b6f 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/pausable/Cargo.toml b/common/modules/pausable/Cargo.toml index 315cda452..3ca944674 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/permissions_module/Cargo.toml b/common/modules/permissions_module/Cargo.toml index 83d6cc69d..73a810f39 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" 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 7b332c22e..25ebd933f 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" 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 39acd0475..1012e67e7 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/token_send/Cargo.toml b/common/modules/token_send/Cargo.toml index efda9bb0c..0be22eae0 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/utils/Cargo.toml b/common/modules/utils/Cargo.toml index 08b566c9c..01bed0f7a 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" 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 b805e5382..20dac657c 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" diff --git a/common/traits/mergeable/Cargo.toml b/common/traits/mergeable/Cargo.toml index bf54b7a1e..829729e6c 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/traits/unwrappable/Cargo.toml b/common/traits/unwrappable/Cargo.toml index 85d0be4a9..46d9c0f09 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" features = ["esdt-token-payment-legacy-decode"] diff --git a/dex/Cargo.toml b/dex/Cargo.toml index 851dfa73b..21ca36643 100644 --- a/dex/Cargo.toml +++ b/dex/Cargo.toml @@ -5,17 +5,17 @@ edition = "2021" publish = false [dependencies.multiversx-sc] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" [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 6cb846a2d..f0c50a943 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" [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 46f21517f..a83124c03 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.49.0-alpha.3" +version = "0.49.0-alpha.4" default-features = false diff --git a/dex/farm-with-locked-rewards/sc-config.toml b/dex/farm-with-locked-rewards/sc-config.toml new file mode 100644 index 000000000..4fcffdbfc --- /dev/null +++ b/dex/farm-with-locked-rewards/sc-config.toml @@ -0,0 +1,2 @@ +[[proxy]] +path = "../interactor/src/farm_with_locked_rewards_proxy.rs" diff --git a/dex/farm-with-locked-rewards/wasm/Cargo.lock b/dex/farm-with-locked-rewards/wasm/Cargo.lock deleted file mode 100644 index 8d8f36b03..000000000 --- a/dex/farm-with-locked-rewards/wasm/Cargo.lock +++ /dev/null @@ -1,566 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" - -[[package]] -name = "common-types" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "config" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "contexts" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "farm_token", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "rewards", - "token_merge_helper", - "token_send", -] - -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "energy-query" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", -] - -[[package]] -name = "events" -version = "0.0.0" -dependencies = [ - "common_structs", - "contexts", - "multiversx-sc", -] - -[[package]] -name = "farm" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "contexts", - "energy-query", - "events", - "farm-boosted-yields", - "farm_base_impl", - "farm_token", - "fixed-supply-token", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pair", - "pausable", - "permissions_module", - "rewards", - "sc_whitelist_module", - "token_send", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "farm-boosted-yields" -version = "0.0.0" -dependencies = [ - "common-types", - "config", - "energy-query", - "multiversx-sc", - "pausable", - "permissions_module", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "farm-with-locked-rewards" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "contexts", - "energy-factory", - "energy-query", - "events", - "farm", - "farm-boosted-yields", - "farm_base_impl", - "farm_token", - "fixed-supply-token", - "locking_module", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "rewards", - "sc_whitelist_module", - "token_send", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "farm-with-locked-rewards-wasm" -version = "0.0.0" -dependencies = [ - "farm-with-locked-rewards", - "multiversx-sc-wasm-adapter", -] - -[[package]] -name = "farm_base_impl" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "contexts", - "events", - "farm_token", - "fixed-supply-token", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "rewards", - "token_merge_helper", - "token_send", - "utils", -] - -[[package]] -name = "farm_token" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "fees-collector" -version = "0.0.0" -dependencies = [ - "common-types", - "common_errors", - "energy-factory", - "energy-query", - "locking_module", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "locking_module" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" -dependencies = [ - "bitflags", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "pair" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "fees-collector", - "itertools", - "multiversx-sc", - "pausable", - "permissions_module", - "simple-lock", - "token_send", - "utils", -] - -[[package]] -name = "pausable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", - "permissions_module", -] - -[[package]] -name = "permissions_module" -version = "0.0.0" -dependencies = [ - "bitflags", - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "proc-macro2" -version = "1.0.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "rewards" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "farm_token", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" - -[[package]] -name = "syn" -version = "2.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "token_merge_helper" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "token_send" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "week-timekeeping" -version = "0.0.0" -dependencies = [ - "common-types", - "multiversx-sc", -] - -[[package]] -name = "weekly-rewards-splitting" -version = "0.0.0" -dependencies = [ - "common-types", - "energy-query", - "math", - "multiversx-sc", - "unwrappable", - "week-timekeeping", -] diff --git a/dex/farm-with-locked-rewards/wasm/Cargo.toml b/dex/farm-with-locked-rewards/wasm/Cargo.toml index 3207abd40..f18e2f60d 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" [workspace] members = ["."] diff --git a/dex/farm/Cargo.toml b/dex/farm/Cargo.toml index be0442dab..1edae2cee 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" [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.49.0-alpha.3" +version = "=0.49.0-alpha.4" [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 67fe5d1a7..bd7aa6a4a 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.49.0-alpha.3" +version = "0.49.0-alpha.4" default-features = false diff --git a/dex/farm/wasm/Cargo.lock b/dex/farm/wasm/Cargo.lock deleted file mode 100644 index f67ee256a..000000000 --- a/dex/farm/wasm/Cargo.lock +++ /dev/null @@ -1,536 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" - -[[package]] -name = "common-types" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "config" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "contexts" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "farm_token", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "rewards", - "token_merge_helper", - "token_send", -] - -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "energy-query" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", -] - -[[package]] -name = "events" -version = "0.0.0" -dependencies = [ - "common_structs", - "contexts", - "multiversx-sc", -] - -[[package]] -name = "farm" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "contexts", - "energy-query", - "events", - "farm-boosted-yields", - "farm_base_impl", - "farm_token", - "fixed-supply-token", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pair", - "pausable", - "permissions_module", - "rewards", - "sc_whitelist_module", - "token_send", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "farm-boosted-yields" -version = "0.0.0" -dependencies = [ - "common-types", - "config", - "energy-query", - "multiversx-sc", - "pausable", - "permissions_module", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "farm-wasm" -version = "0.0.0" -dependencies = [ - "farm", - "multiversx-sc-wasm-adapter", -] - -[[package]] -name = "farm_base_impl" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "contexts", - "events", - "farm_token", - "fixed-supply-token", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "rewards", - "token_merge_helper", - "token_send", - "utils", -] - -[[package]] -name = "farm_token" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "fees-collector" -version = "0.0.0" -dependencies = [ - "common-types", - "common_errors", - "energy-factory", - "energy-query", - "locking_module", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "locking_module" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" -dependencies = [ - "bitflags", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "pair" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "fees-collector", - "itertools", - "multiversx-sc", - "pausable", - "permissions_module", - "simple-lock", - "token_send", - "utils", -] - -[[package]] -name = "pausable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", - "permissions_module", -] - -[[package]] -name = "permissions_module" -version = "0.0.0" -dependencies = [ - "bitflags", - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "proc-macro2" -version = "1.0.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "rewards" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "farm_token", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" - -[[package]] -name = "syn" -version = "2.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "token_merge_helper" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "token_send" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "week-timekeeping" -version = "0.0.0" -dependencies = [ - "common-types", - "multiversx-sc", -] - -[[package]] -name = "weekly-rewards-splitting" -version = "0.0.0" -dependencies = [ - "common-types", - "energy-query", - "math", - "multiversx-sc", - "unwrappable", - "week-timekeeping", -] diff --git a/dex/farm/wasm/Cargo.toml b/dex/farm/wasm/Cargo.toml index 84b234d90..86bd8ce41 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" [workspace] members = ["."] diff --git a/dex/fuzz/Cargo.toml b/dex/fuzz/Cargo.toml index 6d870b69a..98aeb8e22 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-scenario] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" [dependencies.pausable] path = "../../common/modules/pausable" diff --git a/dex/governance/Cargo.toml b/dex/governance/Cargo.toml index 1ad6a0209..012b57fb3 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" [dev-dependencies.pair-mock] path = "../pair-mock" diff --git a/dex/governance/meta/Cargo.toml b/dex/governance/meta/Cargo.toml index 21d1c15fd..d6ecc09cc 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.49.0-alpha.3" +version = "0.49.0-alpha.4" default-features = false diff --git a/dex/governance/wasm/Cargo.lock b/dex/governance/wasm/Cargo.lock deleted file mode 100644 index 6dc5fff54..000000000 --- a/dex/governance/wasm/Cargo.lock +++ /dev/null @@ -1,180 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "governance" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "governance-wasm" -version = "0.0.0" -dependencies = [ - "governance", - "multiversx-sc-wasm-adapter", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "multiversx-sc" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" -dependencies = [ - "bitflags", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "proc-macro2" -version = "1.0.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "smallvec" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" - -[[package]] -name = "syn" -version = "2.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" diff --git a/dex/governance/wasm/Cargo.toml b/dex/governance/wasm/Cargo.toml index 3ce2d1003..7fdd43cea 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" [workspace] members = ["."] diff --git a/dex/interactor/Cargo.toml b/dex/interactor/Cargo.toml index 73ba7dfab..c40061348 100644 --- a/dex/interactor/Cargo.toml +++ b/dex/interactor/Cargo.toml @@ -15,19 +15,13 @@ serde = { version = "1.0", features = ["derive"] } toml = "0.8.6" [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" [dependencies.multiversx-sc-snippets] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" [dependencies.multiversx-sc-scenario] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" -[dependencies.common_structs] -path = "../../common/common_structs" - -[dependencies.permissions_module] -path = "../../common/modules/permissions_module" - -[dependencies.pausable] -path = "../../common/modules/pausable" +[dependencies.proxies] +path = "proxies" diff --git a/dex/interactor/proxies/Cargo.toml b/dex/interactor/proxies/Cargo.toml new file mode 100644 index 000000000..7192c435f --- /dev/null +++ b/dex/interactor/proxies/Cargo.toml @@ -0,0 +1,35 @@ +[package] +name = "proxies" +version = "0.0.0" +authors = [""] +edition = "2021" + +[lib] +path = "src/lib.rs" + +[dependencies.multiversx-sc] +version = "=0.49.0-alpha.4" + +[dependencies.multiversx-sc-scenario] +version = "=0.49.0-alpha.4" + +[dependencies.common_structs] +path = "../../../common/common_structs" + +[dependencies.permissions_module] +path = "../../../common/modules/permissions_module" + +[dependencies.pausable] +path = "../../../common/modules/pausable" + +[dependencies.farm-boosted-yields] +path = "../../../energy-integration/farm-boosted-yields" + +[dependencies.energy-factory] +path = "../../../locked-asset/energy-factory" + +[dependencies.config] +path = "../../../common/modules/farm/config" + +[dependencies.weekly-rewards-splitting] +path = "../../../energy-integration/common-modules/weekly-rewards-splitting" diff --git a/dex/interactor/proxies/src/energy_factory_proxy.rs b/dex/interactor/proxies/src/energy_factory_proxy.rs new file mode 100644 index 000000000..712d682f7 --- /dev/null +++ b/dex/interactor/proxies/src/energy_factory_proxy.rs @@ -0,0 +1,571 @@ +// Code generated by the multiversx-sc proxy generator. DO NOT EDIT. + +//////////////////////////////////////////////////// +////////////////// AUTO-GENERATED ////////////////// +//////////////////////////////////////////////////// + +#![allow(dead_code)] +#![allow(clippy::all)] + +use multiversx_sc::proxy_imports::*; +use multiversx_sc_scenario::multiversx_sc; + +pub struct SimpleLockEnergyProxy; + +impl TxProxyTrait for SimpleLockEnergyProxy +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + type TxProxyMethods = SimpleLockEnergyProxyMethods; + + fn proxy_methods(self, tx: Tx) -> Self::TxProxyMethods { + SimpleLockEnergyProxyMethods { wrapped_tx: tx } + } +} + +pub struct SimpleLockEnergyProxyMethods +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + wrapped_tx: Tx, +} + +#[rustfmt::skip] +impl SimpleLockEnergyProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + Gas: TxGas, +{ + /// Args: + /// - base_asset_token_id: The only token that is accepted for the lockTokens endpoint. + /// NOTE: The SC also needs the ESDTLocalMint and ESDTLocalBurn roles for this token. + /// - legacy_token_id: The token ID of the old locked asset. + /// NOTE: The SC also needs the NFTBurn role for this token. + /// - old_locked_asset_factory_address + /// - min_migrated_token_locked_period - The minimum number of epochs that + /// a migrated old LKMEX token will be locked for after the average is calculated + /// - lock_options: See `addLockOptions` endpoint doc for details. + pub fn init< + Arg0: CodecInto>, + Arg1: CodecInto>, + Arg2: CodecInto>, + Arg3: CodecInto, + Arg4: CodecInto>>, + >( + self, + base_asset_token_id: Arg0, + legacy_token_id: Arg1, + old_locked_asset_factory_address: Arg2, + min_migrated_token_locked_period: Arg3, + lock_options: Arg4, + ) -> TxProxyDeploy { + self.wrapped_tx + .raw_deploy() + .argument(&base_asset_token_id) + .argument(&legacy_token_id) + .argument(&old_locked_asset_factory_address) + .argument(&min_migrated_token_locked_period) + .argument(&lock_options) + .original_result() + } +} + +#[rustfmt::skip] +impl SimpleLockEnergyProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + pub fn upgrade( + self, + ) -> TxProxyUpgrade { + self.wrapped_tx + .raw_upgrade() + .original_result() + } +} + +#[rustfmt::skip] +impl SimpleLockEnergyProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + /// Locks a whitelisted token until `unlock_epoch` and receive meta ESDT LOCKED tokens + /// on a 1:1 ratio. Accepted input tokens: + /// - base asset token + /// - old factory token -> extends all periods to the provided option + /// - previously locked token -> extends period to the provided option + /// + /// Arguments: + /// - lock_epochs - Number of epochs for which the tokens are locked for. + /// Caller may only choose from the available options, + /// which can be seen by querying getLockOptions + /// - opt_destination - OPTIONAL: destination address for the LOCKED tokens. Default is caller. + /// + /// Output payment: LOCKED tokens + pub fn lock_tokens_endpoint< + Arg0: CodecInto, + Arg1: CodecInto>>, + >( + self, + lock_epochs: Arg0, + opt_destination: Arg1, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("lockTokens") + .argument(&lock_epochs) + .argument(&opt_destination) + .original_result() + } + + /// Unlock tokens, previously locked with the `lockTokens` endpoint + /// + /// Expected payments: LOCKED tokens + /// + /// Output payments: the originally locked tokens + pub fn unlock_tokens_endpoint( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("unlockTokens") + .original_result() + } + + /// Used internally by proxy-dex + pub fn extend_lock_period< + Arg0: CodecInto, + Arg1: CodecInto>, + >( + self, + lock_epochs: Arg0, + user: Arg1, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("extendLockPeriod") + .argument(&lock_epochs) + .argument(&user) + .original_result() + } + + pub fn issue_locked_token< + Arg0: CodecInto>, + Arg1: CodecInto>, + Arg2: CodecInto, + >( + self, + token_display_name: Arg0, + token_ticker: Arg1, + num_decimals: Arg2, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("issueLockedToken") + .argument(&token_display_name) + .argument(&token_ticker) + .argument(&num_decimals) + .original_result() + } + + pub fn locked_token( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getLockedTokenId") + .original_result() + } + + pub fn base_asset_token_id( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getBaseAssetTokenId") + .original_result() + } + + pub fn legacy_locked_token_id( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getLegacyLockedTokenId") + .original_result() + } + + pub fn get_updated_energy_entry_for_user< + Arg0: CodecInto>, + >( + self, + user: Arg0, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getEnergyEntryForUser") + .argument(&user) + .original_result() + } + + pub fn get_energy_amount_for_user< + Arg0: CodecInto>, + >( + self, + user: Arg0, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getEnergyAmountForUser") + .argument(&user) + .original_result() + } + + /// Add lock options, as pairs of epochs and penalty percentages. + /// lock epochs must be >= 360 epochs (1 year), + /// percentages must be between 0 and 10_000 + /// Additionally, percentages must increase as lock period increases. + /// + /// For example, an option pair of "360, 100" means the user can choose to lock their tokens + /// for 360 epochs, and if they were to unlock the immediately, + /// they would incur a penalty of 1%. + /// + /// When calling lockTokens, or reducing lock periods, + /// users may only pick one of the whitelisted lock options. + pub fn add_lock_options< + Arg0: CodecInto>>, + >( + self, + new_lock_options: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("addLockOptions") + .argument(&new_lock_options) + .original_result() + } + + pub fn get_lock_options_view( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getLockOptions") + .original_result() + } + + /// Unlock a locked token instantly. This incures a penalty. + /// The longer the remaining locking time, the bigger the penalty. + /// Tokens can be unlocked through another SC after the unbond period has passed. + pub fn unlock_early( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("unlockEarly") + .original_result() + } + + /// Reduce the locking period of a locked token. This incures a penalty. + /// The longer the reduction, the bigger the penalty. + /// new_lock_period must be one of the available lock options + pub fn reduce_lock_period< + Arg0: CodecInto, + >( + self, + new_lock_period: Arg0, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("reduceLockPeriod") + .argument(&new_lock_period) + .original_result() + } + + /// Calculates the penalty that would be incurred if `token_amount` tokens + /// were to have their lock epochs reduced from `prev_lock_epochs` to + /// `new_lock_epochs`. For full unlock, `new_lock_epochs` should be 0. + pub fn calculate_penalty_amount< + Arg0: CodecInto>, + Arg1: CodecInto, + Arg2: CodecInto, + >( + self, + token_amount: Arg0, + prev_lock_epochs: Arg1, + new_lock_epochs: Arg2, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getPenaltyAmount") + .argument(&token_amount) + .argument(&prev_lock_epochs) + .argument(&new_lock_epochs) + .original_result() + } + + /// - token_unstake_address - The address of the SC that will handle the unbond logic + /// By default, all tokens go through an unbond period after unlock + pub fn set_token_unstake_address< + Arg0: CodecInto>, + >( + self, + sc_address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setTokenUnstakeAddress") + .argument(&sc_address) + .original_result() + } + + pub fn revert_unstake< + Arg0: CodecInto>, + Arg1: CodecInto>, + >( + self, + user: Arg0, + new_energy: Arg1, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("revertUnstake") + .argument(&user) + .argument(&new_energy) + .original_result() + } + + pub fn token_unstake_sc_address( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getTokenUnstakeScAddress") + .original_result() + } + + /// Sets the energy amounts and token amounts for users. Overwrites any existing values. + /// Expects any number of pairs of (user address, token amount, energy amount). + pub fn set_energy_for_old_tokens< + Arg0: CodecInto, BigUint, BigInt>>>, + >( + self, + users_energy: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setEnergyForOldTokens") + .argument(&users_energy) + .original_result() + } + + pub fn update_energy_after_old_token_unlock< + Arg0: CodecInto>, + Arg1: CodecInto>, + Arg2: CodecInto>, + >( + self, + original_caller: Arg0, + initial_epoch_amount_pairs: Arg1, + final_epoch_amount_pairs: Arg2, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("updateEnergyAfterOldTokenUnlock") + .argument(&original_caller) + .argument(&initial_epoch_amount_pairs) + .argument(&final_epoch_amount_pairs) + .original_result() + } + + pub fn migrate_old_tokens( + self, + ) -> TxProxyCall>> { + self.wrapped_tx + .raw_call("migrateOldTokens") + .original_result() + } + + pub fn pause_endpoint( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("pause") + .original_result() + } + + pub fn unpause_endpoint( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("unpause") + .original_result() + } + + pub fn paused_status( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("isPaused") + .original_result() + } + + /// Sets the transfer role for the given address. Defaults to own address. + pub fn set_transfer_role< + Arg0: CodecInto>>, + >( + self, + opt_address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setTransferRoleLockedToken") + .argument(&opt_address) + .original_result() + } + + /// Sets the burn role for the given address + pub fn set_burn_role< + Arg0: CodecInto>, + >( + self, + address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setBurnRoleLockedToken") + .argument(&address) + .original_result() + } + + pub fn merge_tokens_endpoint< + Arg0: CodecInto>>, + >( + self, + opt_original_caller: Arg0, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("mergeTokens") + .argument(&opt_original_caller) + .original_result() + } + + pub fn lock_virtual< + Arg0: CodecInto>, + Arg1: CodecInto>, + Arg2: CodecInto, + Arg3: CodecInto>, + Arg4: CodecInto>, + >( + self, + token_id: Arg0, + amount: Arg1, + lock_epochs: Arg2, + dest_address: Arg3, + energy_address: Arg4, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("lockVirtual") + .argument(&token_id) + .argument(&amount) + .argument(&lock_epochs) + .argument(&dest_address) + .argument(&energy_address) + .original_result() + } + + pub fn add_sc_address_to_whitelist< + Arg0: CodecInto>, + >( + self, + address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("addSCAddressToWhitelist") + .argument(&address) + .original_result() + } + + pub fn remove_sc_address_from_whitelist< + Arg0: CodecInto>, + >( + self, + address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("removeSCAddressFromWhitelist") + .argument(&address) + .original_result() + } + + pub fn is_sc_address_whitelisted< + Arg0: CodecInto>, + >( + self, + address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("isSCAddressWhitelisted") + .argument(&address) + .original_result() + } + + pub fn add_to_token_transfer_whitelist< + Arg0: CodecInto>>, + >( + self, + sc_addresses: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("addToTokenTransferWhitelist") + .argument(&sc_addresses) + .original_result() + } + + pub fn remove_from_token_transfer_whitelist< + Arg0: CodecInto>>, + >( + self, + sc_addresses: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("removeFromTokenTransferWhitelist") + .argument(&sc_addresses) + .original_result() + } + + pub fn set_user_energy_after_locked_token_transfer< + Arg0: CodecInto>, + Arg1: CodecInto>, + >( + self, + user: Arg0, + energy: Arg1, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setUserEnergyAfterLockedTokenTransfer") + .argument(&user) + .argument(&energy) + .original_result() + } +} + +#[derive(TopEncode, TopDecode, NestedEncode, NestedDecode, Clone, PartialEq, Debug)] +pub struct Energy +where + Api: ManagedTypeApi, +{ + pub amount: BigInt, + pub last_update_epoch: u64, + pub total_locked_tokens: BigUint, +} + +#[derive(TopEncode, TopDecode)] +pub struct LockOption { + pub lock_epochs: u64, + pub penalty_start_percentage: u64, +} + +#[derive(TopEncode, TopDecode)] +pub struct EnergyUpdatedEvent +where + Api: ManagedTypeApi, +{ + pub old_energy_entry: Energy, + pub new_energy_entry: Energy, +} diff --git a/dex/interactor/proxies/src/farm_staking_proxy.rs b/dex/interactor/proxies/src/farm_staking_proxy.rs new file mode 100644 index 000000000..e751c4336 --- /dev/null +++ b/dex/interactor/proxies/src/farm_staking_proxy.rs @@ -0,0 +1,859 @@ +// Code generated by the multiversx-sc proxy generator. DO NOT EDIT. + +//////////////////////////////////////////////////// +////////////////// AUTO-GENERATED ////////////////// +//////////////////////////////////////////////////// + +#![allow(dead_code)] +#![allow(clippy::all)] + +use multiversx_sc::proxy_imports::*; +use multiversx_sc_scenario::multiversx_sc; + +pub struct FarmStakingProxy; + +impl TxProxyTrait for FarmStakingProxy +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + type TxProxyMethods = FarmStakingProxyMethods; + + fn proxy_methods(self, tx: Tx) -> Self::TxProxyMethods { + FarmStakingProxyMethods { wrapped_tx: tx } + } +} + +pub struct FarmStakingProxyMethods +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + wrapped_tx: Tx, +} + +#[rustfmt::skip] +impl FarmStakingProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + Gas: TxGas, +{ + pub fn init< + Arg0: CodecInto>, + Arg1: CodecInto>, + Arg2: CodecInto>, + Arg3: CodecInto, + Arg4: CodecInto>, + Arg5: CodecInto>>, + >( + self, + farming_token_id: Arg0, + division_safety_constant: Arg1, + max_apr: Arg2, + min_unbond_epochs: Arg3, + owner: Arg4, + admins: Arg5, + ) -> TxProxyDeploy { + self.wrapped_tx + .raw_deploy() + .argument(&farming_token_id) + .argument(&division_safety_constant) + .argument(&max_apr) + .argument(&min_unbond_epochs) + .argument(&owner) + .argument(&admins) + .original_result() + } +} + +#[rustfmt::skip] +impl FarmStakingProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + pub fn upgrade( + self, + ) -> TxProxyUpgrade { + self.wrapped_tx + .raw_upgrade() + .original_result() + } +} + +#[rustfmt::skip] +impl FarmStakingProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + pub fn merge_farm_tokens_endpoint( + self, + ) -> TxProxyCall, EsdtTokenPayment>> { + self.wrapped_tx + .raw_call("mergeFarmTokens") + .original_result() + } + + pub fn set_boosted_yields_rewards_percentage< + Arg0: CodecInto, + >( + self, + percentage: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setBoostedYieldsRewardsPercentage") + .argument(&percentage) + .original_result() + } + + pub fn calculate_rewards_for_given_position< + Arg0: CodecInto>, + Arg1: CodecInto>, + >( + self, + farm_token_amount: Arg0, + attributes: Arg1, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("calculateRewardsForGivenPosition") + .argument(&farm_token_amount) + .argument(&attributes) + .original_result() + } + + pub fn top_up_rewards( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("topUpRewards") + .original_result() + } + + pub fn withdraw_rewards< + Arg0: CodecInto>, + >( + self, + withdraw_amount: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("withdrawRewards") + .argument(&withdraw_amount) + .original_result() + } + + pub fn end_produce_rewards( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("endProduceRewards") + .original_result() + } + + pub fn set_per_block_rewards< + Arg0: CodecInto>, + >( + self, + per_block_amount: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setPerBlockRewardAmount") + .argument(&per_block_amount) + .original_result() + } + + pub fn set_max_apr< + Arg0: CodecInto>, + >( + self, + max_apr: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setMaxApr") + .argument(&max_apr) + .original_result() + } + + pub fn set_min_unbond_epochs_endpoint< + Arg0: CodecInto, + >( + self, + min_unbond_epochs: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setMinUnbondEpochs") + .argument(&min_unbond_epochs) + .original_result() + } + + pub fn start_produce_rewards_endpoint( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("startProduceRewards") + .original_result() + } + + pub fn accumulated_rewards( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getAccumulatedRewards") + .original_result() + } + + pub fn reward_capacity( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getRewardCapacity") + .original_result() + } + + pub fn max_annual_percentage_rewards( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getAnnualPercentageRewards") + .original_result() + } + + pub fn min_unbond_epochs( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getMinUnbondEpochs") + .original_result() + } + + pub fn reward_per_share( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getRewardPerShare") + .original_result() + } + + pub fn reward_reserve( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getRewardReserve") + .original_result() + } + + pub fn allow_external_claim_boosted_rewards< + Arg0: CodecInto, + >( + self, + allow_external_claim: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("allowExternalClaimBoostedRewards") + .argument(&allow_external_claim) + .original_result() + } + + pub fn get_allow_external_claim_rewards< + Arg0: CodecInto>, + >( + self, + user: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getAllowExternalClaimRewards") + .argument(&user) + .original_result() + } + + pub fn farming_token_id( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getFarmingTokenId") + .original_result() + } + + pub fn reward_token_id( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getRewardTokenId") + .original_result() + } + + pub fn per_block_reward_amount( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getPerBlockRewardAmount") + .original_result() + } + + pub fn last_reward_block_nonce( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getLastRewardBlockNonce") + .original_result() + } + + pub fn division_safety_constant( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getDivisionSafetyConstant") + .original_result() + } + + pub fn user_total_farm_position< + Arg0: CodecInto>, + >( + self, + user: Arg0, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getUserTotalFarmPosition") + .argument(&user) + .original_result() + } + + pub fn farm_position_migration_nonce( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getFarmPositionMigrationNonce") + .original_result() + } + + pub fn register_farm_token< + Arg0: CodecInto>, + Arg1: CodecInto>, + Arg2: CodecInto, + >( + self, + token_display_name: Arg0, + token_ticker: Arg1, + num_decimals: Arg2, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("registerFarmToken") + .argument(&token_display_name) + .argument(&token_ticker) + .argument(&num_decimals) + .original_result() + } + + pub fn farm_token( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getFarmTokenId") + .original_result() + } + + pub fn farm_token_supply( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getFarmTokenSupply") + .original_result() + } + + pub fn add_sc_address_to_whitelist< + Arg0: CodecInto>, + >( + self, + address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("addSCAddressToWhitelist") + .argument(&address) + .original_result() + } + + pub fn remove_sc_address_from_whitelist< + Arg0: CodecInto>, + >( + self, + address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("removeSCAddressFromWhitelist") + .argument(&address) + .original_result() + } + + pub fn is_sc_address_whitelisted< + Arg0: CodecInto>, + >( + self, + address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("isSCAddressWhitelisted") + .argument(&address) + .original_result() + } + + pub fn add_to_pause_whitelist< + Arg0: CodecInto>>, + >( + self, + address_list: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("addToPauseWhitelist") + .argument(&address_list) + .original_result() + } + + pub fn remove_from_pause_whitelist< + Arg0: CodecInto>>, + >( + self, + address_list: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("removeFromPauseWhitelist") + .argument(&address_list) + .original_result() + } + + pub fn pause( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("pause") + .original_result() + } + + pub fn resume( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("resume") + .original_result() + } + + pub fn state( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getState") + .original_result() + } + + pub fn add_admin_endpoint< + Arg0: CodecInto>, + >( + self, + address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("addAdmin") + .argument(&address) + .original_result() + } + + pub fn remove_admin_endpoint< + Arg0: CodecInto>, + >( + self, + address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("removeAdmin") + .argument(&address) + .original_result() + } + + pub fn update_owner_or_admin_endpoint< + Arg0: CodecInto>, + >( + self, + previous_owner: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("updateOwnerOrAdmin") + .argument(&previous_owner) + .original_result() + } + + pub fn permissions< + Arg0: CodecInto>, + >( + self, + address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getPermissions") + .argument(&address) + .original_result() + } + + pub fn set_burn_role_for_address< + Arg0: CodecInto>, + >( + self, + address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setBurnRoleForAddress") + .argument(&address) + .original_result() + } + + pub fn stake_farm_through_proxy< + Arg0: CodecInto>, + Arg1: CodecInto>, + >( + self, + staked_token_amount: Arg0, + original_caller: Arg1, + ) -> TxProxyCall, EsdtTokenPayment>> { + self.wrapped_tx + .raw_call("stakeFarmThroughProxy") + .argument(&staked_token_amount) + .argument(&original_caller) + .original_result() + } + + pub fn stake_farm_endpoint< + Arg0: CodecInto>>, + >( + self, + opt_original_caller: Arg0, + ) -> TxProxyCall, EsdtTokenPayment>> { + self.wrapped_tx + .raw_call("stakeFarm") + .argument(&opt_original_caller) + .original_result() + } + + pub fn claim_rewards< + Arg0: CodecInto>>, + >( + self, + opt_original_caller: Arg0, + ) -> TxProxyCall, EsdtTokenPayment>> { + self.wrapped_tx + .raw_call("claimRewards") + .argument(&opt_original_caller) + .original_result() + } + + pub fn claim_rewards_with_new_value< + Arg0: CodecInto>, + Arg1: CodecInto>, + >( + self, + new_farming_amount: Arg0, + original_caller: Arg1, + ) -> TxProxyCall, EsdtTokenPayment>> { + self.wrapped_tx + .raw_call("claimRewardsWithNewValue") + .argument(&new_farming_amount) + .argument(&original_caller) + .original_result() + } + + pub fn compound_rewards( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("compoundRewards") + .original_result() + } + + pub fn unstake_farm< + Arg0: CodecInto>>, + >( + self, + opt_original_caller: Arg0, + ) -> TxProxyCall, EsdtTokenPayment>> { + self.wrapped_tx + .raw_call("unstakeFarm") + .argument(&opt_original_caller) + .original_result() + } + + pub fn unstake_farm_through_proxy< + Arg0: CodecInto>, + >( + self, + original_caller: Arg0, + ) -> TxProxyCall, EsdtTokenPayment>> { + self.wrapped_tx + .raw_call("unstakeFarmThroughProxy") + .argument(&original_caller) + .original_result() + } + + pub fn unbond_farm( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("unbondFarm") + .original_result() + } + + pub fn claim_boosted_rewards< + Arg0: CodecInto>>, + >( + self, + opt_user: Arg0, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("claimBoostedRewards") + .argument(&opt_user) + .original_result() + } + + pub fn collect_undistributed_boosted_rewards( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("collectUndistributedBoostedRewards") + .original_result() + } + + pub fn boosted_yields_rewards_percentage( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getBoostedYieldsRewardsPercentage") + .original_result() + } + + pub fn accumulated_rewards_for_week< + Arg0: CodecInto, + >( + self, + week: Arg0, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getAccumulatedRewardsForWeek") + .argument(&week) + .original_result() + } + + pub fn farm_supply_for_week< + Arg0: CodecInto, + >( + self, + week: Arg0, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getFarmSupplyForWeek") + .argument(&week) + .original_result() + } + + pub fn remaining_boosted_rewards_to_distribute< + Arg0: CodecInto, + >( + self, + week: Arg0, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getRemainingBoostedRewardsToDistribute") + .argument(&week) + .original_result() + } + + pub fn undistributed_boosted_rewards( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getUndistributedBoostedRewards") + .original_result() + } + + pub fn set_boosted_yields_factors< + Arg0: CodecInto>, + Arg1: CodecInto>, + Arg2: CodecInto>, + Arg3: CodecInto>, + Arg4: CodecInto>, + >( + self, + max_rewards_factor: Arg0, + user_rewards_energy_const: Arg1, + user_rewards_farm_const: Arg2, + min_energy_amount: Arg3, + min_farm_amount: Arg4, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setBoostedYieldsFactors") + .argument(&max_rewards_factor) + .argument(&user_rewards_energy_const) + .argument(&user_rewards_farm_const) + .argument(&min_energy_amount) + .argument(&min_farm_amount) + .original_result() + } + + pub fn get_boosted_yields_factors( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getBoostedYieldsFactors") + .original_result() + } + + /// Week starts from 1 + pub fn get_current_week( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getCurrentWeek") + .original_result() + } + + pub fn first_week_start_epoch( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getFirstWeekStartEpoch") + .original_result() + } + + pub fn get_last_active_week_for_user_view< + Arg0: CodecInto>, + >( + self, + user: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getLastActiveWeekForUser") + .argument(&user) + .original_result() + } + + pub fn get_user_energy_for_week_view< + Arg0: CodecInto>, + Arg1: CodecInto, + >( + self, + user: Arg0, + week: Arg1, + ) -> TxProxyCall>> { + self.wrapped_tx + .raw_call("getUserEnergyForWeek") + .argument(&user) + .argument(&week) + .original_result() + } + + pub fn last_global_update_week( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getLastGlobalUpdateWeek") + .original_result() + } + + pub fn total_rewards_for_week< + Arg0: CodecInto, + >( + self, + week: Arg0, + ) -> TxProxyCall>> { + self.wrapped_tx + .raw_call("getTotalRewardsForWeek") + .argument(&week) + .original_result() + } + + pub fn total_energy_for_week< + Arg0: CodecInto, + >( + self, + week: Arg0, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getTotalEnergyForWeek") + .argument(&week) + .original_result() + } + + pub fn total_locked_tokens_for_week< + Arg0: CodecInto, + >( + self, + week: Arg0, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getTotalLockedTokensForWeek") + .argument(&week) + .original_result() + } + + pub fn update_energy_for_user< + Arg0: CodecInto>, + >( + self, + user: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("updateEnergyForUser") + .argument(&user) + .original_result() + } + + pub fn current_claim_progress< + Arg0: CodecInto>, + >( + self, + user: Arg0, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getCurrentClaimProgress") + .argument(&user) + .original_result() + } + + pub fn set_energy_factory_address< + Arg0: CodecInto>, + >( + self, + sc_address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setEnergyFactoryAddress") + .argument(&sc_address) + .original_result() + } + + pub fn energy_factory_address( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getEnergyFactoryAddress") + .original_result() + } +} + +#[derive(TopEncode, TopDecode)] +pub struct StakingFarmTokenAttributes +where + Api: ManagedTypeApi, +{ + pub reward_per_share: BigUint, + pub compounded_reward: BigUint, + pub current_farm_amount: BigUint, + pub original_owner: ManagedAddress, +} diff --git a/dex/interactor/proxies/src/farm_staking_proxy_sc_proxy.rs b/dex/interactor/proxies/src/farm_staking_proxy_sc_proxy.rs new file mode 100644 index 000000000..c6f0afd7b --- /dev/null +++ b/dex/interactor/proxies/src/farm_staking_proxy_sc_proxy.rs @@ -0,0 +1,318 @@ +// Code generated by the multiversx-sc proxy generator. DO NOT EDIT. + +//////////////////////////////////////////////////// +////////////////// AUTO-GENERATED ////////////////// +//////////////////////////////////////////////////// + +#![allow(dead_code)] +#![allow(clippy::all)] + +use multiversx_sc::proxy_imports::*; +use multiversx_sc_scenario::multiversx_sc; + +pub struct FarmStakingProxyProxy; + +impl TxProxyTrait for FarmStakingProxyProxy +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + type TxProxyMethods = FarmStakingProxyProxyMethods; + + fn proxy_methods(self, tx: Tx) -> Self::TxProxyMethods { + FarmStakingProxyProxyMethods { wrapped_tx: tx } + } +} + +pub struct FarmStakingProxyProxyMethods +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + wrapped_tx: Tx, +} + +#[rustfmt::skip] +impl FarmStakingProxyProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + Gas: TxGas, +{ + pub fn init< + Arg0: CodecInto>, + Arg1: CodecInto>, + Arg2: CodecInto>, + Arg3: CodecInto>, + Arg4: CodecInto>, + Arg5: CodecInto>, + Arg6: CodecInto>, + Arg7: CodecInto>, + >( + self, + energy_factory_address: Arg0, + lp_farm_address: Arg1, + staking_farm_address: Arg2, + pair_address: Arg3, + staking_token_id: Arg4, + lp_farm_token_id: Arg5, + staking_farm_token_id: Arg6, + lp_token_id: Arg7, + ) -> TxProxyDeploy { + self.wrapped_tx + .raw_deploy() + .argument(&energy_factory_address) + .argument(&lp_farm_address) + .argument(&staking_farm_address) + .argument(&pair_address) + .argument(&staking_token_id) + .argument(&lp_farm_token_id) + .argument(&staking_farm_token_id) + .argument(&lp_token_id) + .original_result() + } +} + +#[rustfmt::skip] +impl FarmStakingProxyProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + pub fn upgrade( + self, + ) -> TxProxyUpgrade { + self.wrapped_tx + .raw_upgrade() + .original_result() + } +} + +#[rustfmt::skip] +impl FarmStakingProxyProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + pub fn register_dual_yield_token< + Arg0: CodecInto>, + Arg1: CodecInto>, + Arg2: CodecInto, + >( + self, + token_display_name: Arg0, + token_ticker: Arg1, + num_decimals: Arg2, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("registerDualYieldToken") + .argument(&token_display_name) + .argument(&token_ticker) + .argument(&num_decimals) + .original_result() + } + + pub fn dual_yield_token( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getDualYieldTokenId") + .original_result() + } + + pub fn lp_farm_address( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getLpFarmAddress") + .original_result() + } + + pub fn staking_farm_address( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getStakingFarmAddress") + .original_result() + } + + pub fn pair_address( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getPairAddress") + .original_result() + } + + pub fn staking_token_id( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getStakingTokenId") + .original_result() + } + + pub fn staking_farm_token_id( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getFarmTokenId") + .original_result() + } + + pub fn lp_token_id( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getLpTokenId") + .original_result() + } + + pub fn lp_farm_token_id( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getLpFarmTokenId") + .original_result() + } + + pub fn set_energy_factory_address< + Arg0: CodecInto>, + >( + self, + sc_address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setEnergyFactoryAddress") + .argument(&sc_address) + .original_result() + } + + pub fn energy_factory_address( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getEnergyFactoryAddress") + .original_result() + } + + pub fn add_sc_address_to_whitelist< + Arg0: CodecInto>, + >( + self, + address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("addSCAddressToWhitelist") + .argument(&address) + .original_result() + } + + pub fn remove_sc_address_from_whitelist< + Arg0: CodecInto>, + >( + self, + address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("removeSCAddressFromWhitelist") + .argument(&address) + .original_result() + } + + pub fn is_sc_address_whitelisted< + Arg0: CodecInto>, + >( + self, + address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("isSCAddressWhitelisted") + .argument(&address) + .original_result() + } + + pub fn stake_farm_tokens< + Arg0: CodecInto>>, + >( + self, + opt_orig_caller: Arg0, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("stakeFarmTokens") + .argument(&opt_orig_caller) + .original_result() + } + + pub fn claim_dual_yield_endpoint< + Arg0: CodecInto>>, + >( + self, + opt_orig_caller: Arg0, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("claimDualYield") + .argument(&opt_orig_caller) + .original_result() + } + + pub fn unstake_farm_tokens< + Arg0: CodecInto>, + Arg1: CodecInto>, + Arg2: CodecInto>>, + >( + self, + pair_first_token_min_amount: Arg0, + pair_second_token_min_amount: Arg1, + opt_orig_caller: Arg2, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("unstakeFarmTokens") + .argument(&pair_first_token_min_amount) + .argument(&pair_second_token_min_amount) + .argument(&opt_orig_caller) + .original_result() + } +} + +#[derive(TopEncode, TopDecode)] +pub struct StakeProxyResult +where + Api: ManagedTypeApi, +{ + pub dual_yield_tokens: EsdtTokenPayment, + pub staking_boosted_rewards: EsdtTokenPayment, + pub lp_farm_boosted_rewards: EsdtTokenPayment, +} + +#[derive(TopEncode, TopDecode)] +pub struct ClaimDualYieldResult +where + Api: ManagedTypeApi, +{ + pub lp_farm_rewards: EsdtTokenPayment, + pub staking_farm_rewards: EsdtTokenPayment, + pub new_dual_yield_tokens: EsdtTokenPayment, +} + +#[derive(TopEncode, TopDecode)] +pub struct UnstakeResult +where + Api: ManagedTypeApi, +{ + pub other_token_payment: EsdtTokenPayment, + pub lp_farm_rewards: EsdtTokenPayment, + pub staking_rewards: EsdtTokenPayment, + pub unbond_staking_farm_token: EsdtTokenPayment, +} diff --git a/dex/interactor/proxies/src/farm_with_locked_rewards_proxy.rs b/dex/interactor/proxies/src/farm_with_locked_rewards_proxy.rs new file mode 100644 index 000000000..d70a8a6dc --- /dev/null +++ b/dex/interactor/proxies/src/farm_with_locked_rewards_proxy.rs @@ -0,0 +1,817 @@ +// Code generated by the multiversx-sc proxy generator. DO NOT EDIT. + +//////////////////////////////////////////////////// +////////////////// AUTO-GENERATED ////////////////// +//////////////////////////////////////////////////// + +#![allow(dead_code)] +#![allow(clippy::all)] + +use multiversx_sc::proxy_imports::*; +use multiversx_sc_scenario::multiversx_sc; + +pub struct FarmProxy; + +impl TxProxyTrait for FarmProxy +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + type TxProxyMethods = FarmProxyMethods; + + fn proxy_methods(self, tx: Tx) -> Self::TxProxyMethods { + FarmProxyMethods { wrapped_tx: tx } + } +} + +pub struct FarmProxyMethods +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + wrapped_tx: Tx, +} + +#[rustfmt::skip] +impl FarmProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + Gas: TxGas, +{ + pub fn init< + Arg0: CodecInto>, + Arg1: CodecInto>, + Arg2: CodecInto>, + Arg3: CodecInto>, + Arg4: CodecInto>, + Arg5: CodecInto>>, + >( + self, + reward_token_id: Arg0, + farming_token_id: Arg1, + division_safety_constant: Arg2, + pair_contract_address: Arg3, + owner: Arg4, + admins: Arg5, + ) -> TxProxyDeploy { + self.wrapped_tx + .raw_deploy() + .argument(&reward_token_id) + .argument(&farming_token_id) + .argument(&division_safety_constant) + .argument(&pair_contract_address) + .argument(&owner) + .argument(&admins) + .original_result() + } +} + +#[rustfmt::skip] +impl FarmProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + pub fn upgrade( + self, + ) -> TxProxyUpgrade { + self.wrapped_tx + .raw_upgrade() + .original_result() + } +} + +#[rustfmt::skip] +impl FarmProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + pub fn enter_farm_endpoint< + Arg0: CodecInto>>, + >( + self, + opt_orig_caller: Arg0, + ) -> TxProxyCall, EsdtTokenPayment>> { + self.wrapped_tx + .raw_call("enterFarm") + .argument(&opt_orig_caller) + .original_result() + } + + pub fn claim_rewards_endpoint< + Arg0: CodecInto>>, + >( + self, + opt_orig_caller: Arg0, + ) -> TxProxyCall, EsdtTokenPayment>> { + self.wrapped_tx + .raw_call("claimRewards") + .argument(&opt_orig_caller) + .original_result() + } + + pub fn exit_farm_endpoint< + Arg0: CodecInto>>, + >( + self, + opt_orig_caller: Arg0, + ) -> TxProxyCall, EsdtTokenPayment>> { + self.wrapped_tx + .raw_call("exitFarm") + .argument(&opt_orig_caller) + .original_result() + } + + pub fn merge_farm_tokens_endpoint< + Arg0: CodecInto>>, + >( + self, + opt_orig_caller: Arg0, + ) -> TxProxyCall, EsdtTokenPayment>> { + self.wrapped_tx + .raw_call("mergeFarmTokens") + .argument(&opt_orig_caller) + .original_result() + } + + pub fn claim_boosted_rewards< + Arg0: CodecInto>>, + >( + self, + opt_user: Arg0, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("claimBoostedRewards") + .argument(&opt_user) + .original_result() + } + + pub fn start_produce_rewards_endpoint( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("startProduceRewards") + .original_result() + } + + pub fn end_produce_rewards_endpoint( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("endProduceRewards") + .original_result() + } + + pub fn set_per_block_rewards_endpoint< + Arg0: CodecInto>, + >( + self, + per_block_amount: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setPerBlockRewardAmount") + .argument(&per_block_amount) + .original_result() + } + + pub fn set_boosted_yields_rewards_percentage< + Arg0: CodecInto, + >( + self, + percentage: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setBoostedYieldsRewardsPercentage") + .argument(&percentage) + .original_result() + } + + pub fn calculate_rewards_for_given_position< + Arg0: CodecInto>, + Arg1: CodecInto>, + Arg2: CodecInto>, + >( + self, + user: Arg0, + farm_token_amount: Arg1, + attributes: Arg2, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("calculateRewardsForGivenPosition") + .argument(&user) + .argument(&farm_token_amount) + .argument(&attributes) + .original_result() + } + + pub fn reward_per_share( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getRewardPerShare") + .original_result() + } + + pub fn reward_reserve( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getRewardReserve") + .original_result() + } + + pub fn allow_external_claim_boosted_rewards< + Arg0: CodecInto, + >( + self, + allow_external_claim: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("allowExternalClaimBoostedRewards") + .argument(&allow_external_claim) + .original_result() + } + + pub fn get_allow_external_claim_rewards< + Arg0: CodecInto>, + >( + self, + user: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getAllowExternalClaimRewards") + .argument(&user) + .original_result() + } + + pub fn farming_token_id( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getFarmingTokenId") + .original_result() + } + + pub fn reward_token_id( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getRewardTokenId") + .original_result() + } + + pub fn per_block_reward_amount( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getPerBlockRewardAmount") + .original_result() + } + + pub fn last_reward_block_nonce( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getLastRewardBlockNonce") + .original_result() + } + + pub fn division_safety_constant( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getDivisionSafetyConstant") + .original_result() + } + + pub fn user_total_farm_position< + Arg0: CodecInto>, + >( + self, + user: Arg0, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getUserTotalFarmPosition") + .argument(&user) + .original_result() + } + + pub fn farm_position_migration_nonce( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getFarmPositionMigrationNonce") + .original_result() + } + + pub fn set_locking_sc_address< + Arg0: CodecInto>, + >( + self, + new_address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setLockingScAddress") + .argument(&new_address) + .original_result() + } + + pub fn set_lock_epochs< + Arg0: CodecInto, + >( + self, + lock_epochs: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setLockEpochs") + .argument(&lock_epochs) + .original_result() + } + + pub fn locking_sc_address( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getLockingScAddress") + .original_result() + } + + pub fn lock_epochs( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getLockEpochs") + .original_result() + } + + pub fn register_farm_token< + Arg0: CodecInto>, + Arg1: CodecInto>, + Arg2: CodecInto, + >( + self, + token_display_name: Arg0, + token_ticker: Arg1, + num_decimals: Arg2, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("registerFarmToken") + .argument(&token_display_name) + .argument(&token_ticker) + .argument(&num_decimals) + .original_result() + } + + pub fn farm_token( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getFarmTokenId") + .original_result() + } + + pub fn farm_token_supply( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getFarmTokenSupply") + .original_result() + } + + pub fn add_to_pause_whitelist< + Arg0: CodecInto>>, + >( + self, + address_list: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("addToPauseWhitelist") + .argument(&address_list) + .original_result() + } + + pub fn remove_from_pause_whitelist< + Arg0: CodecInto>>, + >( + self, + address_list: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("removeFromPauseWhitelist") + .argument(&address_list) + .original_result() + } + + pub fn pause( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("pause") + .original_result() + } + + pub fn resume( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("resume") + .original_result() + } + + pub fn state( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getState") + .original_result() + } + + pub fn add_admin_endpoint< + Arg0: CodecInto>, + >( + self, + address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("addAdmin") + .argument(&address) + .original_result() + } + + pub fn remove_admin_endpoint< + Arg0: CodecInto>, + >( + self, + address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("removeAdmin") + .argument(&address) + .original_result() + } + + pub fn update_owner_or_admin_endpoint< + Arg0: CodecInto>, + >( + self, + previous_owner: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("updateOwnerOrAdmin") + .argument(&previous_owner) + .original_result() + } + + pub fn permissions< + Arg0: CodecInto>, + >( + self, + address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getPermissions") + .argument(&address) + .original_result() + } + + pub fn add_sc_address_to_whitelist< + Arg0: CodecInto>, + >( + self, + address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("addSCAddressToWhitelist") + .argument(&address) + .original_result() + } + + pub fn remove_sc_address_from_whitelist< + Arg0: CodecInto>, + >( + self, + address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("removeSCAddressFromWhitelist") + .argument(&address) + .original_result() + } + + pub fn is_sc_address_whitelisted< + Arg0: CodecInto>, + >( + self, + address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("isSCAddressWhitelisted") + .argument(&address) + .original_result() + } + + pub fn set_penalty_percent< + Arg0: CodecInto, + >( + self, + percent: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("set_penalty_percent") + .argument(&percent) + .original_result() + } + + pub fn set_minimum_farming_epochs< + Arg0: CodecInto, + >( + self, + epochs: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("set_minimum_farming_epochs") + .argument(&epochs) + .original_result() + } + + pub fn set_burn_gas_limit< + Arg0: CodecInto, + >( + self, + gas_limit: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("set_burn_gas_limit") + .argument(&gas_limit) + .original_result() + } + + pub fn penalty_percent( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getPenaltyPercent") + .original_result() + } + + pub fn minimum_farming_epochs( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getMinimumFarmingEpoch") + .original_result() + } + + pub fn burn_gas_limit( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getBurnGasLimit") + .original_result() + } + + pub fn pair_contract_address( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getPairContractManagedAddress") + .original_result() + } + + pub fn collect_undistributed_boosted_rewards( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("collectUndistributedBoostedRewards") + .original_result() + } + + pub fn boosted_yields_rewards_percentage( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getBoostedYieldsRewardsPercentage") + .original_result() + } + + pub fn accumulated_rewards_for_week< + Arg0: CodecInto, + >( + self, + week: Arg0, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getAccumulatedRewardsForWeek") + .argument(&week) + .original_result() + } + + pub fn farm_supply_for_week< + Arg0: CodecInto, + >( + self, + week: Arg0, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getFarmSupplyForWeek") + .argument(&week) + .original_result() + } + + pub fn remaining_boosted_rewards_to_distribute< + Arg0: CodecInto, + >( + self, + week: Arg0, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getRemainingBoostedRewardsToDistribute") + .argument(&week) + .original_result() + } + + pub fn undistributed_boosted_rewards( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getUndistributedBoostedRewards") + .original_result() + } + + pub fn set_boosted_yields_factors< + Arg0: CodecInto>, + Arg1: CodecInto>, + Arg2: CodecInto>, + Arg3: CodecInto>, + Arg4: CodecInto>, + >( + self, + max_rewards_factor: Arg0, + user_rewards_energy_const: Arg1, + user_rewards_farm_const: Arg2, + min_energy_amount: Arg3, + min_farm_amount: Arg4, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setBoostedYieldsFactors") + .argument(&max_rewards_factor) + .argument(&user_rewards_energy_const) + .argument(&user_rewards_farm_const) + .argument(&min_energy_amount) + .argument(&min_farm_amount) + .original_result() + } + + pub fn get_boosted_yields_factors( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getBoostedYieldsFactors") + .original_result() + } + + /// Week starts from 1 + pub fn get_current_week( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getCurrentWeek") + .original_result() + } + + pub fn first_week_start_epoch( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getFirstWeekStartEpoch") + .original_result() + } + + pub fn get_last_active_week_for_user_view< + Arg0: CodecInto>, + >( + self, + user: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getLastActiveWeekForUser") + .argument(&user) + .original_result() + } + + pub fn get_user_energy_for_week_view< + Arg0: CodecInto>, + Arg1: CodecInto, + >( + self, + user: Arg0, + week: Arg1, + ) -> TxProxyCall>> { + self.wrapped_tx + .raw_call("getUserEnergyForWeek") + .argument(&user) + .argument(&week) + .original_result() + } + + pub fn last_global_update_week( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getLastGlobalUpdateWeek") + .original_result() + } + + pub fn total_rewards_for_week< + Arg0: CodecInto, + >( + self, + week: Arg0, + ) -> TxProxyCall>> { + self.wrapped_tx + .raw_call("getTotalRewardsForWeek") + .argument(&week) + .original_result() + } + + pub fn total_energy_for_week< + Arg0: CodecInto, + >( + self, + week: Arg0, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getTotalEnergyForWeek") + .argument(&week) + .original_result() + } + + pub fn total_locked_tokens_for_week< + Arg0: CodecInto, + >( + self, + week: Arg0, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getTotalLockedTokensForWeek") + .argument(&week) + .original_result() + } + + pub fn update_energy_for_user< + Arg0: CodecInto>, + >( + self, + user: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("updateEnergyForUser") + .argument(&user) + .original_result() + } + + pub fn current_claim_progress< + Arg0: CodecInto>, + >( + self, + user: Arg0, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getCurrentClaimProgress") + .argument(&user) + .original_result() + } + + pub fn set_energy_factory_address< + Arg0: CodecInto>, + >( + self, + sc_address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setEnergyFactoryAddress") + .argument(&sc_address) + .original_result() + } + + pub fn energy_factory_address( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getEnergyFactoryAddress") + .original_result() + } +} diff --git a/dex/interactor/proxies/src/lib.rs b/dex/interactor/proxies/src/lib.rs new file mode 100644 index 000000000..a532c5878 --- /dev/null +++ b/dex/interactor/proxies/src/lib.rs @@ -0,0 +1,13 @@ +pub mod energy_factory_proxy; +pub mod farm_staking_proxy; +pub mod farm_staking_proxy_sc_proxy; +pub mod farm_with_locked_rewards_proxy; +pub mod pair_proxy; +pub mod router_proxy; + +pub use energy_factory_proxy::*; +pub use farm_staking_proxy::*; +pub use farm_staking_proxy_sc_proxy::*; +pub use farm_with_locked_rewards_proxy::*; +pub use pair_proxy::*; +pub use router_proxy::*; diff --git a/dex/interactor/src/pair_proxy.rs b/dex/interactor/proxies/src/pair_proxy.rs similarity index 100% rename from dex/interactor/src/pair_proxy.rs rename to dex/interactor/proxies/src/pair_proxy.rs index 77f743b52..3744445e9 100644 --- a/dex/interactor/src/pair_proxy.rs +++ b/dex/interactor/proxies/src/pair_proxy.rs @@ -7,8 +7,8 @@ #![allow(dead_code)] #![allow(clippy::all)] -use multiversx_sc_scenario::multiversx_sc; use multiversx_sc::proxy_imports::*; +use multiversx_sc_scenario::multiversx_sc; pub struct PairProxy; diff --git a/dex/interactor/proxies/src/router_proxy.rs b/dex/interactor/proxies/src/router_proxy.rs new file mode 100644 index 000000000..acbc39930 --- /dev/null +++ b/dex/interactor/proxies/src/router_proxy.rs @@ -0,0 +1,517 @@ +// Code generated by the multiversx-sc proxy generator. DO NOT EDIT. + +//////////////////////////////////////////////////// +////////////////// AUTO-GENERATED ////////////////// +//////////////////////////////////////////////////// + +#![allow(dead_code)] +#![allow(clippy::all)] + +use multiversx_sc::proxy_imports::*; + +pub struct RouterProxy; + +impl TxProxyTrait for RouterProxy +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + type TxProxyMethods = RouterProxyMethods; + + fn proxy_methods(self, tx: Tx) -> Self::TxProxyMethods { + RouterProxyMethods { wrapped_tx: tx } + } +} + +pub struct RouterProxyMethods +where + Env: TxEnv, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + wrapped_tx: Tx, +} + +#[rustfmt::skip] +impl RouterProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + Gas: TxGas, +{ + pub fn init< + Arg0: CodecInto>>, + >( + self, + pair_template_address_opt: Arg0, + ) -> TxProxyDeploy { + self.wrapped_tx + .raw_deploy() + .argument(&pair_template_address_opt) + .original_result() + } +} + +#[rustfmt::skip] +impl RouterProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + pub fn upgrade( + self, + ) -> TxProxyUpgrade { + self.wrapped_tx + .raw_upgrade() + .original_result() + } +} + +#[rustfmt::skip] +impl RouterProxyMethods +where + Env: TxEnv, + Env::Api: VMApi, + From: TxFrom, + To: TxTo, + Gas: TxGas, +{ + pub fn pause< + Arg0: CodecInto>, + >( + self, + address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("pause") + .argument(&address) + .original_result() + } + + pub fn resume< + Arg0: CodecInto>, + >( + self, + address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("resume") + .argument(&address) + .original_result() + } + + pub fn create_pair_endpoint< + Arg0: CodecInto>, + Arg1: CodecInto>, + Arg2: CodecInto>, + Arg3: CodecInto>>, + Arg4: CodecInto>>, + >( + self, + first_token_id: Arg0, + second_token_id: Arg1, + initial_liquidity_adder: Arg2, + opt_fee_percents: Arg3, + admins: Arg4, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("createPair") + .argument(&first_token_id) + .argument(&second_token_id) + .argument(&initial_liquidity_adder) + .argument(&opt_fee_percents) + .argument(&admins) + .original_result() + } + + pub fn upgrade_pair_endpoint< + Arg0: CodecInto>, + Arg1: CodecInto>, + >( + self, + first_token_id: Arg0, + second_token_id: Arg1, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("upgradePair") + .argument(&first_token_id) + .argument(&second_token_id) + .original_result() + } + + pub fn issue_lp_token< + Arg0: CodecInto>, + Arg1: CodecInto>, + Arg2: CodecInto>, + >( + self, + pair_address: Arg0, + lp_token_display_name: Arg1, + lp_token_ticker: Arg2, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("issueLpToken") + .argument(&pair_address) + .argument(&lp_token_display_name) + .argument(&lp_token_ticker) + .original_result() + } + + pub fn set_local_roles< + Arg0: CodecInto>, + >( + self, + pair_address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setLocalRoles") + .argument(&pair_address) + .original_result() + } + + pub fn remove_pair< + Arg0: CodecInto>, + Arg1: CodecInto>, + >( + self, + first_token_id: Arg0, + second_token_id: Arg1, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("removePair") + .argument(&first_token_id) + .argument(&second_token_id) + .original_result() + } + + pub fn set_fee_on< + Arg0: CodecInto>, + Arg1: CodecInto>, + Arg2: CodecInto>, + >( + self, + pair_address: Arg0, + fee_to_address: Arg1, + fee_token: Arg2, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setFeeOn") + .argument(&pair_address) + .argument(&fee_to_address) + .argument(&fee_token) + .original_result() + } + + pub fn set_fee_off< + Arg0: CodecInto>, + Arg1: CodecInto>, + Arg2: CodecInto>, + >( + self, + pair_address: Arg0, + fee_to_address: Arg1, + fee_token: Arg2, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setFeeOff") + .argument(&pair_address) + .argument(&fee_to_address) + .argument(&fee_token) + .original_result() + } + + pub fn set_pair_creation_enabled< + Arg0: CodecInto, + >( + self, + enabled: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setPairCreationEnabled") + .argument(&enabled) + .original_result() + } + + pub fn migrate_pair_map( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("migratePairMap") + .original_result() + } + + pub fn pair_creation_enabled( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getPairCreationEnabled") + .original_result() + } + + pub fn state( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getState") + .original_result() + } + + pub fn owner( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getOwner") + .original_result() + } + + pub fn set_temporary_owner_period< + Arg0: CodecInto, + >( + self, + period_blocks: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setTemporaryOwnerPeriod") + .argument(&period_blocks) + .original_result() + } + + pub fn set_pair_template_address< + Arg0: CodecInto>, + >( + self, + address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setPairTemplateAddress") + .argument(&address) + .original_result() + } + + pub fn pair_template_address( + self, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getPairTemplateAddress") + .original_result() + } + + pub fn temporary_owner_period( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("getTemporaryOwnerPeriod") + .original_result() + } + + pub fn common_tokens_for_user_pairs( + self, + ) -> TxProxyCall>> { + self.wrapped_tx + .raw_call("getCommonTokensForUserPairs") + .original_result() + } + + pub fn get_all_pairs_addresses( + self, + ) -> TxProxyCall>> { + self.wrapped_tx + .raw_call("getAllPairsManagedAddresses") + .original_result() + } + + pub fn get_all_token_pairs( + self, + ) -> TxProxyCall>> { + self.wrapped_tx + .raw_call("getAllPairTokens") + .original_result() + } + + pub fn get_all_pair_contract_metadata( + self, + ) -> TxProxyCall>> { + self.wrapped_tx + .raw_call("getAllPairContractMetadata") + .original_result() + } + + pub fn get_pair< + Arg0: CodecInto>, + Arg1: CodecInto>, + >( + self, + first_token_id: Arg0, + second_token_id: Arg1, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getPair") + .argument(&first_token_id) + .argument(&second_token_id) + .original_result() + } + + pub fn get_pair_tokens< + Arg0: CodecInto>, + >( + self, + pair_address: Arg0, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getPairTokens") + .argument(&pair_address) + .original_result() + } + + pub fn clear_pair_temporary_owner_storage( + self, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("clearPairTemporaryOwnerStorage") + .original_result() + } + + pub fn multi_pair_swap< + Arg0: CodecInto, ManagedBuffer, TokenIdentifier, BigUint>>>, + >( + self, + swap_operations: Arg0, + ) -> TxProxyCall>> { + self.wrapped_tx + .raw_call("multiPairSwap") + .argument(&swap_operations) + .original_result() + } + + pub fn config_enable_by_user_parameters< + Arg0: CodecInto>, + Arg1: CodecInto>, + Arg2: CodecInto>, + Arg3: CodecInto, + >( + self, + common_token_id: Arg0, + locked_token_id: Arg1, + min_locked_token_value: Arg2, + min_lock_period_epochs: Arg3, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("configEnableByUserParameters") + .argument(&common_token_id) + .argument(&locked_token_id) + .argument(&min_locked_token_value) + .argument(&min_lock_period_epochs) + .original_result() + } + + pub fn add_common_tokens_for_user_pairs< + Arg0: CodecInto>>, + >( + self, + tokens: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("addCommonTokensForUserPairs") + .argument(&tokens) + .original_result() + } + + pub fn remove_common_tokens_for_user_pairs< + Arg0: CodecInto>>, + >( + self, + tokens: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("removeCommonTokensForUserPairs") + .argument(&tokens) + .original_result() + } + + pub fn set_swap_enabled_by_user< + Arg0: CodecInto>, + >( + self, + pair_address: Arg0, + ) -> TxProxyCall { + self.wrapped_tx + .raw_call("setSwapEnabledByUser") + .argument(&pair_address) + .original_result() + } + + pub fn try_get_config< + Arg0: CodecInto>, + >( + self, + token_id: Arg0, + ) -> TxProxyCall> { + self.wrapped_tx + .raw_call("getEnableSwapByUserConfig") + .argument(&token_id) + .original_result() + } +} + +#[derive(TopEncode, TopDecode)] +pub struct PairTokens +where + Api: ManagedTypeApi, +{ + pub first_token_id: TokenIdentifier, + pub second_token_id: TokenIdentifier, +} + +#[derive(TopEncode, TopDecode)] +pub struct PairContractMetadata +where + Api: ManagedTypeApi, +{ + pub first_token_id: TokenIdentifier, + pub second_token_id: TokenIdentifier, + pub address: ManagedAddress, +} + +#[derive(TopEncode, TopDecode)] +pub struct CreatePairEvent +where + Api: ManagedTypeApi, +{ + pub caller: ManagedAddress, + pub first_token_id: TokenIdentifier, + pub second_token_id: TokenIdentifier, + pub total_fee_percent: u64, + pub special_fee_percent: u64, + pub pair_address: ManagedAddress, + pub block: u64, + pub epoch: u64, + pub timestamp: u64, +} + +#[derive(TopEncode, TopDecode)] +pub struct UserPairSwapEnabledEvent +where + Api: ManagedTypeApi, +{ + pub caller: ManagedAddress, + pub first_token_id: TokenIdentifier, + pub second_token_id: TokenIdentifier, + pub pair_address: ManagedAddress, +} + +#[derive(TopEncode, TopDecode)] +pub struct EnableSwapByUserConfig +where + Api: ManagedTypeApi, +{ + pub locked_token_id: TokenIdentifier, + pub min_locked_token_value: BigUint, + pub min_lock_period_epochs: u64, +} diff --git a/dex/interactor/src/dex_interact.rs b/dex/interactor/src/dex_interact.rs index 01878f7da..18c067cbc 100644 --- a/dex/interactor/src/dex_interact.rs +++ b/dex/interactor/src/dex_interact.rs @@ -1,16 +1,16 @@ mod dex_interact_cli; mod dex_interact_config; +mod dex_interact_farm_locked; mod dex_interact_pair; mod dex_interact_state; -mod pair_proxy; +use proxies::*; use clap::Parser; +use dex_interact_cli::AddArgs; use dex_interact_config::Config; use dex_interact_state::State; use multiversx_sc_snippets::imports::*; -const INTERACTOR_SCENARIO_TRACE_PATH: &str = "interactor_trace.scen.json"; - #[tokio::main] async fn main() { env_logger::init(); @@ -25,9 +25,22 @@ async fn main() { } Some(dex_interact_cli::InteractCliCommand::Swap(args)) => { dex_interact - .swap_tokens_fixed_input(args.amount, &args.token_identifier, args.min_amount) + .swap_tokens_fixed_input(args.amount, args.min_amount) .await; } + Some(dex_interact_cli::InteractCliCommand::Add(args)) => { + dex_interact + .add_liquidity( + args.first_payment_amount, + args.second_payment_amount, + args.first_token_amount_min, + args.second_token_amount_min, + ) + .await; + } + Some(dex_interact_cli::InteractCliCommand::FullFarm(args)) => { + dex_interact.full_farm_scenario(args).await; + } None => {} } } @@ -41,10 +54,8 @@ struct DexInteract { impl DexInteract { async fn init() -> Self { let config = Config::load_config(); - let mut interactor = Interactor::new(config.gateway()) - .await - .with_tracer(INTERACTOR_SCENARIO_TRACE_PATH) - .await; + let mut interactor = Interactor::new(config.gateway()).await; + let test_address = test_wallets::mike(); let wallet_address = interactor.register_wallet(test_address); println!("wallet address: {:#?}", test_address.address()); @@ -66,6 +77,19 @@ impl DexInteract { } } + async fn full_farm_scenario(&mut self, args: &AddArgs) { + let (_, _, lp_token) = self + .add_liquidity( + args.first_payment_amount, + args.second_payment_amount, + args.first_token_amount_min, + args.second_token_amount_min, + ) + .await; + let _result = self.enter_farm(lp_token).await; + //TODO + } + async fn pause(&mut self) { println!("Attempting to pause pair contract..."); diff --git a/dex/interactor/src/dex_interact_cli.rs b/dex/interactor/src/dex_interact_cli.rs index 2fd828d4b..1aa4eff25 100644 --- a/dex/interactor/src/dex_interact_cli.rs +++ b/dex/interactor/src/dex_interact_cli.rs @@ -16,17 +16,35 @@ pub enum InteractCliCommand { Pause, #[command(name = "swap", about = "Swaps token with a minimum return amount")] Swap(SwapArgs), + #[command(name = "add_liquidity", about = "Adds liquidity to a pair")] + Add(AddArgs), + #[command(name = "full_farm", about = "Creates a full farm scenario")] + FullFarm(AddArgs) } +// Second token id is taken from the state #[derive(Default, Clone, PartialEq, Eq, Debug, Args)] pub struct SwapArgs { /// Amount to swap #[arg(short = 'a', long = "amount", verbatim_doc_comment)] pub amount: u128, - /// The token id for the swap - #[arg(short = 't', long = "token_identifier", verbatim_doc_comment)] - pub token_identifier: String, /// Minimum return amount #[arg(short = 'm', long = "min_amount", verbatim_doc_comment)] pub min_amount: u128, } + +#[derive(Default, Clone, PartialEq, Eq, Debug, Args)] +pub struct AddArgs { + /// Amount to send from first token + #[arg(long = "fist_amount", verbatim_doc_comment)] + pub first_payment_amount: u128, + /// Amount to send from second token + #[arg(long = "second_amount", verbatim_doc_comment)] + pub second_payment_amount: u128, + /// Min amount accepted for first token (slippage) + #[arg(long = "first_amount_min", verbatim_doc_comment)] + pub first_token_amount_min: u128, + /// Min amount accepted for second token (slippage) + #[arg(long = "second_amount_min", verbatim_doc_comment)] + pub second_token_amount_min: u128, +} diff --git a/dex/interactor/src/dex_interact_config.rs b/dex/interactor/src/dex_interact_config.rs index 2eddd1bf9..8330f0e51 100644 --- a/dex/interactor/src/dex_interact_config.rs +++ b/dex/interactor/src/dex_interact_config.rs @@ -4,7 +4,7 @@ use std::io::Read; /// Config file const CONFIG_FILE: &str = "config.toml"; -/// Multisig Interact configuration +/// Dex Interact configuration #[derive(Debug, Deserialize)] pub struct Config { gateway: String, diff --git a/dex/interactor/src/dex_interact_farm_locked.rs b/dex/interactor/src/dex_interact_farm_locked.rs new file mode 100644 index 000000000..66cf97a30 --- /dev/null +++ b/dex/interactor/src/dex_interact_farm_locked.rs @@ -0,0 +1,35 @@ +use multiversx_sc_scenario::imports::{BigUint, ManagedAddress, ReturnsResult, TokenIdentifier}; +use multiversx_sc_snippets::InteractorPrepareAsync; + +use crate::{dex_interact_pair::InteractorToken, farm_with_locked_rewards_proxy, DexInteract}; + +impl DexInteract { + pub async fn enter_farm( + &mut self, + lp_token: InteractorToken, + ) -> (InteractorToken, InteractorToken) { + println!("Attempting to enter farm with locked rewards..."); + + let result_token = self + .interactor + .tx() + .from(&self.wallet_address) + .to(self.state.current_farm_with_locked_rewards_address()) + .gas(100_000_000u64) + .typed(farm_with_locked_rewards_proxy::FarmProxy) + .enter_farm_endpoint(ManagedAddress::from(self.wallet_address.as_address())) + .payment(( + TokenIdentifier::from(lp_token.token_id.as_bytes()), + lp_token.nonce, + BigUint::from(lp_token.amount), + )) + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + ( + InteractorToken::from(result_token.0 .0), + InteractorToken::from(result_token.0 .1), + ) + } +} diff --git a/dex/interactor/src/dex_interact_pair.rs b/dex/interactor/src/dex_interact_pair.rs index 2acc019a7..0948afa94 100644 --- a/dex/interactor/src/dex_interact_pair.rs +++ b/dex/interactor/src/dex_interact_pair.rs @@ -1,13 +1,9 @@ -use multiversx_sc_scenario::imports::{BigUint, RustBigUint, TokenIdentifier}; +use multiversx_sc_scenario::imports::{BigUint, ManagedVec, RustBigUint, TokenIdentifier}; use multiversx_sc_scenario::imports::{EsdtTokenPayment, ManagedTypeApi, ReturnsResult}; use multiversx_sc_snippets::InteractorPrepareAsync; -use crate::pair_proxy; use crate::DexInteract; - -pub const UTK: &str = "UTK-14d57d"; -pub const _WEGLD: &str = "WEGLD-a28c59"; -pub const GAS: u64 = 100_000_000u64; +use proxies::pair_proxy; pub struct InteractorToken { pub token_id: String, @@ -29,11 +25,13 @@ impl DexInteract { pub async fn swap_tokens_fixed_input( &mut self, amount_to_swap: u128, - token_id: &str, min_amount_to_receive: u128, ) -> InteractorToken { + let first_token_id = self.state.first_token_id(); + let second_token_id = self.state.second_token_id(); + println!( - "Attempting to swap {amount_to_swap} {UTK} for a min amount {min_amount_to_receive} of {token_id}..." + "Attempting to swap {amount_to_swap} {first_token_id} for a min amount {min_amount_to_receive} of {second_token_id}..." ); let result_token = self @@ -41,13 +39,17 @@ impl DexInteract { .tx() .from(&self.wallet_address) .to(self.state.current_pair_address()) - .gas(GAS) + .gas(100_000_000u64) .typed(pair_proxy::PairProxy) .swap_tokens_fixed_input( - TokenIdentifier::from(token_id), + TokenIdentifier::from(second_token_id.as_bytes()), BigUint::from(min_amount_to_receive), ) - .payment((TokenIdentifier::from(UTK), 0, BigUint::from(amount_to_swap))) + .payment(( + TokenIdentifier::from(first_token_id.as_bytes()), + 0, + BigUint::from(amount_to_swap), + )) .returns(ReturnsResult) .prepare_async() .run() @@ -57,8 +59,53 @@ impl DexInteract { InteractorToken::from(result_token) } + + pub async fn add_liquidity( + &mut self, + first_payment_amount: u128, + second_payment_amount: u128, + first_token_amount_min: u128, + second_token_amount_min: u128, + ) -> (InteractorToken, InteractorToken, InteractorToken) { + println!("Attempting to add liquidity to pair..."); + let first_token_id = self.state.first_token_id().as_bytes(); + let second_token_id = self.state.second_token_id().as_bytes(); + + let mut payments = ManagedVec::from_single_item(EsdtTokenPayment::new( + TokenIdentifier::from(first_token_id), + 0, + BigUint::from(first_payment_amount), + )); + payments.push(EsdtTokenPayment::new( + TokenIdentifier::from(second_token_id), + 0, + BigUint::from(second_payment_amount), + )); + + let result_token = self + .interactor + .tx() + .from(&self.wallet_address) + .to(self.state.current_pair_address()) + .gas(100_000_000u64) + .typed(pair_proxy::PairProxy) + .add_liquidity( + BigUint::from(first_token_amount_min), + BigUint::from(second_token_amount_min), + ) + .payment(payments) + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + ( + InteractorToken::from(result_token.0 .0), + InteractorToken::from(result_token.0 .1), + InteractorToken::from(result_token.0 .2), + ) + } } // 10000000000000000000 ; 10 UTK // 1000000000000; 0,000001 WEGLD -// cargo run swap -a 10000000000000000000 -t WEGLD-a28c59 -m 1000000000000 +// cargo run swap -a 10000000000000000000 -m 1000000000000 diff --git a/dex/interactor/src/dex_interact_state.rs b/dex/interactor/src/dex_interact_state.rs index f763e58a3..07fa85d80 100644 --- a/dex/interactor/src/dex_interact_state.rs +++ b/dex/interactor/src/dex_interact_state.rs @@ -16,6 +16,9 @@ pub struct State { router: Option, farm_staking: Option, farm_staking_proxy: Option, + energy_factory: Option, + first_token_id: Option, + second_token_id: Option, } impl State { @@ -31,7 +34,7 @@ impl State { } } - pub fn _current_farm_with_locked_rewards_address(&self) -> &Bech32Address { + pub fn current_farm_with_locked_rewards_address(&self) -> &Bech32Address { self.farm_with_locked_rewards .as_ref() .expect("no known farm with locked rewards contract, set first") @@ -60,6 +63,24 @@ impl State { .as_ref() .expect("no known farm staking proxy contract, set first") } + + pub fn _current_energy_factory_address(&self) -> &Bech32Address { + self.energy_factory + .as_ref() + .expect("no known energy factory contract, set first") + } + + pub fn first_token_id(&self) -> &String { + self.first_token_id + .as_ref() + .expect("no knows first token id, set first") + } + + pub fn second_token_id(&self) -> &String { + self.second_token_id + .as_ref() + .expect("no knows second token id, set first") + } } impl Drop for State { diff --git a/dex/interactor/state.toml b/dex/interactor/state.toml index 4d5afee3e..b416a20d2 100644 --- a/dex/interactor/state.toml +++ b/dex/interactor/state.toml @@ -1,6 +1,8 @@ -# SC addresses on the devnet farm_with_locked_rewards = "erd1qqqqqqqqqqqqqpgql7rysqgxxzhykg3j6vccnx4003z2mcl80n4ste3jh8" pair = "erd1qqqqqqqqqqqqqpgq4zafu6rzdw7fj07hjh5tkm68jsaj7hl60n4s8py4ra" router = "erd1qqqqqqqqqqqqqpgqa7hv0nahgsl8tz0psat46x0tchm0wuyc0n4s6q28ad" farm_staking = "erd1qqqqqqqqqqqqqpgquvklwltnlgyn5w5cd65ey36nw8sc008d0n4s0xpr25" farm_staking_proxy = "erd1qqqqqqqqqqqqqpgqqwn0qa7ft4tew05r0zcd0c5hay5mp6np0n4ss8jm86" +energy_factory = "erd1qqqqqqqqqqqqqpgqs7qnuvj2t0m40xmgrrh88wc7qdx286c60n4spvrzzk" +first_token_id = "UTK-14d57d" +second_token_id = "WEGLD-a28c59" diff --git a/dex/pair-mock/Cargo.toml b/dex/pair-mock/Cargo.toml index f4bb8fb4c..fdd698828 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" diff --git a/dex/pair-mock/meta/Cargo.toml b/dex/pair-mock/meta/Cargo.toml index a357c0309..44c3237e1 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.49.0-alpha.3" +version = "0.49.0-alpha.4" default-features = false diff --git a/dex/pair-mock/wasm/Cargo.lock b/dex/pair-mock/wasm/Cargo.lock deleted file mode 100644 index b73e70b7b..000000000 --- a/dex/pair-mock/wasm/Cargo.lock +++ /dev/null @@ -1,204 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "multiversx-sc" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" -dependencies = [ - "bitflags", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "pair-mock" -version = "0.0.0" -dependencies = [ - "common_errors", - "itertools", - "multiversx-sc", -] - -[[package]] -name = "pair-mock-wasm" -version = "0.0.0" -dependencies = [ - "multiversx-sc-wasm-adapter", - "pair-mock", -] - -[[package]] -name = "proc-macro2" -version = "1.0.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "smallvec" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" - -[[package]] -name = "syn" -version = "2.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" diff --git a/dex/pair-mock/wasm/Cargo.toml b/dex/pair-mock/wasm/Cargo.toml index decca127e..934f1cad7 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" [workspace] members = ["."] diff --git a/dex/pair/Cargo.toml b/dex/pair/Cargo.toml index 1f632b8fc..09d153c90 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" diff --git a/dex/pair/meta/Cargo.toml b/dex/pair/meta/Cargo.toml index 1d30889b7..8ebb9495a 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.49.0-alpha.3" +version = "0.49.0-alpha.4" default-features = false diff --git a/dex/pair/wasm-pair-full/Cargo.lock b/dex/pair/wasm-pair-full/Cargo.lock deleted file mode 100644 index c47139c93..000000000 --- a/dex/pair/wasm-pair-full/Cargo.lock +++ /dev/null @@ -1,397 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" - -[[package]] -name = "common-types" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "energy-query" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", -] - -[[package]] -name = "fees-collector" -version = "0.0.0" -dependencies = [ - "common-types", - "common_errors", - "energy-factory", - "energy-query", - "locking_module", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "locking_module" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" -dependencies = [ - "bitflags", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "pair" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "fees-collector", - "itertools", - "multiversx-sc", - "pausable", - "permissions_module", - "simple-lock", - "token_send", - "utils", -] - -[[package]] -name = "pair-full-wasm" -version = "0.0.0" -dependencies = [ - "multiversx-sc-wasm-adapter", - "pair", -] - -[[package]] -name = "pausable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", - "permissions_module", -] - -[[package]] -name = "permissions_module" -version = "0.0.0" -dependencies = [ - "bitflags", - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "proc-macro2" -version = "1.0.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" - -[[package]] -name = "syn" -version = "2.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "token_send" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "week-timekeeping" -version = "0.0.0" -dependencies = [ - "common-types", - "multiversx-sc", -] - -[[package]] -name = "weekly-rewards-splitting" -version = "0.0.0" -dependencies = [ - "common-types", - "energy-query", - "math", - "multiversx-sc", - "unwrappable", - "week-timekeeping", -] diff --git a/dex/pair/wasm-pair-full/Cargo.toml b/dex/pair/wasm-pair-full/Cargo.toml index cf230b043..a31686952 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" [workspace] members = ["."] diff --git a/dex/pair/wasm-pair-full/src/lib.rs b/dex/pair/wasm-pair-full/src/lib.rs index 9b34ff9b2..500b879d9 100644 --- a/dex/pair/wasm-pair-full/src/lib.rs +++ b/dex/pair/wasm-pair-full/src/lib.rs @@ -8,7 +8,7 @@ // Upgrade: 1 // Endpoints: 63 // Async Callback (empty): 1 -// Total number of exported functions: 65 +// Total number of exported functions: 66 #![no_std] #![allow(internal_features)] diff --git a/dex/pair/wasm-safe-price-view/Cargo.lock b/dex/pair/wasm-safe-price-view/Cargo.lock deleted file mode 100644 index 1a65d0de5..000000000 --- a/dex/pair/wasm-safe-price-view/Cargo.lock +++ /dev/null @@ -1,397 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" - -[[package]] -name = "common-types" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "energy-query" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", -] - -[[package]] -name = "fees-collector" -version = "0.0.0" -dependencies = [ - "common-types", - "common_errors", - "energy-factory", - "energy-query", - "locking_module", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "locking_module" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" -dependencies = [ - "bitflags", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "pair" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "fees-collector", - "itertools", - "multiversx-sc", - "pausable", - "permissions_module", - "simple-lock", - "token_send", - "utils", -] - -[[package]] -name = "pausable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", - "permissions_module", -] - -[[package]] -name = "permissions_module" -version = "0.0.0" -dependencies = [ - "bitflags", - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "proc-macro2" -version = "1.0.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "safe-price-view-wasm" -version = "0.0.0" -dependencies = [ - "multiversx-sc-wasm-adapter", - "pair", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" - -[[package]] -name = "syn" -version = "2.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "token_send" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "week-timekeeping" -version = "0.0.0" -dependencies = [ - "common-types", - "multiversx-sc", -] - -[[package]] -name = "weekly-rewards-splitting" -version = "0.0.0" -dependencies = [ - "common-types", - "energy-query", - "math", - "multiversx-sc", - "unwrappable", - "week-timekeeping", -] diff --git a/dex/pair/wasm-safe-price-view/Cargo.toml b/dex/pair/wasm-safe-price-view/Cargo.toml index 11735ceba..e82d6e2a7 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" [workspace] members = ["."] diff --git a/dex/pair/wasm/Cargo.lock b/dex/pair/wasm/Cargo.lock deleted file mode 100644 index 24fb477df..000000000 --- a/dex/pair/wasm/Cargo.lock +++ /dev/null @@ -1,397 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" - -[[package]] -name = "common-types" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "energy-query" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", -] - -[[package]] -name = "fees-collector" -version = "0.0.0" -dependencies = [ - "common-types", - "common_errors", - "energy-factory", - "energy-query", - "locking_module", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "locking_module" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" -dependencies = [ - "bitflags", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "pair" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "fees-collector", - "itertools", - "multiversx-sc", - "pausable", - "permissions_module", - "simple-lock", - "token_send", - "utils", -] - -[[package]] -name = "pair-wasm" -version = "0.0.0" -dependencies = [ - "multiversx-sc-wasm-adapter", - "pair", -] - -[[package]] -name = "pausable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", - "permissions_module", -] - -[[package]] -name = "permissions_module" -version = "0.0.0" -dependencies = [ - "bitflags", - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "proc-macro2" -version = "1.0.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" - -[[package]] -name = "syn" -version = "2.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "token_send" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "week-timekeeping" -version = "0.0.0" -dependencies = [ - "common-types", - "multiversx-sc", -] - -[[package]] -name = "weekly-rewards-splitting" -version = "0.0.0" -dependencies = [ - "common-types", - "energy-query", - "math", - "multiversx-sc", - "unwrappable", - "week-timekeeping", -] diff --git a/dex/pair/wasm/Cargo.toml b/dex/pair/wasm/Cargo.toml index af98f0086..37a09e925 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" [workspace] members = ["."] diff --git a/dex/pair/wasm/src/lib.rs b/dex/pair/wasm/src/lib.rs index bceaa24db..374a01549 100644 --- a/dex/pair/wasm/src/lib.rs +++ b/dex/pair/wasm/src/lib.rs @@ -8,7 +8,7 @@ // Upgrade: 1 // Endpoints: 54 // Async Callback (empty): 1 -// Total number of exported functions: 56 +// Total number of exported functions: 57 #![no_std] #![allow(internal_features)] diff --git a/dex/price-discovery/Cargo.toml b/dex/price-discovery/Cargo.toml index e15039156..996a45104 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" [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.49.0-alpha.3" +version = "=0.49.0-alpha.4" diff --git a/dex/price-discovery/meta/Cargo.toml b/dex/price-discovery/meta/Cargo.toml index e65fef8ef..a236ae820 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.49.0-alpha.3" +version = "0.49.0-alpha.4" default-features = false diff --git a/dex/price-discovery/wasm/Cargo.lock b/dex/price-discovery/wasm/Cargo.lock deleted file mode 100644 index 3cabb7d63..000000000 --- a/dex/price-discovery/wasm/Cargo.lock +++ /dev/null @@ -1,205 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "locking_module" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" -dependencies = [ - "bitflags", - "hex-literal 0.4.1", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "price-discovery" -version = "0.0.0" -dependencies = [ - "hex-literal 0.3.4", - "locking_module", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "price-discovery-wasm" -version = "0.0.0" -dependencies = [ - "multiversx-sc-wasm-adapter", - "price-discovery", -] - -[[package]] -name = "proc-macro2" -version = "1.0.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "smallvec" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" - -[[package]] -name = "syn" -version = "2.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" diff --git a/dex/price-discovery/wasm/Cargo.toml b/dex/price-discovery/wasm/Cargo.toml index 8ab9cbbf8..5e4ec803b 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" [workspace] members = ["."] diff --git a/dex/proxy-deployer/Cargo.toml b/dex/proxy-deployer/Cargo.toml index 1930538c7..13bccae9b 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" diff --git a/dex/proxy-deployer/meta/Cargo.toml b/dex/proxy-deployer/meta/Cargo.toml index 5377ce6f5..b21f7b7a6 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.49.0-alpha.3" +version = "0.49.0-alpha.4" default-features = false diff --git a/dex/proxy-deployer/wasm/Cargo.lock b/dex/proxy-deployer/wasm/Cargo.lock deleted file mode 100644 index 7067da6a8..000000000 --- a/dex/proxy-deployer/wasm/Cargo.lock +++ /dev/null @@ -1,547 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" - -[[package]] -name = "common-types" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "config" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "contexts" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "farm_token", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "rewards", - "token_merge_helper", - "token_send", -] - -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "energy-query" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", -] - -[[package]] -name = "events" -version = "0.0.0" -dependencies = [ - "common_structs", - "contexts", - "multiversx-sc", -] - -[[package]] -name = "farm" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "contexts", - "energy-query", - "events", - "farm-boosted-yields", - "farm_base_impl", - "farm_token", - "fixed-supply-token", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pair", - "pausable", - "permissions_module", - "rewards", - "sc_whitelist_module", - "token_send", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "farm-boosted-yields" -version = "0.0.0" -dependencies = [ - "common-types", - "config", - "energy-query", - "multiversx-sc", - "pausable", - "permissions_module", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "farm_base_impl" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "contexts", - "events", - "farm_token", - "fixed-supply-token", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "rewards", - "token_merge_helper", - "token_send", - "utils", -] - -[[package]] -name = "farm_token" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "fees-collector" -version = "0.0.0" -dependencies = [ - "common-types", - "common_errors", - "energy-factory", - "energy-query", - "locking_module", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "locking_module" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" -dependencies = [ - "bitflags", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "pair" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "fees-collector", - "itertools", - "multiversx-sc", - "pausable", - "permissions_module", - "simple-lock", - "token_send", - "utils", -] - -[[package]] -name = "pausable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", - "permissions_module", -] - -[[package]] -name = "permissions_module" -version = "0.0.0" -dependencies = [ - "bitflags", - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "proc-macro2" -version = "1.0.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "proxy-deployer" -version = "0.0.0" -dependencies = [ - "config", - "farm", - "farm_token", - "multiversx-sc", - "pausable", -] - -[[package]] -name = "proxy-deployer-wasm" -version = "0.0.0" -dependencies = [ - "multiversx-sc-wasm-adapter", - "proxy-deployer", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "rewards" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "farm_token", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" - -[[package]] -name = "syn" -version = "2.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "token_merge_helper" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "token_send" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "week-timekeeping" -version = "0.0.0" -dependencies = [ - "common-types", - "multiversx-sc", -] - -[[package]] -name = "weekly-rewards-splitting" -version = "0.0.0" -dependencies = [ - "common-types", - "energy-query", - "math", - "multiversx-sc", - "unwrappable", - "week-timekeeping", -] diff --git a/dex/proxy-deployer/wasm/Cargo.toml b/dex/proxy-deployer/wasm/Cargo.toml index 0c94e69f5..418d02ac0 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" [workspace] members = ["."] diff --git a/dex/router/Cargo.toml b/dex/router/Cargo.toml index 850d408c1..bac02d2ed 100644 --- a/dex/router/Cargo.toml +++ b/dex/router/Cargo.toml @@ -21,7 +21,7 @@ path = "../../common/modules/token_send" path = "../../common/modules/pausable" [dependencies.multiversx-sc] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" features = ["esdt-token-payment-legacy-decode"] [dependencies.pair] @@ -34,4 +34,4 @@ path = "../../common/modules/locking_module" path = "../../locked-asset/simple-lock" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" diff --git a/dex/router/meta/Cargo.toml b/dex/router/meta/Cargo.toml index a450444f8..4e7a1bec5 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.49.0-alpha.3" +version = "0.49.0-alpha.4" default-features = false diff --git a/dex/router/sc-config.toml b/dex/router/sc-config.toml new file mode 100644 index 000000000..437fade89 --- /dev/null +++ b/dex/router/sc-config.toml @@ -0,0 +1,2 @@ +[[proxy]] +path = "../interactor/src/router_proxy.rs" diff --git a/dex/router/wasm/Cargo.lock b/dex/router/wasm/Cargo.lock deleted file mode 100644 index 0bac012f7..000000000 --- a/dex/router/wasm/Cargo.lock +++ /dev/null @@ -1,411 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" - -[[package]] -name = "common-types" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "energy-query" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", -] - -[[package]] -name = "fees-collector" -version = "0.0.0" -dependencies = [ - "common-types", - "common_errors", - "energy-factory", - "energy-query", - "locking_module", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "locking_module" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" -dependencies = [ - "bitflags", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "pair" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "fees-collector", - "itertools", - "multiversx-sc", - "pausable", - "permissions_module", - "simple-lock", - "token_send", - "utils", -] - -[[package]] -name = "pausable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", - "permissions_module", -] - -[[package]] -name = "permissions_module" -version = "0.0.0" -dependencies = [ - "bitflags", - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "proc-macro2" -version = "1.0.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "router" -version = "0.0.0" -dependencies = [ - "common_structs", - "locking_module", - "multiversx-sc", - "pair", - "pausable", - "permissions_module", - "simple-lock", - "token_send", -] - -[[package]] -name = "router-wasm" -version = "0.0.0" -dependencies = [ - "multiversx-sc-wasm-adapter", - "router", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" - -[[package]] -name = "syn" -version = "2.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "token_send" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "week-timekeeping" -version = "0.0.0" -dependencies = [ - "common-types", - "multiversx-sc", -] - -[[package]] -name = "weekly-rewards-splitting" -version = "0.0.0" -dependencies = [ - "common-types", - "energy-query", - "math", - "multiversx-sc", - "unwrappable", - "week-timekeeping", -] diff --git a/dex/router/wasm/Cargo.toml b/dex/router/wasm/Cargo.toml index a3c717206..1fd8d50d7 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" [workspace] members = ["."] diff --git a/energy-integration/common-modules/energy-query/Cargo.toml b/energy-integration/common-modules/energy-query/Cargo.toml index a9f714ee8..cce8e0979 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" 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 83d23466f..7c128231e 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" 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 aa811ed80..50dfb2880 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" 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 1a8eb6bb1..0ffdf8c44 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" 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 88e17fb3f..189d3d0b4 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" diff --git a/energy-integration/energy-factory-mock/meta/Cargo.toml b/energy-integration/energy-factory-mock/meta/Cargo.toml index 44fddf2fa..3d4597540 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.49.0-alpha.3" +version = "0.49.0-alpha.4" default-features = false diff --git a/energy-integration/energy-factory-mock/wasm/Cargo.lock b/energy-integration/energy-factory-mock/wasm/Cargo.lock deleted file mode 100644 index 5e02a9399..000000000 --- a/energy-integration/energy-factory-mock/wasm/Cargo.lock +++ /dev/null @@ -1,296 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "energy-factory-mock" -version = "0.0.0" -dependencies = [ - "energy-query", - "multiversx-sc", -] - -[[package]] -name = "energy-factory-mock-wasm" -version = "0.0.0" -dependencies = [ - "energy-factory-mock", - "multiversx-sc-wasm-adapter", -] - -[[package]] -name = "energy-query" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" -dependencies = [ - "bitflags", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "proc-macro2" -version = "1.0.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" - -[[package]] -name = "syn" -version = "2.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] diff --git a/energy-integration/energy-factory-mock/wasm/Cargo.toml b/energy-integration/energy-factory-mock/wasm/Cargo.toml index 5cf929c73..5369759c0 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" [workspace] members = ["."] diff --git a/energy-integration/energy-update/Cargo.toml b/energy-integration/energy-update/Cargo.toml index 01584d457..f4b1e3d0e 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" [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.49.0-alpha.3" +version = "=0.49.0-alpha.4" diff --git a/energy-integration/energy-update/meta/Cargo.toml b/energy-integration/energy-update/meta/Cargo.toml index f5658f13b..cdc416dca 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.49.0-alpha.3" +version = "0.49.0-alpha.4" default-features = false diff --git a/energy-integration/energy-update/wasm/Cargo.lock b/energy-integration/energy-update/wasm/Cargo.lock deleted file mode 100644 index f1d29961e..000000000 --- a/energy-integration/energy-update/wasm/Cargo.lock +++ /dev/null @@ -1,546 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" - -[[package]] -name = "common-types" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "config" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "contexts" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "farm_token", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "rewards", - "token_merge_helper", - "token_send", -] - -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "energy-query" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", -] - -[[package]] -name = "energy-update" -version = "0.0.0" -dependencies = [ - "farm", - "multiversx-sc", - "multiversx-sc-modules", - "weekly-rewards-splitting", -] - -[[package]] -name = "energy-update-wasm" -version = "0.0.0" -dependencies = [ - "energy-update", - "multiversx-sc-wasm-adapter", -] - -[[package]] -name = "events" -version = "0.0.0" -dependencies = [ - "common_structs", - "contexts", - "multiversx-sc", -] - -[[package]] -name = "farm" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "contexts", - "energy-query", - "events", - "farm-boosted-yields", - "farm_base_impl", - "farm_token", - "fixed-supply-token", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pair", - "pausable", - "permissions_module", - "rewards", - "sc_whitelist_module", - "token_send", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "farm-boosted-yields" -version = "0.0.0" -dependencies = [ - "common-types", - "config", - "energy-query", - "multiversx-sc", - "pausable", - "permissions_module", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "farm_base_impl" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "contexts", - "events", - "farm_token", - "fixed-supply-token", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "rewards", - "token_merge_helper", - "token_send", - "utils", -] - -[[package]] -name = "farm_token" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "fees-collector" -version = "0.0.0" -dependencies = [ - "common-types", - "common_errors", - "energy-factory", - "energy-query", - "locking_module", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "locking_module" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" -dependencies = [ - "bitflags", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "pair" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "fees-collector", - "itertools", - "multiversx-sc", - "pausable", - "permissions_module", - "simple-lock", - "token_send", - "utils", -] - -[[package]] -name = "pausable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", - "permissions_module", -] - -[[package]] -name = "permissions_module" -version = "0.0.0" -dependencies = [ - "bitflags", - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "proc-macro2" -version = "1.0.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "rewards" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "farm_token", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" - -[[package]] -name = "syn" -version = "2.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "token_merge_helper" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "token_send" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "week-timekeeping" -version = "0.0.0" -dependencies = [ - "common-types", - "multiversx-sc", -] - -[[package]] -name = "weekly-rewards-splitting" -version = "0.0.0" -dependencies = [ - "common-types", - "energy-query", - "math", - "multiversx-sc", - "unwrappable", - "week-timekeeping", -] diff --git a/energy-integration/energy-update/wasm/Cargo.toml b/energy-integration/energy-update/wasm/Cargo.toml index 0fde5bf04..19412d392 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" [workspace] members = ["."] diff --git a/energy-integration/farm-boosted-yields/Cargo.toml b/energy-integration/farm-boosted-yields/Cargo.toml index 7f03ad393..832bb0026 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" 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 95b9ed20c..6f2f27221 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" [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.49.0-alpha.3" +version = "=0.49.0-alpha.4" [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 ba69d61e6..3f528b833 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.49.0-alpha.3" +version = "0.49.0-alpha.4" default-features = false diff --git a/energy-integration/fees-collector/wasm/Cargo.lock b/energy-integration/fees-collector/wasm/Cargo.lock deleted file mode 100644 index d29a16c62..000000000 --- a/energy-integration/fees-collector/wasm/Cargo.lock +++ /dev/null @@ -1,340 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" - -[[package]] -name = "common-types" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "energy-query" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", -] - -[[package]] -name = "fees-collector" -version = "0.0.0" -dependencies = [ - "common-types", - "common_errors", - "energy-factory", - "energy-query", - "locking_module", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "fees-collector-wasm" -version = "0.0.0" -dependencies = [ - "fees-collector", - "multiversx-sc-wasm-adapter", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "locking_module" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" -dependencies = [ - "bitflags", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "proc-macro2" -version = "1.0.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" - -[[package]] -name = "syn" -version = "2.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "week-timekeeping" -version = "0.0.0" -dependencies = [ - "common-types", - "multiversx-sc", -] - -[[package]] -name = "weekly-rewards-splitting" -version = "0.0.0" -dependencies = [ - "common-types", - "energy-query", - "math", - "multiversx-sc", - "unwrappable", - "week-timekeeping", -] diff --git a/energy-integration/fees-collector/wasm/Cargo.toml b/energy-integration/fees-collector/wasm/Cargo.toml index f571a5791..3aef54830 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" [workspace] members = ["."] diff --git a/energy-integration/governance-v2/Cargo.toml b/energy-integration/governance-v2/Cargo.toml index 9faf3b323..549df0451 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" [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 9feb95e9f..0888e0275 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.49.0-alpha.3" +version = "0.49.0-alpha.4" default-features = false diff --git a/energy-integration/governance-v2/wasm/Cargo.lock b/energy-integration/governance-v2/wasm/Cargo.lock deleted file mode 100644 index a71a95db7..000000000 --- a/energy-integration/governance-v2/wasm/Cargo.lock +++ /dev/null @@ -1,360 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" - -[[package]] -name = "common-types" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "energy-query" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", -] - -[[package]] -name = "fees-collector" -version = "0.0.0" -dependencies = [ - "common-types", - "common_errors", - "energy-factory", - "energy-query", - "locking_module", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "governance-v2" -version = "0.0.0" -dependencies = [ - "energy-query", - "fees-collector", - "multiversx-sc", - "permissions_module", - "weekly-rewards-splitting", -] - -[[package]] -name = "governance-v2-wasm" -version = "0.0.0" -dependencies = [ - "governance-v2", - "multiversx-sc-wasm-adapter", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "locking_module" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" -dependencies = [ - "bitflags", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "permissions_module" -version = "0.0.0" -dependencies = [ - "bitflags", - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "proc-macro2" -version = "1.0.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" - -[[package]] -name = "syn" -version = "2.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "week-timekeeping" -version = "0.0.0" -dependencies = [ - "common-types", - "multiversx-sc", -] - -[[package]] -name = "weekly-rewards-splitting" -version = "0.0.0" -dependencies = [ - "common-types", - "energy-query", - "math", - "multiversx-sc", - "unwrappable", - "week-timekeeping", -] diff --git a/energy-integration/governance-v2/wasm/Cargo.toml b/energy-integration/governance-v2/wasm/Cargo.toml index f86a2b6fb..9718bcfcc 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" [workspace] members = ["."] diff --git a/farm-staking/farm-staking-proxy/Cargo.toml b/farm-staking/farm-staking-proxy/Cargo.toml index fd520d5fd..c123dcd99 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" [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.49.0-alpha.3" +version = "=0.49.0-alpha.4" [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 f9470aa81..2da972b9b 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.49.0-alpha.3" +version = "0.49.0-alpha.4" default-features = false diff --git a/farm-staking/farm-staking-proxy/sc-config.toml b/farm-staking/farm-staking-proxy/sc-config.toml new file mode 100644 index 000000000..2fea6bd24 --- /dev/null +++ b/farm-staking/farm-staking-proxy/sc-config.toml @@ -0,0 +1,2 @@ +[[proxy]] +path = "../../dex/interactor/src/farm_staking_proxy_sc_proxy.rs" diff --git a/farm-staking/farm-staking-proxy/wasm/Cargo.lock b/farm-staking/farm-staking-proxy/wasm/Cargo.lock deleted file mode 100644 index 4169daf52..000000000 --- a/farm-staking/farm-staking-proxy/wasm/Cargo.lock +++ /dev/null @@ -1,627 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" - -[[package]] -name = "common-types" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "config" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "contexts" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "farm_token", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "rewards", - "token_merge_helper", - "token_send", -] - -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "energy-query" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", -] - -[[package]] -name = "events" -version = "0.0.0" -dependencies = [ - "common_structs", - "contexts", - "multiversx-sc", -] - -[[package]] -name = "farm" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "contexts", - "energy-query", - "events", - "farm-boosted-yields", - "farm_base_impl", - "farm_token", - "fixed-supply-token", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pair", - "pausable", - "permissions_module", - "rewards", - "sc_whitelist_module", - "token_send", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "farm-boosted-yields" -version = "0.0.0" -dependencies = [ - "common-types", - "config", - "energy-query", - "multiversx-sc", - "pausable", - "permissions_module", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "farm-staking" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "contexts", - "energy-factory", - "energy-query", - "events", - "farm", - "farm-boosted-yields", - "farm_base_impl", - "farm_token", - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pair", - "pausable", - "permissions_module", - "rewards", - "sc_whitelist_module", - "token_send", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "farm-staking-proxy" -version = "0.0.0" -dependencies = [ - "common_structs", - "config", - "energy-query", - "farm", - "farm-staking", - "farm-with-locked-rewards", - "fixed-supply-token", - "hex-literal 0.3.4", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pair", - "pausable", - "rewards", - "sc_whitelist_module", - "token_send", - "unwrappable", - "utils", -] - -[[package]] -name = "farm-staking-proxy-wasm" -version = "0.0.0" -dependencies = [ - "farm-staking-proxy", - "multiversx-sc-wasm-adapter", -] - -[[package]] -name = "farm-with-locked-rewards" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "contexts", - "energy-factory", - "energy-query", - "events", - "farm", - "farm-boosted-yields", - "farm_base_impl", - "farm_token", - "fixed-supply-token", - "locking_module", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "rewards", - "sc_whitelist_module", - "token_send", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "farm_base_impl" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "contexts", - "events", - "farm_token", - "fixed-supply-token", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "rewards", - "token_merge_helper", - "token_send", - "utils", -] - -[[package]] -name = "farm_token" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "fees-collector" -version = "0.0.0" -dependencies = [ - "common-types", - "common_errors", - "energy-factory", - "energy-query", - "locking_module", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "locking_module" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" -dependencies = [ - "bitflags", - "hex-literal 0.4.1", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "pair" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "fees-collector", - "itertools", - "multiversx-sc", - "pausable", - "permissions_module", - "simple-lock", - "token_send", - "utils", -] - -[[package]] -name = "pausable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", - "permissions_module", -] - -[[package]] -name = "permissions_module" -version = "0.0.0" -dependencies = [ - "bitflags", - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "proc-macro2" -version = "1.0.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "rewards" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "farm_token", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" - -[[package]] -name = "syn" -version = "2.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "token_merge_helper" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "token_send" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "week-timekeeping" -version = "0.0.0" -dependencies = [ - "common-types", - "multiversx-sc", -] - -[[package]] -name = "weekly-rewards-splitting" -version = "0.0.0" -dependencies = [ - "common-types", - "energy-query", - "math", - "multiversx-sc", - "unwrappable", - "week-timekeeping", -] diff --git a/farm-staking/farm-staking-proxy/wasm/Cargo.toml b/farm-staking/farm-staking-proxy/wasm/Cargo.toml index 35ad48fed..b181fbb59 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" [workspace] members = ["."] diff --git a/farm-staking/farm-staking/Cargo.toml b/farm-staking/farm-staking/Cargo.toml index db8888636..ecf277982 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" diff --git a/farm-staking/farm-staking/meta/Cargo.toml b/farm-staking/farm-staking/meta/Cargo.toml index 5f389bba7..a9806b29f 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.49.0-alpha.3" +version = "0.49.0-alpha.4" default-features = false diff --git a/farm-staking/farm-staking/sc-config.toml b/farm-staking/farm-staking/sc-config.toml new file mode 100644 index 000000000..780249791 --- /dev/null +++ b/farm-staking/farm-staking/sc-config.toml @@ -0,0 +1,2 @@ +[[proxy]] +path = "../../dex/interactor/src/farm_staking_proxy.rs" diff --git a/farm-staking/farm-staking/wasm/Cargo.lock b/farm-staking/farm-staking/wasm/Cargo.lock deleted file mode 100644 index df6d9c270..000000000 --- a/farm-staking/farm-staking/wasm/Cargo.lock +++ /dev/null @@ -1,567 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" - -[[package]] -name = "common-types" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "config" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "contexts" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "farm_token", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "rewards", - "token_merge_helper", - "token_send", -] - -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "energy-query" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", -] - -[[package]] -name = "events" -version = "0.0.0" -dependencies = [ - "common_structs", - "contexts", - "multiversx-sc", -] - -[[package]] -name = "farm" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "contexts", - "energy-query", - "events", - "farm-boosted-yields", - "farm_base_impl", - "farm_token", - "fixed-supply-token", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pair", - "pausable", - "permissions_module", - "rewards", - "sc_whitelist_module", - "token_send", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "farm-boosted-yields" -version = "0.0.0" -dependencies = [ - "common-types", - "config", - "energy-query", - "multiversx-sc", - "pausable", - "permissions_module", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "farm-staking" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "contexts", - "energy-factory", - "energy-query", - "events", - "farm", - "farm-boosted-yields", - "farm_base_impl", - "farm_token", - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pair", - "pausable", - "permissions_module", - "rewards", - "sc_whitelist_module", - "token_send", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "farm-staking-wasm" -version = "0.0.0" -dependencies = [ - "farm-staking", - "multiversx-sc-wasm-adapter", -] - -[[package]] -name = "farm_base_impl" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "contexts", - "events", - "farm_token", - "fixed-supply-token", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "rewards", - "token_merge_helper", - "token_send", - "utils", -] - -[[package]] -name = "farm_token" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "fees-collector" -version = "0.0.0" -dependencies = [ - "common-types", - "common_errors", - "energy-factory", - "energy-query", - "locking_module", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "locking_module" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" -dependencies = [ - "bitflags", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "pair" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "fees-collector", - "itertools", - "multiversx-sc", - "pausable", - "permissions_module", - "simple-lock", - "token_send", - "utils", -] - -[[package]] -name = "pausable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", - "permissions_module", -] - -[[package]] -name = "permissions_module" -version = "0.0.0" -dependencies = [ - "bitflags", - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "proc-macro2" -version = "1.0.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "rewards" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "farm_token", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" - -[[package]] -name = "syn" -version = "2.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "token_merge_helper" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "token_send" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "week-timekeeping" -version = "0.0.0" -dependencies = [ - "common-types", - "multiversx-sc", -] - -[[package]] -name = "weekly-rewards-splitting" -version = "0.0.0" -dependencies = [ - "common-types", - "energy-query", - "math", - "multiversx-sc", - "unwrappable", - "week-timekeeping", -] diff --git a/farm-staking/farm-staking/wasm/Cargo.toml b/farm-staking/farm-staking/wasm/Cargo.toml index 90ee8b35c..2eedc0cbc 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" [workspace] members = ["."] diff --git a/farm-staking/metabonding-staking/Cargo.toml b/farm-staking/metabonding-staking/Cargo.toml index e6143459f..01fe3a80f 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" [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.49.0-alpha.3" +version = "=0.49.0-alpha.4" [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 fc5655bda..e98e1948f 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.49.0-alpha.3" +version = "0.49.0-alpha.4" default-features = false diff --git a/farm-staking/metabonding-staking/wasm/Cargo.lock b/farm-staking/metabonding-staking/wasm/Cargo.lock deleted file mode 100644 index 5a7ca782e..000000000 --- a/farm-staking/metabonding-staking/wasm/Cargo.lock +++ /dev/null @@ -1,389 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "factory" -version = "0.0.0" -dependencies = [ - "arrayvec", - "common_errors", - "common_structs", - "energy-factory", - "itertools", - "multiversx-sc", - "multiversx-sc-modules", - "token_merge_helper", - "token_send", - "wee_alloc", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "libc" -version = "0.2.151" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "metabonding-staking" -version = "0.0.0" -dependencies = [ - "factory", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "metabonding-staking-wasm" -version = "0.0.0" -dependencies = [ - "metabonding-staking", - "multiversx-sc-wasm-adapter", -] - -[[package]] -name = "multiversx-sc" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" -dependencies = [ - "bitflags", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "proc-macro2" -version = "1.0.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" - -[[package]] -name = "syn" -version = "2.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "token_merge_helper" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "token_send" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if", - "libc", - "memory_units", - "winapi", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/farm-staking/metabonding-staking/wasm/Cargo.toml b/farm-staking/metabonding-staking/wasm/Cargo.toml index 6cb9ee986..085c518ba 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" [workspace] members = ["."] diff --git a/locked-asset/Cargo.toml b/locked-asset/Cargo.toml index da9b5e684..57f568521 100644 --- a/locked-asset/Cargo.toml +++ b/locked-asset/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" publish = false [dependencies.multiversx-sc] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" diff --git a/locked-asset/distribution/Cargo.toml b/locked-asset/distribution/Cargo.toml index a64d2a8f8..8ac11907a 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" diff --git a/locked-asset/distribution/meta/Cargo.toml b/locked-asset/distribution/meta/Cargo.toml index 7ee863646..fedde7760 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.49.0-alpha.3" +version = "0.49.0-alpha.4" default-features = false diff --git a/locked-asset/distribution/wasm/Cargo.lock b/locked-asset/distribution/wasm/Cargo.lock deleted file mode 100644 index cf192200d..000000000 --- a/locked-asset/distribution/wasm/Cargo.lock +++ /dev/null @@ -1,389 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "distribution" -version = "0.0.0" -dependencies = [ - "common_structs", - "factory", - "multiversx-sc", -] - -[[package]] -name = "distribution-wasm" -version = "0.0.0" -dependencies = [ - "distribution", - "multiversx-sc-wasm-adapter", -] - -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "factory" -version = "0.0.0" -dependencies = [ - "arrayvec", - "common_errors", - "common_structs", - "energy-factory", - "itertools", - "multiversx-sc", - "multiversx-sc-modules", - "token_merge_helper", - "token_send", - "wee_alloc", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "libc" -version = "0.2.151" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" -dependencies = [ - "bitflags", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "proc-macro2" -version = "1.0.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" - -[[package]] -name = "syn" -version = "2.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "token_merge_helper" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "token_send" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if", - "libc", - "memory_units", - "winapi", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/locked-asset/distribution/wasm/Cargo.toml b/locked-asset/distribution/wasm/Cargo.toml index ddc490e0a..0cdf5c852 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" [workspace] members = ["."] diff --git a/locked-asset/energy-factory/Cargo.toml b/locked-asset/energy-factory/Cargo.toml index 30688101d..6cad11412 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" [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.49.0-alpha.3" +version = "=0.49.0-alpha.4" diff --git a/locked-asset/energy-factory/meta/Cargo.toml b/locked-asset/energy-factory/meta/Cargo.toml index 0cc27c130..f07b3d9c7 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.49.0-alpha.3" +version = "0.49.0-alpha.4" default-features = false diff --git a/locked-asset/energy-factory/sc-config.toml b/locked-asset/energy-factory/sc-config.toml new file mode 100644 index 000000000..ac8f646d8 --- /dev/null +++ b/locked-asset/energy-factory/sc-config.toml @@ -0,0 +1,2 @@ +[[proxy]] +path = "../../dex/interactor/src/energy_factory_proxy.rs" diff --git a/locked-asset/energy-factory/src/energy.rs b/locked-asset/energy-factory/src/energy.rs index 533ca58b8..6511168e8 100644 --- a/locked-asset/energy-factory/src/energy.rs +++ b/locked-asset/energy-factory/src/energy.rs @@ -3,7 +3,8 @@ multiversx_sc::derive_imports!(); use common_structs::Epoch; -#[derive(TypeAbi, TopEncode, TopDecode, NestedEncode, NestedDecode, Clone, PartialEq, Debug)] +#[type_abi] +#[derive(TopEncode, TopDecode, NestedEncode, NestedDecode, Clone, PartialEq, Debug)] pub struct Energy { amount: BigInt, last_update_epoch: Epoch, diff --git a/locked-asset/energy-factory/src/events.rs b/locked-asset/energy-factory/src/events.rs index 047f46e53..a5e3b78ee 100644 --- a/locked-asset/energy-factory/src/events.rs +++ b/locked-asset/energy-factory/src/events.rs @@ -3,7 +3,8 @@ multiversx_sc::derive_imports!(); use crate::energy::Energy; -#[derive(TypeAbi, TopEncode, TopDecode)] +#[type_abi] +#[derive(TopEncode, TopDecode)] pub struct EnergyUpdatedEvent { pub old_energy_entry: Energy, pub new_energy_entry: Energy, diff --git a/locked-asset/energy-factory/wasm/Cargo.lock b/locked-asset/energy-factory/wasm/Cargo.lock deleted file mode 100644 index 38e0f596c..000000000 --- a/locked-asset/energy-factory/wasm/Cargo.lock +++ /dev/null @@ -1,280 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "energy-factory-wasm" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc-wasm-adapter", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" -dependencies = [ - "bitflags", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "proc-macro2" -version = "1.0.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" - -[[package]] -name = "syn" -version = "2.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] diff --git a/locked-asset/energy-factory/wasm/Cargo.toml b/locked-asset/energy-factory/wasm/Cargo.toml index ad6aa9524..f39f72f97 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" [workspace] members = ["."] diff --git a/locked-asset/energy-factory/wasm/src/lib.rs b/locked-asset/energy-factory/wasm/src/lib.rs index fcae7f6f1..eb42f733b 100644 --- a/locked-asset/energy-factory/wasm/src/lib.rs +++ b/locked-asset/energy-factory/wasm/src/lib.rs @@ -8,7 +8,7 @@ // Upgrade: 1 // Endpoints: 33 // Async Callback: 1 -// Total number of exported functions: 35 +// Total number of exported functions: 36 #![no_std] #![allow(internal_features)] diff --git a/locked-asset/factory/Cargo.toml b/locked-asset/factory/Cargo.toml index 15b29dfc0..5f29016ea 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" [dependencies.arrayvec] version = "0.7.1" @@ -49,4 +49,4 @@ hex = "0.4" path = "../simple-lock" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" diff --git a/locked-asset/factory/meta/Cargo.toml b/locked-asset/factory/meta/Cargo.toml index 948fdc6fd..c9bb24529 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.49.0-alpha.3" +version = "0.49.0-alpha.4" default-features = false diff --git a/locked-asset/factory/wasm/Cargo.lock b/locked-asset/factory/wasm/Cargo.lock deleted file mode 100644 index d3fd72377..000000000 --- a/locked-asset/factory/wasm/Cargo.lock +++ /dev/null @@ -1,380 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "factory" -version = "0.0.0" -dependencies = [ - "arrayvec", - "common_errors", - "common_structs", - "energy-factory", - "itertools", - "multiversx-sc", - "multiversx-sc-modules", - "token_merge_helper", - "token_send", - "wee_alloc", -] - -[[package]] -name = "factory-wasm" -version = "0.0.0" -dependencies = [ - "factory", - "multiversx-sc-wasm-adapter", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "libc" -version = "0.2.151" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" -dependencies = [ - "bitflags", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "proc-macro2" -version = "1.0.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" - -[[package]] -name = "syn" -version = "2.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "token_merge_helper" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "token_send" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if", - "libc", - "memory_units", - "winapi", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/locked-asset/factory/wasm/Cargo.toml b/locked-asset/factory/wasm/Cargo.toml index d0a3567f2..6d59b39dc 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" [workspace] members = ["."] diff --git a/locked-asset/lkmex-transfer/Cargo.toml b/locked-asset/lkmex-transfer/Cargo.toml index 7ecf8b07d..b37373906 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" [dev-dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" diff --git a/locked-asset/lkmex-transfer/meta/Cargo.toml b/locked-asset/lkmex-transfer/meta/Cargo.toml index 625e265e6..95616056e 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.49.0-alpha.3" +version = "0.49.0-alpha.4" default-features = false diff --git a/locked-asset/lkmex-transfer/wasm/Cargo.lock b/locked-asset/lkmex-transfer/wasm/Cargo.lock deleted file mode 100644 index 514ce3931..000000000 --- a/locked-asset/lkmex-transfer/wasm/Cargo.lock +++ /dev/null @@ -1,311 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "energy-query" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "lkmex-transfer" -version = "0.0.0" -dependencies = [ - "common_structs", - "energy-factory", - "energy-query", - "legacy_token_decode_module", - "multiversx-sc", - "permissions_module", - "simple-lock", - "utils", -] - -[[package]] -name = "lkmex-transfer-wasm" -version = "0.0.0" -dependencies = [ - "lkmex-transfer", - "multiversx-sc-wasm-adapter", -] - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" -dependencies = [ - "bitflags", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "permissions_module" -version = "0.0.0" -dependencies = [ - "bitflags", - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "proc-macro2" -version = "1.0.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" - -[[package]] -name = "syn" -version = "2.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] diff --git a/locked-asset/lkmex-transfer/wasm/Cargo.toml b/locked-asset/lkmex-transfer/wasm/Cargo.toml index 44bbb3be2..b271c9d51 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" [workspace] members = ["."] diff --git a/locked-asset/locked-token-wrapper/Cargo.toml b/locked-asset/locked-token-wrapper/Cargo.toml index 002a09ebf..a065fda6c 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" [dependencies.utils] path = "../../common/modules/utils" @@ -44,4 +44,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" diff --git a/locked-asset/locked-token-wrapper/meta/Cargo.toml b/locked-asset/locked-token-wrapper/meta/Cargo.toml index 55394b903..1343d268c 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.49.0-alpha.3" +version = "0.49.0-alpha.4" default-features = false diff --git a/locked-asset/locked-token-wrapper/wasm/Cargo.lock b/locked-asset/locked-token-wrapper/wasm/Cargo.lock deleted file mode 100644 index de7509857..000000000 --- a/locked-asset/locked-token-wrapper/wasm/Cargo.lock +++ /dev/null @@ -1,335 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "energy-factory-mock" -version = "0.0.0" -dependencies = [ - "energy-query", - "multiversx-sc", -] - -[[package]] -name = "energy-query" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "lkmex-transfer" -version = "0.0.0" -dependencies = [ - "common_structs", - "energy-factory", - "energy-query", - "legacy_token_decode_module", - "multiversx-sc", - "permissions_module", - "simple-lock", - "utils", -] - -[[package]] -name = "locked-token-wrapper" -version = "0.0.0" -dependencies = [ - "common_structs", - "energy-factory", - "energy-factory-mock", - "energy-query", - "legacy_token_decode_module", - "lkmex-transfer", - "multiversx-sc", - "multiversx-sc-modules", - "simple-lock", - "utils", -] - -[[package]] -name = "locked-token-wrapper-wasm" -version = "0.0.0" -dependencies = [ - "locked-token-wrapper", - "multiversx-sc-wasm-adapter", -] - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" -dependencies = [ - "bitflags", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "permissions_module" -version = "0.0.0" -dependencies = [ - "bitflags", - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "proc-macro2" -version = "1.0.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" - -[[package]] -name = "syn" -version = "2.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] diff --git a/locked-asset/locked-token-wrapper/wasm/Cargo.toml b/locked-asset/locked-token-wrapper/wasm/Cargo.toml index fb7f87672..0af4889f5 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" [workspace] members = ["."] diff --git a/locked-asset/proxy_dex/Cargo.toml b/locked-asset/proxy_dex/Cargo.toml index c22279c64..c292563bc 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" [dependencies.energy-factory] path = "../energy-factory" @@ -69,7 +69,7 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" [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 090f7954f..8d1cc9632 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.49.0-alpha.3" +version = "0.49.0-alpha.4" default-features = false diff --git a/locked-asset/proxy_dex/wasm/Cargo.lock b/locked-asset/proxy_dex/wasm/Cargo.lock deleted file mode 100644 index c8ea129ba..000000000 --- a/locked-asset/proxy_dex/wasm/Cargo.lock +++ /dev/null @@ -1,590 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" - -[[package]] -name = "common-types" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "config" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "contexts" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "farm_token", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "rewards", - "token_merge_helper", - "token_send", -] - -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "energy-query" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", -] - -[[package]] -name = "events" -version = "0.0.0" -dependencies = [ - "common_structs", - "contexts", - "multiversx-sc", -] - -[[package]] -name = "farm" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "contexts", - "energy-query", - "events", - "farm-boosted-yields", - "farm_base_impl", - "farm_token", - "fixed-supply-token", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pair", - "pausable", - "permissions_module", - "rewards", - "sc_whitelist_module", - "token_send", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "farm-boosted-yields" -version = "0.0.0" -dependencies = [ - "common-types", - "config", - "energy-query", - "multiversx-sc", - "pausable", - "permissions_module", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "farm-with-locked-rewards" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "contexts", - "energy-factory", - "energy-query", - "events", - "farm", - "farm-boosted-yields", - "farm_base_impl", - "farm_token", - "fixed-supply-token", - "locking_module", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "rewards", - "sc_whitelist_module", - "token_send", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "farm_base_impl" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "contexts", - "events", - "farm_token", - "fixed-supply-token", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "rewards", - "token_merge_helper", - "token_send", - "utils", -] - -[[package]] -name = "farm_token" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "fees-collector" -version = "0.0.0" -dependencies = [ - "common-types", - "common_errors", - "energy-factory", - "energy-query", - "locking_module", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "utils", - "week-timekeeping", - "weekly-rewards-splitting", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "locking_module" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" -dependencies = [ - "bitflags", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "pair" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "fees-collector", - "itertools", - "multiversx-sc", - "pausable", - "permissions_module", - "simple-lock", - "token_send", - "utils", -] - -[[package]] -name = "pausable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", - "permissions_module", -] - -[[package]] -name = "permissions_module" -version = "0.0.0" -dependencies = [ - "bitflags", - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "proc-macro2" -version = "1.0.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "proxy_dex" -version = "0.0.0" -dependencies = [ - "common_structs", - "energy-factory", - "energy-query", - "farm", - "farm-with-locked-rewards", - "fixed-supply-token", - "itertools", - "legacy_token_decode_module", - "locking_module", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "pair", - "sc_whitelist_module", - "simple-lock", - "token_merge_helper", - "token_send", - "utils", -] - -[[package]] -name = "proxy_dex-wasm" -version = "0.0.0" -dependencies = [ - "multiversx-sc-wasm-adapter", - "proxy_dex", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "rewards" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "config", - "farm_token", - "multiversx-sc", - "multiversx-sc-modules", - "pausable", - "permissions_module", - "token_send", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" - -[[package]] -name = "syn" -version = "2.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "token_merge_helper" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "token_send" -version = "0.0.0" -dependencies = [ - "common_errors", - "common_structs", - "multiversx-sc", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "week-timekeeping" -version = "0.0.0" -dependencies = [ - "common-types", - "multiversx-sc", -] - -[[package]] -name = "weekly-rewards-splitting" -version = "0.0.0" -dependencies = [ - "common-types", - "energy-query", - "math", - "multiversx-sc", - "unwrappable", - "week-timekeeping", -] diff --git a/locked-asset/proxy_dex/wasm/Cargo.toml b/locked-asset/proxy_dex/wasm/Cargo.toml index 6c385208d..72432ab4d 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" [workspace] members = ["."] diff --git a/locked-asset/simple-lock-whitelist/Cargo.toml b/locked-asset/simple-lock-whitelist/Cargo.toml index 1b6418da3..f44708230 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" [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.49.0-alpha.3" +version = "=0.49.0-alpha.4" diff --git a/locked-asset/simple-lock-whitelist/meta/Cargo.toml b/locked-asset/simple-lock-whitelist/meta/Cargo.toml index f50a9d3d4..f09b1c6f2 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.49.0-alpha.3" +version = "0.49.0-alpha.4" default-features = false diff --git a/locked-asset/simple-lock-whitelist/wasm/Cargo.lock b/locked-asset/simple-lock-whitelist/wasm/Cargo.lock deleted file mode 100644 index 335c9e3e8..000000000 --- a/locked-asset/simple-lock-whitelist/wasm/Cargo.lock +++ /dev/null @@ -1,250 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" -dependencies = [ - "bitflags", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "proc-macro2" -version = "1.0.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "simple-lock-whitelist" -version = "0.0.0" -dependencies = [ - "multiversx-sc", - "multiversx-sc-modules", - "simple-lock", - "utils", -] - -[[package]] -name = "simple-lock-whitelist-wasm" -version = "0.0.0" -dependencies = [ - "multiversx-sc-wasm-adapter", - "simple-lock-whitelist", -] - -[[package]] -name = "smallvec" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" - -[[package]] -name = "syn" -version = "2.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] diff --git a/locked-asset/simple-lock-whitelist/wasm/Cargo.toml b/locked-asset/simple-lock-whitelist/wasm/Cargo.toml index 883a71df0..1816d6644 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" [workspace] members = ["."] diff --git a/locked-asset/simple-lock/Cargo.toml b/locked-asset/simple-lock/Cargo.toml index 18164347c..9d50c173e 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" [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.49.0-alpha.3" +version = "=0.49.0-alpha.4" diff --git a/locked-asset/simple-lock/meta/Cargo.toml b/locked-asset/simple-lock/meta/Cargo.toml index 84c933a4d..8cf746dbc 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.49.0-alpha.3" +version = "0.49.0-alpha.4" default-features = false diff --git a/locked-asset/simple-lock/wasm/Cargo.lock b/locked-asset/simple-lock/wasm/Cargo.lock deleted file mode 100644 index 33e108868..000000000 --- a/locked-asset/simple-lock/wasm/Cargo.lock +++ /dev/null @@ -1,230 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" -dependencies = [ - "bitflags", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "proc-macro2" -version = "1.0.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "simple-lock-wasm" -version = "0.0.0" -dependencies = [ - "multiversx-sc-wasm-adapter", - "simple-lock", -] - -[[package]] -name = "smallvec" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" - -[[package]] -name = "syn" -version = "2.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] diff --git a/locked-asset/simple-lock/wasm/Cargo.toml b/locked-asset/simple-lock/wasm/Cargo.toml index 45cab2e76..c24d5e9bf 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" [workspace] members = ["."] diff --git a/locked-asset/token-unstake/Cargo.toml b/locked-asset/token-unstake/Cargo.toml index bdcca8710..895951570 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" [dev-dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" diff --git a/locked-asset/token-unstake/meta/Cargo.toml b/locked-asset/token-unstake/meta/Cargo.toml index cff9ee324..919579f7d 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.49.0-alpha.3" +version = "0.49.0-alpha.4" default-features = false diff --git a/locked-asset/token-unstake/wasm/Cargo.lock b/locked-asset/token-unstake/wasm/Cargo.lock deleted file mode 100644 index 0e1a9da47..000000000 --- a/locked-asset/token-unstake/wasm/Cargo.lock +++ /dev/null @@ -1,317 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" - -[[package]] -name = "common-types" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "common_structs" -version = "0.0.0" -dependencies = [ - "fixed-supply-token", - "math", - "mergeable", - "multiversx-sc", - "unwrappable", -] - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "energy-factory" -version = "0.0.0" -dependencies = [ - "common_structs", - "legacy_token_decode_module", - "math", - "mergeable", - "multiversx-sc", - "multiversx-sc-modules", - "sc_whitelist_module", - "simple-lock", - "unwrappable", - "utils", -] - -[[package]] -name = "energy-query" -version = "0.0.0" -dependencies = [ - "energy-factory", - "multiversx-sc", -] - -[[package]] -name = "fixed-supply-token" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "legacy_token_decode_module" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "utils", -] - -[[package]] -name = "math" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "mergeable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" -dependencies = [ - "bitflags", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "proc-macro2" -version = "1.0.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "sc_whitelist_module" -version = "0.0.0" -dependencies = [ - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "simple-lock" -version = "0.0.0" -dependencies = [ - "common_structs", - "multiversx-sc", - "multiversx-sc-modules", -] - -[[package]] -name = "smallvec" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" - -[[package]] -name = "syn" -version = "2.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "token-unstake" -version = "0.0.0" -dependencies = [ - "common_structs", - "energy-factory", - "energy-query", - "mergeable", - "multiversx-sc", - "simple-lock", - "utils", - "week-timekeeping", -] - -[[package]] -name = "token-unstake-wasm" -version = "0.0.0" -dependencies = [ - "multiversx-sc-wasm-adapter", - "token-unstake", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unwrappable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "utils" -version = "0.0.0" -dependencies = [ - "common_structs", - "fixed-supply-token", - "mergeable", - "multiversx-sc", -] - -[[package]] -name = "week-timekeeping" -version = "0.0.0" -dependencies = [ - "common-types", - "multiversx-sc", -] diff --git a/locked-asset/token-unstake/wasm/Cargo.toml b/locked-asset/token-unstake/wasm/Cargo.toml index cf2b66770..3fe2c65e6 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" [workspace] members = ["."] diff --git a/pause-all/Cargo.toml b/pause-all/Cargo.toml index 1ec9191e3..ed1347bcc 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0-alpha.3" +version = "=0.49.0-alpha.4" [dev-dependencies.farm] path = "../dex/farm" diff --git a/pause-all/meta/Cargo.toml b/pause-all/meta/Cargo.toml index 9429a8271..0714f84e4 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.49.0-alpha.3" +version = "0.49.0-alpha.4" default-features = false diff --git a/pause-all/wasm/Cargo.lock b/pause-all/wasm/Cargo.lock deleted file mode 100644 index 7c380c10e..000000000 --- a/pause-all/wasm/Cargo.lock +++ /dev/null @@ -1,215 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" - -[[package]] -name = "common_errors" -version = "0.0.0" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "multiversx-sc" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" -dependencies = [ - "bitflags", - "hex-literal", - "multiversx-sc-codec", - "multiversx-sc-derive", - "num-traits", -] - -[[package]] -name = "multiversx-sc-codec" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" -dependencies = [ - "arrayvec", - "multiversx-sc-codec-derive", -] - -[[package]] -name = "multiversx-sc-codec-derive" -version = "0.18.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "multiversx-sc-derive" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" -dependencies = [ - "hex", - "proc-macro2", - "quote", - "radix_trie", - "syn", -] - -[[package]] -name = "multiversx-sc-modules" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "multiversx-sc-wasm-adapter" -version = "0.49.0-alpha.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c5022b0818e3c16fc76d5c812fca70a46f2fcec4b581600010b2c8cddac7342" -dependencies = [ - "multiversx-sc", -] - -[[package]] -name = "nibble_vec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" -dependencies = [ - "smallvec", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "pausable" -version = "0.0.0" -dependencies = [ - "multiversx-sc", - "permissions_module", -] - -[[package]] -name = "pause-all" -version = "0.0.0" -dependencies = [ - "multiversx-sc", - "multiversx-sc-modules", - "pausable", -] - -[[package]] -name = "pause-all-wasm" -version = "0.0.0" -dependencies = [ - "multiversx-sc-wasm-adapter", - "pause-all", -] - -[[package]] -name = "permissions_module" -version = "0.0.0" -dependencies = [ - "bitflags", - "common_errors", - "multiversx-sc", -] - -[[package]] -name = "proc-macro2" -version = "1.0.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radix_trie" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] - -[[package]] -name = "smallvec" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" - -[[package]] -name = "syn" -version = "2.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" diff --git a/pause-all/wasm/Cargo.toml b/pause-all/wasm/Cargo.toml index 2c68f615d..cde056f99 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.49.0-alpha.3" +version = "=0.49.0-alpha.4" [workspace] members = ["."] From e993235d059d074dc6941be6e21cc201be3a7cdc Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Tue, 23 Apr 2024 22:56:02 +0300 Subject: [PATCH 31/55] original caller merge fix --- dex/farm-with-locked-rewards/src/lib.rs | 3 ++- dex/farm/src/base_functions.rs | 8 +++++--- dex/farm/src/lib.rs | 2 +- farm-staking/farm-staking/src/lib.rs | 11 +++++++---- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/dex/farm-with-locked-rewards/src/lib.rs b/dex/farm-with-locked-rewards/src/lib.rs index a8abdade2..d704a80df 100644 --- a/dex/farm-with-locked-rewards/src/lib.rs +++ b/dex/farm-with-locked-rewards/src/lib.rs @@ -213,7 +213,8 @@ pub trait Farm: } fn merge_and_update_farm_tokens(&self, orig_caller: ManagedAddress) -> EsdtTokenPayment { - let mut output_attributes = self.merge_and_return_attributes::>(); + let mut output_attributes = + self.merge_and_return_attributes::>(&orig_caller); output_attributes.original_owner = orig_caller; let new_token_amount = output_attributes.get_total_supply(); diff --git a/dex/farm/src/base_functions.rs b/dex/farm/src/base_functions.rs index be97f7e80..48a59ac56 100644 --- a/dex/farm/src/base_functions.rs +++ b/dex/farm/src/base_functions.rs @@ -182,13 +182,15 @@ pub trait BaseFunctionsModule: } } - fn merge_and_return_attributes>(&self) -> FC::AttributesType { + fn merge_and_return_attributes>( + &self, + orig_caller: &ManagedAddress, + ) -> FC::AttributesType { let payments = self.get_non_empty_payments(); let token_mapper = self.farm_token(); token_mapper.require_all_same_token(&payments); - let caller = self.blockchain().get_caller(); - FC::check_and_update_user_farm_position(self, &caller, &payments); + FC::check_and_update_user_farm_position(self, orig_caller, &payments); self.merge_from_payments_and_burn(payments, &token_mapper) } diff --git a/dex/farm/src/lib.rs b/dex/farm/src/lib.rs index f7d69572b..1a35c1631 100644 --- a/dex/farm/src/lib.rs +++ b/dex/farm/src/lib.rs @@ -205,7 +205,7 @@ pub trait Farm: } fn merge_and_update_farm_tokens(&self, orig_caller: ManagedAddress) -> EsdtTokenPayment { - let mut output_attributes = self.merge_and_return_attributes::>(); + let mut output_attributes = self.merge_and_return_attributes::>(&orig_caller); output_attributes.original_owner = orig_caller; let new_token_amount = output_attributes.get_total_supply(); diff --git a/farm-staking/farm-staking/src/lib.rs b/farm-staking/farm-staking/src/lib.rs index ddc12f53b..5fd2b28d6 100644 --- a/farm-staking/farm-staking/src/lib.rs +++ b/farm-staking/farm-staking/src/lib.rs @@ -126,7 +126,8 @@ pub trait FarmStaking: } fn merge_and_update_farm_tokens(&self, orig_caller: ManagedAddress) -> EsdtTokenPayment { - let mut output_attributes = self.merge_farm_tokens::>(); + let mut output_attributes = + self.merge_farm_tokens::>(&orig_caller); output_attributes.original_owner = orig_caller; let new_token_amount = output_attributes.get_total_supply(); @@ -134,13 +135,15 @@ pub trait FarmStaking: .nft_create(new_token_amount, &output_attributes) } - fn merge_farm_tokens>(&self) -> FC::AttributesType { + fn merge_farm_tokens>( + &self, + orig_caller: &ManagedAddress, + ) -> FC::AttributesType { let payments = self.get_non_empty_payments(); let token_mapper = self.farm_token(); token_mapper.require_all_same_token(&payments); - let caller = self.blockchain().get_caller(); - FC::check_and_update_user_farm_position(self, &caller, &payments); + FC::check_and_update_user_farm_position(self, orig_caller, &payments); self.merge_from_payments_and_burn(payments, &token_mapper) } From 031b36a976aa1ef487d39937fb43f3ee8c41b421 Mon Sep 17 00:00:00 2001 From: Costin Carabas Date: Wed, 24 Apr 2024 00:55:53 +0300 Subject: [PATCH 32/55] proxy_dex: more unit tests --- .../proxy_dex/tests/proxy_farm_test.rs | 466 ++++++++++++++++++ locked-asset/proxy_dex/tests/proxy_lp_test.rs | 447 +++++++++++++++++ 2 files changed, 913 insertions(+) diff --git a/locked-asset/proxy_dex/tests/proxy_farm_test.rs b/locked-asset/proxy_dex/tests/proxy_farm_test.rs index 612bd7093..9692a945b 100644 --- a/locked-asset/proxy_dex/tests/proxy_farm_test.rs +++ b/locked-asset/proxy_dex/tests/proxy_farm_test.rs @@ -1487,6 +1487,472 @@ fn increase_proxy_farm_proxy_lp_energy() { ); } +#[test] +fn increase_proxy_farm_proxy_lp_energy_unlocked_tokens() { + let mut setup = ProxySetup::new( + proxy_dex::contract_obj, + pair::contract_obj, + farm_with_locked_rewards::contract_obj, + energy_factory::contract_obj, + ); + + setup + .b_mock + .execute_tx( + &setup.owner, + &setup.farm_locked_wrapper, + &rust_biguint!(0), + |sc| { + sc.farming_token_id().set(&managed_token_id!(LP_TOKEN_ID)); + + // set produce rewards to false for easier calculation + sc.produce_rewards_enabled().set(false); + }, + ) + .assert_ok(); + + setup.b_mock.set_esdt_local_roles( + setup.farm_locked_wrapper.address_ref(), + LP_TOKEN_ID, + &[EsdtLocalRole::Burn], + ); + + let first_user = setup.first_user.clone(); + let locked_token_amount = rust_biguint!(1_000_000_000); + let other_token_amount = rust_biguint!(500_000_000); + let expected_lp_token_amount = rust_biguint!(499_999_000); + + // set the price to 1 EGLD = 2 MEX + let payments = vec![ + TxTokenTransfer { + token_identifier: LOCKED_TOKEN_ID.to_vec(), + nonce: 1, + value: locked_token_amount.clone(), + }, + TxTokenTransfer { + token_identifier: WEGLD_TOKEN_ID.to_vec(), + nonce: 0, + value: other_token_amount.clone(), + }, + ]; + + // add liquidity twice, to have 2 nonces + let pair_addr = setup.pair_wrapper.address_ref().clone(); + setup + .b_mock + .execute_esdt_multi_transfer(&first_user, &setup.proxy_wrapper, &payments, |sc| { + sc.add_liquidity_proxy( + managed_address!(&pair_addr), + managed_biguint!(locked_token_amount.to_u64().unwrap() / 2), + managed_biguint!(other_token_amount.to_u64().unwrap() / 2), + ); + }) + .assert_ok(); + + let pair_addr = setup.pair_wrapper.address_ref().clone(); + setup + .b_mock + .execute_esdt_multi_transfer(&first_user, &setup.proxy_wrapper, &payments, |sc| { + sc.add_liquidity_proxy( + managed_address!(&pair_addr), + managed_biguint!(locked_token_amount.to_u64().unwrap() / 2), + managed_biguint!(other_token_amount.to_u64().unwrap() / 2), + ); + }) + .assert_ok(); + + let mut block_epoch = 1u64; + let user_balance = USER_BALANCE; + + // check energy before + setup + .b_mock + .execute_query(&setup.simple_lock_wrapper, |sc| { + let unlock_epoch = LOCK_OPTIONS[0]; + let lock_epochs = unlock_epoch - block_epoch; + let expected_energy_amount = + BigInt::from((user_balance) as i64) * BigInt::from(lock_epochs as i64); + let expected_energy = Energy::new( + expected_energy_amount, + block_epoch, + managed_biguint!(user_balance), + ); + let actual_energy = sc.user_energy(&managed_address!(&first_user)).get(); + assert_eq!(expected_energy, actual_energy); + }) + .assert_ok(); + + let farm_locked_addr = setup.farm_locked_wrapper.address_ref().clone(); + + //////////////////////////////////////////// ENTER FARM ///////////////////////////////////// + + // Enter multiple times, to distribute the nonces + setup + .b_mock + .execute_esdt_transfer( + &first_user, + &setup.proxy_wrapper, + WRAPPED_LP_TOKEN_ID, + 1, + &(&expected_lp_token_amount / &rust_biguint!(4u64)), + |sc| { + sc.enter_farm_proxy_endpoint( + managed_address!(&farm_locked_addr), + OptionalValue::None, + ); + }, + ) + .assert_ok(); + + setup + .b_mock + .execute_esdt_transfer( + &first_user, + &setup.proxy_wrapper, + WRAPPED_LP_TOKEN_ID, + 2, + &(&expected_lp_token_amount / &rust_biguint!(4u64)), + |sc| { + sc.enter_farm_proxy_endpoint( + managed_address!(&farm_locked_addr), + OptionalValue::None, + ); + }, + ) + .assert_ok(); + + setup + .b_mock + .execute_esdt_transfer( + &first_user, + &setup.proxy_wrapper, + WRAPPED_LP_TOKEN_ID, + 1, + &(&expected_lp_token_amount / &rust_biguint!(4u64)), + |sc| { + sc.enter_farm_proxy_endpoint( + managed_address!(&farm_locked_addr), + OptionalValue::None, + ); + }, + ) + .assert_ok(); + + setup + .b_mock + .execute_esdt_transfer( + &first_user, + &setup.proxy_wrapper, + WRAPPED_LP_TOKEN_ID, + 2, + &(&expected_lp_token_amount / &rust_biguint!(4u64)), + |sc| { + sc.enter_farm_proxy_endpoint( + managed_address!(&farm_locked_addr), + OptionalValue::None, + ); + }, + ) + .assert_ok(); + + ////////////////////////////// Wait for tokens to unlock ///////////////////////////////////// + block_epoch += LOCK_OPTIONS[0]; + setup.b_mock.set_block_epoch(block_epoch); + + + //////////////////////////////////////////// INCREASE ENERGY ///////////////////////////////////// + setup + .b_mock + .execute_esdt_transfer( + &first_user, + &setup.proxy_wrapper, + WRAPPED_FARM_TOKEN_ID, + 4, + &(&expected_lp_token_amount / &rust_biguint!(4u64)), + |sc| { + sc.increase_proxy_farm_token_energy_endpoint(LOCK_OPTIONS[1]); + }, + ) + .assert_ok(); + + // check energy after + // lp tokens recharged = total tokens / 4 - 500 + let user_locked_tokens_in_lp = locked_token_amount.to_u64().unwrap() / 4 - 500; + setup + .b_mock + .execute_query(&setup.simple_lock_wrapper, |sc| { + 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) + * BigInt::from(first_lock_epochs as i64) + + 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(); + assert_eq!(expected_energy, actual_energy); + }) + .assert_ok(); + + // check user token after increase energy + // new farm token was created + setup.b_mock.check_nft_balance( + &first_user, + WRAPPED_FARM_TOKEN_ID, + 5, + &(&expected_lp_token_amount / &rust_biguint!(4u64)), + Some(&WrappedFarmTokenAttributes:: { + proxy_farming_token: EsdtTokenPayment { + token_identifier: managed_token_id!(WRAPPED_LP_TOKEN_ID), + token_nonce: 3, + amount: managed_biguint!(expected_lp_token_amount.to_u64().unwrap() / 4u64), + }, + farm_token: EsdtTokenPayment { + token_identifier: managed_token_id!(FARM_LOCKED_TOKEN_ID), + token_nonce: 4, + amount: managed_biguint!(expected_lp_token_amount.to_u64().unwrap() / 4u64), + }, + }), + ); +} + + + +#[test] +fn increase_proxy_farm_proxy_lp_energy_partially_unlocked_tokens() { + let mut setup = ProxySetup::new( + proxy_dex::contract_obj, + pair::contract_obj, + farm_with_locked_rewards::contract_obj, + energy_factory::contract_obj, + ); + + setup + .b_mock + .execute_tx( + &setup.owner, + &setup.farm_locked_wrapper, + &rust_biguint!(0), + |sc| { + sc.farming_token_id().set(&managed_token_id!(LP_TOKEN_ID)); + + // set produce rewards to false for easier calculation + sc.produce_rewards_enabled().set(false); + }, + ) + .assert_ok(); + + setup.b_mock.set_esdt_local_roles( + setup.farm_locked_wrapper.address_ref(), + LP_TOKEN_ID, + &[EsdtLocalRole::Burn], + ); + + let first_user = setup.first_user.clone(); + let locked_token_amount = rust_biguint!(1_000_000_000); + let other_token_amount = rust_biguint!(500_000_000); + let expected_lp_token_amount = rust_biguint!(499_999_000); + + // set the price to 1 EGLD = 2 MEX + let payments = vec![ + TxTokenTransfer { + token_identifier: LOCKED_TOKEN_ID.to_vec(), + nonce: 1, + value: locked_token_amount.clone(), + }, + TxTokenTransfer { + token_identifier: WEGLD_TOKEN_ID.to_vec(), + nonce: 0, + value: other_token_amount.clone(), + }, + ]; + + // add liquidity twice, to have 2 nonces + let pair_addr = setup.pair_wrapper.address_ref().clone(); + setup + .b_mock + .execute_esdt_multi_transfer(&first_user, &setup.proxy_wrapper, &payments, |sc| { + sc.add_liquidity_proxy( + managed_address!(&pair_addr), + managed_biguint!(locked_token_amount.to_u64().unwrap() / 2), + managed_biguint!(other_token_amount.to_u64().unwrap() / 2), + ); + }) + .assert_ok(); + + let pair_addr = setup.pair_wrapper.address_ref().clone(); + setup + .b_mock + .execute_esdt_multi_transfer(&first_user, &setup.proxy_wrapper, &payments, |sc| { + sc.add_liquidity_proxy( + managed_address!(&pair_addr), + managed_biguint!(locked_token_amount.to_u64().unwrap() / 2), + managed_biguint!(other_token_amount.to_u64().unwrap() / 2), + ); + }) + .assert_ok(); + + let mut block_epoch = 1u64; + let user_balance = USER_BALANCE; + + // check energy before + setup + .b_mock + .execute_query(&setup.simple_lock_wrapper, |sc| { + let unlock_epoch = LOCK_OPTIONS[0]; + let lock_epochs = unlock_epoch - block_epoch; + let expected_energy_amount = + BigInt::from((user_balance) as i64) * BigInt::from(lock_epochs as i64); + let expected_energy = Energy::new( + expected_energy_amount, + block_epoch, + managed_biguint!(user_balance), + ); + let actual_energy = sc.user_energy(&managed_address!(&first_user)).get(); + assert_eq!(expected_energy, actual_energy); + }) + .assert_ok(); + + let farm_locked_addr = setup.farm_locked_wrapper.address_ref().clone(); + + //////////////////////////////////////////// ENTER FARM ///////////////////////////////////// + + // Enter multiple times, to distribute the nonces + setup + .b_mock + .execute_esdt_transfer( + &first_user, + &setup.proxy_wrapper, + WRAPPED_LP_TOKEN_ID, + 1, + &(&expected_lp_token_amount / &rust_biguint!(4u64)), + |sc| { + sc.enter_farm_proxy_endpoint( + managed_address!(&farm_locked_addr), + OptionalValue::None, + ); + }, + ) + .assert_ok(); + + setup + .b_mock + .execute_esdt_transfer( + &first_user, + &setup.proxy_wrapper, + WRAPPED_LP_TOKEN_ID, + 2, + &(&expected_lp_token_amount / &rust_biguint!(4u64)), + |sc| { + sc.enter_farm_proxy_endpoint( + managed_address!(&farm_locked_addr), + OptionalValue::None, + ); + }, + ) + .assert_ok(); + + setup + .b_mock + .execute_esdt_transfer( + &first_user, + &setup.proxy_wrapper, + WRAPPED_LP_TOKEN_ID, + 1, + &(&expected_lp_token_amount / &rust_biguint!(4u64)), + |sc| { + sc.enter_farm_proxy_endpoint( + managed_address!(&farm_locked_addr), + OptionalValue::None, + ); + }, + ) + .assert_ok(); + + setup + .b_mock + .execute_esdt_transfer( + &first_user, + &setup.proxy_wrapper, + WRAPPED_LP_TOKEN_ID, + 2, + &(&expected_lp_token_amount / &rust_biguint!(4u64)), + |sc| { + sc.enter_farm_proxy_endpoint( + managed_address!(&farm_locked_addr), + OptionalValue::None, + ); + }, + ) + .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 + .execute_esdt_transfer( + &first_user, + &setup.proxy_wrapper, + WRAPPED_FARM_TOKEN_ID, + 4, + &(&expected_lp_token_amount / &rust_biguint!(4u64)), + |sc| { + sc.increase_proxy_farm_token_energy_endpoint(LOCK_OPTIONS[1]); + }, + ) + .assert_ok(); + + // check energy after + // lp tokens recharged = total tokens / 4 - 500 + let user_locked_tokens_in_lp = locked_token_amount.to_u64().unwrap() / 4 - 500; + setup + .b_mock + .execute_query(&setup.simple_lock_wrapper, |sc| { + 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) + * BigInt::from(first_lock_epochs as i64) + + 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(); + assert_eq!(expected_energy, actual_energy); + }) + .assert_ok(); + + // check user token after increase energy + // new farm token was created + setup.b_mock.check_nft_balance( + &first_user, + WRAPPED_FARM_TOKEN_ID, + 5, + &(&expected_lp_token_amount / &rust_biguint!(4u64)), + Some(&WrappedFarmTokenAttributes:: { + proxy_farming_token: EsdtTokenPayment { + token_identifier: managed_token_id!(WRAPPED_LP_TOKEN_ID), + token_nonce: 3, + amount: managed_biguint!(expected_lp_token_amount.to_u64().unwrap() / 4u64), + }, + farm_token: EsdtTokenPayment { + token_identifier: managed_token_id!(FARM_LOCKED_TOKEN_ID), + token_nonce: 4, + amount: managed_biguint!(expected_lp_token_amount.to_u64().unwrap() / 4u64), + }, + }), + ); +} + #[test] diff --git a/locked-asset/proxy_dex/tests/proxy_lp_test.rs b/locked-asset/proxy_dex/tests/proxy_lp_test.rs index 9c3710bb7..90e511568 100644 --- a/locked-asset/proxy_dex/tests/proxy_lp_test.rs +++ b/locked-asset/proxy_dex/tests/proxy_lp_test.rs @@ -941,3 +941,450 @@ fn increase_proxy_lp_token_energy() { }) .assert_ok(); } + +#[test] +fn increase_proxy_lp_token_energy_unlocked_tokens() { + let mut setup = ProxySetup::new( + proxy_dex::contract_obj, + pair::contract_obj, + farm_with_locked_rewards::contract_obj, + energy_factory::contract_obj, + ); + let first_user = setup.first_user.clone(); + let full_balance = rust_biguint!(USER_BALANCE); + let locked_token_amount = rust_biguint!(1_000_000_000); + let other_token_amount = rust_biguint!(500_000_000); + let expected_lp_token_amount = rust_biguint!(499_999_000); + + // set the price to 1 EGLD = 2 MEX + let payments = vec![ + TxTokenTransfer { + token_identifier: LOCKED_TOKEN_ID.to_vec(), + nonce: 1, + value: locked_token_amount.clone(), + }, + TxTokenTransfer { + token_identifier: WEGLD_TOKEN_ID.to_vec(), + nonce: 0, + value: other_token_amount.clone(), + }, + ]; + + // add liquidity + let pair_addr = setup.pair_wrapper.address_ref().clone(); + setup + .b_mock + .execute_esdt_multi_transfer(&first_user, &setup.proxy_wrapper, &payments, |sc| { + sc.add_liquidity_proxy( + managed_address!(&pair_addr), + managed_biguint!(locked_token_amount.to_u64().unwrap()), + managed_biguint!(other_token_amount.to_u64().unwrap()), + ); + }) + .assert_ok(); + + // check user's balance + setup.b_mock.check_nft_balance::( + &first_user, + LOCKED_TOKEN_ID, + 1, + &(&full_balance - &locked_token_amount), + None, + ); + setup.b_mock.check_esdt_balance( + &first_user, + WEGLD_TOKEN_ID, + &(&full_balance - &other_token_amount), + ); + setup.b_mock.check_nft_balance( + &first_user, + WRAPPED_LP_TOKEN_ID, + 1, + &expected_lp_token_amount, + Some(&WrappedLpTokenAttributes:: { + locked_tokens: EsdtTokenPayment { + token_identifier: managed_token_id!(LOCKED_TOKEN_ID), + token_nonce: 1, + amount: managed_biguint!(locked_token_amount.to_u64().unwrap()), + }, + lp_token_id: managed_token_id!(LP_TOKEN_ID), + lp_token_amount: managed_biguint!(expected_lp_token_amount.to_u64().unwrap()), + }), + ); + + let mut block_epoch = 1; + let user_locked_tokens_in_lp = locked_token_amount.to_u64().unwrap(); + + // check user energy before + setup + .b_mock + .execute_query(&setup.simple_lock_wrapper, |sc| { + let lock_epochs = LOCK_OPTIONS[0] - block_epoch; + let expected_energy_amount = + BigInt::from((USER_BALANCE) as i64) * BigInt::from(lock_epochs as i64); + let expected_energy = Energy::new( + expected_energy_amount, + block_epoch, + managed_biguint!(USER_BALANCE), + ); + let actual_energy = sc.user_energy(&managed_address!(&first_user)).get(); + assert_eq!(expected_energy, actual_energy); + }) + .assert_ok(); + + + // Wait for tokens to unlock + block_epoch += LOCK_OPTIONS[0]; + + setup.b_mock.set_block_epoch(block_epoch); + + + // call increase energy + setup + .b_mock + .execute_esdt_transfer( + &setup.first_user, + &setup.proxy_wrapper, + WRAPPED_LP_TOKEN_ID, + 1, + &expected_lp_token_amount, + |sc| { + let _ = sc.increase_proxy_pair_token_energy_endpoint(LOCK_OPTIONS[1]); + }, + ) + .assert_ok(); + + // chceck new wrapped lp token + setup.b_mock.check_nft_balance( + &first_user, + WRAPPED_LP_TOKEN_ID, + 2, + &expected_lp_token_amount, + Some(&WrappedLpTokenAttributes:: { + locked_tokens: EsdtTokenPayment { + token_identifier: managed_token_id!(LOCKED_TOKEN_ID), + // Nonce increases + token_nonce: 3, + amount: managed_biguint!(locked_token_amount.to_u64().unwrap()), + }, + lp_token_id: managed_token_id!(LP_TOKEN_ID), + lp_token_amount: managed_biguint!(expected_lp_token_amount.to_u64().unwrap()), + }), + ); + + // check user energy after + setup + .b_mock + .execute_query(&setup.simple_lock_wrapper, |sc| { + let first_lock_epochs = LOCK_OPTIONS[1] - 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) + * BigInt::from(first_lock_epochs as i64) + + 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(); + assert_eq!(expected_energy, actual_energy); + }) + .assert_ok(); +} + +#[test] +fn increase_proxy_lp_token_energy_partially_unlocked_tokens() { + let mut setup = ProxySetup::new( + proxy_dex::contract_obj, + pair::contract_obj, + farm_with_locked_rewards::contract_obj, + energy_factory::contract_obj, + ); + let first_user = setup.first_user.clone(); + let full_balance = rust_biguint!(USER_BALANCE); + let locked_token_amount = rust_biguint!(1_000_000_000); + let other_token_amount = rust_biguint!(500_000_000); + let expected_lp_token_amount = rust_biguint!(499_999_000); + + // set the price to 1 EGLD = 2 MEX + let payments = vec![ + TxTokenTransfer { + token_identifier: LOCKED_TOKEN_ID.to_vec(), + nonce: 1, + value: locked_token_amount.clone(), + }, + TxTokenTransfer { + token_identifier: WEGLD_TOKEN_ID.to_vec(), + nonce: 0, + value: other_token_amount.clone(), + }, + ]; + + // add liquidity + let pair_addr = setup.pair_wrapper.address_ref().clone(); + setup + .b_mock + .execute_esdt_multi_transfer(&first_user, &setup.proxy_wrapper, &payments, |sc| { + sc.add_liquidity_proxy( + managed_address!(&pair_addr), + managed_biguint!(locked_token_amount.to_u64().unwrap()), + managed_biguint!(other_token_amount.to_u64().unwrap()), + ); + }) + .assert_ok(); + + // check user's balance + setup.b_mock.check_nft_balance::( + &first_user, + LOCKED_TOKEN_ID, + 1, + &(&full_balance - &locked_token_amount), + None, + ); + setup.b_mock.check_esdt_balance( + &first_user, + WEGLD_TOKEN_ID, + &(&full_balance - &other_token_amount), + ); + setup.b_mock.check_nft_balance( + &first_user, + WRAPPED_LP_TOKEN_ID, + 1, + &expected_lp_token_amount, + Some(&WrappedLpTokenAttributes:: { + locked_tokens: EsdtTokenPayment { + token_identifier: managed_token_id!(LOCKED_TOKEN_ID), + token_nonce: 1, + amount: managed_biguint!(locked_token_amount.to_u64().unwrap()), + }, + lp_token_id: managed_token_id!(LP_TOKEN_ID), + lp_token_amount: managed_biguint!(expected_lp_token_amount.to_u64().unwrap()), + }), + ); + + let mut block_epoch = 1; + let user_locked_tokens_in_lp = locked_token_amount.to_u64().unwrap(); + + // check user energy before + setup + .b_mock + .execute_query(&setup.simple_lock_wrapper, |sc| { + let lock_epochs = LOCK_OPTIONS[0] - block_epoch; + let expected_energy_amount = + BigInt::from((USER_BALANCE) as i64) * BigInt::from(lock_epochs as i64); + let expected_energy = Energy::new( + expected_energy_amount, + block_epoch, + managed_biguint!(USER_BALANCE), + ); + let actual_energy = sc.user_energy(&managed_address!(&first_user)).get(); + assert_eq!(expected_energy, actual_energy); + }) + .assert_ok(); + + + // 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 + .execute_esdt_transfer( + &setup.first_user, + &setup.proxy_wrapper, + WRAPPED_LP_TOKEN_ID, + 1, + &expected_lp_token_amount, + |sc| { + let _ = sc.increase_proxy_pair_token_energy_endpoint(LOCK_OPTIONS[1]); + }, + ) + .assert_ok(); + + // chceck new wrapped lp token + setup.b_mock.check_nft_balance( + &first_user, + WRAPPED_LP_TOKEN_ID, + 2, + &expected_lp_token_amount, + Some(&WrappedLpTokenAttributes:: { + locked_tokens: EsdtTokenPayment { + token_identifier: managed_token_id!(LOCKED_TOKEN_ID), + // Nonce increases + token_nonce: 3, + amount: managed_biguint!(locked_token_amount.to_u64().unwrap()), + }, + lp_token_id: managed_token_id!(LP_TOKEN_ID), + lp_token_amount: managed_biguint!(expected_lp_token_amount.to_u64().unwrap()), + }), + ); + + // check user energy after + setup + .b_mock + .execute_query(&setup.simple_lock_wrapper, |sc| { + let first_lock_epochs = LOCK_OPTIONS[1] - 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) + * BigInt::from(first_lock_epochs as i64) + + 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(); + assert_eq!(expected_energy, actual_energy); + }) + .assert_ok(); +} + + + +#[test] +fn increase_proxy_lp_legacy_token_energy() { + let mut setup = ProxySetup::new( + proxy_dex::contract_obj, + pair::contract_obj, + farm_with_locked_rewards::contract_obj, + energy_factory::contract_obj, + ); + let first_user = setup.first_user.clone(); + let full_balance = rust_biguint!(USER_BALANCE); + let locked_token_amount = rust_biguint!(1_000_000_000); + let other_token_amount = rust_biguint!(500_000_000); + let expected_lp_token_amount = rust_biguint!(499_999_000); + + // set the price to 1 EGLD = 2 MEX + let payments = vec![ + TxTokenTransfer { + token_identifier: LOCKED_TOKEN_ID.to_vec(), + nonce: 1, + value: locked_token_amount.clone(), + }, + TxTokenTransfer { + token_identifier: WEGLD_TOKEN_ID.to_vec(), + nonce: 0, + value: other_token_amount.clone(), + }, + ]; + + // add liquidity + let pair_addr = setup.pair_wrapper.address_ref().clone(); + setup + .b_mock + .execute_esdt_multi_transfer(&first_user, &setup.proxy_wrapper, &payments, |sc| { + sc.add_liquidity_proxy( + managed_address!(&pair_addr), + managed_biguint!(locked_token_amount.to_u64().unwrap()), + managed_biguint!(other_token_amount.to_u64().unwrap()), + ); + }) + .assert_ok(); + + // check user's balance + setup.b_mock.check_nft_balance::( + &first_user, + LOCKED_TOKEN_ID, + 1, + &(&full_balance - &locked_token_amount), + None, + ); + setup.b_mock.check_esdt_balance( + &first_user, + WEGLD_TOKEN_ID, + &(&full_balance - &other_token_amount), + ); + setup.b_mock.check_nft_balance( + &first_user, + WRAPPED_LP_TOKEN_ID, + 1, + &expected_lp_token_amount, + Some(&WrappedLpTokenAttributes:: { + locked_tokens: EsdtTokenPayment { + token_identifier: managed_token_id!(LOCKED_TOKEN_ID), + token_nonce: 1, + amount: managed_biguint!(locked_token_amount.to_u64().unwrap()), + }, + lp_token_id: managed_token_id!(LP_TOKEN_ID), + lp_token_amount: managed_biguint!(expected_lp_token_amount.to_u64().unwrap()), + }), + ); + + let block_epoch = 1; + let user_locked_tokens_in_lp = locked_token_amount.to_u64().unwrap(); + + // check user energy before + setup + .b_mock + .execute_query(&setup.simple_lock_wrapper, |sc| { + let lock_epochs = LOCK_OPTIONS[0] - block_epoch; + let expected_energy_amount = + BigInt::from((USER_BALANCE) as i64) * BigInt::from(lock_epochs as i64); + let expected_energy = Energy::new( + expected_energy_amount, + block_epoch, + managed_biguint!(USER_BALANCE), + ); + let actual_energy = sc.user_energy(&managed_address!(&first_user)).get(); + assert_eq!(expected_energy, actual_energy); + }) + .assert_ok(); + + // call increase energy + setup + .b_mock + .execute_esdt_transfer( + &setup.first_user, + &setup.proxy_wrapper, + WRAPPED_LP_TOKEN_ID, + 1, + &expected_lp_token_amount, + |sc| { + let _ = sc.increase_proxy_pair_token_energy_endpoint(LOCK_OPTIONS[1]); + }, + ) + .assert_ok(); + + // chceck new wrapped lp token + setup.b_mock.check_nft_balance( + &first_user, + WRAPPED_LP_TOKEN_ID, + 2, + &expected_lp_token_amount, + Some(&WrappedLpTokenAttributes:: { + locked_tokens: EsdtTokenPayment { + token_identifier: managed_token_id!(LOCKED_TOKEN_ID), + token_nonce: 2, + amount: managed_biguint!(locked_token_amount.to_u64().unwrap()), + }, + lp_token_id: managed_token_id!(LP_TOKEN_ID), + lp_token_amount: managed_biguint!(expected_lp_token_amount.to_u64().unwrap()), + }), + ); + + // check user energy after + setup + .b_mock + .execute_query(&setup.simple_lock_wrapper, |sc| { + let first_lock_epochs = LOCK_OPTIONS[1] - block_epoch; + let second_lock_epochs = LOCK_OPTIONS[0] - block_epoch; + let expected_energy_amount = BigInt::from((user_locked_tokens_in_lp) as i64) + * BigInt::from(first_lock_epochs as i64) + + BigInt::from((USER_BALANCE - user_locked_tokens_in_lp) as i64) + * BigInt::from(second_lock_epochs as i64); + let expected_energy = Energy::new( + expected_energy_amount, + block_epoch, + managed_biguint!(USER_BALANCE), + ); + let actual_energy = sc.user_energy(&managed_address!(&first_user)).get(); + assert_eq!(expected_energy, actual_energy); + }) + .assert_ok(); +} \ No newline at end of file From 6516b3608d8195b63d77612bbeccccb132fc135c Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Wed, 24 Apr 2024 04:00:59 +0300 Subject: [PATCH 33/55] farm staking additional tests --- .../tests/farm_staking_energy_test.rs | 539 +++++++++++++++++- .../tests/farm_staking_setup/mod.rs | 70 +++ 2 files changed, 592 insertions(+), 17 deletions(-) diff --git a/farm-staking/farm-staking/tests/farm_staking_energy_test.rs b/farm-staking/farm-staking/tests/farm_staking_energy_test.rs index b2c2f03ba..124272884 100644 --- a/farm-staking/farm-staking/tests/farm_staking_energy_test.rs +++ b/farm-staking/farm-staking/tests/farm_staking_energy_test.rs @@ -1,6 +1,7 @@ #![allow(deprecated)] pub mod farm_staking_setup; +use config::ConfigModule; use farm_staking::{ claim_stake_farm_rewards::ClaimStakeFarmRewardsModule, stake_farm::StakeFarmModule, @@ -127,8 +128,8 @@ fn farm_staking_boosted_rewards_with_energy_test() { fs_setup.set_boosted_yields_factors(); fs_setup.set_boosted_yields_rewards_percentage(BOOSTED_YIELDS_PERCENTAGE); - fs_setup.set_user_energy(&user_address, 10_000, 0, 10); - fs_setup.set_user_energy(&user_address2, 5_000, 0, 10); + fs_setup.set_user_energy(&user_address, 9_800, 0, 100); + fs_setup.set_user_energy(&user_address2, 4_900, 0, 350); let farm_in_amount = 100_000_000; fs_setup.stake_farm(&user_address, farm_in_amount, &[], 1, 0, 0); @@ -164,10 +165,7 @@ fn farm_staking_boosted_rewards_with_energy_test() { ) .assert_ok(); - fs_setup.set_block_nonce(10); - - // random user tx to collect rewards - + // random user tx to collect rewards - week 1 let rand_user = fs_setup.b_mock.create_user_account(&rust_biguint!(0)); fs_setup.b_mock.set_esdt_balance( &rand_user, @@ -175,8 +173,9 @@ fn farm_staking_boosted_rewards_with_energy_test() { &rust_biguint!(USER_TOTAL_RIDE_TOKENS), ); - fs_setup.set_user_energy(&rand_user, 1, 5, 1); - fs_setup.set_block_epoch(5); + fs_setup.set_user_energy(&rand_user, 1, 6, 1); + fs_setup.set_block_epoch(6); + fs_setup.set_block_nonce(10); fs_setup .b_mock @@ -206,21 +205,119 @@ fn farm_staking_boosted_rewards_with_energy_test() { ) .assert_ok(); - fs_setup.set_block_epoch(8); + // random user tx to collect rewards - week 2 + fs_setup.set_user_energy(&rand_user, 1, 13, 1); + fs_setup.set_block_epoch(13); + fs_setup.set_block_nonce(20); - fs_setup.set_user_energy(&user_address, 10_000, 8, 10); - fs_setup.set_user_energy(&user_address2, 5_000, 8, 10); + fs_setup + .b_mock + .execute_esdt_transfer( + &rand_user, + &fs_setup.farm_wrapper, + FARMING_TOKEN_ID, + 0, + &rust_biguint!(10), + |sc| { + let _ = sc.stake_farm_endpoint(OptionalValue::None); + }, + ) + .assert_ok(); + + fs_setup + .b_mock + .execute_esdt_transfer( + &rand_user, + &fs_setup.farm_wrapper, + FARM_TOKEN_ID, + 7, + &rust_biguint!(10), + |sc| { + let _ = sc.unstake_farm(OptionalValue::None); + }, + ) + .assert_ok(); + + // random user tx to collect rewards - week 3 + fs_setup.set_user_energy(&rand_user, 1, 20, 1); + fs_setup.set_block_epoch(20); + fs_setup.set_block_nonce(30); + + fs_setup + .b_mock + .execute_esdt_transfer( + &rand_user, + &fs_setup.farm_wrapper, + FARMING_TOKEN_ID, + 0, + &rust_biguint!(10), + |sc| { + let _ = sc.stake_farm_endpoint(OptionalValue::None); + }, + ) + .assert_ok(); + + fs_setup + .b_mock + .execute_esdt_transfer( + &rand_user, + &fs_setup.farm_wrapper, + FARM_TOKEN_ID, + 9, + &rust_biguint!(10), + |sc| { + let _ = sc.unstake_farm(OptionalValue::None); + }, + ) + .assert_ok(); - let base_rewards = 34; - let boosted_rewards_user = 13; - let boosted_rewards_user2 = 8; + // random user tx to collect rewards - week 4 + fs_setup.set_user_energy(&rand_user, 1, 27, 1); + fs_setup.set_block_epoch(27); + fs_setup.set_block_nonce(40); + + fs_setup + .b_mock + .execute_esdt_transfer( + &rand_user, + &fs_setup.farm_wrapper, + FARMING_TOKEN_ID, + 0, + &rust_biguint!(10), + |sc| { + let _ = sc.stake_farm_endpoint(OptionalValue::None); + }, + ) + .assert_ok(); + + fs_setup + .b_mock + .execute_esdt_transfer( + &rand_user, + &fs_setup.farm_wrapper, + FARM_TOKEN_ID, + 11, + &rust_biguint!(10), + |sc| { + let _ = sc.unstake_farm(OptionalValue::None); + }, + ) + .assert_ok(); + + fs_setup.set_block_epoch(28); + fs_setup.update_energy_for_user(&user_address); + fs_setup.update_energy_for_user(&user_address2); + + let base_rewards = 136; + let boosted_rewards_user = 61; + let boosted_rewards_user2 = 15; // ~ 1/4 rewards than user1 (half the energy for only 2 weeks) let expected_reward_token_out_user = base_rewards + boosted_rewards_user; let expected_reward_token_out_user2 = base_rewards + boosted_rewards_user2; let expected_farming_token_balance_user = rust_biguint!(USER_TOTAL_RIDE_TOKENS - farm_in_amount + expected_reward_token_out_user); let expected_farming_token_balance_user2 = rust_biguint!(USER_TOTAL_RIDE_TOKENS - farm_in_amount + expected_reward_token_out_user2); - let expected_reward_per_share = 340_000; + let expected_reward_per_share = 1_360_000; fs_setup.claim_rewards( &user_address, farm_in_amount, @@ -228,7 +325,7 @@ fn farm_staking_boosted_rewards_with_energy_test() { expected_reward_token_out_user, &expected_farming_token_balance_user, &expected_farming_token_balance_user, - 7, + 13, expected_reward_per_share, ); fs_setup.claim_rewards( @@ -238,7 +335,7 @@ fn farm_staking_boosted_rewards_with_energy_test() { expected_reward_token_out_user2, &expected_farming_token_balance_user2, &expected_farming_token_balance_user2, - 8, + 14, expected_reward_per_share, ); fs_setup.check_farm_token_supply(farm_in_amount * 2); @@ -926,3 +1023,411 @@ fn position_owner_change_test() { fs_setup.check_user_total_farm_position(&first_user, half_farm_in_amount * 5); fs_setup.check_user_total_farm_position(&second_user, farm_in_amount + half_farm_in_amount * 4); } + +#[test] +fn farm_staking_farm_position_migration_test() { + DebugApi::dummy(); + let mut fs_setup = + FarmStakingSetup::new(farm_staking::contract_obj, energy_factory::contract_obj); + + let user = fs_setup.user_address.clone(); + + let farm_in_amount = 10_000_000; + let half_farm_in_amount = farm_in_amount / 2; + fs_setup.stake_farm(&user, farm_in_amount, &[], 1, 0, 0); + fs_setup.stake_farm(&user, farm_in_amount, &[], 2, 0, 0); + fs_setup.stake_farm(&user, farm_in_amount, &[], 3, 0, 0); + fs_setup.stake_farm(&user, farm_in_amount, &[], 4, 0, 0); + fs_setup.check_user_total_farm_position(&user, farm_in_amount * 4); + + // Simulate migration by resetting the user total farm position + fs_setup + .b_mock + .execute_esdt_transfer( + &user, + &fs_setup.farm_wrapper, + FARMING_TOKEN_ID, + 0, + &rust_biguint!(10), + |sc| { + let mut user_total_farm_position = + sc.get_user_total_farm_position(&managed_address!(&user)); + user_total_farm_position.total_farm_position = managed_biguint!(0u64); + let _ = sc + .user_total_farm_position(&managed_address!(&user)) + .set(user_total_farm_position); + + sc.farm_position_migration_nonce().set(5); + }, + ) + .assert_ok(); + + fs_setup.check_user_total_farm_position(&user, 0); + + let mut expected_total_farm_position = 0u64; + let additional_farm_tokens = [TxTokenTransfer { + token_identifier: FARM_TOKEN_ID.to_vec(), + nonce: 1, + value: rust_biguint!(half_farm_in_amount), + }]; + + // Check enter farm with half old position additional payment + fs_setup.stake_farm(&user, farm_in_amount, &additional_farm_tokens, 5, 0, 0); + expected_total_farm_position += farm_in_amount + half_farm_in_amount; + fs_setup.check_user_total_farm_position(&user, expected_total_farm_position); + + // Check claim with half old position + let expected_farming_token_balance = rust_biguint!(4_949_999_990u64); + fs_setup.claim_rewards( + &user, + half_farm_in_amount, + 2, + 0, + &expected_farming_token_balance, + &expected_farming_token_balance, + 6, + 0, + ); + expected_total_farm_position += half_farm_in_amount; + fs_setup.check_user_total_farm_position(&user, expected_total_farm_position); + + // Check exit with half old position + fs_setup.unstake_farm( + &user, + half_farm_in_amount, + 3, + 0, + &expected_farming_token_balance, + &expected_farming_token_balance, + 7, + half_farm_in_amount, + &UnbondSftAttributes { + unlock_epoch: MIN_UNBOND_EPOCHS, + }, + ); + fs_setup.check_user_total_farm_position(&user, expected_total_farm_position); + + // Check compound with half old position + fs_setup.compound_rewards( + &user, + 4, + half_farm_in_amount, + &[], + 8, + half_farm_in_amount, + 0, + 0, + ); + expected_total_farm_position += half_farm_in_amount; + fs_setup.check_user_total_farm_position(&user, expected_total_farm_position); +} + +#[test] +fn boosted_rewards_config_change_test() { + DebugApi::dummy(); + let mut fs_setup = + FarmStakingSetup::new(farm_staking::contract_obj, energy_factory::contract_obj); + + let first_user = fs_setup.user_address.clone(); + let second_user = fs_setup.user_address2.clone(); + let third_user = fs_setup + .b_mock + .create_user_account(&rust_biguint!(100_000_000)); + fs_setup.b_mock.set_esdt_balance( + &third_user, + FARMING_TOKEN_ID, + &rust_biguint!(USER_TOTAL_RIDE_TOKENS), + ); + + let mut first_user_total_rewards = 0u64; + let mut second_user_total_rewards = 0u64; + let mut third_user_total_rewards = 0u64; + + let farm_in_amount = 10_000_000; + fs_setup.stake_farm(&first_user, farm_in_amount, &[], 1, 0, 0); + fs_setup.stake_farm(&second_user, farm_in_amount, &[], 2, 0, 0); + fs_setup.stake_farm(&third_user, farm_in_amount, &[], 3, 0, 0); + + fs_setup.set_user_energy(&first_user, 10_000, 0, 10); + fs_setup.set_user_energy(&second_user, 10_000, 0, 10); + fs_setup.set_user_energy(&third_user, 10_000, 0, 10); + + // claim to get energy registered + fs_setup + .b_mock + .execute_esdt_transfer( + &first_user, + &fs_setup.farm_wrapper, + FARM_TOKEN_ID, + 1, + &rust_biguint!(farm_in_amount), + |sc| { + let _ = sc.claim_rewards(OptionalValue::None); + }, + ) + .assert_ok(); + fs_setup + .b_mock + .execute_esdt_transfer( + &second_user, + &fs_setup.farm_wrapper, + FARM_TOKEN_ID, + 2, + &rust_biguint!(farm_in_amount), + |sc| { + let _ = sc.claim_rewards(OptionalValue::None); + }, + ) + .assert_ok(); + fs_setup + .b_mock + .execute_esdt_transfer( + &third_user, + &fs_setup.farm_wrapper, + FARM_TOKEN_ID, + 3, + &rust_biguint!(farm_in_amount), + |sc| { + let _ = sc.claim_rewards(OptionalValue::None); + }, + ) + .assert_ok(); + + // random user tx to collect rewards + let rand_user = fs_setup.b_mock.create_user_account(&rust_biguint!(0)); + fs_setup.b_mock.set_esdt_balance( + &rand_user, + FARMING_TOKEN_ID, + &rust_biguint!(USER_TOTAL_RIDE_TOKENS), + ); + + fs_setup.set_user_energy(&rand_user, 1, 6, 1); + fs_setup.set_block_epoch(6); + fs_setup.set_block_nonce(100); + + fs_setup + .b_mock + .execute_esdt_transfer( + &rand_user, + &fs_setup.farm_wrapper, + FARMING_TOKEN_ID, + 0, + &rust_biguint!(10), + |sc| { + let _ = sc.stake_farm_endpoint(OptionalValue::None); + }, + ) + .assert_ok(); + + fs_setup + .b_mock + .execute_esdt_transfer( + &rand_user, + &fs_setup.farm_wrapper, + FARM_TOKEN_ID, + 7, + &rust_biguint!(10), + |sc| { + let _ = sc.unstake_farm(OptionalValue::None); + }, + ) + .assert_ok(); + + fs_setup.set_block_epoch(7); + fs_setup.set_user_energy(&first_user, 10_000, 7, 10); + fs_setup.set_user_energy(&second_user, 10_000, 7, 10); + fs_setup.set_user_energy(&third_user, 10_000, 7, 10); + + // First user claims + let mut base_rewards1 = 33; + let mut boosted_rewards1 = 0; + let mut expected_reward_token_out = base_rewards1 + boosted_rewards1; + first_user_total_rewards += expected_reward_token_out; + let mut expected_farming_token_balance = + rust_biguint!(USER_TOTAL_RIDE_TOKENS - farm_in_amount + expected_reward_token_out); + let mut expected_reward_per_share = 3_333_333u64; + fs_setup.claim_rewards( + &first_user, + farm_in_amount, + 4, + expected_reward_token_out, + &expected_farming_token_balance, + &expected_farming_token_balance, + 9, + expected_reward_per_share, + ); + + // Boosted rewards config is added + fs_setup.set_boosted_yields_factors(); + fs_setup.set_boosted_yields_rewards_percentage(BOOSTED_YIELDS_PERCENTAGE); + + // random user tx to collect rewards + fs_setup.set_user_energy(&rand_user, 1, 13, 1); + fs_setup.set_block_epoch(13); + fs_setup.set_block_nonce(200); + + fs_setup + .b_mock + .execute_esdt_transfer( + &rand_user, + &fs_setup.farm_wrapper, + FARMING_TOKEN_ID, + 0, + &rust_biguint!(10), + |sc| { + let _ = sc.stake_farm_endpoint(OptionalValue::None); + }, + ) + .assert_ok(); + + fs_setup + .b_mock + .execute_esdt_transfer( + &rand_user, + &fs_setup.farm_wrapper, + FARM_TOKEN_ID, + 10, + &rust_biguint!(10), + |sc| { + let _ = sc.unstake_farm(OptionalValue::None); + }, + ) + .assert_ok(); + + fs_setup.set_block_epoch(14); + fs_setup.set_user_energy(&first_user, 10_000, 14, 10); + fs_setup.set_user_energy(&second_user, 10_000, 14, 10); + fs_setup.set_user_energy(&third_user, 10_000, 14, 10); + + // First and second users claim + base_rewards1 = 25; + boosted_rewards1 = 8; + expected_reward_token_out = base_rewards1 + boosted_rewards1; + first_user_total_rewards += expected_reward_token_out; + expected_farming_token_balance += expected_reward_token_out; + expected_reward_per_share = 5_833_333u64; + fs_setup.claim_rewards( + &first_user, + farm_in_amount, + 9, + expected_reward_token_out, + &expected_farming_token_balance, + &expected_farming_token_balance, + 12, + expected_reward_per_share, + ); + + let mut base_rewards2 = 33 + 25; + let mut boosted_rewards2 = 8; + let mut expected_reward_token_out2 = base_rewards2 + boosted_rewards2; + second_user_total_rewards += expected_reward_token_out2; + let mut expected_farming_token_balance2 = + rust_biguint!(USER_TOTAL_RIDE_TOKENS - farm_in_amount + expected_reward_token_out2); + fs_setup.claim_rewards( + &second_user, + farm_in_amount, + 5, + expected_reward_token_out2, + &expected_farming_token_balance2, + &expected_farming_token_balance2, + 13, + expected_reward_per_share, + ); + + // Boosted rewards config is updated + fs_setup.set_boosted_yields_rewards_percentage(BOOSTED_YIELDS_PERCENTAGE * 2); // 50% + + // random user tx to collect rewards + fs_setup.set_user_energy(&rand_user, 1, 20, 1); + fs_setup.set_block_epoch(20); + fs_setup.set_block_nonce(300); + + fs_setup + .b_mock + .execute_esdt_transfer( + &rand_user, + &fs_setup.farm_wrapper, + FARMING_TOKEN_ID, + 0, + &rust_biguint!(10), + |sc| { + let _ = sc.stake_farm_endpoint(OptionalValue::None); + }, + ) + .assert_ok(); + + fs_setup + .b_mock + .execute_esdt_transfer( + &rand_user, + &fs_setup.farm_wrapper, + FARM_TOKEN_ID, + 14, + &rust_biguint!(10), + |sc| { + let _ = sc.unstake_farm(OptionalValue::None); + }, + ) + .assert_ok(); + + fs_setup.set_block_epoch(21); + fs_setup.set_user_energy(&first_user, 10_000, 21, 10); + fs_setup.set_user_energy(&second_user, 10_000, 21, 10); + fs_setup.set_user_energy(&third_user, 10_000, 21, 10); + + // All users claim - boosted rewards 50% + base_rewards1 = 16; + boosted_rewards1 = 16; + expected_reward_token_out = base_rewards1 + boosted_rewards1; + first_user_total_rewards += expected_reward_token_out; + expected_farming_token_balance += expected_reward_token_out; + expected_reward_per_share = 7_499_999u64; + fs_setup.claim_rewards( + &first_user, + farm_in_amount, + 12, + expected_reward_token_out, + &expected_farming_token_balance, + &expected_farming_token_balance, + 16, + expected_reward_per_share, + ); + + base_rewards2 = 16; + boosted_rewards2 = 16; + expected_reward_token_out2 = base_rewards2 + boosted_rewards2; + second_user_total_rewards += expected_reward_token_out2; + expected_farming_token_balance2 += expected_reward_token_out2; + fs_setup.claim_rewards( + &second_user, + farm_in_amount, + 13, + expected_reward_token_out2, + &expected_farming_token_balance2, + &expected_farming_token_balance2, + 17, + expected_reward_per_share, + ); + + let base_rewards3 = 74; + let boosted_rewards3 = 24; + let expected_reward_token_out3 = base_rewards3 + boosted_rewards3; + third_user_total_rewards += expected_reward_token_out3; + let expected_farming_token_balance3 = + rust_biguint!(USER_TOTAL_RIDE_TOKENS - farm_in_amount + expected_reward_token_out3); + fs_setup.claim_rewards( + &third_user, + farm_in_amount, + 6, + expected_reward_token_out3, + &expected_farming_token_balance3, + &expected_farming_token_balance3, + 18, + expected_reward_per_share, + ); + + assert!( + first_user_total_rewards == second_user_total_rewards + && first_user_total_rewards == third_user_total_rewards + ); +} diff --git a/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs b/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs index c0329a2f6..7bcab9d85 100644 --- a/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs +++ b/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs @@ -1,6 +1,7 @@ #![allow(deprecated)] use farm_staking::claim_only_boosted_staking_rewards::ClaimOnlyBoostedStakingRewardsModule; +use farm_staking::compound_stake_farm_rewards::CompoundStakeFarmRewardsModule; use multiversx_sc::codec::multi_types::OptionalValue; use multiversx_sc::storage::mappers::StorageTokenWrapper; use multiversx_sc::types::{Address, BigInt, EsdtLocalRole, ManagedAddress, MultiValueEncoded}; @@ -389,6 +390,60 @@ where .assert_error(4, "Cannot claim rewards for this address"); } + pub fn compound_rewards( + &mut self, + user: &Address, + farm_in_nonce: u64, + farm_in_amount: u64, + additional_farm_tokens: &[TxTokenTransfer], + expected_farm_token_nonce: u64, + expected_farm_token_amount: u64, + expected_reward_per_share: u64, + expected_compounded_reward: u64, + ) { + let mut payments = Vec::with_capacity(1 + additional_farm_tokens.len()); + payments.push(TxTokenTransfer { + token_identifier: FARM_TOKEN_ID.to_vec(), + nonce: farm_in_nonce, + value: rust_biguint!(farm_in_amount), + }); + payments.extend_from_slice(additional_farm_tokens); + + self.b_mock + .execute_esdt_multi_transfer(user, &self.farm_wrapper, &payments, |sc| { + let new_farm_token_payment = sc.compound_rewards(); + assert_eq!( + new_farm_token_payment.token_identifier, + managed_token_id!(FARM_TOKEN_ID) + ); + assert_eq!( + new_farm_token_payment.token_nonce, + expected_farm_token_nonce + ); + assert_eq!( + new_farm_token_payment.amount, + managed_biguint!(expected_farm_token_amount) + ); + }) + .assert_ok(); + + let expected_attributes = StakingFarmTokenAttributes:: { + reward_per_share: managed_biguint!(expected_reward_per_share), + compounded_reward: managed_biguint!(expected_compounded_reward), + current_farm_amount: managed_biguint!( + expected_farm_token_amount + expected_compounded_reward + ), + original_owner: managed_address!(&user), + }; + self.b_mock.check_nft_balance( + user, + FARM_TOKEN_ID, + expected_farm_token_nonce, + &rust_biguint!(expected_farm_token_amount + expected_compounded_reward), + Some(&expected_attributes), + ); + } + #[allow(clippy::too_many_arguments)] pub fn unstake_farm( &mut self, @@ -705,4 +760,19 @@ where }) .assert_ok(); } + + pub fn update_energy_for_user(&mut self, user_addr: &Address) { + self.b_mock + .execute_tx( + user_addr, + &self.energy_factory_wrapper, + &rust_biguint!(0), + |sc| { + let user_energy = + sc.get_updated_energy_entry_for_user(&managed_address!(user_addr)); + sc.set_energy_entry(&managed_address!(user_addr), user_energy); + }, + ) + .assert_ok(); + } } From 6eb71131f3be086fd9ee1f4b3401bbfa610106de Mon Sep 17 00:00:00 2001 From: Costin Carabas Date: Wed, 24 Apr 2024 10:15:05 +0300 Subject: [PATCH 34/55] proxy_dex: more unit tests --- .../tests/proxy_dex_test_setup/mod.rs | 22 ++- .../proxy_dex/tests/proxy_farm_test.rs | 180 ++++++++++++++++++ locked-asset/proxy_dex/tests/proxy_lp_test.rs | 52 +---- 3 files changed, 208 insertions(+), 46 deletions(-) diff --git a/locked-asset/proxy_dex/tests/proxy_dex_test_setup/mod.rs b/locked-asset/proxy_dex/tests/proxy_dex_test_setup/mod.rs index 2ab0326d4..322fedd61 100644 --- a/locked-asset/proxy_dex/tests/proxy_dex_test_setup/mod.rs +++ b/locked-asset/proxy_dex/tests/proxy_dex_test_setup/mod.rs @@ -1,5 +1,6 @@ #![allow(deprecated)] +use common_structs::{LockedAssetTokenAttributesEx, UnlockMilestoneEx, UnlockScheduleEx}; use config::ConfigModule; use energy_factory::{locked_token_transfer::LockedTokenTransferModule, SimpleLockEnergy}; use energy_query::EnergyQueryModule; @@ -11,7 +12,7 @@ use multiversx_sc::{ codec::multi_types::OptionalValue, contract_base::{CallableContract, ContractBase}, storage::mappers::StorageTokenWrapper, - types::{Address, EsdtLocalRole, ManagedAddress, MultiValueEncoded}, + types::{Address, EsdtLocalRole, ManagedAddress, ManagedVec, MultiValueEncoded}, }; use multiversx_sc_modules::pause::PauseModule; use multiversx_sc_scenario::{ @@ -151,6 +152,25 @@ where b_mock.set_esdt_balance(&second_user, MEX_TOKEN_ID, &user_balance); b_mock.set_esdt_balance(&second_user, WEGLD_TOKEN_ID, &user_balance); + let mut unlock_milestones = ManagedVec::::new(); + unlock_milestones.push(UnlockMilestoneEx { + unlock_percent: 10_000, + unlock_epoch: LOCK_OPTIONS[0], + }); + + let old_token_attributes = LockedAssetTokenAttributesEx { + is_merged: false, + unlock_schedule: UnlockScheduleEx { unlock_milestones }, + }; + b_mock.set_nft_balance( + &first_user, + LEGACY_LOCKED_TOKEN_ID, + 3, // higher random nonce to avoid nonce caching conflicts + &rust_biguint!(USER_BALANCE), + &old_token_attributes, + ); + + // users lock tokens b_mock .execute_esdt_transfer( diff --git a/locked-asset/proxy_dex/tests/proxy_farm_test.rs b/locked-asset/proxy_dex/tests/proxy_farm_test.rs index 9692a945b..5af54011c 100644 --- a/locked-asset/proxy_dex/tests/proxy_farm_test.rs +++ b/locked-asset/proxy_dex/tests/proxy_farm_test.rs @@ -1181,6 +1181,186 @@ fn different_farm_locked_token_nonce_merging_test() { ); } + + +#[test] +fn total_farm_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); + setup + .b_mock + .set_esdt_balance(&first_user, MEX_TOKEN_ID, &user_balance); + + // users lock tokens + setup + .b_mock + .execute_esdt_transfer( + &first_user, + &setup.simple_lock_wrapper, + MEX_TOKEN_ID, + 0, + &user_balance, + |sc| { + let user_payment = sc.lock_tokens_endpoint(LOCK_OPTIONS[1], OptionalValue::None); + assert_eq!(user_payment.token_nonce, 2); + assert_eq!(user_payment.amount, managed_biguint!(USER_BALANCE)); + }, + ) + .assert_ok(); + + let mut block_epoch = 1; + setup.b_mock.set_block_epoch(block_epoch); + + //////////////////////////////////////////// ENTER FARM ///////////////////////////////////// + + setup + .b_mock + .execute_esdt_transfer( + &first_user, + &setup.proxy_wrapper, + LOCKED_TOKEN_ID, + 1, + &rust_biguint!(USER_BALANCE), + |sc| { + sc.enter_farm_proxy_endpoint(managed_address!(&farm_addr), OptionalValue::None); + }, + ) + .assert_ok(); + + block_epoch += 7; + setup.b_mock.set_block_epoch(block_epoch); + + 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.check_nft_balance( + &first_user, + WRAPPED_FARM_TOKEN_ID, + 1, + &rust_biguint!(USER_BALANCE), + Some(&WrappedFarmTokenAttributes:: { + proxy_farming_token: EsdtTokenPayment { + token_identifier: managed_token_id!(LOCKED_TOKEN_ID), + token_nonce: 1, + amount: managed_biguint!(USER_BALANCE), + }, + farm_token: EsdtTokenPayment { + token_identifier: managed_token_id!(FARM_LOCKED_TOKEN_ID), + token_nonce: 1, + amount: managed_biguint!(USER_BALANCE), + }, + }), + ); + + setup.b_mock.check_nft_balance( + &first_user, + WRAPPED_FARM_TOKEN_ID, + 2, + &rust_biguint!(USER_BALANCE), + Some(&WrappedFarmTokenAttributes:: { + proxy_farming_token: EsdtTokenPayment { + token_identifier: managed_token_id!(LOCKED_TOKEN_ID), + token_nonce: 2, + amount: managed_biguint!(USER_BALANCE), + }, + farm_token: EsdtTokenPayment { + token_identifier: managed_token_id!(FARM_LOCKED_TOKEN_ID), + token_nonce: 2, + amount: managed_biguint!(USER_BALANCE), + }, + }), + ); + + //////////////////////////////////////////// CLAIM REWARDS ///////////////////////////////////// + + // claim rewards + setup + .b_mock + .execute_esdt_transfer( + &first_user, + &setup.proxy_wrapper, + WRAPPED_FARM_TOKEN_ID, + 1, + &rust_biguint!(USER_BALANCE), + |sc| { + sc.claim_rewards_proxy(managed_address!(&farm_addr), OptionalValue::None); + }, + ) + .assert_ok(); + + // check user balance + setup.b_mock.check_nft_balance::( + &first_user, + LOCKED_TOKEN_ID, + 2, + &rust_biguint!(0), + None, + ); + setup.b_mock.check_nft_balance::( + &first_user, + LOCKED_TOKEN_ID, + 1, + &rust_biguint!(0), + None, + ); + + setup.b_mock.check_nft_balance( + &first_user, + WRAPPED_FARM_TOKEN_ID, + 3, + &rust_biguint!(USER_BALANCE), + Some(&WrappedFarmTokenAttributes:: { + proxy_farming_token: EsdtTokenPayment { + token_identifier: managed_token_id!(LOCKED_TOKEN_ID), + token_nonce: 1, + amount: managed_biguint!(USER_BALANCE), + }, + farm_token: EsdtTokenPayment { + token_identifier: managed_token_id!(FARM_LOCKED_TOKEN_ID), + token_nonce: 3, + amount: managed_biguint!(USER_BALANCE), + }, + }), + ); + // new NFT + setup.b_mock.check_nft_balance( + &first_user, + WRAPPED_FARM_TOKEN_ID, + 2, + &rust_biguint!(USER_BALANCE), + Some(&WrappedFarmTokenAttributes:: { + proxy_farming_token: EsdtTokenPayment { + token_identifier: managed_token_id!(LOCKED_TOKEN_ID), + token_nonce: 2, + amount: managed_biguint!(USER_BALANCE), + }, + farm_token: EsdtTokenPayment { + token_identifier: managed_token_id!(FARM_LOCKED_TOKEN_ID), + token_nonce: 2, + amount: managed_biguint!(USER_BALANCE), + }, + }), + ); +} + #[test] fn increase_proxy_farm_lkmex_energy() { let mut setup = ProxySetup::new( diff --git a/locked-asset/proxy_dex/tests/proxy_lp_test.rs b/locked-asset/proxy_dex/tests/proxy_lp_test.rs index 90e511568..4dab8b14a 100644 --- a/locked-asset/proxy_dex/tests/proxy_lp_test.rs +++ b/locked-asset/proxy_dex/tests/proxy_lp_test.rs @@ -1263,8 +1263,8 @@ fn increase_proxy_lp_legacy_token_energy() { // set the price to 1 EGLD = 2 MEX let payments = vec![ TxTokenTransfer { - token_identifier: LOCKED_TOKEN_ID.to_vec(), - nonce: 1, + token_identifier: LEGACY_LOCKED_TOKEN_ID.to_vec(), + nonce: 3, value: locked_token_amount.clone(), }, TxTokenTransfer { @@ -1290,8 +1290,8 @@ fn increase_proxy_lp_legacy_token_energy() { // check user's balance setup.b_mock.check_nft_balance::( &first_user, - LOCKED_TOKEN_ID, - 1, + LEGACY_LOCKED_TOKEN_ID, + 3, &(&full_balance - &locked_token_amount), None, ); @@ -1307,8 +1307,8 @@ fn increase_proxy_lp_legacy_token_energy() { &expected_lp_token_amount, Some(&WrappedLpTokenAttributes:: { locked_tokens: EsdtTokenPayment { - token_identifier: managed_token_id!(LOCKED_TOKEN_ID), - token_nonce: 1, + token_identifier: managed_token_id!(LEGACY_LOCKED_TOKEN_ID), + token_nonce: 3, amount: managed_biguint!(locked_token_amount.to_u64().unwrap()), }, lp_token_id: managed_token_id!(LP_TOKEN_ID), @@ -1317,7 +1317,6 @@ fn increase_proxy_lp_legacy_token_energy() { ); let block_epoch = 1; - let user_locked_tokens_in_lp = locked_token_amount.to_u64().unwrap(); // check user energy before setup @@ -1349,42 +1348,5 @@ fn increase_proxy_lp_legacy_token_energy() { let _ = sc.increase_proxy_pair_token_energy_endpoint(LOCK_OPTIONS[1]); }, ) - .assert_ok(); - - // chceck new wrapped lp token - setup.b_mock.check_nft_balance( - &first_user, - WRAPPED_LP_TOKEN_ID, - 2, - &expected_lp_token_amount, - Some(&WrappedLpTokenAttributes:: { - locked_tokens: EsdtTokenPayment { - token_identifier: managed_token_id!(LOCKED_TOKEN_ID), - token_nonce: 2, - amount: managed_biguint!(locked_token_amount.to_u64().unwrap()), - }, - lp_token_id: managed_token_id!(LP_TOKEN_ID), - lp_token_amount: managed_biguint!(expected_lp_token_amount.to_u64().unwrap()), - }), - ); - - // check user energy after - setup - .b_mock - .execute_query(&setup.simple_lock_wrapper, |sc| { - let first_lock_epochs = LOCK_OPTIONS[1] - block_epoch; - let second_lock_epochs = LOCK_OPTIONS[0] - block_epoch; - let expected_energy_amount = BigInt::from((user_locked_tokens_in_lp) as i64) - * BigInt::from(first_lock_epochs as i64) - + BigInt::from((USER_BALANCE - user_locked_tokens_in_lp) as i64) - * BigInt::from(second_lock_epochs as i64); - let expected_energy = Energy::new( - expected_energy_amount, - block_epoch, - managed_biguint!(USER_BALANCE), - ); - let actual_energy = sc.user_energy(&managed_address!(&first_user)).get(); - assert_eq!(expected_energy, actual_energy); - }) - .assert_ok(); + .assert_error(4, "Invalid payment"); } \ No newline at end of file From a9bcc26c5b1091f5ab5721fe38262b14ed4fa030 Mon Sep 17 00:00:00 2001 From: Mihai Calin Luca Date: Wed, 24 Apr 2024 16:43:13 +0200 Subject: [PATCH 35/55] design change, reorg and progress for farm with locked rewards and pair --- Cargo.lock | 48 +++-- dex/interactor/src/dex_interact.rs | 46 +---- dex/interactor/src/dex_interact_cli.rs | 2 - .../src/dex_interact_farm_locked.rs | 167 ++++++++++++++++-- dex/interactor/src/dex_interact_pair.rs | 94 ++++------ dex/interactor/src/structs.rs | 80 +++++++++ 6 files changed, 309 insertions(+), 128 deletions(-) create mode 100644 dex/interactor/src/structs.rs diff --git a/Cargo.lock b/Cargo.lock index 08269a9aa..be849fbd9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1404,12 +1404,10 @@ name = "interactor" version = "0.0.0" dependencies = [ "clap", - "common_structs", "multiversx-sc-modules", "multiversx-sc-scenario", "multiversx-sc-snippets", - "pausable", - "permissions_module", + "proxies", "serde", "toml", ] @@ -1681,9 +1679,9 @@ checksum = "b59072fa0624b55ae5ae3fa6bfa91515bbeb4ac440214bc4a509e2c8806d6e9f" [[package]] name = "multiversx-sc" -version = "0.49.0-alpha.3" +version = "0.49.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3294c0d990001b56d4b6a9fdecbc5a9bc0f9c49f9b5650c0ebc7535ed1949f3f" +checksum = "c86c9822909c32b10ad50f376d2a710ff465b806aa710874c0417053fdc16530" dependencies = [ "bitflags 2.4.2", "hex-literal 0.4.1", @@ -1717,9 +1715,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.49.0-alpha.3" +version = "0.49.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74c63eebab4c614574ec02fb380da77edf49c8af01881f0d7543fb4b56dc6ef6" +checksum = "bc4fe5b47d3d7e51b8c2ed6a7c6d656885875cd3d41931193c364fe8ec7814d8" dependencies = [ "hex", "proc-macro2", @@ -1730,9 +1728,9 @@ dependencies = [ [[package]] name = "multiversx-sc-meta" -version = "0.49.0-alpha.3" +version = "0.49.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9a23a7ad8f945474ecce36641cbbe20baa6945ee281dafa467b75495206c4f" +checksum = "226c52919dfc89df47817ee053c6ea4eddaeca15e1cd3d927c65b805d1d3b6a6" dependencies = [ "clap", "colored", @@ -1757,18 +1755,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.49.0-alpha.3" +version = "0.49.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6abecca08ba936b66dbb841f08d95550c20d0dcbbe5a0022a23d31d662bd0447" +checksum = "ddb52421af0c8c451b023a13671f7a9bda3e934d41bfe0a9a8296c4ffc991b1a" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-scenario" -version = "0.49.0-alpha.3" +version = "0.49.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9acdd0442fa078d6374f65e04a1eaa2d29bf5ef601972384ba3399689eb6173" +checksum = "cd56212a3d90aedeb217203d76e28da52b3b5cd46aab5fc62998256aa3bbaf77" dependencies = [ "base64", "bech32", @@ -1794,9 +1792,9 @@ dependencies = [ [[package]] name = "multiversx-sc-snippets" -version = "0.49.0-alpha.3" +version = "0.49.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5721598414c1867204596d88826fad4923c41b3f927867967095d0a20e6709af" +checksum = "3770569d5c943a4be1c9e81188e52f984eb16c49b06851cec07893cb3d0e811a" dependencies = [ "base64", "env_logger", @@ -1805,14 +1803,15 @@ dependencies = [ "log", "multiversx-sc-scenario", "multiversx-sdk", + "rand 0.8.5", "tokio", ] [[package]] name = "multiversx-sdk" -version = "0.3.2" +version = "0.4.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46d709ddf46c50a407ce4b90ff487e854926d47f80de6abfe4a4adca3eaa7964" +checksum = "f898859f51bfcb010bad5cb9080f8872bd023a78db2a523cdc6af083a400d328" dependencies = [ "anyhow", "base64", @@ -2157,6 +2156,21 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "proxies" +version = "0.0.0" +dependencies = [ + "common_structs", + "config", + "energy-factory", + "farm-boosted-yields", + "multiversx-sc", + "multiversx-sc-scenario", + "pausable", + "permissions_module", + "weekly-rewards-splitting", +] + [[package]] name = "proxy-deployer" version = "0.0.0" diff --git a/dex/interactor/src/dex_interact.rs b/dex/interactor/src/dex_interact.rs index 18c067cbc..81ff0dca2 100644 --- a/dex/interactor/src/dex_interact.rs +++ b/dex/interactor/src/dex_interact.rs @@ -3,13 +3,16 @@ mod dex_interact_config; mod dex_interact_farm_locked; mod dex_interact_pair; mod dex_interact_state; +mod structs; -use proxies::*; use clap::Parser; use dex_interact_cli::AddArgs; use dex_interact_config::Config; +use dex_interact_farm_locked::{FarmLocked, FarmLockedTrait}; +use dex_interact_pair::{Pair, PairTrait}; use dex_interact_state::State; use multiversx_sc_snippets::imports::*; +use proxies::*; #[tokio::main] async fn main() { @@ -20,23 +23,11 @@ async fn main() { let cli = dex_interact_cli::InteractCli::parse(); match &cli.command { - Some(dex_interact_cli::InteractCliCommand::Pause) => { - dex_interact.pause().await; - } Some(dex_interact_cli::InteractCliCommand::Swap(args)) => { - dex_interact - .swap_tokens_fixed_input(args.amount, args.min_amount) - .await; + Pair::swap_tokens_fixed_input(&mut dex_interact, args).await; } Some(dex_interact_cli::InteractCliCommand::Add(args)) => { - dex_interact - .add_liquidity( - args.first_payment_amount, - args.second_payment_amount, - args.first_token_amount_min, - args.second_token_amount_min, - ) - .await; + Pair::add_liquidity(&mut dex_interact, args).await; } Some(dex_interact_cli::InteractCliCommand::FullFarm(args)) => { dex_interact.full_farm_scenario(args).await; @@ -78,29 +69,8 @@ impl DexInteract { } async fn full_farm_scenario(&mut self, args: &AddArgs) { - let (_, _, lp_token) = self - .add_liquidity( - args.first_payment_amount, - args.second_payment_amount, - args.first_token_amount_min, - args.second_token_amount_min, - ) - .await; - let _result = self.enter_farm(lp_token).await; + let (_, _, lp_token) = Pair::add_liquidity(self, args).await; + let _result = FarmLocked::enter_farm(self, lp_token).await; //TODO } - - async fn pause(&mut self) { - println!("Attempting to pause pair contract..."); - - self.interactor - .tx() - .from(&self.wallet_address) - .to(self.state.current_pair_address()) - .typed(pair_proxy::PairProxy) - .pause() - .prepare_async() - .run() - .await; - } } diff --git a/dex/interactor/src/dex_interact_cli.rs b/dex/interactor/src/dex_interact_cli.rs index 1aa4eff25..8ec2c2f64 100644 --- a/dex/interactor/src/dex_interact_cli.rs +++ b/dex/interactor/src/dex_interact_cli.rs @@ -12,8 +12,6 @@ pub struct InteractCli { /// Dex Interact CLI Commands #[derive(Clone, PartialEq, Eq, Debug, Subcommand)] pub enum InteractCliCommand { - #[command(name = "pause", about = "Pause pair contract")] - Pause, #[command(name = "swap", about = "Swaps token with a minimum return amount")] Swap(SwapArgs), #[command(name = "add_liquidity", about = "Adds liquidity to a pair")] diff --git a/dex/interactor/src/dex_interact_farm_locked.rs b/dex/interactor/src/dex_interact_farm_locked.rs index 66cf97a30..a230f98f6 100644 --- a/dex/interactor/src/dex_interact_farm_locked.rs +++ b/dex/interactor/src/dex_interact_farm_locked.rs @@ -1,32 +1,173 @@ -use multiversx_sc_scenario::imports::{BigUint, ManagedAddress, ReturnsResult, TokenIdentifier}; +use multiversx_sc_scenario::{ + api::StaticApi, + imports::{ + Address, EsdtTokenPayment, ManagedAddress, ManagedVec, OptionalValue, ReturnsResult, + }, +}; use multiversx_sc_snippets::InteractorPrepareAsync; -use crate::{dex_interact_pair::InteractorToken, farm_with_locked_rewards_proxy, DexInteract}; +use crate::{farm_with_locked_rewards_proxy, structs::InteractorToken, DexInteract}; -impl DexInteract { - pub async fn enter_farm( - &mut self, +pub struct FarmLocked; + +pub trait FarmLockedTrait { + async fn enter_farm( + dex_interact: &mut DexInteract, + lp_token: InteractorToken, + ) -> (InteractorToken, InteractorToken); + async fn claim_rewards( + dex_interact: &mut DexInteract, + payment: Vec, + opt_original_caller: Option
, + ) -> (InteractorToken, InteractorToken); + async fn exit_farm( + dex_interact: &mut DexInteract, + payment: InteractorToken, + opt_original_caller: Option
, + ) -> (InteractorToken, InteractorToken); + async fn merge_farm_tokens( + dex_interact: &mut DexInteract, + payment: Vec, + opt_original_caller: Option
, + ) -> (InteractorToken, InteractorToken); +} + +impl FarmLockedTrait for FarmLocked { + async fn enter_farm( + dex_interact: &mut DexInteract, lp_token: InteractorToken, ) -> (InteractorToken, InteractorToken) { println!("Attempting to enter farm with locked rewards..."); - let result_token = self + let result_token = dex_interact .interactor .tx() - .from(&self.wallet_address) - .to(self.state.current_farm_with_locked_rewards_address()) + .from(&dex_interact.wallet_address) + .to(dex_interact + .state + .current_farm_with_locked_rewards_address()) .gas(100_000_000u64) .typed(farm_with_locked_rewards_proxy::FarmProxy) - .enter_farm_endpoint(ManagedAddress::from(self.wallet_address.as_address())) - .payment(( - TokenIdentifier::from(lp_token.token_id.as_bytes()), - lp_token.nonce, - BigUint::from(lp_token.amount), + .enter_farm_endpoint(ManagedAddress::from( + dex_interact.wallet_address.as_address(), )) + .payment::>(lp_token.into()) + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + ( + InteractorToken::from(result_token.0 .0), + InteractorToken::from(result_token.0 .1), + ) + } + + async fn claim_rewards( + dex_interact: &mut DexInteract, + payment: Vec, + opt_original_caller: Option
, + ) -> (InteractorToken, InteractorToken) { + println!("Attempting to claim rewards from farm with locked rewards..."); + + let payments = payment + .iter() + .map(EsdtTokenPayment::from) + .collect::>>(); + + let caller = + opt_original_caller.unwrap_or_else(|| dex_interact.wallet_address.to_address()); + let caller_arg: OptionalValue> = + OptionalValue::Some(ManagedAddress::from(caller)); + + let result_token = dex_interact + .interactor + .tx() + .from(&dex_interact.wallet_address) + .to(dex_interact + .state + .current_farm_with_locked_rewards_address()) + .gas(100_000_000u64) + .typed(farm_with_locked_rewards_proxy::FarmProxy) + .claim_rewards_endpoint(caller_arg) + .payment(&payments) + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + ( + InteractorToken::from(result_token.0 .0), + InteractorToken::from(result_token.0 .1), + ) + } + + async fn exit_farm( + dex_interact: &mut DexInteract, + payment: InteractorToken, + opt_original_caller: Option
, + ) -> (InteractorToken, InteractorToken) { + println!("Attempting to exit farm with locked rewards..."); + + let caller = + opt_original_caller.unwrap_or_else(|| dex_interact.wallet_address.to_address()); + let caller_arg: OptionalValue> = + OptionalValue::Some(ManagedAddress::from(caller)); + + let result_token = dex_interact + .interactor + .tx() + .from(&dex_interact.wallet_address) + .to(dex_interact + .state + .current_farm_with_locked_rewards_address()) + .gas(100_000_000u64) + .typed(farm_with_locked_rewards_proxy::FarmProxy) + .exit_farm_endpoint(caller_arg) + .payment::>(payment.into()) + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + ( + InteractorToken::from(result_token.0 .0), + InteractorToken::from(result_token.0 .1), + ) + } + + async fn merge_farm_tokens( + dex_interact: &mut DexInteract, + payment: Vec, + opt_original_caller: Option
, + ) -> (InteractorToken, InteractorToken) { + println!("Attempting to merge tokens in farm with locked rewards..."); + + let payments = payment + .iter() + .map(EsdtTokenPayment::from) + .collect::>>(); + + let caller = + opt_original_caller.unwrap_or_else(|| dex_interact.wallet_address.to_address()); + let caller_arg: OptionalValue> = + OptionalValue::Some(ManagedAddress::from(caller)); + + let result_token = dex_interact + .interactor + .tx() + .from(&dex_interact.wallet_address) + .to(dex_interact + .state + .current_farm_with_locked_rewards_address()) + .gas(100_000_000u64) + .typed(farm_with_locked_rewards_proxy::FarmProxy) + .merge_farm_tokens_endpoint(caller_arg) + .payment(payments) .returns(ReturnsResult) .prepare_async() .run() .await; + ( InteractorToken::from(result_token.0 .0), InteractorToken::from(result_token.0 .1), diff --git a/dex/interactor/src/dex_interact_pair.rs b/dex/interactor/src/dex_interact_pair.rs index 0948afa94..f9b7db221 100644 --- a/dex/interactor/src/dex_interact_pair.rs +++ b/dex/interactor/src/dex_interact_pair.rs @@ -1,97 +1,75 @@ -use multiversx_sc_scenario::imports::{BigUint, ManagedVec, RustBigUint, TokenIdentifier}; -use multiversx_sc_scenario::imports::{EsdtTokenPayment, ManagedTypeApi, ReturnsResult}; +use multiversx_sc_scenario::imports::{BigUint, ReturnsResult, TokenIdentifier}; use multiversx_sc_snippets::InteractorPrepareAsync; +use crate::dex_interact_cli::{AddArgs, SwapArgs}; +use crate::structs::InteractorToken; use crate::DexInteract; use proxies::pair_proxy; -pub struct InteractorToken { - pub token_id: String, - pub nonce: u64, - pub amount: RustBigUint, -} +pub struct Pair; -impl From> for InteractorToken { - fn from(value: EsdtTokenPayment) -> Self { - InteractorToken { - token_id: value.token_identifier.to_string(), - nonce: value.token_nonce, - amount: RustBigUint::from_bytes_be(value.amount.to_bytes_be().as_slice()), - } - } +pub trait PairTrait { + async fn swap_tokens_fixed_input( + dex_interact: &mut DexInteract, + args: &SwapArgs, + ) -> InteractorToken; + async fn add_liquidity( + dex_interact: &mut DexInteract, + args: &AddArgs, + ) -> (InteractorToken, InteractorToken, InteractorToken); } -impl DexInteract { - pub async fn swap_tokens_fixed_input( - &mut self, - amount_to_swap: u128, - min_amount_to_receive: u128, +impl PairTrait for Pair { + async fn swap_tokens_fixed_input( + dex_interact: &mut DexInteract, + args: &SwapArgs, ) -> InteractorToken { - let first_token_id = self.state.first_token_id(); - let second_token_id = self.state.second_token_id(); + let payment = args.as_payment(dex_interact); + let first_token_id = dex_interact.state.first_token_id(); + let second_token_id = dex_interact.state.second_token_id(); println!( - "Attempting to swap {amount_to_swap} {first_token_id} for a min amount {min_amount_to_receive} of {second_token_id}..." + "Attempting to swap {} {first_token_id} for a min amount {} of {second_token_id}...", + args.amount, args.min_amount ); - let result_token = self + let result_token = dex_interact .interactor .tx() - .from(&self.wallet_address) - .to(self.state.current_pair_address()) + .from(&dex_interact.wallet_address) + .to(dex_interact.state.current_pair_address()) .gas(100_000_000u64) .typed(pair_proxy::PairProxy) .swap_tokens_fixed_input( TokenIdentifier::from(second_token_id.as_bytes()), - BigUint::from(min_amount_to_receive), + BigUint::from(args.min_amount), ) - .payment(( - TokenIdentifier::from(first_token_id.as_bytes()), - 0, - BigUint::from(amount_to_swap), - )) + .payment(payment) .returns(ReturnsResult) .prepare_async() .run() .await; - println!("Result token {:#?}", result_token); - InteractorToken::from(result_token) } - pub async fn add_liquidity( - &mut self, - first_payment_amount: u128, - second_payment_amount: u128, - first_token_amount_min: u128, - second_token_amount_min: u128, + async fn add_liquidity( + dex_interact: &mut DexInteract, + args: &AddArgs, ) -> (InteractorToken, InteractorToken, InteractorToken) { println!("Attempting to add liquidity to pair..."); - let first_token_id = self.state.first_token_id().as_bytes(); - let second_token_id = self.state.second_token_id().as_bytes(); - - let mut payments = ManagedVec::from_single_item(EsdtTokenPayment::new( - TokenIdentifier::from(first_token_id), - 0, - BigUint::from(first_payment_amount), - )); - payments.push(EsdtTokenPayment::new( - TokenIdentifier::from(second_token_id), - 0, - BigUint::from(second_payment_amount), - )); + let payments = args.as_payment_vec(dex_interact); - let result_token = self + let result_token = dex_interact .interactor .tx() - .from(&self.wallet_address) - .to(self.state.current_pair_address()) + .from(&dex_interact.wallet_address) + .to(dex_interact.state.current_pair_address()) .gas(100_000_000u64) .typed(pair_proxy::PairProxy) .add_liquidity( - BigUint::from(first_token_amount_min), - BigUint::from(second_token_amount_min), + BigUint::from(args.first_token_amount_min), + BigUint::from(args.second_token_amount_min), ) .payment(payments) .returns(ReturnsResult) diff --git a/dex/interactor/src/structs.rs b/dex/interactor/src/structs.rs new file mode 100644 index 000000000..1b3f437ab --- /dev/null +++ b/dex/interactor/src/structs.rs @@ -0,0 +1,80 @@ +use multiversx_sc_scenario::{ + api::StaticApi, + imports::{ + BigUint, EsdtTokenPayment, ManagedTypeApi, ManagedVec, RustBigUint, TokenIdentifier, + }, +}; + +use crate::{ + dex_interact_cli::{AddArgs, SwapArgs}, + DexInteract, +}; + +pub struct InteractorToken { + pub token_id: String, + pub nonce: u64, + pub amount: RustBigUint, +} + +impl From> for InteractorToken { + fn from(value: EsdtTokenPayment) -> Self { + InteractorToken { + token_id: value.token_identifier.to_string(), + nonce: value.token_nonce, + amount: RustBigUint::from_bytes_be(value.amount.to_bytes_be().as_slice()), + } + } +} + +impl From for EsdtTokenPayment { + fn from(interactor_token: InteractorToken) -> Self { + EsdtTokenPayment::new( + TokenIdentifier::from(interactor_token.token_id.as_bytes()), + interactor_token.nonce, + BigUint::from(interactor_token.amount), + ) + } +} + +impl From<&InteractorToken> for EsdtTokenPayment { + fn from(interactor_token: &InteractorToken) -> Self { + EsdtTokenPayment::new( + TokenIdentifier::from(interactor_token.token_id.as_bytes()), + interactor_token.nonce, + BigUint::from(interactor_token.amount.clone()), + ) + } +} + +impl AddArgs { + pub fn as_payment_vec( + &self, + dex_interact: &mut DexInteract, + ) -> ManagedVec> { + let first_token_id = dex_interact.state.first_token_id().as_bytes(); + let second_token_id = dex_interact.state.second_token_id().as_bytes(); + + let mut payments = ManagedVec::from_single_item(EsdtTokenPayment::new( + TokenIdentifier::from(first_token_id), + 0, + BigUint::from(self.first_payment_amount), + )); + payments.push(EsdtTokenPayment::new( + TokenIdentifier::from(second_token_id), + 0, + BigUint::from(self.second_payment_amount), + )); + payments + } +} + +impl SwapArgs { + pub fn as_payment(&self, dex_interact: &mut DexInteract) -> EsdtTokenPayment { + let first_token_id = dex_interact.state.first_token_id().as_bytes(); + EsdtTokenPayment::new( + TokenIdentifier::from(first_token_id), + 0, + BigUint::from(self.amount), + ) + } +} From b0d1236eff177c86a3ba1dd6333c7112e7893351 Mon Sep 17 00:00:00 2001 From: Mihai Calin Luca Date: Wed, 24 Apr 2024 20:25:08 +0200 Subject: [PATCH 36/55] small integration test, cleanup, more endpoints --- Cargo.lock | 1 + dex/interactor/Cargo.toml | 3 + dex/interactor/src/dex_interact.rs | 33 +++++++ .../src/dex_interact_farm_locked.rs | 94 ++++++++++++++++--- dex/interactor/src/structs.rs | 28 +++++- 5 files changed, 143 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index be849fbd9..3e490d97d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1404,6 +1404,7 @@ name = "interactor" version = "0.0.0" dependencies = [ "clap", + "common_structs", "multiversx-sc-modules", "multiversx-sc-scenario", "multiversx-sc-snippets", diff --git a/dex/interactor/Cargo.toml b/dex/interactor/Cargo.toml index c40061348..bbd0533c8 100644 --- a/dex/interactor/Cargo.toml +++ b/dex/interactor/Cargo.toml @@ -25,3 +25,6 @@ version = "=0.49.0-alpha.4" [dependencies.proxies] path = "proxies" + +[dependencies.common_structs] +path = "../../common/common_structs" diff --git a/dex/interactor/src/dex_interact.rs b/dex/interactor/src/dex_interact.rs index 81ff0dca2..ed05bf886 100644 --- a/dex/interactor/src/dex_interact.rs +++ b/dex/interactor/src/dex_interact.rs @@ -74,3 +74,36 @@ impl DexInteract { //TODO } } + +// Just for demo, still TODO +#[cfg(test)] +pub mod integration_tests { + use crate::{ + dex_interact_cli::SwapArgs, + dex_interact_pair::{Pair, PairTrait}, + DexInteract, + }; + + #[test] + fn test_full_farm_scenario() { + let rt = crate::tokio::runtime::Runtime::new().unwrap(); + + rt.block_on(async { + let mut dex_interact = DexInteract::init().await; + dex_interact.register_wallets(); + let args = SwapArgs { + amount: 10_000_000_000_000_000_000u128, + min_amount: 1_000_000_000_000u128, + }; + let result = Pair::swap_tokens_fixed_input(&mut dex_interact, &args).await; + println!("result {:#?}", result); + // let args = AddArgs { + // first_payment_amount: 0u128, + // second_payment_amount: 0u128, + // first_token_amount_min: 0u128, + // second_token_amount_min: 0u128, + // }; + // dex_interact.full_farm_scenario(&args).await; + }); + } +} diff --git a/dex/interactor/src/dex_interact_farm_locked.rs b/dex/interactor/src/dex_interact_farm_locked.rs index a230f98f6..ed9711bdf 100644 --- a/dex/interactor/src/dex_interact_farm_locked.rs +++ b/dex/interactor/src/dex_interact_farm_locked.rs @@ -1,16 +1,22 @@ +use common_structs::FarmTokenAttributes; use multiversx_sc_scenario::{ api::StaticApi, imports::{ - Address, EsdtTokenPayment, ManagedAddress, ManagedVec, OptionalValue, ReturnsResult, + Address, BigUint, EsdtTokenPayment, ManagedAddress, ManagedVec, ReturnsResult, RustBigUint, }, }; use multiversx_sc_snippets::InteractorPrepareAsync; -use crate::{farm_with_locked_rewards_proxy, structs::InteractorToken, DexInteract}; +use crate::{ + farm_with_locked_rewards_proxy, + structs::{extract_caller, to_rust_biguint, InteractorFarmTokenAttributes, InteractorToken}, + DexInteract, +}; pub struct FarmLocked; pub trait FarmLockedTrait { + // endpoints async fn enter_farm( dex_interact: &mut DexInteract, lp_token: InteractorToken, @@ -30,6 +36,17 @@ pub trait FarmLockedTrait { payment: Vec, opt_original_caller: Option
, ) -> (InteractorToken, InteractorToken); + async fn claim_boosted_rewards( + dex_interact: &mut DexInteract, + opt_original_caller: Option
, + ) -> InteractorToken; + // views + async fn calculate_rewards_for_given_position( + dex_interact: &mut DexInteract, + user: Address, + farm_token_amount: u128, + attributes: InteractorFarmTokenAttributes, + ) -> RustBigUint; } impl FarmLockedTrait for FarmLocked { @@ -74,10 +91,7 @@ impl FarmLockedTrait for FarmLocked { .map(EsdtTokenPayment::from) .collect::>>(); - let caller = - opt_original_caller.unwrap_or_else(|| dex_interact.wallet_address.to_address()); - let caller_arg: OptionalValue> = - OptionalValue::Some(ManagedAddress::from(caller)); + let caller_arg = extract_caller(dex_interact, opt_original_caller); let result_token = dex_interact .interactor @@ -108,10 +122,7 @@ impl FarmLockedTrait for FarmLocked { ) -> (InteractorToken, InteractorToken) { println!("Attempting to exit farm with locked rewards..."); - let caller = - opt_original_caller.unwrap_or_else(|| dex_interact.wallet_address.to_address()); - let caller_arg: OptionalValue> = - OptionalValue::Some(ManagedAddress::from(caller)); + let caller_arg = extract_caller(dex_interact, opt_original_caller); let result_token = dex_interact .interactor @@ -147,10 +158,7 @@ impl FarmLockedTrait for FarmLocked { .map(EsdtTokenPayment::from) .collect::>>(); - let caller = - opt_original_caller.unwrap_or_else(|| dex_interact.wallet_address.to_address()); - let caller_arg: OptionalValue> = - OptionalValue::Some(ManagedAddress::from(caller)); + let caller_arg = extract_caller(dex_interact, opt_original_caller); let result_token = dex_interact .interactor @@ -173,4 +181,62 @@ impl FarmLockedTrait for FarmLocked { InteractorToken::from(result_token.0 .1), ) } + + async fn claim_boosted_rewards( + dex_interact: &mut DexInteract, + opt_original_caller: Option
, + ) -> InteractorToken { + let caller_arg = extract_caller(dex_interact, opt_original_caller); + + let result_token = dex_interact + .interactor + .tx() + .from(&dex_interact.wallet_address) + .to(dex_interact + .state + .current_farm_with_locked_rewards_address()) + .gas(100_000_000u64) + .typed(farm_with_locked_rewards_proxy::FarmProxy) + .claim_boosted_rewards(caller_arg) + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + InteractorToken::from(result_token) + } + + async fn calculate_rewards_for_given_position( + dex_interact: &mut DexInteract, + user: Address, + farm_token_amount: u128, + attributes: InteractorFarmTokenAttributes, + ) -> RustBigUint { + let attributes_arg: FarmTokenAttributes = FarmTokenAttributes { + reward_per_share: BigUint::from(attributes.reward_per_share), + entering_epoch: attributes.entering_epoch, + compounded_reward: BigUint::from(attributes.compounded_reward), + current_farm_amount: BigUint::from(attributes.current_farm_amount), + original_owner: ManagedAddress::from(attributes.original_owner), + }; + + let result_token = dex_interact + .interactor + .query() + .to(dex_interact + .state + .current_farm_with_locked_rewards_address()) + .typed(farm_with_locked_rewards_proxy::FarmProxy) + .calculate_rewards_for_given_position( + ManagedAddress::from(user), + BigUint::from(farm_token_amount), + attributes_arg, + ) + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + to_rust_biguint(result_token) + } } diff --git a/dex/interactor/src/structs.rs b/dex/interactor/src/structs.rs index 1b3f437ab..62604bb79 100644 --- a/dex/interactor/src/structs.rs +++ b/dex/interactor/src/structs.rs @@ -1,7 +1,8 @@ use multiversx_sc_scenario::{ api::StaticApi, imports::{ - BigUint, EsdtTokenPayment, ManagedTypeApi, ManagedVec, RustBigUint, TokenIdentifier, + Address, BigUint, EsdtTokenPayment, ManagedAddress, ManagedTypeApi, ManagedVec, + OptionalValue, RustBigUint, TokenIdentifier, }, }; @@ -10,6 +11,15 @@ use crate::{ DexInteract, }; +pub struct InteractorFarmTokenAttributes { + pub reward_per_share: RustBigUint, + pub entering_epoch: u64, + pub compounded_reward: RustBigUint, + pub current_farm_amount: RustBigUint, + pub original_owner: Address, +} + +#[derive(Debug)] pub struct InteractorToken { pub token_id: String, pub nonce: u64, @@ -21,7 +31,7 @@ impl From> for InteractorToken { InteractorToken { token_id: value.token_identifier.to_string(), nonce: value.token_nonce, - amount: RustBigUint::from_bytes_be(value.amount.to_bytes_be().as_slice()), + amount: to_rust_biguint(value.amount), } } } @@ -78,3 +88,17 @@ impl SwapArgs { ) } } + +// helpers + +pub fn extract_caller( + dex_interact: &mut DexInteract, + opt_original_caller: Option
, +) -> OptionalValue> { + let caller = opt_original_caller.unwrap_or_else(|| dex_interact.wallet_address.to_address()); + OptionalValue::>::Some(ManagedAddress::from(caller)) +} + +pub fn to_rust_biguint(value: BigUint) -> RustBigUint { + RustBigUint::from_bytes_be(value.to_bytes_be().as_slice()) +} From 1a1f27684ac49680c5c655da86b9a732f6469f80 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Thu, 25 Apr 2024 00:13:33 +0300 Subject: [PATCH 37/55] code coverage update --- .github/workflows/actions.yml | 58 ++--------------------------------- 1 file changed, 3 insertions(+), 55 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index afa63aa92..84a8b5a86 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -20,61 +20,9 @@ permissions: jobs: contracts: name: Contracts - uses: multiversx/mx-sc-actions/.github/workflows/contracts.yml@v2.3.5 + uses: multiversx/mx-sc-actions/.github/workflows/contracts.yml@v3.1.0 with: rust-toolchain: nightly-2023-12-11 - vmtools-version: v1.5.24 + coverage-args: --ignore-filename-regex='/.cargo/git' --output ./coverage.md secrets: - token: ${{ secrets.GITHUB_TOKEN }} - - # TEMPORARY: Remove this job when we can upgrade to mx-sc-actions v3+ - test_coverage: - name: Test Coverage - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Install rust - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - toolchain: nightly-2023-12-11 - target: wasm32-unknown-unknown - - - name: Install prerequisites - run: | - rustup component add llvm-tools-preview - dirname $(find ~/.rustup -name llvm-cov) >> $GITHUB_PATH - - echo $(dirname $(find ~/.rustup -name llvm-cov)) - - cargo install multiversx-sc-meta --locked - - - name: Run tests and generate report - env: - RUSTFLAGS: "" - run: | - sc-meta test-coverage --output ./coverage.md - - - name: Upload the report - uses: actions/upload-artifact@v3 - with: - name: coverage - path: coverage.md - - - name: Find the comment containing the report - id: fc - uses: peter-evans/find-comment@v2 - if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository - with: - issue-number: ${{ github.event.pull_request.number }} - comment-author: "github-actions[bot]" - body-includes: "Coverage Summary" - - - name: Create or update the report comment - uses: peter-evans/create-or-update-comment@v2 - if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository - with: - comment-id: ${{ steps.fc.outputs.comment-id }} - issue-number: ${{ github.event.pull_request.number }} - body-file: ./coverage.md - edit-mode: replace + token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From dfbd57b91e4c47aee2d8fcfe24b0f5d17b5fb57b Mon Sep 17 00:00:00 2001 From: Mihai Calin Luca Date: Thu, 25 Apr 2024 13:32:11 +0200 Subject: [PATCH 38/55] energy-factory views --- dex/interactor/src/dex_interact.rs | 1 + .../src/dex_interact_energy_factory.rs | 122 ++++++++++++++++++ dex/interactor/src/dex_interact_state.rs | 2 +- dex/interactor/src/structs.rs | 38 +++++- 4 files changed, 160 insertions(+), 3 deletions(-) create mode 100644 dex/interactor/src/dex_interact_energy_factory.rs diff --git a/dex/interactor/src/dex_interact.rs b/dex/interactor/src/dex_interact.rs index ed05bf886..b74ff2f7d 100644 --- a/dex/interactor/src/dex_interact.rs +++ b/dex/interactor/src/dex_interact.rs @@ -1,5 +1,6 @@ mod dex_interact_cli; mod dex_interact_config; +mod dex_interact_energy_factory; mod dex_interact_farm_locked; mod dex_interact_pair; mod dex_interact_state; diff --git a/dex/interactor/src/dex_interact_energy_factory.rs b/dex/interactor/src/dex_interact_energy_factory.rs new file mode 100644 index 000000000..bb9a71fba --- /dev/null +++ b/dex/interactor/src/dex_interact_energy_factory.rs @@ -0,0 +1,122 @@ +use multiversx_sc_scenario::imports::{ + Address, BigUint, ManagedAddress, ReturnsResult, RustBigUint, +}; +use multiversx_sc_snippets::InteractorPrepareAsync; +use proxies::energy_factory_proxy; + +use crate::{ + structs::{to_rust_biguint, InteractorEnergy}, + DexInteract, +}; + +pub struct EnergyFactory; + +pub trait EnergyFactoryTrait { + // views + async fn get_energy_entry_for_user( + dex_interact: &mut DexInteract, + user: Address, + ) -> InteractorEnergy; + async fn get_energy_amount_for_user( + dex_interact: &mut DexInteract, + user: Address, + ) -> RustBigUint; + async fn get_penalty_amount( + dex_interact: &mut DexInteract, + token_amount: RustBigUint, + prev_lock_epochs: u64, + new_lock_epochs: u64, + ) -> RustBigUint; + async fn get_token_unstake_address(dex_interact: &mut DexInteract) -> Address; + async fn is_sc_address_whitelisted(dex_interact: &mut DexInteract, address: Address) -> bool; +} + +impl EnergyFactoryTrait for EnergyFactory { + async fn get_energy_entry_for_user( + dex_interact: &mut DexInteract, + user: Address, + ) -> InteractorEnergy { + let result_token = dex_interact + .interactor + .query() + .to(dex_interact.state.current_energy_factory_address()) + .typed(energy_factory_proxy::SimpleLockEnergyProxy) + .get_updated_energy_entry_for_user(ManagedAddress::from(user)) + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + InteractorEnergy::from(result_token) + } + + async fn get_energy_amount_for_user( + dex_interact: &mut DexInteract, + user: Address, + ) -> RustBigUint { + let result_token = dex_interact + .interactor + .query() + .to(dex_interact.state.current_energy_factory_address()) + .typed(energy_factory_proxy::SimpleLockEnergyProxy) + .get_energy_amount_for_user(ManagedAddress::from(user)) + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + to_rust_biguint(result_token) + } + + async fn get_penalty_amount( + dex_interact: &mut DexInteract, + token_amount: RustBigUint, + prev_lock_epochs: u64, + new_lock_epochs: u64, + ) -> RustBigUint { + let result_token = dex_interact + .interactor + .query() + .to(dex_interact.state.current_energy_factory_address()) + .typed(energy_factory_proxy::SimpleLockEnergyProxy) + .calculate_penalty_amount( + BigUint::from(token_amount), + prev_lock_epochs, + new_lock_epochs, + ) + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + to_rust_biguint(result_token) + } + + async fn get_token_unstake_address(dex_interact: &mut DexInteract) -> Address { + let result_token = dex_interact + .interactor + .query() + .to(dex_interact.state.current_energy_factory_address()) + .typed(energy_factory_proxy::SimpleLockEnergyProxy) + .token_unstake_sc_address() + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + result_token.to_address() + } + + async fn is_sc_address_whitelisted(dex_interact: &mut DexInteract, address: Address) -> bool { + dex_interact + .interactor + .query() + .to(dex_interact.state.current_energy_factory_address()) + .typed(energy_factory_proxy::SimpleLockEnergyProxy) + .is_sc_address_whitelisted(ManagedAddress::from(address)) + .returns(ReturnsResult) + .prepare_async() + .run() + .await + } +} diff --git a/dex/interactor/src/dex_interact_state.rs b/dex/interactor/src/dex_interact_state.rs index 07fa85d80..ae7575f11 100644 --- a/dex/interactor/src/dex_interact_state.rs +++ b/dex/interactor/src/dex_interact_state.rs @@ -64,7 +64,7 @@ impl State { .expect("no known farm staking proxy contract, set first") } - pub fn _current_energy_factory_address(&self) -> &Bech32Address { + pub fn current_energy_factory_address(&self) -> &Bech32Address { self.energy_factory .as_ref() .expect("no known energy factory contract, set first") diff --git a/dex/interactor/src/structs.rs b/dex/interactor/src/structs.rs index 62604bb79..a81b0ed54 100644 --- a/dex/interactor/src/structs.rs +++ b/dex/interactor/src/structs.rs @@ -1,16 +1,20 @@ use multiversx_sc_scenario::{ api::StaticApi, imports::{ - Address, BigUint, EsdtTokenPayment, ManagedAddress, ManagedTypeApi, ManagedVec, - OptionalValue, RustBigUint, TokenIdentifier, + Address, BigInt, BigUint, EsdtTokenPayment, ManagedAddress, ManagedTypeApi, ManagedVec, + OptionalValue, RustBigUint, Sign, TokenIdentifier, }, + num_bigint, }; +use proxies::Energy; use crate::{ dex_interact_cli::{AddArgs, SwapArgs}, DexInteract, }; +pub type RustBigInt = num_bigint::BigInt; + pub struct InteractorFarmTokenAttributes { pub reward_per_share: RustBigUint, pub entering_epoch: u64, @@ -26,6 +30,22 @@ pub struct InteractorToken { pub amount: RustBigUint, } +pub struct InteractorEnergy { + pub amount: RustBigInt, + pub last_update_epoch: u64, + pub total_locked_tokens: RustBigUint, +} + +impl From> for InteractorEnergy { + fn from(value: Energy) -> Self { + InteractorEnergy { + amount: to_rust_bigint(value.amount), + last_update_epoch: value.last_update_epoch, + total_locked_tokens: to_rust_biguint(value.total_locked_tokens), + } + } +} + impl From> for InteractorToken { fn from(value: EsdtTokenPayment) -> Self { InteractorToken { @@ -102,3 +122,17 @@ pub fn extract_caller( pub fn to_rust_biguint(value: BigUint) -> RustBigUint { RustBigUint::from_bytes_be(value.to_bytes_be().as_slice()) } + +pub fn to_rust_bigint(value: BigInt) -> RustBigInt { + let sign = value.sign(); + + RustBigInt::from_bytes_be(to_rust_sign(sign), value.to_signed_bytes_be().as_slice()) +} + +pub fn to_rust_sign(value: Sign) -> num_bigint::Sign { + match value { + Sign::Minus => num_bigint::Sign::Minus, + Sign::Plus => num_bigint::Sign::Plus, + Sign::NoSign => num_bigint::Sign::NoSign, + } +} From 7f2b02b1c816d12f24767a717eac7f8bfca30049 Mon Sep 17 00:00:00 2001 From: Mihai Calin Luca Date: Thu, 25 Apr 2024 16:04:29 +0200 Subject: [PATCH 39/55] farm staking proxy interaction and small fixes --- dex/interactor/src/dex_interact.rs | 3 +- .../src/dex_interact_farm_locked.rs | 2 +- .../src/dex_interact_farm_staking_proxy.rs | 285 ++++++++++++++++++ dex/interactor/src/dex_interact_pair.rs | 14 +- dex/interactor/src/dex_interact_state.rs | 2 +- dex/interactor/src/structs.rs | 81 ++++- 6 files changed, 374 insertions(+), 13 deletions(-) create mode 100644 dex/interactor/src/dex_interact_farm_staking_proxy.rs diff --git a/dex/interactor/src/dex_interact.rs b/dex/interactor/src/dex_interact.rs index b74ff2f7d..d7f4f32e3 100644 --- a/dex/interactor/src/dex_interact.rs +++ b/dex/interactor/src/dex_interact.rs @@ -2,6 +2,7 @@ mod dex_interact_cli; mod dex_interact_config; mod dex_interact_energy_factory; mod dex_interact_farm_locked; +mod dex_interact_farm_staking_proxy; mod dex_interact_pair; mod dex_interact_state; mod structs; @@ -70,7 +71,7 @@ impl DexInteract { } async fn full_farm_scenario(&mut self, args: &AddArgs) { - let (_, _, lp_token) = Pair::add_liquidity(self, args).await; + let (_, _, lp_token) = Pair::add_liquidity(self, args).await.0; let _result = FarmLocked::enter_farm(self, lp_token).await; //TODO } diff --git a/dex/interactor/src/dex_interact_farm_locked.rs b/dex/interactor/src/dex_interact_farm_locked.rs index ed9711bdf..7b4a7bb15 100644 --- a/dex/interactor/src/dex_interact_farm_locked.rs +++ b/dex/interactor/src/dex_interact_farm_locked.rs @@ -103,7 +103,7 @@ impl FarmLockedTrait for FarmLocked { .gas(100_000_000u64) .typed(farm_with_locked_rewards_proxy::FarmProxy) .claim_rewards_endpoint(caller_arg) - .payment(&payments) + .payment(payments) .returns(ReturnsResult) .prepare_async() .run() diff --git a/dex/interactor/src/dex_interact_farm_staking_proxy.rs b/dex/interactor/src/dex_interact_farm_staking_proxy.rs new file mode 100644 index 000000000..033d3387b --- /dev/null +++ b/dex/interactor/src/dex_interact_farm_staking_proxy.rs @@ -0,0 +1,285 @@ +use multiversx_sc_scenario::{ + api::StaticApi, + imports::{ + Address, BigUint, EsdtTokenPayment, ManagedAddress, ManagedVec, ReturnsResult, RustBigUint, + }, +}; +use multiversx_sc_snippets::InteractorPrepareAsync; +use proxies::farm_staking_proxy_sc_proxy; + +use crate::{ + structs::{ + extract_caller, InteractorClaimDualYieldResult, InteractorStakeProxyResult, + InteractorToken, InteractorUnstakeResult, + }, + DexInteract, +}; + +pub struct FarmProxy; + +pub trait FarmProxyTrait { + // endpoints + async fn stake_farm_tokens( + dex_interact: &mut DexInteract, + payment: Vec, + opt_original_caller: Option
, + ) -> InteractorStakeProxyResult; + async fn claim_dual_yield( + dex_interact: &mut DexInteract, + payment: InteractorToken, + opt_original_caller: Option
, + ) -> InteractorClaimDualYieldResult; + async fn unstake_farm_tokens( + dex_interact: &mut DexInteract, + payment: InteractorToken, + pair_first_token_min_amount: RustBigUint, + pair_second_token_min_amount: RustBigUint, + opt_original_caller: Option
, + ) -> InteractorUnstakeResult; + // views + async fn is_sc_address_whitelisted(dex_interact: &mut DexInteract, address: Address) -> bool; + async fn get_dual_yield_token_id(dex_interact: &mut DexInteract) -> String; + async fn get_lp_farm_address(dex_interact: &mut DexInteract) -> Address; + async fn get_staking_farm_address(dex_interact: &mut DexInteract) -> Address; + async fn get_pair_address(dex_interact: &mut DexInteract) -> Address; + async fn get_staking_token_id(dex_interact: &mut DexInteract) -> String; + async fn get_farm_token_id(dex_interact: &mut DexInteract) -> String; + async fn get_lp_token_id(dex_interact: &mut DexInteract) -> String; + async fn get_lp_farm_token_id(dex_interact: &mut DexInteract) -> String; + async fn get_energy_factory_address(dex_interact: &mut DexInteract) -> Address; +} + +impl FarmProxyTrait for FarmProxy { + // views + async fn is_sc_address_whitelisted(dex_interact: &mut DexInteract, address: Address) -> bool { + dex_interact + .interactor + .query() + .to(dex_interact.state.current_farm_staking_proxy_address()) + .typed(farm_staking_proxy_sc_proxy::FarmStakingProxyProxy) + .is_sc_address_whitelisted(ManagedAddress::from(address)) + .returns(ReturnsResult) + .prepare_async() + .run() + .await + } + + async fn get_dual_yield_token_id(dex_interact: &mut DexInteract) -> String { + let result_token = dex_interact + .interactor + .query() + .to(dex_interact.state.current_farm_staking_proxy_address()) + .typed(farm_staking_proxy_sc_proxy::FarmStakingProxyProxy) + .dual_yield_token() + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + result_token.to_string() + } + + async fn get_lp_farm_address(dex_interact: &mut DexInteract) -> Address { + let result_token = dex_interact + .interactor + .query() + .to(dex_interact.state.current_farm_staking_proxy_address()) + .typed(farm_staking_proxy_sc_proxy::FarmStakingProxyProxy) + .lp_farm_address() + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + result_token.to_address() + } + + async fn get_staking_farm_address(dex_interact: &mut DexInteract) -> Address { + let result_token = dex_interact + .interactor + .query() + .to(dex_interact.state.current_farm_staking_proxy_address()) + .typed(farm_staking_proxy_sc_proxy::FarmStakingProxyProxy) + .staking_farm_address() + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + result_token.to_address() + } + + async fn get_pair_address(dex_interact: &mut DexInteract) -> Address { + let result_token = dex_interact + .interactor + .query() + .to(dex_interact.state.current_farm_staking_proxy_address()) + .typed(farm_staking_proxy_sc_proxy::FarmStakingProxyProxy) + .pair_address() + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + result_token.to_address() + } + + async fn get_staking_token_id(dex_interact: &mut DexInteract) -> String { + let result_token = dex_interact + .interactor + .query() + .to(dex_interact.state.current_farm_staking_proxy_address()) + .typed(farm_staking_proxy_sc_proxy::FarmStakingProxyProxy) + .staking_token_id() + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + result_token.to_string() + } + + async fn get_farm_token_id(dex_interact: &mut DexInteract) -> String { + let result_token = dex_interact + .interactor + .query() + .to(dex_interact.state.current_farm_staking_proxy_address()) + .typed(farm_staking_proxy_sc_proxy::FarmStakingProxyProxy) + .staking_farm_token_id() + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + result_token.to_string() + } + + async fn get_lp_token_id(dex_interact: &mut DexInteract) -> String { + let result_token = dex_interact + .interactor + .query() + .to(dex_interact.state.current_farm_staking_proxy_address()) + .typed(farm_staking_proxy_sc_proxy::FarmStakingProxyProxy) + .lp_token_id() + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + result_token.to_string() + } + + async fn get_lp_farm_token_id(dex_interact: &mut DexInteract) -> String { + let result_token = dex_interact + .interactor + .query() + .to(dex_interact.state.current_farm_staking_proxy_address()) + .typed(farm_staking_proxy_sc_proxy::FarmStakingProxyProxy) + .lp_farm_token_id() + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + result_token.to_string() + } + + async fn get_energy_factory_address(dex_interact: &mut DexInteract) -> Address { + let result_token = dex_interact + .interactor + .query() + .to(dex_interact.state.current_farm_staking_proxy_address()) + .typed(farm_staking_proxy_sc_proxy::FarmStakingProxyProxy) + .energy_factory_address() + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + result_token.to_address() + } + + // endpoints + async fn stake_farm_tokens( + dex_interact: &mut DexInteract, + payment: Vec, + opt_original_caller: Option
, + ) -> InteractorStakeProxyResult { + let caller_arg = extract_caller(dex_interact, opt_original_caller); + + let payments = payment + .iter() + .map(EsdtTokenPayment::from) + .collect::>>(); + + let result_token = dex_interact + .interactor + .tx() + .from(&dex_interact.wallet_address) + .to(dex_interact.state.current_farm_staking_proxy_address()) + .gas(100_000_000u64) + .typed(farm_staking_proxy_sc_proxy::FarmStakingProxyProxy) + .stake_farm_tokens(caller_arg) + .payment(payments) + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + InteractorStakeProxyResult::from(result_token) + } + + async fn claim_dual_yield( + dex_interact: &mut DexInteract, + payment: InteractorToken, + opt_original_caller: Option
, + ) -> InteractorClaimDualYieldResult { + let caller_arg = extract_caller(dex_interact, opt_original_caller); + + let result_token = dex_interact + .interactor + .tx() + .from(&dex_interact.wallet_address) + .to(dex_interact.state.current_farm_staking_proxy_address()) + .gas(100_000_000u64) + .typed(farm_staking_proxy_sc_proxy::FarmStakingProxyProxy) + .claim_dual_yield_endpoint(caller_arg) + .payment(EsdtTokenPayment::from(payment)) + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + InteractorClaimDualYieldResult::from(result_token) + } + + async fn unstake_farm_tokens( + dex_interact: &mut DexInteract, + payment: InteractorToken, + pair_first_token_min_amount: RustBigUint, + pair_second_token_min_amount: RustBigUint, + opt_original_caller: Option
, + ) -> InteractorUnstakeResult { + let caller_arg = extract_caller(dex_interact, opt_original_caller); + + let result_token = dex_interact + .interactor + .tx() + .from(&dex_interact.wallet_address) + .to(dex_interact.state.current_farm_staking_proxy_address()) + .gas(100_000_000u64) + .typed(farm_staking_proxy_sc_proxy::FarmStakingProxyProxy) + .unstake_farm_tokens( + BigUint::from(pair_first_token_min_amount), + BigUint::from(pair_second_token_min_amount), + caller_arg, + ) + .payment(EsdtTokenPayment::from(payment)) + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + InteractorUnstakeResult::from(result_token) + } +} diff --git a/dex/interactor/src/dex_interact_pair.rs b/dex/interactor/src/dex_interact_pair.rs index f9b7db221..2a7288ee6 100644 --- a/dex/interactor/src/dex_interact_pair.rs +++ b/dex/interactor/src/dex_interact_pair.rs @@ -2,13 +2,14 @@ use multiversx_sc_scenario::imports::{BigUint, ReturnsResult, TokenIdentifier}; use multiversx_sc_snippets::InteractorPrepareAsync; use crate::dex_interact_cli::{AddArgs, SwapArgs}; -use crate::structs::InteractorToken; +use crate::structs::{InteractorAddLiquidityResultType, InteractorToken}; use crate::DexInteract; use proxies::pair_proxy; pub struct Pair; pub trait PairTrait { + // endpoints async fn swap_tokens_fixed_input( dex_interact: &mut DexInteract, args: &SwapArgs, @@ -16,7 +17,7 @@ pub trait PairTrait { async fn add_liquidity( dex_interact: &mut DexInteract, args: &AddArgs, - ) -> (InteractorToken, InteractorToken, InteractorToken); + ) -> InteractorAddLiquidityResultType; } impl PairTrait for Pair { @@ -56,7 +57,7 @@ impl PairTrait for Pair { async fn add_liquidity( dex_interact: &mut DexInteract, args: &AddArgs, - ) -> (InteractorToken, InteractorToken, InteractorToken) { + ) -> InteractorAddLiquidityResultType { println!("Attempting to add liquidity to pair..."); let payments = args.as_payment_vec(dex_interact); @@ -76,11 +77,8 @@ impl PairTrait for Pair { .prepare_async() .run() .await; - ( - InteractorToken::from(result_token.0 .0), - InteractorToken::from(result_token.0 .1), - InteractorToken::from(result_token.0 .2), - ) + + InteractorAddLiquidityResultType::from(result_token) } } diff --git a/dex/interactor/src/dex_interact_state.rs b/dex/interactor/src/dex_interact_state.rs index ae7575f11..e79658255 100644 --- a/dex/interactor/src/dex_interact_state.rs +++ b/dex/interactor/src/dex_interact_state.rs @@ -58,7 +58,7 @@ impl State { .expect("no known farm staking contract, set first") } - pub fn _current_farm_staking_proxy_address(&self) -> &Bech32Address { + pub fn current_farm_staking_proxy_address(&self) -> &Bech32Address { self.farm_staking_proxy .as_ref() .expect("no known farm staking proxy contract, set first") diff --git a/dex/interactor/src/structs.rs b/dex/interactor/src/structs.rs index a81b0ed54..69d0f4c8d 100644 --- a/dex/interactor/src/structs.rs +++ b/dex/interactor/src/structs.rs @@ -2,19 +2,96 @@ use multiversx_sc_scenario::{ api::StaticApi, imports::{ Address, BigInt, BigUint, EsdtTokenPayment, ManagedAddress, ManagedTypeApi, ManagedVec, - OptionalValue, RustBigUint, Sign, TokenIdentifier, + MultiValue3, OptionalValue, RustBigUint, Sign, TokenIdentifier, }, num_bigint, }; -use proxies::Energy; +use proxies::{ClaimDualYieldResult, Energy, StakeProxyResult, UnstakeResult}; use crate::{ dex_interact_cli::{AddArgs, SwapArgs}, DexInteract, }; +pub struct InteractorMultiValue3(pub (T0, T1, T2)); + +impl InteractorMultiValue3 { + pub fn new(first: T0, second: T1, third: T2) -> Self { + InteractorMultiValue3((first, second, third)) + } +} +pub type InteractorAddLiquidityResultType = + InteractorMultiValue3; + +impl + From, EsdtTokenPayment, EsdtTokenPayment>> + for InteractorAddLiquidityResultType +{ + fn from( + value: MultiValue3, EsdtTokenPayment, EsdtTokenPayment>, + ) -> Self { + let extracted = value.0; + + InteractorMultiValue3::new( + InteractorToken::from(extracted.0), + InteractorToken::from(extracted.1), + InteractorToken::from(extracted.2), + ) + } +} + pub type RustBigInt = num_bigint::BigInt; +pub struct InteractorUnstakeResult { + pub other_token_payment: InteractorToken, + pub lp_farm_rewards: InteractorToken, + pub staking_rewards: InteractorToken, + pub unbond_staking_farm_token: InteractorToken, +} + +impl From> for InteractorUnstakeResult { + fn from(value: UnstakeResult) -> Self { + InteractorUnstakeResult { + other_token_payment: InteractorToken::from(value.other_token_payment), + lp_farm_rewards: InteractorToken::from(value.lp_farm_rewards), + staking_rewards: InteractorToken::from(value.staking_rewards), + unbond_staking_farm_token: InteractorToken::from(value.unbond_staking_farm_token), + } + } +} + +pub struct InteractorStakeProxyResult { + pub dual_yield_tokens: InteractorToken, + pub staking_boosted_rewards: InteractorToken, + pub lp_farm_boosted_rewards: InteractorToken, +} + +impl From> for InteractorStakeProxyResult { + fn from(value: StakeProxyResult) -> Self { + InteractorStakeProxyResult { + dual_yield_tokens: InteractorToken::from(value.dual_yield_tokens), + staking_boosted_rewards: InteractorToken::from(value.staking_boosted_rewards), + lp_farm_boosted_rewards: InteractorToken::from(value.lp_farm_boosted_rewards), + } + } +} + +pub struct InteractorClaimDualYieldResult { + pub lp_farm_rewards: InteractorToken, + pub staking_farm_rewards: InteractorToken, + pub new_dual_yield_tokens: InteractorToken, +} + +impl From> for InteractorClaimDualYieldResult { + fn from(value: ClaimDualYieldResult) -> Self { + InteractorClaimDualYieldResult { + lp_farm_rewards: InteractorToken::from(value.lp_farm_rewards), + staking_farm_rewards: InteractorToken::from(value.staking_farm_rewards), + new_dual_yield_tokens: InteractorToken::from(value.new_dual_yield_tokens), + } + } +} + pub struct InteractorFarmTokenAttributes { pub reward_per_share: RustBigUint, pub entering_epoch: u64, From 6a6ceace28bda66fbcd34bfaac8a97210b7c2865 Mon Sep 17 00:00:00 2001 From: Mihai Calin Luca Date: Mon, 29 Apr 2024 03:34:13 +0200 Subject: [PATCH 40/55] reorg traits as modules --- dex/interactor/src/dex_interact.rs | 33 +- .../src/dex_interact_energy_factory.rs | 122 -------- .../src/dex_interact_farm_locked.rs | 242 --------------- .../src/dex_interact_farm_staking_proxy.rs | 285 ------------------ dex/interactor/src/dex_interact_pair.rs | 87 ------ dex/interactor/src/energy_factory.rs | 101 +++++++ dex/interactor/src/farm_locked.rs | 204 +++++++++++++ dex/interactor/src/farm_staking_proxy.rs | 249 +++++++++++++++ dex/interactor/src/pair.rs | 69 +++++ 9 files changed, 638 insertions(+), 754 deletions(-) delete mode 100644 dex/interactor/src/dex_interact_energy_factory.rs delete mode 100644 dex/interactor/src/dex_interact_farm_locked.rs delete mode 100644 dex/interactor/src/dex_interact_farm_staking_proxy.rs delete mode 100644 dex/interactor/src/dex_interact_pair.rs create mode 100644 dex/interactor/src/energy_factory.rs create mode 100644 dex/interactor/src/farm_locked.rs create mode 100644 dex/interactor/src/farm_staking_proxy.rs create mode 100644 dex/interactor/src/pair.rs diff --git a/dex/interactor/src/dex_interact.rs b/dex/interactor/src/dex_interact.rs index d7f4f32e3..07346ea29 100644 --- a/dex/interactor/src/dex_interact.rs +++ b/dex/interactor/src/dex_interact.rs @@ -1,17 +1,15 @@ mod dex_interact_cli; mod dex_interact_config; -mod dex_interact_energy_factory; -mod dex_interact_farm_locked; -mod dex_interact_farm_staking_proxy; -mod dex_interact_pair; mod dex_interact_state; +mod energy_factory; +mod farm_locked; +mod farm_staking_proxy; +mod pair; mod structs; use clap::Parser; use dex_interact_cli::AddArgs; use dex_interact_config::Config; -use dex_interact_farm_locked::{FarmLocked, FarmLockedTrait}; -use dex_interact_pair::{Pair, PairTrait}; use dex_interact_state::State; use multiversx_sc_snippets::imports::*; use proxies::*; @@ -26,10 +24,10 @@ async fn main() { let cli = dex_interact_cli::InteractCli::parse(); match &cli.command { Some(dex_interact_cli::InteractCliCommand::Swap(args)) => { - Pair::swap_tokens_fixed_input(&mut dex_interact, args).await; + pair::swap_tokens_fixed_input(&mut dex_interact, args).await; } Some(dex_interact_cli::InteractCliCommand::Add(args)) => { - Pair::add_liquidity(&mut dex_interact, args).await; + pair::add_liquidity(&mut dex_interact, args).await; } Some(dex_interact_cli::InteractCliCommand::FullFarm(args)) => { dex_interact.full_farm_scenario(args).await; @@ -70,21 +68,20 @@ impl DexInteract { } } + // mock async fn full_farm_scenario(&mut self, args: &AddArgs) { - let (_, _, lp_token) = Pair::add_liquidity(self, args).await.0; - let _result = FarmLocked::enter_farm(self, lp_token).await; - //TODO + let (_, _, lp_token) = pair::add_liquidity(self, args).await.0; + let _result = farm_locked::enter_farm(self, lp_token).await; + let _query = energy_factory::get_energy_amount_for_user(self, Address::zero()).await; + let _farm_token = farm_staking_proxy::stake_farm_tokens(self, Vec::new(), None).await; + // TODO } } // Just for demo, still TODO #[cfg(test)] pub mod integration_tests { - use crate::{ - dex_interact_cli::SwapArgs, - dex_interact_pair::{Pair, PairTrait}, - DexInteract, - }; + use crate::{dex_interact_cli::SwapArgs, pair, DexInteract}; #[test] fn test_full_farm_scenario() { @@ -97,9 +94,9 @@ pub mod integration_tests { amount: 10_000_000_000_000_000_000u128, min_amount: 1_000_000_000_000u128, }; - let result = Pair::swap_tokens_fixed_input(&mut dex_interact, &args).await; + let result = pair::swap_tokens_fixed_input(&mut dex_interact, &args).await; println!("result {:#?}", result); - // let args = AddArgs { + // let args =PairArgs { // first_payment_amount: 0u128, // second_payment_amount: 0u128, // first_token_amount_min: 0u128, diff --git a/dex/interactor/src/dex_interact_energy_factory.rs b/dex/interactor/src/dex_interact_energy_factory.rs deleted file mode 100644 index bb9a71fba..000000000 --- a/dex/interactor/src/dex_interact_energy_factory.rs +++ /dev/null @@ -1,122 +0,0 @@ -use multiversx_sc_scenario::imports::{ - Address, BigUint, ManagedAddress, ReturnsResult, RustBigUint, -}; -use multiversx_sc_snippets::InteractorPrepareAsync; -use proxies::energy_factory_proxy; - -use crate::{ - structs::{to_rust_biguint, InteractorEnergy}, - DexInteract, -}; - -pub struct EnergyFactory; - -pub trait EnergyFactoryTrait { - // views - async fn get_energy_entry_for_user( - dex_interact: &mut DexInteract, - user: Address, - ) -> InteractorEnergy; - async fn get_energy_amount_for_user( - dex_interact: &mut DexInteract, - user: Address, - ) -> RustBigUint; - async fn get_penalty_amount( - dex_interact: &mut DexInteract, - token_amount: RustBigUint, - prev_lock_epochs: u64, - new_lock_epochs: u64, - ) -> RustBigUint; - async fn get_token_unstake_address(dex_interact: &mut DexInteract) -> Address; - async fn is_sc_address_whitelisted(dex_interact: &mut DexInteract, address: Address) -> bool; -} - -impl EnergyFactoryTrait for EnergyFactory { - async fn get_energy_entry_for_user( - dex_interact: &mut DexInteract, - user: Address, - ) -> InteractorEnergy { - let result_token = dex_interact - .interactor - .query() - .to(dex_interact.state.current_energy_factory_address()) - .typed(energy_factory_proxy::SimpleLockEnergyProxy) - .get_updated_energy_entry_for_user(ManagedAddress::from(user)) - .returns(ReturnsResult) - .prepare_async() - .run() - .await; - - InteractorEnergy::from(result_token) - } - - async fn get_energy_amount_for_user( - dex_interact: &mut DexInteract, - user: Address, - ) -> RustBigUint { - let result_token = dex_interact - .interactor - .query() - .to(dex_interact.state.current_energy_factory_address()) - .typed(energy_factory_proxy::SimpleLockEnergyProxy) - .get_energy_amount_for_user(ManagedAddress::from(user)) - .returns(ReturnsResult) - .prepare_async() - .run() - .await; - - to_rust_biguint(result_token) - } - - async fn get_penalty_amount( - dex_interact: &mut DexInteract, - token_amount: RustBigUint, - prev_lock_epochs: u64, - new_lock_epochs: u64, - ) -> RustBigUint { - let result_token = dex_interact - .interactor - .query() - .to(dex_interact.state.current_energy_factory_address()) - .typed(energy_factory_proxy::SimpleLockEnergyProxy) - .calculate_penalty_amount( - BigUint::from(token_amount), - prev_lock_epochs, - new_lock_epochs, - ) - .returns(ReturnsResult) - .prepare_async() - .run() - .await; - - to_rust_biguint(result_token) - } - - async fn get_token_unstake_address(dex_interact: &mut DexInteract) -> Address { - let result_token = dex_interact - .interactor - .query() - .to(dex_interact.state.current_energy_factory_address()) - .typed(energy_factory_proxy::SimpleLockEnergyProxy) - .token_unstake_sc_address() - .returns(ReturnsResult) - .prepare_async() - .run() - .await; - - result_token.to_address() - } - - async fn is_sc_address_whitelisted(dex_interact: &mut DexInteract, address: Address) -> bool { - dex_interact - .interactor - .query() - .to(dex_interact.state.current_energy_factory_address()) - .typed(energy_factory_proxy::SimpleLockEnergyProxy) - .is_sc_address_whitelisted(ManagedAddress::from(address)) - .returns(ReturnsResult) - .prepare_async() - .run() - .await - } -} diff --git a/dex/interactor/src/dex_interact_farm_locked.rs b/dex/interactor/src/dex_interact_farm_locked.rs deleted file mode 100644 index 7b4a7bb15..000000000 --- a/dex/interactor/src/dex_interact_farm_locked.rs +++ /dev/null @@ -1,242 +0,0 @@ -use common_structs::FarmTokenAttributes; -use multiversx_sc_scenario::{ - api::StaticApi, - imports::{ - Address, BigUint, EsdtTokenPayment, ManagedAddress, ManagedVec, ReturnsResult, RustBigUint, - }, -}; -use multiversx_sc_snippets::InteractorPrepareAsync; - -use crate::{ - farm_with_locked_rewards_proxy, - structs::{extract_caller, to_rust_biguint, InteractorFarmTokenAttributes, InteractorToken}, - DexInteract, -}; - -pub struct FarmLocked; - -pub trait FarmLockedTrait { - // endpoints - async fn enter_farm( - dex_interact: &mut DexInteract, - lp_token: InteractorToken, - ) -> (InteractorToken, InteractorToken); - async fn claim_rewards( - dex_interact: &mut DexInteract, - payment: Vec, - opt_original_caller: Option
, - ) -> (InteractorToken, InteractorToken); - async fn exit_farm( - dex_interact: &mut DexInteract, - payment: InteractorToken, - opt_original_caller: Option
, - ) -> (InteractorToken, InteractorToken); - async fn merge_farm_tokens( - dex_interact: &mut DexInteract, - payment: Vec, - opt_original_caller: Option
, - ) -> (InteractorToken, InteractorToken); - async fn claim_boosted_rewards( - dex_interact: &mut DexInteract, - opt_original_caller: Option
, - ) -> InteractorToken; - // views - async fn calculate_rewards_for_given_position( - dex_interact: &mut DexInteract, - user: Address, - farm_token_amount: u128, - attributes: InteractorFarmTokenAttributes, - ) -> RustBigUint; -} - -impl FarmLockedTrait for FarmLocked { - async fn enter_farm( - dex_interact: &mut DexInteract, - lp_token: InteractorToken, - ) -> (InteractorToken, InteractorToken) { - println!("Attempting to enter farm with locked rewards..."); - - let result_token = dex_interact - .interactor - .tx() - .from(&dex_interact.wallet_address) - .to(dex_interact - .state - .current_farm_with_locked_rewards_address()) - .gas(100_000_000u64) - .typed(farm_with_locked_rewards_proxy::FarmProxy) - .enter_farm_endpoint(ManagedAddress::from( - dex_interact.wallet_address.as_address(), - )) - .payment::>(lp_token.into()) - .returns(ReturnsResult) - .prepare_async() - .run() - .await; - ( - InteractorToken::from(result_token.0 .0), - InteractorToken::from(result_token.0 .1), - ) - } - - async fn claim_rewards( - dex_interact: &mut DexInteract, - payment: Vec, - opt_original_caller: Option
, - ) -> (InteractorToken, InteractorToken) { - println!("Attempting to claim rewards from farm with locked rewards..."); - - let payments = payment - .iter() - .map(EsdtTokenPayment::from) - .collect::>>(); - - let caller_arg = extract_caller(dex_interact, opt_original_caller); - - let result_token = dex_interact - .interactor - .tx() - .from(&dex_interact.wallet_address) - .to(dex_interact - .state - .current_farm_with_locked_rewards_address()) - .gas(100_000_000u64) - .typed(farm_with_locked_rewards_proxy::FarmProxy) - .claim_rewards_endpoint(caller_arg) - .payment(payments) - .returns(ReturnsResult) - .prepare_async() - .run() - .await; - - ( - InteractorToken::from(result_token.0 .0), - InteractorToken::from(result_token.0 .1), - ) - } - - async fn exit_farm( - dex_interact: &mut DexInteract, - payment: InteractorToken, - opt_original_caller: Option
, - ) -> (InteractorToken, InteractorToken) { - println!("Attempting to exit farm with locked rewards..."); - - let caller_arg = extract_caller(dex_interact, opt_original_caller); - - let result_token = dex_interact - .interactor - .tx() - .from(&dex_interact.wallet_address) - .to(dex_interact - .state - .current_farm_with_locked_rewards_address()) - .gas(100_000_000u64) - .typed(farm_with_locked_rewards_proxy::FarmProxy) - .exit_farm_endpoint(caller_arg) - .payment::>(payment.into()) - .returns(ReturnsResult) - .prepare_async() - .run() - .await; - - ( - InteractorToken::from(result_token.0 .0), - InteractorToken::from(result_token.0 .1), - ) - } - - async fn merge_farm_tokens( - dex_interact: &mut DexInteract, - payment: Vec, - opt_original_caller: Option
, - ) -> (InteractorToken, InteractorToken) { - println!("Attempting to merge tokens in farm with locked rewards..."); - - let payments = payment - .iter() - .map(EsdtTokenPayment::from) - .collect::>>(); - - let caller_arg = extract_caller(dex_interact, opt_original_caller); - - let result_token = dex_interact - .interactor - .tx() - .from(&dex_interact.wallet_address) - .to(dex_interact - .state - .current_farm_with_locked_rewards_address()) - .gas(100_000_000u64) - .typed(farm_with_locked_rewards_proxy::FarmProxy) - .merge_farm_tokens_endpoint(caller_arg) - .payment(payments) - .returns(ReturnsResult) - .prepare_async() - .run() - .await; - - ( - InteractorToken::from(result_token.0 .0), - InteractorToken::from(result_token.0 .1), - ) - } - - async fn claim_boosted_rewards( - dex_interact: &mut DexInteract, - opt_original_caller: Option
, - ) -> InteractorToken { - let caller_arg = extract_caller(dex_interact, opt_original_caller); - - let result_token = dex_interact - .interactor - .tx() - .from(&dex_interact.wallet_address) - .to(dex_interact - .state - .current_farm_with_locked_rewards_address()) - .gas(100_000_000u64) - .typed(farm_with_locked_rewards_proxy::FarmProxy) - .claim_boosted_rewards(caller_arg) - .returns(ReturnsResult) - .prepare_async() - .run() - .await; - - InteractorToken::from(result_token) - } - - async fn calculate_rewards_for_given_position( - dex_interact: &mut DexInteract, - user: Address, - farm_token_amount: u128, - attributes: InteractorFarmTokenAttributes, - ) -> RustBigUint { - let attributes_arg: FarmTokenAttributes = FarmTokenAttributes { - reward_per_share: BigUint::from(attributes.reward_per_share), - entering_epoch: attributes.entering_epoch, - compounded_reward: BigUint::from(attributes.compounded_reward), - current_farm_amount: BigUint::from(attributes.current_farm_amount), - original_owner: ManagedAddress::from(attributes.original_owner), - }; - - let result_token = dex_interact - .interactor - .query() - .to(dex_interact - .state - .current_farm_with_locked_rewards_address()) - .typed(farm_with_locked_rewards_proxy::FarmProxy) - .calculate_rewards_for_given_position( - ManagedAddress::from(user), - BigUint::from(farm_token_amount), - attributes_arg, - ) - .returns(ReturnsResult) - .prepare_async() - .run() - .await; - - to_rust_biguint(result_token) - } -} diff --git a/dex/interactor/src/dex_interact_farm_staking_proxy.rs b/dex/interactor/src/dex_interact_farm_staking_proxy.rs deleted file mode 100644 index 033d3387b..000000000 --- a/dex/interactor/src/dex_interact_farm_staking_proxy.rs +++ /dev/null @@ -1,285 +0,0 @@ -use multiversx_sc_scenario::{ - api::StaticApi, - imports::{ - Address, BigUint, EsdtTokenPayment, ManagedAddress, ManagedVec, ReturnsResult, RustBigUint, - }, -}; -use multiversx_sc_snippets::InteractorPrepareAsync; -use proxies::farm_staking_proxy_sc_proxy; - -use crate::{ - structs::{ - extract_caller, InteractorClaimDualYieldResult, InteractorStakeProxyResult, - InteractorToken, InteractorUnstakeResult, - }, - DexInteract, -}; - -pub struct FarmProxy; - -pub trait FarmProxyTrait { - // endpoints - async fn stake_farm_tokens( - dex_interact: &mut DexInteract, - payment: Vec, - opt_original_caller: Option
, - ) -> InteractorStakeProxyResult; - async fn claim_dual_yield( - dex_interact: &mut DexInteract, - payment: InteractorToken, - opt_original_caller: Option
, - ) -> InteractorClaimDualYieldResult; - async fn unstake_farm_tokens( - dex_interact: &mut DexInteract, - payment: InteractorToken, - pair_first_token_min_amount: RustBigUint, - pair_second_token_min_amount: RustBigUint, - opt_original_caller: Option
, - ) -> InteractorUnstakeResult; - // views - async fn is_sc_address_whitelisted(dex_interact: &mut DexInteract, address: Address) -> bool; - async fn get_dual_yield_token_id(dex_interact: &mut DexInteract) -> String; - async fn get_lp_farm_address(dex_interact: &mut DexInteract) -> Address; - async fn get_staking_farm_address(dex_interact: &mut DexInteract) -> Address; - async fn get_pair_address(dex_interact: &mut DexInteract) -> Address; - async fn get_staking_token_id(dex_interact: &mut DexInteract) -> String; - async fn get_farm_token_id(dex_interact: &mut DexInteract) -> String; - async fn get_lp_token_id(dex_interact: &mut DexInteract) -> String; - async fn get_lp_farm_token_id(dex_interact: &mut DexInteract) -> String; - async fn get_energy_factory_address(dex_interact: &mut DexInteract) -> Address; -} - -impl FarmProxyTrait for FarmProxy { - // views - async fn is_sc_address_whitelisted(dex_interact: &mut DexInteract, address: Address) -> bool { - dex_interact - .interactor - .query() - .to(dex_interact.state.current_farm_staking_proxy_address()) - .typed(farm_staking_proxy_sc_proxy::FarmStakingProxyProxy) - .is_sc_address_whitelisted(ManagedAddress::from(address)) - .returns(ReturnsResult) - .prepare_async() - .run() - .await - } - - async fn get_dual_yield_token_id(dex_interact: &mut DexInteract) -> String { - let result_token = dex_interact - .interactor - .query() - .to(dex_interact.state.current_farm_staking_proxy_address()) - .typed(farm_staking_proxy_sc_proxy::FarmStakingProxyProxy) - .dual_yield_token() - .returns(ReturnsResult) - .prepare_async() - .run() - .await; - - result_token.to_string() - } - - async fn get_lp_farm_address(dex_interact: &mut DexInteract) -> Address { - let result_token = dex_interact - .interactor - .query() - .to(dex_interact.state.current_farm_staking_proxy_address()) - .typed(farm_staking_proxy_sc_proxy::FarmStakingProxyProxy) - .lp_farm_address() - .returns(ReturnsResult) - .prepare_async() - .run() - .await; - - result_token.to_address() - } - - async fn get_staking_farm_address(dex_interact: &mut DexInteract) -> Address { - let result_token = dex_interact - .interactor - .query() - .to(dex_interact.state.current_farm_staking_proxy_address()) - .typed(farm_staking_proxy_sc_proxy::FarmStakingProxyProxy) - .staking_farm_address() - .returns(ReturnsResult) - .prepare_async() - .run() - .await; - - result_token.to_address() - } - - async fn get_pair_address(dex_interact: &mut DexInteract) -> Address { - let result_token = dex_interact - .interactor - .query() - .to(dex_interact.state.current_farm_staking_proxy_address()) - .typed(farm_staking_proxy_sc_proxy::FarmStakingProxyProxy) - .pair_address() - .returns(ReturnsResult) - .prepare_async() - .run() - .await; - - result_token.to_address() - } - - async fn get_staking_token_id(dex_interact: &mut DexInteract) -> String { - let result_token = dex_interact - .interactor - .query() - .to(dex_interact.state.current_farm_staking_proxy_address()) - .typed(farm_staking_proxy_sc_proxy::FarmStakingProxyProxy) - .staking_token_id() - .returns(ReturnsResult) - .prepare_async() - .run() - .await; - - result_token.to_string() - } - - async fn get_farm_token_id(dex_interact: &mut DexInteract) -> String { - let result_token = dex_interact - .interactor - .query() - .to(dex_interact.state.current_farm_staking_proxy_address()) - .typed(farm_staking_proxy_sc_proxy::FarmStakingProxyProxy) - .staking_farm_token_id() - .returns(ReturnsResult) - .prepare_async() - .run() - .await; - - result_token.to_string() - } - - async fn get_lp_token_id(dex_interact: &mut DexInteract) -> String { - let result_token = dex_interact - .interactor - .query() - .to(dex_interact.state.current_farm_staking_proxy_address()) - .typed(farm_staking_proxy_sc_proxy::FarmStakingProxyProxy) - .lp_token_id() - .returns(ReturnsResult) - .prepare_async() - .run() - .await; - - result_token.to_string() - } - - async fn get_lp_farm_token_id(dex_interact: &mut DexInteract) -> String { - let result_token = dex_interact - .interactor - .query() - .to(dex_interact.state.current_farm_staking_proxy_address()) - .typed(farm_staking_proxy_sc_proxy::FarmStakingProxyProxy) - .lp_farm_token_id() - .returns(ReturnsResult) - .prepare_async() - .run() - .await; - - result_token.to_string() - } - - async fn get_energy_factory_address(dex_interact: &mut DexInteract) -> Address { - let result_token = dex_interact - .interactor - .query() - .to(dex_interact.state.current_farm_staking_proxy_address()) - .typed(farm_staking_proxy_sc_proxy::FarmStakingProxyProxy) - .energy_factory_address() - .returns(ReturnsResult) - .prepare_async() - .run() - .await; - - result_token.to_address() - } - - // endpoints - async fn stake_farm_tokens( - dex_interact: &mut DexInteract, - payment: Vec, - opt_original_caller: Option
, - ) -> InteractorStakeProxyResult { - let caller_arg = extract_caller(dex_interact, opt_original_caller); - - let payments = payment - .iter() - .map(EsdtTokenPayment::from) - .collect::>>(); - - let result_token = dex_interact - .interactor - .tx() - .from(&dex_interact.wallet_address) - .to(dex_interact.state.current_farm_staking_proxy_address()) - .gas(100_000_000u64) - .typed(farm_staking_proxy_sc_proxy::FarmStakingProxyProxy) - .stake_farm_tokens(caller_arg) - .payment(payments) - .returns(ReturnsResult) - .prepare_async() - .run() - .await; - - InteractorStakeProxyResult::from(result_token) - } - - async fn claim_dual_yield( - dex_interact: &mut DexInteract, - payment: InteractorToken, - opt_original_caller: Option
, - ) -> InteractorClaimDualYieldResult { - let caller_arg = extract_caller(dex_interact, opt_original_caller); - - let result_token = dex_interact - .interactor - .tx() - .from(&dex_interact.wallet_address) - .to(dex_interact.state.current_farm_staking_proxy_address()) - .gas(100_000_000u64) - .typed(farm_staking_proxy_sc_proxy::FarmStakingProxyProxy) - .claim_dual_yield_endpoint(caller_arg) - .payment(EsdtTokenPayment::from(payment)) - .returns(ReturnsResult) - .prepare_async() - .run() - .await; - - InteractorClaimDualYieldResult::from(result_token) - } - - async fn unstake_farm_tokens( - dex_interact: &mut DexInteract, - payment: InteractorToken, - pair_first_token_min_amount: RustBigUint, - pair_second_token_min_amount: RustBigUint, - opt_original_caller: Option
, - ) -> InteractorUnstakeResult { - let caller_arg = extract_caller(dex_interact, opt_original_caller); - - let result_token = dex_interact - .interactor - .tx() - .from(&dex_interact.wallet_address) - .to(dex_interact.state.current_farm_staking_proxy_address()) - .gas(100_000_000u64) - .typed(farm_staking_proxy_sc_proxy::FarmStakingProxyProxy) - .unstake_farm_tokens( - BigUint::from(pair_first_token_min_amount), - BigUint::from(pair_second_token_min_amount), - caller_arg, - ) - .payment(EsdtTokenPayment::from(payment)) - .returns(ReturnsResult) - .prepare_async() - .run() - .await; - - InteractorUnstakeResult::from(result_token) - } -} diff --git a/dex/interactor/src/dex_interact_pair.rs b/dex/interactor/src/dex_interact_pair.rs deleted file mode 100644 index 2a7288ee6..000000000 --- a/dex/interactor/src/dex_interact_pair.rs +++ /dev/null @@ -1,87 +0,0 @@ -use multiversx_sc_scenario::imports::{BigUint, ReturnsResult, TokenIdentifier}; -use multiversx_sc_snippets::InteractorPrepareAsync; - -use crate::dex_interact_cli::{AddArgs, SwapArgs}; -use crate::structs::{InteractorAddLiquidityResultType, InteractorToken}; -use crate::DexInteract; -use proxies::pair_proxy; - -pub struct Pair; - -pub trait PairTrait { - // endpoints - async fn swap_tokens_fixed_input( - dex_interact: &mut DexInteract, - args: &SwapArgs, - ) -> InteractorToken; - async fn add_liquidity( - dex_interact: &mut DexInteract, - args: &AddArgs, - ) -> InteractorAddLiquidityResultType; -} - -impl PairTrait for Pair { - async fn swap_tokens_fixed_input( - dex_interact: &mut DexInteract, - args: &SwapArgs, - ) -> InteractorToken { - let payment = args.as_payment(dex_interact); - let first_token_id = dex_interact.state.first_token_id(); - let second_token_id = dex_interact.state.second_token_id(); - - println!( - "Attempting to swap {} {first_token_id} for a min amount {} of {second_token_id}...", - args.amount, args.min_amount - ); - - let result_token = dex_interact - .interactor - .tx() - .from(&dex_interact.wallet_address) - .to(dex_interact.state.current_pair_address()) - .gas(100_000_000u64) - .typed(pair_proxy::PairProxy) - .swap_tokens_fixed_input( - TokenIdentifier::from(second_token_id.as_bytes()), - BigUint::from(args.min_amount), - ) - .payment(payment) - .returns(ReturnsResult) - .prepare_async() - .run() - .await; - - InteractorToken::from(result_token) - } - - async fn add_liquidity( - dex_interact: &mut DexInteract, - args: &AddArgs, - ) -> InteractorAddLiquidityResultType { - println!("Attempting to add liquidity to pair..."); - let payments = args.as_payment_vec(dex_interact); - - let result_token = dex_interact - .interactor - .tx() - .from(&dex_interact.wallet_address) - .to(dex_interact.state.current_pair_address()) - .gas(100_000_000u64) - .typed(pair_proxy::PairProxy) - .add_liquidity( - BigUint::from(args.first_token_amount_min), - BigUint::from(args.second_token_amount_min), - ) - .payment(payments) - .returns(ReturnsResult) - .prepare_async() - .run() - .await; - - InteractorAddLiquidityResultType::from(result_token) - } -} - -// 10000000000000000000 ; 10 UTK -// 1000000000000; 0,000001 WEGLD -// cargo run swap -a 10000000000000000000 -m 1000000000000 diff --git a/dex/interactor/src/energy_factory.rs b/dex/interactor/src/energy_factory.rs new file mode 100644 index 000000000..ba64f9591 --- /dev/null +++ b/dex/interactor/src/energy_factory.rs @@ -0,0 +1,101 @@ +use multiversx_sc_scenario::imports::{ + Address, BigUint, ManagedAddress, ReturnsResult, RustBigUint, +}; +use multiversx_sc_snippets::InteractorPrepareAsync; +use proxies::energy_factory_proxy; + +use crate::{ + structs::{to_rust_biguint, InteractorEnergy}, + DexInteract, +}; + +pub(crate) async fn get_energy_entry_for_user( + dex_interact: &mut DexInteract, + user: Address, +) -> InteractorEnergy { + let result_token = dex_interact + .interactor + .query() + .to(dex_interact.state.current_energy_factory_address()) + .typed(energy_factory_proxy::SimpleLockEnergyProxy) + .get_updated_energy_entry_for_user(ManagedAddress::from(user)) + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + InteractorEnergy::from(result_token) +} + +pub(crate) async fn get_energy_amount_for_user( + dex_interact: &mut DexInteract, + user: Address, +) -> RustBigUint { + let result_token = dex_interact + .interactor + .query() + .to(dex_interact.state.current_energy_factory_address()) + .typed(energy_factory_proxy::SimpleLockEnergyProxy) + .get_energy_amount_for_user(ManagedAddress::from(user)) + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + to_rust_biguint(result_token) +} + +pub(crate) async fn get_penalty_amount( + dex_interact: &mut DexInteract, + token_amount: RustBigUint, + prev_lock_epochs: u64, + new_lock_epochs: u64, +) -> RustBigUint { + let result_token = dex_interact + .interactor + .query() + .to(dex_interact.state.current_energy_factory_address()) + .typed(energy_factory_proxy::SimpleLockEnergyProxy) + .calculate_penalty_amount( + BigUint::from(token_amount), + prev_lock_epochs, + new_lock_epochs, + ) + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + to_rust_biguint(result_token) +} + +pub(crate) async fn get_token_unstake_address(dex_interact: &mut DexInteract) -> Address { + let result_token = dex_interact + .interactor + .query() + .to(dex_interact.state.current_energy_factory_address()) + .typed(energy_factory_proxy::SimpleLockEnergyProxy) + .token_unstake_sc_address() + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + result_token.to_address() +} + +pub(crate) async fn is_sc_address_whitelisted( + dex_interact: &mut DexInteract, + address: Address, +) -> bool { + dex_interact + .interactor + .query() + .to(dex_interact.state.current_energy_factory_address()) + .typed(energy_factory_proxy::SimpleLockEnergyProxy) + .is_sc_address_whitelisted(ManagedAddress::from(address)) + .returns(ReturnsResult) + .prepare_async() + .run() + .await +} diff --git a/dex/interactor/src/farm_locked.rs b/dex/interactor/src/farm_locked.rs new file mode 100644 index 000000000..9c8dbea75 --- /dev/null +++ b/dex/interactor/src/farm_locked.rs @@ -0,0 +1,204 @@ +use common_structs::FarmTokenAttributes; +use multiversx_sc_scenario::{ + api::StaticApi, + imports::{ + Address, BigUint, EsdtTokenPayment, ManagedAddress, ManagedVec, ReturnsResult, RustBigUint, + }, +}; +use multiversx_sc_snippets::InteractorPrepareAsync; + +use crate::{ + farm_with_locked_rewards_proxy, + structs::{extract_caller, to_rust_biguint, InteractorFarmTokenAttributes, InteractorToken}, + DexInteract, +}; + +pub(crate) async fn enter_farm( + dex_interact: &mut DexInteract, + lp_token: InteractorToken, +) -> (InteractorToken, InteractorToken) { + println!("Attempting to enter farm with locked rewards..."); + + let result_token = dex_interact + .interactor + .tx() + .from(&dex_interact.wallet_address) + .to(dex_interact + .state + .current_farm_with_locked_rewards_address()) + .gas(100_000_000u64) + .typed(farm_with_locked_rewards_proxy::FarmProxy) + .enter_farm_endpoint(ManagedAddress::from( + dex_interact.wallet_address.as_address(), + )) + .payment::>(lp_token.into()) + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + ( + InteractorToken::from(result_token.0 .0), + InteractorToken::from(result_token.0 .1), + ) +} + +pub(crate) async fn claim_rewards( + dex_interact: &mut DexInteract, + payment: Vec, + opt_original_caller: Option
, +) -> (InteractorToken, InteractorToken) { + println!("Attempting to claim rewards from farm with locked rewards..."); + + let payments = payment + .iter() + .map(EsdtTokenPayment::from) + .collect::>>(); + + let caller_arg = extract_caller(dex_interact, opt_original_caller); + + let result_token = dex_interact + .interactor + .tx() + .from(&dex_interact.wallet_address) + .to(dex_interact + .state + .current_farm_with_locked_rewards_address()) + .gas(100_000_000u64) + .typed(farm_with_locked_rewards_proxy::FarmProxy) + .claim_rewards_endpoint(caller_arg) + .payment(payments) + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + ( + InteractorToken::from(result_token.0 .0), + InteractorToken::from(result_token.0 .1), + ) +} + +pub(crate) async fn exit_farm( + dex_interact: &mut DexInteract, + payment: InteractorToken, + opt_original_caller: Option
, +) -> (InteractorToken, InteractorToken) { + println!("Attempting to exit farm with locked rewards..."); + + let caller_arg = extract_caller(dex_interact, opt_original_caller); + + let result_token = dex_interact + .interactor + .tx() + .from(&dex_interact.wallet_address) + .to(dex_interact + .state + .current_farm_with_locked_rewards_address()) + .gas(100_000_000u64) + .typed(farm_with_locked_rewards_proxy::FarmProxy) + .exit_farm_endpoint(caller_arg) + .payment::>(payment.into()) + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + ( + InteractorToken::from(result_token.0 .0), + InteractorToken::from(result_token.0 .1), + ) +} + +pub(crate) async fn merge_farm_tokens( + dex_interact: &mut DexInteract, + payment: Vec, + opt_original_caller: Option
, +) -> (InteractorToken, InteractorToken) { + println!("Attempting to merge tokens in farm with locked rewards..."); + + let payments = payment + .iter() + .map(EsdtTokenPayment::from) + .collect::>>(); + + let caller_arg = extract_caller(dex_interact, opt_original_caller); + + let result_token = dex_interact + .interactor + .tx() + .from(&dex_interact.wallet_address) + .to(dex_interact + .state + .current_farm_with_locked_rewards_address()) + .gas(100_000_000u64) + .typed(farm_with_locked_rewards_proxy::FarmProxy) + .merge_farm_tokens_endpoint(caller_arg) + .payment(payments) + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + ( + InteractorToken::from(result_token.0 .0), + InteractorToken::from(result_token.0 .1), + ) +} + +pub(crate) async fn claim_boosted_rewards( + dex_interact: &mut DexInteract, + opt_original_caller: Option
, +) -> InteractorToken { + let caller_arg = extract_caller(dex_interact, opt_original_caller); + + let result_token = dex_interact + .interactor + .tx() + .from(&dex_interact.wallet_address) + .to(dex_interact + .state + .current_farm_with_locked_rewards_address()) + .gas(100_000_000u64) + .typed(farm_with_locked_rewards_proxy::FarmProxy) + .claim_boosted_rewards(caller_arg) + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + InteractorToken::from(result_token) +} + +pub(crate) async fn calculate_rewards_for_given_position( + dex_interact: &mut DexInteract, + user: Address, + farm_token_amount: u128, + attributes: InteractorFarmTokenAttributes, +) -> RustBigUint { + let attributes_arg: FarmTokenAttributes = FarmTokenAttributes { + reward_per_share: BigUint::from(attributes.reward_per_share), + entering_epoch: attributes.entering_epoch, + compounded_reward: BigUint::from(attributes.compounded_reward), + current_farm_amount: BigUint::from(attributes.current_farm_amount), + original_owner: ManagedAddress::from(attributes.original_owner), + }; + + let result_token = dex_interact + .interactor + .query() + .to(dex_interact + .state + .current_farm_with_locked_rewards_address()) + .typed(farm_with_locked_rewards_proxy::FarmProxy) + .calculate_rewards_for_given_position( + ManagedAddress::from(user), + BigUint::from(farm_token_amount), + attributes_arg, + ) + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + to_rust_biguint(result_token) +} diff --git a/dex/interactor/src/farm_staking_proxy.rs b/dex/interactor/src/farm_staking_proxy.rs new file mode 100644 index 000000000..88507d620 --- /dev/null +++ b/dex/interactor/src/farm_staking_proxy.rs @@ -0,0 +1,249 @@ +use multiversx_sc_scenario::{ + api::StaticApi, + imports::{ + Address, BigUint, EsdtTokenPayment, ManagedAddress, ManagedVec, ReturnsResult, RustBigUint, + }, +}; +use multiversx_sc_snippets::InteractorPrepareAsync; +use proxies::farm_staking_proxy_sc_proxy; + +use crate::{ + structs::{ + extract_caller, InteractorClaimDualYieldResult, InteractorStakeProxyResult, + InteractorToken, InteractorUnstakeResult, + }, + DexInteract, +}; + +// views +pub(crate) async fn is_sc_address_whitelisted(dex_interact: &mut DexInteract, address: Address) -> bool { + dex_interact + .interactor + .query() + .to(dex_interact.state.current_farm_staking_proxy_address()) + .typed(farm_staking_proxy_sc_proxy::FarmStakingProxyProxy) + .is_sc_address_whitelisted(ManagedAddress::from(address)) + .returns(ReturnsResult) + .prepare_async() + .run() + .await +} + +pub(crate) async fn get_dual_yield_token_id(dex_interact: &mut DexInteract) -> String { + let result_token = dex_interact + .interactor + .query() + .to(dex_interact.state.current_farm_staking_proxy_address()) + .typed(farm_staking_proxy_sc_proxy::FarmStakingProxyProxy) + .dual_yield_token() + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + result_token.to_string() +} + +pub(crate) async fn get_lp_farm_address(dex_interact: &mut DexInteract) -> Address { + let result_token = dex_interact + .interactor + .query() + .to(dex_interact.state.current_farm_staking_proxy_address()) + .typed(farm_staking_proxy_sc_proxy::FarmStakingProxyProxy) + .lp_farm_address() + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + result_token.to_address() +} + +pub(crate) async fn get_staking_farm_address(dex_interact: &mut DexInteract) -> Address { + let result_token = dex_interact + .interactor + .query() + .to(dex_interact.state.current_farm_staking_proxy_address()) + .typed(farm_staking_proxy_sc_proxy::FarmStakingProxyProxy) + .staking_farm_address() + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + result_token.to_address() +} + +pub(crate) async fn get_pair_address(dex_interact: &mut DexInteract) -> Address { + let result_token = dex_interact + .interactor + .query() + .to(dex_interact.state.current_farm_staking_proxy_address()) + .typed(farm_staking_proxy_sc_proxy::FarmStakingProxyProxy) + .pair_address() + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + result_token.to_address() +} + +pub(crate) async fn get_staking_token_id(dex_interact: &mut DexInteract) -> String { + let result_token = dex_interact + .interactor + .query() + .to(dex_interact.state.current_farm_staking_proxy_address()) + .typed(farm_staking_proxy_sc_proxy::FarmStakingProxyProxy) + .staking_token_id() + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + result_token.to_string() +} + +pub(crate) async fn get_farm_token_id(dex_interact: &mut DexInteract) -> String { + let result_token = dex_interact + .interactor + .query() + .to(dex_interact.state.current_farm_staking_proxy_address()) + .typed(farm_staking_proxy_sc_proxy::FarmStakingProxyProxy) + .staking_farm_token_id() + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + result_token.to_string() +} + +pub(crate) async fn get_lp_token_id(dex_interact: &mut DexInteract) -> String { + let result_token = dex_interact + .interactor + .query() + .to(dex_interact.state.current_farm_staking_proxy_address()) + .typed(farm_staking_proxy_sc_proxy::FarmStakingProxyProxy) + .lp_token_id() + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + result_token.to_string() +} + +pub(crate) async fn get_lp_farm_token_id(dex_interact: &mut DexInteract) -> String { + let result_token = dex_interact + .interactor + .query() + .to(dex_interact.state.current_farm_staking_proxy_address()) + .typed(farm_staking_proxy_sc_proxy::FarmStakingProxyProxy) + .lp_farm_token_id() + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + result_token.to_string() +} + +pub(crate) async fn get_energy_factory_address(dex_interact: &mut DexInteract) -> Address { + let result_token = dex_interact + .interactor + .query() + .to(dex_interact.state.current_farm_staking_proxy_address()) + .typed(farm_staking_proxy_sc_proxy::FarmStakingProxyProxy) + .energy_factory_address() + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + result_token.to_address() +} + +// endpoints +pub(crate) async fn stake_farm_tokens( + dex_interact: &mut DexInteract, + payment: Vec, + opt_original_caller: Option
, +) -> InteractorStakeProxyResult { + let caller_arg = extract_caller(dex_interact, opt_original_caller); + + let payments = payment + .iter() + .map(EsdtTokenPayment::from) + .collect::>>(); + + let result_token = dex_interact + .interactor + .tx() + .from(&dex_interact.wallet_address) + .to(dex_interact.state.current_farm_staking_proxy_address()) + .gas(100_000_000u64) + .typed(farm_staking_proxy_sc_proxy::FarmStakingProxyProxy) + .stake_farm_tokens(caller_arg) + .payment(payments) + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + InteractorStakeProxyResult::from(result_token) +} + +pub(crate) async fn claim_dual_yield( + dex_interact: &mut DexInteract, + payment: InteractorToken, + opt_original_caller: Option
, +) -> InteractorClaimDualYieldResult { + let caller_arg = extract_caller(dex_interact, opt_original_caller); + + let result_token = dex_interact + .interactor + .tx() + .from(&dex_interact.wallet_address) + .to(dex_interact.state.current_farm_staking_proxy_address()) + .gas(100_000_000u64) + .typed(farm_staking_proxy_sc_proxy::FarmStakingProxyProxy) + .claim_dual_yield_endpoint(caller_arg) + .payment(EsdtTokenPayment::from(payment)) + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + InteractorClaimDualYieldResult::from(result_token) +} + +pub(crate) async fn unstake_farm_tokens( + dex_interact: &mut DexInteract, + payment: InteractorToken, + pair_first_token_min_amount: RustBigUint, + pair_second_token_min_amount: RustBigUint, + opt_original_caller: Option
, +) -> InteractorUnstakeResult { + let caller_arg = extract_caller(dex_interact, opt_original_caller); + + let result_token = dex_interact + .interactor + .tx() + .from(&dex_interact.wallet_address) + .to(dex_interact.state.current_farm_staking_proxy_address()) + .gas(100_000_000u64) + .typed(farm_staking_proxy_sc_proxy::FarmStakingProxyProxy) + .unstake_farm_tokens( + BigUint::from(pair_first_token_min_amount), + BigUint::from(pair_second_token_min_amount), + caller_arg, + ) + .payment(EsdtTokenPayment::from(payment)) + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + InteractorUnstakeResult::from(result_token) +} diff --git a/dex/interactor/src/pair.rs b/dex/interactor/src/pair.rs new file mode 100644 index 000000000..1b1073bba --- /dev/null +++ b/dex/interactor/src/pair.rs @@ -0,0 +1,69 @@ +use multiversx_sc_scenario::imports::{BigUint, ReturnsResult, TokenIdentifier}; +use multiversx_sc_snippets::InteractorPrepareAsync; +use proxies::pair_proxy; + +use crate::{dex_interact_cli::{AddArgs, SwapArgs}, structs::{InteractorAddLiquidityResultType, InteractorToken}, DexInteract}; + +pub(crate) async fn swap_tokens_fixed_input( + dex_interact: &mut DexInteract, + args: &SwapArgs, +) -> InteractorToken { + let payment = args.as_payment(dex_interact); + let first_token_id = dex_interact.state.first_token_id(); + let second_token_id = dex_interact.state.second_token_id(); + + println!( + "Attempting to swap {} {first_token_id} for a min amount {} of {second_token_id}...", + args.amount, args.min_amount + ); + + let result_token = dex_interact + .interactor + .tx() + .from(&dex_interact.wallet_address) + .to(dex_interact.state.current_pair_address()) + .gas(100_000_000u64) + .typed(pair_proxy::PairProxy) + .swap_tokens_fixed_input( + TokenIdentifier::from(second_token_id.as_bytes()), + BigUint::from(args.min_amount), + ) + .payment(payment) + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + InteractorToken::from(result_token) +} + +pub(crate) async fn add_liquidity( + dex_interact: &mut DexInteract, + args: &AddArgs, +) -> InteractorAddLiquidityResultType { + println!("Attempting to add liquidity to pair..."); + let payments = args.as_payment_vec(dex_interact); + + let result_token = dex_interact + .interactor + .tx() + .from(&dex_interact.wallet_address) + .to(dex_interact.state.current_pair_address()) + .gas(100_000_000u64) + .typed(pair_proxy::PairProxy) + .add_liquidity( + BigUint::from(args.first_token_amount_min), + BigUint::from(args.second_token_amount_min), + ) + .payment(payments) + .returns(ReturnsResult) + .prepare_async() + .run() + .await; + + InteractorAddLiquidityResultType::from(result_token) +} + +// 10000000000000000000 ; 10 UTK +// 1000000000000; 0,000001 WEGLD +// cargo run swap -a 10000000000000000000 -m 1000000000000 From 9c04db53fe3240c002283f8ae7b3d7d43d154501 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Mon, 29 Apr 2024 12:23:27 +0300 Subject: [PATCH 41/55] clippy fixes --- farm-staking/farm-staking/tests/farm_staking_energy_test.rs | 3 +-- farm-staking/farm-staking/tests/farm_staking_setup/mod.rs | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/farm-staking/farm-staking/tests/farm_staking_energy_test.rs b/farm-staking/farm-staking/tests/farm_staking_energy_test.rs index 124272884..facc2025f 100644 --- a/farm-staking/farm-staking/tests/farm_staking_energy_test.rs +++ b/farm-staking/farm-staking/tests/farm_staking_energy_test.rs @@ -1053,8 +1053,7 @@ fn farm_staking_farm_position_migration_test() { let mut user_total_farm_position = sc.get_user_total_farm_position(&managed_address!(&user)); user_total_farm_position.total_farm_position = managed_biguint!(0u64); - let _ = sc - .user_total_farm_position(&managed_address!(&user)) + sc.user_total_farm_position(&managed_address!(&user)) .set(user_total_farm_position); sc.farm_position_migration_nonce().set(5); diff --git a/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs b/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs index 7bcab9d85..369b029bd 100644 --- a/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs +++ b/farm-staking/farm-staking/tests/farm_staking_setup/mod.rs @@ -390,6 +390,7 @@ where .assert_error(4, "Cannot claim rewards for this address"); } + #[allow(clippy::too_many_arguments)] pub fn compound_rewards( &mut self, user: &Address, From effd81cd5b7327a14e2e1c19c4bb4dba1bc94d51 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Mon, 29 Apr 2024 12:39:08 +0300 Subject: [PATCH 42/55] force rebuild github actions --- .github/workflows/actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 84a8b5a86..eb7e44644 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -25,4 +25,4 @@ jobs: rust-toolchain: nightly-2023-12-11 coverage-args: --ignore-filename-regex='/.cargo/git' --output ./coverage.md secrets: - token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + token: ${{ secrets.GITHUB_TOKEN }} From 1761d5413fc8b6972f1a5c80b6b9618e8b776f54 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Mon, 29 Apr 2024 17:00:35 +0300 Subject: [PATCH 43/55] Total farm position test in proxy dex --- .../proxy_dex/tests/proxy_farm_test.rs | 196 +++++++++++++++--- 1 file changed, 168 insertions(+), 28 deletions(-) diff --git a/locked-asset/proxy_dex/tests/proxy_farm_test.rs b/locked-asset/proxy_dex/tests/proxy_farm_test.rs index 5af54011c..6fe7c59b9 100644 --- a/locked-asset/proxy_dex/tests/proxy_farm_test.rs +++ b/locked-asset/proxy_dex/tests/proxy_farm_test.rs @@ -1181,8 +1181,6 @@ fn different_farm_locked_token_nonce_merging_test() { ); } - - #[test] fn total_farm_mechanism_test() { let mut setup = ProxySetup::new( @@ -1310,9 +1308,9 @@ fn total_farm_mechanism_test() { setup.b_mock.check_nft_balance::( &first_user, LOCKED_TOKEN_ID, - 2, - &rust_biguint!(0), - None, + 2, + &rust_biguint!(0), + None, ); setup.b_mock.check_nft_balance::( &first_user, @@ -1835,10 +1833,9 @@ fn increase_proxy_farm_proxy_lp_energy_unlocked_tokens() { ) .assert_ok(); - ////////////////////////////// Wait for tokens to unlock ///////////////////////////////////// - block_epoch += LOCK_OPTIONS[0]; - setup.b_mock.set_block_epoch(block_epoch); - + ////////////////////////////// Wait for tokens to unlock ///////////////////////////////////// + block_epoch += LOCK_OPTIONS[0]; + setup.b_mock.set_block_epoch(block_epoch); //////////////////////////////////////////// INCREASE ENERGY ///////////////////////////////////// setup @@ -1862,7 +1859,8 @@ fn increase_proxy_farm_proxy_lp_energy_unlocked_tokens() { .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) @@ -1899,8 +1897,6 @@ fn increase_proxy_farm_proxy_lp_energy_unlocked_tokens() { ); } - - #[test] fn increase_proxy_farm_proxy_lp_energy_partially_unlocked_tokens() { let mut setup = ProxySetup::new( @@ -2069,10 +2065,9 @@ 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); - + ////////////////////////////// Wait for tokens to unlock ///////////////////////////////////// + block_epoch += LOCK_OPTIONS[0] / 2; + setup.b_mock.set_block_epoch(block_epoch); //////////////////////////////////////////// INCREASE ENERGY ///////////////////////////////////// setup @@ -2096,7 +2091,8 @@ fn increase_proxy_farm_proxy_lp_energy_partially_unlocked_tokens() { .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) @@ -2133,8 +2129,6 @@ fn increase_proxy_farm_proxy_lp_energy_partially_unlocked_tokens() { ); } - - #[test] fn original_caller_negative_test() { let mut setup = ProxySetup::new( @@ -2178,12 +2172,15 @@ fn original_caller_negative_test() { 1, &rust_biguint!(USER_BALANCE), |sc| { - sc.enter_farm_proxy_endpoint(managed_address!(&farm_addr), Some(managed_address!(&first_user)).into()); + sc.enter_farm_proxy_endpoint( + managed_address!(&farm_addr), + Some(managed_address!(&first_user)).into(), + ); }, ) .assert_error(4, "Item not whitelisted"); - setup + setup .b_mock .execute_esdt_transfer( &first_user, @@ -2197,9 +2194,8 @@ fn original_caller_negative_test() { ) .assert_ok(); - - // claim rewards with half position - setup + // claim rewards with half position + setup .b_mock .execute_esdt_transfer( &first_user, @@ -2208,12 +2204,15 @@ fn original_caller_negative_test() { 1, &rust_biguint!(USER_BALANCE / 2), |sc| { - sc.claim_rewards_proxy(managed_address!(&farm_addr), Some(managed_address!(&first_user)).into()); + sc.claim_rewards_proxy( + managed_address!(&farm_addr), + Some(managed_address!(&first_user)).into(), + ); }, ) .assert_error(4, "Item not whitelisted"); - setup + setup .b_mock .execute_esdt_transfer( &first_user, @@ -2222,12 +2221,153 @@ fn original_caller_negative_test() { 1, &rust_biguint!(USER_BALANCE), |sc| { - let output = sc.exit_farm_proxy(managed_address!(&farm_addr), Some(managed_address!(&first_user)).into()); + let output = sc.exit_farm_proxy( + managed_address!(&farm_addr), + Some(managed_address!(&first_user)).into(), + ); let output_lp_token = output.0 .0; assert_eq!(output_lp_token.token_nonce, 1); assert_eq!(output_lp_token.amount, USER_BALANCE); }, ) .assert_error(4, "Item not whitelisted"); +} + +#[test] +fn total_farm_position_migration_through_proxy_dex_test() { + let mut setup = ProxySetup::new( + proxy_dex::contract_obj, + pair::contract_obj, + farm_with_locked_rewards::contract_obj, + energy_factory::contract_obj, + ); + let first_user = setup.first_user.clone(); + let farm_addr = setup.farm_locked_wrapper.address_ref().clone(); + let user_balance = rust_biguint!(USER_BALANCE); + setup + .b_mock + .set_esdt_balance(&first_user, MEX_TOKEN_ID, &user_balance); + + // 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)); + }, + ) + .assert_ok(); + + // User enter farm before migration + setup + .b_mock + .execute_esdt_transfer( + &first_user, + &setup.proxy_wrapper, + LOCKED_TOKEN_ID, + 1, + &rust_biguint!(USER_BALANCE), + |sc| { + sc.enter_farm_proxy_endpoint(managed_address!(&farm_addr), 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(2u64); + }, + ) + .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 + 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_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(); + + // Merge user tokens + let payments = vec![ + TxTokenTransfer { + token_identifier: WRAPPED_FARM_TOKEN_ID.to_vec(), + nonce: 1, + value: rust_biguint!(USER_BALANCE), + }, + TxTokenTransfer { + token_identifier: WRAPPED_FARM_TOKEN_ID.to_vec(), + nonce: 2, + value: rust_biguint!(USER_BALANCE), + }, + ]; + setup + .b_mock + .execute_esdt_multi_transfer(&first_user, &setup.proxy_wrapper, &payments, |sc| { + sc.merge_wrapped_farm_tokens_endpoint(managed_address!(&farm_addr)); + }) + .assert_ok(); -} \ No newline at end of file + // Total farm position should be correct + 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(); +} From 8e8d180e9d5d4ec1047f9b54598a5d9a74d84123 Mon Sep 17 00:00:00 2001 From: Sorin Petreasca Date: Thu, 2 May 2024 02:21:14 +0300 Subject: [PATCH 44/55] Metastaking claim total farm position fix --- .../tests/staking_farm_with_lp.rs | 211 ++++++++++++++++++ .../src/claim_stake_farm_rewards.rs | 6 + 2 files changed, 217 insertions(+) diff --git a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp.rs b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp.rs index 03d7ce263..34fbe059e 100644 --- a/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp.rs +++ b/farm-staking/farm-staking-proxy/tests/staking_farm_with_lp.rs @@ -21,6 +21,7 @@ use multiversx_sc::codec::Empty; use multiversx_sc_scenario::{ managed_address, managed_biguint, managed_token_id, rust_biguint, DebugApi, }; +use pair::pair_actions::swap::SwapModule; use simple_lock::locked_token::LockedTokenAttributes; use staking_farm_with_lp_staking_contract_interactions::*; @@ -1003,3 +1004,213 @@ fn stake_farm_through_proxy_migration_test() { setup.check_user_total_staking_farm_position(&user, user_total_staking_farm_position); setup.check_user_total_lp_farm_position(&user, user_total_lp_farm_position); } + +#[test] +fn total_farm_position_after_claim_and_exit_metastaking_test() { + let mut setup = FarmStakingSetup::new( + pair::contract_obj, + farm_with_locked_rewards::contract_obj, + energy_factory::contract_obj, + farm_staking::contract_obj, + farm_staking_proxy::contract_obj, + ); + + // Boosted rewards setup + setup + .b_mock + .execute_tx( + &setup.owner_addr, + &setup.staking_farm_wrapper, + &rust_biguint!(0), + |sc| { + sc.set_boosted_yields_rewards_percentage(BOOSTED_YIELDS_PERCENTAGE); + }, + ) + .assert_ok(); + + setup.set_lp_farm_boosted_yields_rewards_percentage(BOOSTED_YIELDS_PERCENTAGE); + let farm_amount = 100_000_000u64; + let user_address = setup.user_addr.clone(); + let temp_user = setup + .b_mock + .create_user_account(&rust_biguint!(farm_amount)); + setup.exit_lp_farm(&user_address, 1, USER_TOTAL_LP_TOKENS); + setup + .b_mock + .set_esdt_balance(&setup.user_addr, LP_TOKEN_ID, &rust_biguint!(farm_amount)); + setup + .b_mock + .set_esdt_balance(&temp_user, LP_TOKEN_ID, &rust_biguint!(1)); + + setup.b_mock.set_block_epoch(2); + + setup.set_user_energy(&user_address, 1_000, 2, 1); + let farm_token_nonce = setup.enter_lp_farm(&user_address, farm_amount); + + setup.check_user_total_staking_farm_position(&user_address, 0); + + // User enters Metastaking + setup.stake_farm_lp_proxy(farm_token_nonce, farm_amount, 1, farm_amount); + + // User has his total position saved + setup.check_user_total_staking_farm_position(&user_address, farm_amount); + + // User claims rewards to get his energy registered + setup + .claim_dual_yield_for_other_user(&user_address, &user_address, 1, farm_amount) + .assert_ok(); + + // User total farm position should be the same, as no swaps happened + setup.check_user_total_staking_farm_position(&user_address, farm_amount); + + // Random swaps to change the LP ratio + setup + .b_mock + .set_esdt_balance(&temp_user, WEGLD_TOKEN_ID, &rust_biguint!(300_000_000u64)); + + setup.b_mock.set_block_nonce(700); + setup.b_mock.set_block_round(700); + setup + .b_mock + .execute_esdt_transfer( + &temp_user, + &setup.pair_wrapper, + WEGLD_TOKEN_ID, + 0, + &rust_biguint!(100_000_000u64), + |sc| { + sc.swap_tokens_fixed_input(managed_token_id!(RIDE_TOKEN_ID), managed_biguint!(1)); + }, + ) + .assert_ok(); + + setup.b_mock.set_block_nonce(800); + setup.b_mock.set_block_round(800); + setup + .b_mock + .execute_esdt_transfer( + &temp_user, + &setup.pair_wrapper, + WEGLD_TOKEN_ID, + 0, + &rust_biguint!(100_000_000u64), + |sc| { + sc.swap_tokens_fixed_input(managed_token_id!(RIDE_TOKEN_ID), managed_biguint!(1)); + }, + ) + .assert_ok(); + + setup.b_mock.set_block_nonce(1250); + setup.b_mock.set_block_round(1250); + setup + .b_mock + .execute_esdt_transfer( + &temp_user, + &setup.pair_wrapper, + WEGLD_TOKEN_ID, + 0, + &rust_biguint!(100_000_000u64), + |sc| { + sc.swap_tokens_fixed_input(managed_token_id!(RIDE_TOKEN_ID), managed_biguint!(1)); + }, + ) + .assert_ok(); + + // random tx on end of week 1, to cummulate rewards + setup.b_mock.set_block_epoch(6); + setup.set_user_energy(&user_address, 1_000, 6, 1); + setup.set_user_energy(&temp_user, 1, 6, 1); + let temp_user_farm_token_nonce = setup.enter_lp_farm(&temp_user, 1); + setup.exit_lp_farm(&temp_user, temp_user_farm_token_nonce, 1); + + setup.stake_farm(9000000, 9000000); + setup.staking_farm_unstake(3, 9000000, 0, 9000000); + + // advance 1 week + setup.b_mock.set_block_epoch(10); + setup.set_user_energy(&user_address, 1_000, 10, 1); + + // User total farm position should still be the same + setup.check_user_total_staking_farm_position(&user_address, farm_amount); + + // User claims rewards + setup + .b_mock + .check_nft_balance::>( + &user_address, + DUAL_YIELD_TOKEN_ID, + 2, + &rust_biguint!(farm_amount), + None, + ); + + setup + .claim_dual_yield_for_other_user(&user_address, &user_address, 2, farm_amount) + .assert_ok(); + + // Total farm position should be updated after claim, as a few swaps happened + let new_expected_token_amount = 92_416_406u64; + setup.check_user_total_staking_farm_position(&user_address, new_expected_token_amount); + + // User does not have any dual yield tokens with the before the claim token nonce + setup + .b_mock + .check_nft_balance::>( + &user_address, + DUAL_YIELD_TOKEN_ID, + 2, + &rust_biguint!(0), + None, + ); + + setup + .b_mock + .check_nft_balance::>( + &user_address, + DUAL_YIELD_TOKEN_ID, + 3, + &rust_biguint!(new_expected_token_amount), + None, + ); + + // User exits with partial position + let user_remaining_position = 50_000_000u64; + setup + .unstake_dual_yield_for_other_user( + &user_address, + &user_address, + 3, + new_expected_token_amount - user_remaining_position, + ) + .assert_ok(); + + setup + .b_mock + .check_nft_balance::>( + &user_address, + DUAL_YIELD_TOKEN_ID, + 3, + &rust_biguint!(user_remaining_position), + None, + ); + + setup.check_user_total_staking_farm_position(&user_address, user_remaining_position); + + // User exits with remaining position + setup + .unstake_dual_yield_for_other_user(&user_address, &user_address, 3, user_remaining_position) + .assert_ok(); + + setup + .b_mock + .check_nft_balance::>( + &user_address, + DUAL_YIELD_TOKEN_ID, + 3, + &rust_biguint!(0), + None, + ); + + // Total farm position should be 0 after full unstake + setup.check_user_total_staking_farm_position(&user_address, 0); +} 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 e3d0b1dc4..93d4802ea 100644 --- a/farm-staking/farm-staking/src/claim_stake_farm_rewards.rs +++ b/farm-staking/farm-staking/src/claim_stake_farm_rewards.rs @@ -74,6 +74,12 @@ pub trait ClaimStakeFarmRewardsModule: claim_result.storage_cache.farm_token_supply -= &virtual_farm_token.payment.amount; claim_result.storage_cache.farm_token_supply += &new_amount; + let mut user_total_farm_position = self.get_user_total_farm_position(&original_caller); + user_total_farm_position.total_farm_position -= &virtual_farm_token.payment.amount; + user_total_farm_position.total_farm_position += &new_amount; + self.user_total_farm_position(&original_caller) + .set(user_total_farm_position); + virtual_farm_token.payment.amount = new_amount.clone(); virtual_farm_token.attributes.current_farm_amount = new_amount; From eba787288207f37829b7fb405bf2451a657ba23a Mon Sep 17 00:00:00 2001 From: Andrei Marinica Date: Fri, 10 May 2024 12:03:15 +0300 Subject: [PATCH 45/55] upgrade to framework version 0.49.0 --- Cargo.lock | 36 +++++++++---------- 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 +- .../permissions_module/src/permissions.rs | 10 +++++- common/modules/sc_whitelist_module/Cargo.toml | 2 +- common/modules/token_merge_helper/Cargo.toml | 2 +- common/modules/token_send/Cargo.toml | 2 +- common/modules/utils/Cargo.toml | 2 +- common/traits/fixed-supply-token/Cargo.toml | 2 +- common/traits/mergeable/Cargo.toml | 2 +- common/traits/unwrappable/Cargo.toml | 2 +- dex/Cargo.toml | 6 ++-- dex/farm-with-locked-rewards/Cargo.toml | 6 ++-- dex/farm-with-locked-rewards/meta/Cargo.toml | 2 +- dex/farm-with-locked-rewards/wasm/Cargo.toml | 2 +- dex/farm/Cargo.toml | 6 ++-- dex/farm/meta/Cargo.toml | 2 +- dex/farm/wasm/Cargo.toml | 2 +- dex/fuzz/Cargo.toml | 4 +-- dex/governance/Cargo.toml | 4 +-- dex/governance/meta/Cargo.toml | 2 +- dex/governance/wasm/Cargo.toml | 2 +- dex/interactor/Cargo.toml | 6 ++-- dex/interactor/proxies/Cargo.toml | 4 +-- dex/pair-mock/Cargo.toml | 4 +-- dex/pair-mock/meta/Cargo.toml | 2 +- dex/pair-mock/wasm/Cargo.toml | 2 +- dex/pair/Cargo.toml | 4 +-- dex/pair/meta/Cargo.toml | 2 +- dex/pair/wasm-pair-full/Cargo.toml | 2 +- dex/pair/wasm-safe-price-view/Cargo.toml | 2 +- dex/pair/wasm/Cargo.toml | 2 +- dex/price-discovery/Cargo.toml | 6 ++-- dex/price-discovery/meta/Cargo.toml | 2 +- dex/price-discovery/wasm/Cargo.toml | 2 +- dex/proxy-deployer/Cargo.toml | 4 +-- dex/proxy-deployer/meta/Cargo.toml | 2 +- dex/proxy-deployer/wasm/Cargo.toml | 2 +- dex/router/Cargo.toml | 4 +-- dex/router/meta/Cargo.toml | 2 +- dex/router/wasm/Cargo.toml | 2 +- .../common-modules/energy-query/Cargo.toml | 2 +- .../week-timekeeping/Cargo.toml | 2 +- .../weekly-rewards-splitting/Cargo.toml | 2 +- energy-integration/common-types/Cargo.toml | 2 +- .../energy-factory-mock/Cargo.toml | 4 +-- .../energy-factory-mock/meta/Cargo.toml | 2 +- .../energy-factory-mock/wasm/Cargo.toml | 2 +- energy-integration/energy-update/Cargo.toml | 6 ++-- .../energy-update/meta/Cargo.toml | 2 +- .../energy-update/wasm/Cargo.toml | 2 +- .../farm-boosted-yields/Cargo.toml | 2 +- energy-integration/fees-collector/Cargo.toml | 6 ++-- .../fees-collector/meta/Cargo.toml | 2 +- .../fees-collector/wasm/Cargo.toml | 2 +- energy-integration/governance-v2/Cargo.toml | 4 +-- .../governance-v2/meta/Cargo.toml | 2 +- .../governance-v2/wasm/Cargo.toml | 2 +- farm-staking/farm-staking-proxy/Cargo.toml | 6 ++-- .../farm-staking-proxy/meta/Cargo.toml | 2 +- .../farm-staking-proxy/wasm/Cargo.toml | 2 +- farm-staking/farm-staking/Cargo.toml | 6 ++-- farm-staking/farm-staking/meta/Cargo.toml | 2 +- farm-staking/farm-staking/wasm/Cargo.toml | 2 +- farm-staking/metabonding-staking/Cargo.toml | 6 ++-- .../metabonding-staking/meta/Cargo.toml | 2 +- .../metabonding-staking/wasm/Cargo.toml | 2 +- locked-asset/Cargo.toml | 6 ++-- locked-asset/distribution/Cargo.toml | 4 +-- locked-asset/distribution/meta/Cargo.toml | 2 +- locked-asset/distribution/wasm/Cargo.toml | 2 +- locked-asset/energy-factory/Cargo.toml | 6 ++-- locked-asset/energy-factory/meta/Cargo.toml | 2 +- locked-asset/energy-factory/wasm/Cargo.toml | 2 +- locked-asset/factory/Cargo.toml | 6 ++-- locked-asset/factory/meta/Cargo.toml | 2 +- locked-asset/factory/wasm/Cargo.toml | 2 +- locked-asset/lkmex-transfer/Cargo.toml | 6 ++-- locked-asset/lkmex-transfer/meta/Cargo.toml | 2 +- locked-asset/lkmex-transfer/wasm/Cargo.toml | 2 +- locked-asset/locked-token-wrapper/Cargo.toml | 6 ++-- .../locked-token-wrapper/meta/Cargo.toml | 2 +- .../locked-token-wrapper/wasm/Cargo.toml | 2 +- locked-asset/proxy_dex/Cargo.toml | 6 ++-- locked-asset/proxy_dex/meta/Cargo.toml | 2 +- locked-asset/proxy_dex/wasm/Cargo.toml | 2 +- locked-asset/simple-lock-whitelist/Cargo.toml | 6 ++-- .../simple-lock-whitelist/meta/Cargo.toml | 2 +- .../simple-lock-whitelist/wasm/Cargo.toml | 2 +- locked-asset/simple-lock/Cargo.toml | 6 ++-- locked-asset/simple-lock/meta/Cargo.toml | 2 +- locked-asset/simple-lock/wasm/Cargo.toml | 2 +- locked-asset/token-unstake/Cargo.toml | 6 ++-- locked-asset/token-unstake/meta/Cargo.toml | 2 +- locked-asset/token-unstake/wasm/Cargo.toml | 2 +- pause-all/Cargo.toml | 6 ++-- pause-all/meta/Cargo.toml | 2 +- pause-all/wasm/Cargo.toml | 2 +- 110 files changed, 191 insertions(+), 183 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3e490d97d..3cbaaf004 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1680,9 +1680,9 @@ checksum = "b59072fa0624b55ae5ae3fa6bfa91515bbeb4ac440214bc4a509e2c8806d6e9f" [[package]] name = "multiversx-sc" -version = "0.49.0-alpha.4" +version = "0.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c86c9822909c32b10ad50f376d2a710ff465b806aa710874c0417053fdc16530" +checksum = "1a96d128e19ebcb77e7b4fcf5e299c5e3a684b3daae45441d4476ce665ed7d77" dependencies = [ "bitflags 2.4.2", "hex-literal 0.4.1", @@ -1693,9 +1693,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec" -version = "0.18.6" +version = "0.18.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1da6db65170105c9495848c5e4ba388abb1f9201ff2ca362056c9328f36b7760" +checksum = "d0b18391f871e3eb938823aad052bfab1585d29c6f3983ca478992883ca7f959" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", @@ -1704,9 +1704,9 @@ dependencies = [ [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.6" +version = "0.18.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631c4d4b37fc94659c8d6cf559c21b68c68899095201de2e1b779fccad7b0b03" +checksum = "f3332da2eca87f209ddd37d1824667425de4ca08c4af4f37bce900468a078810" dependencies = [ "hex", "proc-macro2", @@ -1716,9 +1716,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.49.0-alpha.4" +version = "0.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc4fe5b47d3d7e51b8c2ed6a7c6d656885875cd3d41931193c364fe8ec7814d8" +checksum = "d88cb41e3592b1f026a6dc11aba1f616a3c3996e2f03e3e7306bbd84bb114a08" dependencies = [ "hex", "proc-macro2", @@ -1729,9 +1729,9 @@ dependencies = [ [[package]] name = "multiversx-sc-meta" -version = "0.49.0-alpha.4" +version = "0.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "226c52919dfc89df47817ee053c6ea4eddaeca15e1cd3d927c65b805d1d3b6a6" +checksum = "16839f6aab27995f106402ec43ff7cb56b3cf2026f40f53eb2fa9350827df80c" dependencies = [ "clap", "colored", @@ -1756,18 +1756,18 @@ dependencies = [ [[package]] name = "multiversx-sc-modules" -version = "0.49.0-alpha.4" +version = "0.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddb52421af0c8c451b023a13671f7a9bda3e934d41bfe0a9a8296c4ffc991b1a" +checksum = "76677b460607cf76c427f7518a4b418f85b6e81e27ae0bf4f143f14b3f4f9621" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-scenario" -version = "0.49.0-alpha.4" +version = "0.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd56212a3d90aedeb217203d76e28da52b3b5cd46aab5fc62998256aa3bbaf77" +checksum = "e7243e4ee488cb0fab83ee654e190a7c3469a38171782e7a7816ac272c6bd549" dependencies = [ "base64", "bech32", @@ -1793,9 +1793,9 @@ dependencies = [ [[package]] name = "multiversx-sc-snippets" -version = "0.49.0-alpha.4" +version = "0.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3770569d5c943a4be1c9e81188e52f984eb16c49b06851cec07893cb3d0e811a" +checksum = "c9ec483133afc807543d0f426a3f61c4b1576c3632c44c56c48d814744f88ebf" dependencies = [ "base64", "env_logger", @@ -1810,9 +1810,9 @@ dependencies = [ [[package]] name = "multiversx-sdk" -version = "0.4.0-alpha.4" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f898859f51bfcb010bad5cb9080f8872bd023a78db2a523cdc6af083a400d328" +checksum = "b93ef8c0da9590019f0997b8b9620f78e37169ac04523d77933eed1abc835cf4" dependencies = [ "anyhow", "base64", diff --git a/common/common_errors/Cargo.toml b/common/common_errors/Cargo.toml index 044d8fa75..8dcc4f67a 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/common_structs/Cargo.toml b/common/common_structs/Cargo.toml index 140ec1dbb..7ed536099 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.mergeable] diff --git a/common/modules/farm/config/Cargo.toml b/common/modules/farm/config/Cargo.toml index 8dff568bd..79be7a17d 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/farm/contexts/Cargo.toml b/common/modules/farm/contexts/Cargo.toml index 80afa7345..43d3ed8e5 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.4" +version = "=0.49.0" diff --git a/common/modules/farm/events/Cargo.toml b/common/modules/farm/events/Cargo.toml index 4905a6196..dfdc417f2 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/farm/farm_base_impl/Cargo.toml b/common/modules/farm/farm_base_impl/Cargo.toml index d7993b38f..f11cfb0a0 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.4" +version = "=0.49.0" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0-alpha.4" +version = "=0.49.0" diff --git a/common/modules/farm/farm_token/Cargo.toml b/common/modules/farm/farm_token/Cargo.toml index 729c2bd1e..ab1bd02d3 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.4" +version = "=0.49.0" diff --git a/common/modules/farm/farm_token_merge/Cargo.toml b/common/modules/farm/farm_token_merge/Cargo.toml index bbd9bb2ec..791ab9356 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.4" +version = "=0.49.0" [workspace] members = ["."] diff --git a/common/modules/farm/rewards/Cargo.toml b/common/modules/farm/rewards/Cargo.toml index 2a913013e..acb2dd5bb 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.4" +version = "=0.49.0" diff --git a/common/modules/legacy_token_decode_module/Cargo.toml b/common/modules/legacy_token_decode_module/Cargo.toml index 3afc5da65..5f5e665f0 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.common_structs] diff --git a/common/modules/locking_module/Cargo.toml b/common/modules/locking_module/Cargo.toml index 75d71ae29..207d16047 100644 --- a/common/modules/locking_module/Cargo.toml +++ b/common/modules/locking_module/Cargo.toml @@ -8,5 +8,5 @@ edition = "2021" path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/math/Cargo.toml b/common/modules/math/Cargo.toml index eaf6a6b6f..d0fa1a11e 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/pausable/Cargo.toml b/common/modules/pausable/Cargo.toml index 3ca944674..19602f04c 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/permissions_module/Cargo.toml b/common/modules/permissions_module/Cargo.toml index 73a810f39..7c1581b8b 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/permissions_module/src/permissions.rs b/common/modules/permissions_module/src/permissions.rs index 623c72718..c0e4ec205 100644 --- a/common/modules/permissions_module/src/permissions.rs +++ b/common/modules/permissions_module/src/permissions.rs @@ -1,6 +1,6 @@ use bitflags::bitflags; use multiversx_sc::{ - abi::TypeAbi, + abi::{TypeAbi, TypeAbiFrom}, codec::{DecodeError, TopDecode, TopEncode}, }; bitflags! { @@ -32,8 +32,16 @@ impl TopDecode for Permissions { } } +impl TypeAbiFrom for Permissions {} + impl TypeAbi for Permissions { + type Unmanaged = Self; + fn type_name() -> multiversx_sc::abi::TypeName { core::any::type_name::().into() } + + fn type_name_rust() -> multiversx_sc::abi::TypeName { + core::any::type_name::().into() + } } diff --git a/common/modules/sc_whitelist_module/Cargo.toml b/common/modules/sc_whitelist_module/Cargo.toml index 25ebd933f..9d47e79b0 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/token_merge_helper/Cargo.toml b/common/modules/token_merge_helper/Cargo.toml index 1012e67e7..e9a4aacd0 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/token_send/Cargo.toml b/common/modules/token_send/Cargo.toml index 0be22eae0..286777549 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/utils/Cargo.toml b/common/modules/utils/Cargo.toml index 01bed0f7a..1db6bdfd8 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.common_structs] diff --git a/common/traits/fixed-supply-token/Cargo.toml b/common/traits/fixed-supply-token/Cargo.toml index 20dac657c..62548bb2b 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.49.0-alpha.4" +version = "=0.49.0" diff --git a/common/traits/mergeable/Cargo.toml b/common/traits/mergeable/Cargo.toml index 829729e6c..489e909c4 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/traits/unwrappable/Cargo.toml b/common/traits/unwrappable/Cargo.toml index 46d9c0f09..fa021e4d2 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/dex/Cargo.toml b/dex/Cargo.toml index 21ca36643..c55e49abf 100644 --- a/dex/Cargo.toml +++ b/dex/Cargo.toml @@ -5,17 +5,17 @@ edition = "2021" publish = false [dependencies.multiversx-sc] -version = "=0.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.4" +version = "=0.49.0" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0-alpha.4" +version = "=0.49.0" [dev-dependencies.config] path = "../common/modules/farm/config" diff --git a/dex/farm-with-locked-rewards/Cargo.toml b/dex/farm-with-locked-rewards/Cargo.toml index f0c50a943..e50619f8d 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.4" +version = "=0.49.0" [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0-alpha.4" +version = "=0.49.0" [dev-dependencies.simple-lock] path = "../../locked-asset/simple-lock" diff --git a/dex/farm-with-locked-rewards/meta/Cargo.toml b/dex/farm-with-locked-rewards/meta/Cargo.toml index a83124c03..9241e0fc7 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.49.0-alpha.4" +version = "0.49.0" default-features = false diff --git a/dex/farm-with-locked-rewards/wasm/Cargo.toml b/dex/farm-with-locked-rewards/wasm/Cargo.toml index f18e2f60d..3eafc284a 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.49.0-alpha.4" +version = "=0.49.0" [workspace] members = ["."] diff --git a/dex/farm/Cargo.toml b/dex/farm/Cargo.toml index 1edae2cee..d29f19944 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.4" +version = "=0.49.0" [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.49.0-alpha.4" +version = "=0.49.0" [dev-dependencies.energy-factory-mock] path = "../../energy-integration/energy-factory-mock" diff --git a/dex/farm/meta/Cargo.toml b/dex/farm/meta/Cargo.toml index bd7aa6a4a..5a31990a7 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.49.0-alpha.4" +version = "0.49.0" default-features = false diff --git a/dex/farm/wasm/Cargo.toml b/dex/farm/wasm/Cargo.toml index 86bd8ce41..3defb267b 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.49.0-alpha.4" +version = "=0.49.0" [workspace] members = ["."] diff --git a/dex/fuzz/Cargo.toml b/dex/fuzz/Cargo.toml index 98aeb8e22..9e579cfc1 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-scenario] -version = "=0.49.0-alpha.4" +version = "=0.49.0" [dependencies.pausable] path = "../../common/modules/pausable" diff --git a/dex/governance/Cargo.toml b/dex/governance/Cargo.toml index 012b57fb3..46218ccee 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0-alpha.4" +version = "=0.49.0" [dev-dependencies.pair-mock] path = "../pair-mock" diff --git a/dex/governance/meta/Cargo.toml b/dex/governance/meta/Cargo.toml index d6ecc09cc..00194b668 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.49.0-alpha.4" +version = "0.49.0" default-features = false diff --git a/dex/governance/wasm/Cargo.toml b/dex/governance/wasm/Cargo.toml index 7fdd43cea..c4e9425f6 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.49.0-alpha.4" +version = "=0.49.0" [workspace] members = ["."] diff --git a/dex/interactor/Cargo.toml b/dex/interactor/Cargo.toml index bbd0533c8..44fd666dd 100644 --- a/dex/interactor/Cargo.toml +++ b/dex/interactor/Cargo.toml @@ -15,13 +15,13 @@ serde = { version = "1.0", features = ["derive"] } toml = "0.8.6" [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.4" +version = "=0.49.0" [dependencies.multiversx-sc-snippets] -version = "=0.49.0-alpha.4" +version = "=0.49.0" [dependencies.multiversx-sc-scenario] -version = "=0.49.0-alpha.4" +version = "=0.49.0" [dependencies.proxies] path = "proxies" diff --git a/dex/interactor/proxies/Cargo.toml b/dex/interactor/proxies/Cargo.toml index 7192c435f..8b18a90a0 100644 --- a/dex/interactor/proxies/Cargo.toml +++ b/dex/interactor/proxies/Cargo.toml @@ -8,10 +8,10 @@ edition = "2021" path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.49.0-alpha.4" +version = "=0.49.0" [dependencies.multiversx-sc-scenario] -version = "=0.49.0-alpha.4" +version = "=0.49.0" [dependencies.common_structs] path = "../../../common/common_structs" diff --git a/dex/pair-mock/Cargo.toml b/dex/pair-mock/Cargo.toml index fdd698828..9cb06df92 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.49.0-alpha.4" +version = "=0.49.0" 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.49.0-alpha.4" +version = "=0.49.0" diff --git a/dex/pair-mock/meta/Cargo.toml b/dex/pair-mock/meta/Cargo.toml index 44c3237e1..072414630 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.49.0-alpha.4" +version = "0.49.0" default-features = false diff --git a/dex/pair-mock/wasm/Cargo.toml b/dex/pair-mock/wasm/Cargo.toml index 934f1cad7..fe2190e3b 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.49.0-alpha.4" +version = "=0.49.0" [workspace] members = ["."] diff --git a/dex/pair/Cargo.toml b/dex/pair/Cargo.toml index 09d153c90..0c75493e7 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0-alpha.4" +version = "=0.49.0" diff --git a/dex/pair/meta/Cargo.toml b/dex/pair/meta/Cargo.toml index 8ebb9495a..d924cd0de 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.49.0-alpha.4" +version = "0.49.0" default-features = false diff --git a/dex/pair/wasm-pair-full/Cargo.toml b/dex/pair/wasm-pair-full/Cargo.toml index a31686952..293c10a5d 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.49.0-alpha.4" +version = "=0.49.0" [workspace] members = ["."] diff --git a/dex/pair/wasm-safe-price-view/Cargo.toml b/dex/pair/wasm-safe-price-view/Cargo.toml index e82d6e2a7..7920e9940 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.49.0-alpha.4" +version = "=0.49.0" [workspace] members = ["."] diff --git a/dex/pair/wasm/Cargo.toml b/dex/pair/wasm/Cargo.toml index 37a09e925..05f0687c6 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.49.0-alpha.4" +version = "=0.49.0" [workspace] members = ["."] diff --git a/dex/price-discovery/Cargo.toml b/dex/price-discovery/Cargo.toml index 996a45104..b4a6e27c0 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.4" +version = "=0.49.0" [dependencies.locking_module] path = "../../common/modules/locking_module" @@ -30,4 +30,4 @@ hex = "0.4" path = "../../locked-asset/simple-lock" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0-alpha.4" +version = "=0.49.0" diff --git a/dex/price-discovery/meta/Cargo.toml b/dex/price-discovery/meta/Cargo.toml index a236ae820..420981d62 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.49.0-alpha.4" +version = "0.49.0" default-features = false diff --git a/dex/price-discovery/wasm/Cargo.toml b/dex/price-discovery/wasm/Cargo.toml index 5e4ec803b..6b8ba36b7 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.49.0-alpha.4" +version = "=0.49.0" [workspace] members = ["."] diff --git a/dex/proxy-deployer/Cargo.toml b/dex/proxy-deployer/Cargo.toml index 13bccae9b..344cf5439 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0-alpha.4" +version = "=0.49.0" diff --git a/dex/proxy-deployer/meta/Cargo.toml b/dex/proxy-deployer/meta/Cargo.toml index b21f7b7a6..54e0925ab 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.49.0-alpha.4" +version = "0.49.0" default-features = false diff --git a/dex/proxy-deployer/wasm/Cargo.toml b/dex/proxy-deployer/wasm/Cargo.toml index 418d02ac0..689bdc768 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.49.0-alpha.4" +version = "=0.49.0" [workspace] members = ["."] diff --git a/dex/router/Cargo.toml b/dex/router/Cargo.toml index bac02d2ed..c8194fbbb 100644 --- a/dex/router/Cargo.toml +++ b/dex/router/Cargo.toml @@ -21,7 +21,7 @@ path = "../../common/modules/token_send" path = "../../common/modules/pausable" [dependencies.multiversx-sc] -version = "=0.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.pair] @@ -34,4 +34,4 @@ path = "../../common/modules/locking_module" path = "../../locked-asset/simple-lock" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0-alpha.4" +version = "=0.49.0" diff --git a/dex/router/meta/Cargo.toml b/dex/router/meta/Cargo.toml index 4e7a1bec5..266ca6d0f 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.49.0-alpha.4" +version = "0.49.0" default-features = false diff --git a/dex/router/wasm/Cargo.toml b/dex/router/wasm/Cargo.toml index 1fd8d50d7..b5b9b8034 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.49.0-alpha.4" +version = "=0.49.0" [workspace] members = ["."] diff --git a/energy-integration/common-modules/energy-query/Cargo.toml b/energy-integration/common-modules/energy-query/Cargo.toml index cce8e0979..fd5fdcf8b 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.energy-factory] diff --git a/energy-integration/common-modules/week-timekeeping/Cargo.toml b/energy-integration/common-modules/week-timekeeping/Cargo.toml index 7c128231e..4314f957a 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.common-types] diff --git a/energy-integration/common-modules/weekly-rewards-splitting/Cargo.toml b/energy-integration/common-modules/weekly-rewards-splitting/Cargo.toml index 50dfb2880..d77461b5f 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.energy-query] diff --git a/energy-integration/common-types/Cargo.toml b/energy-integration/common-types/Cargo.toml index 0ffdf8c44..bc066d60b 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/energy-integration/energy-factory-mock/Cargo.toml b/energy-integration/energy-factory-mock/Cargo.toml index 189d3d0b4..8210f7f8a 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0-alpha.4" +version = "=0.49.0" diff --git a/energy-integration/energy-factory-mock/meta/Cargo.toml b/energy-integration/energy-factory-mock/meta/Cargo.toml index 3d4597540..f5b0b13cb 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.49.0-alpha.4" +version = "0.49.0" default-features = false diff --git a/energy-integration/energy-factory-mock/wasm/Cargo.toml b/energy-integration/energy-factory-mock/wasm/Cargo.toml index 5369759c0..5c74db241 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.49.0-alpha.4" +version = "=0.49.0" [workspace] members = ["."] diff --git a/energy-integration/energy-update/Cargo.toml b/energy-integration/energy-update/Cargo.toml index f4b1e3d0e..def1196b8 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.4" +version = "=0.49.0" [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.49.0-alpha.4" +version = "=0.49.0" diff --git a/energy-integration/energy-update/meta/Cargo.toml b/energy-integration/energy-update/meta/Cargo.toml index cdc416dca..dc5eb4e7f 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.49.0-alpha.4" +version = "0.49.0" default-features = false diff --git a/energy-integration/energy-update/wasm/Cargo.toml b/energy-integration/energy-update/wasm/Cargo.toml index 19412d392..5de83835a 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.49.0-alpha.4" +version = "=0.49.0" [workspace] members = ["."] diff --git a/energy-integration/farm-boosted-yields/Cargo.toml b/energy-integration/farm-boosted-yields/Cargo.toml index 832bb0026..2a47f3648 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.config] diff --git a/energy-integration/fees-collector/Cargo.toml b/energy-integration/fees-collector/Cargo.toml index 6f2f27221..a31e4a860 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.4" +version = "=0.49.0" [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.49.0-alpha.4" +version = "=0.49.0" [dev-dependencies.sc_whitelist_module] path = "../../common/modules/sc_whitelist_module" diff --git a/energy-integration/fees-collector/meta/Cargo.toml b/energy-integration/fees-collector/meta/Cargo.toml index 3f528b833..ab9d510ed 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.49.0-alpha.4" +version = "0.49.0" default-features = false diff --git a/energy-integration/fees-collector/wasm/Cargo.toml b/energy-integration/fees-collector/wasm/Cargo.toml index 3aef54830..e42dac8a1 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.49.0-alpha.4" +version = "=0.49.0" [workspace] members = ["."] diff --git a/energy-integration/governance-v2/Cargo.toml b/energy-integration/governance-v2/Cargo.toml index 549df0451..6a912a8d6 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.49.0-alpha.4" +version = "=0.49.0" 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.49.0-alpha.4" +version = "=0.49.0" [dev-dependencies.energy-factory-mock] path = "../energy-factory-mock" diff --git a/energy-integration/governance-v2/meta/Cargo.toml b/energy-integration/governance-v2/meta/Cargo.toml index 0888e0275..cd7b9d3b5 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.49.0-alpha.4" +version = "0.49.0" default-features = false diff --git a/energy-integration/governance-v2/wasm/Cargo.toml b/energy-integration/governance-v2/wasm/Cargo.toml index 9718bcfcc..fa41ae068 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.49.0-alpha.4" +version = "=0.49.0" [workspace] members = ["."] diff --git a/farm-staking/farm-staking-proxy/Cargo.toml b/farm-staking/farm-staking-proxy/Cargo.toml index c123dcd99..1c35dcc82 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.4" +version = "=0.49.0" [dependencies.farm] path = "../../dex/farm" @@ -67,7 +67,7 @@ path = "../../energy-integration/common-modules/energy-query" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0-alpha.4" +version = "=0.49.0" [dev-dependencies.farm_token] path = "../../common/modules/farm/farm_token" diff --git a/farm-staking/farm-staking-proxy/meta/Cargo.toml b/farm-staking/farm-staking-proxy/meta/Cargo.toml index 2da972b9b..1ee61cd44 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.49.0-alpha.4" +version = "0.49.0" default-features = false diff --git a/farm-staking/farm-staking-proxy/wasm/Cargo.toml b/farm-staking/farm-staking-proxy/wasm/Cargo.toml index b181fbb59..9e2510ff6 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.49.0-alpha.4" +version = "=0.49.0" [workspace] members = ["."] diff --git a/farm-staking/farm-staking/Cargo.toml b/farm-staking/farm-staking/Cargo.toml index ecf277982..dffb76152 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.4" +version = "=0.49.0" [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0-alpha.4" +version = "=0.49.0" diff --git a/farm-staking/farm-staking/meta/Cargo.toml b/farm-staking/farm-staking/meta/Cargo.toml index a9806b29f..4cf7ca5cf 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.49.0-alpha.4" +version = "0.49.0" default-features = false diff --git a/farm-staking/farm-staking/wasm/Cargo.toml b/farm-staking/farm-staking/wasm/Cargo.toml index 2eedc0cbc..ce93309d7 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.49.0-alpha.4" +version = "=0.49.0" [workspace] members = ["."] diff --git a/farm-staking/metabonding-staking/Cargo.toml b/farm-staking/metabonding-staking/Cargo.toml index 01fe3a80f..3c2c48b5b 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.4" +version = "=0.49.0" [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.49.0-alpha.4" +version = "=0.49.0" [dev-dependencies.common_structs] path = "../../common/common_structs" diff --git a/farm-staking/metabonding-staking/meta/Cargo.toml b/farm-staking/metabonding-staking/meta/Cargo.toml index e98e1948f..63856cd6d 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.49.0-alpha.4" +version = "0.49.0" default-features = false diff --git a/farm-staking/metabonding-staking/wasm/Cargo.toml b/farm-staking/metabonding-staking/wasm/Cargo.toml index 085c518ba..a48b6938b 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.49.0-alpha.4" +version = "=0.49.0" [workspace] members = ["."] diff --git a/locked-asset/Cargo.toml b/locked-asset/Cargo.toml index 57f568521..5c3aa07d6 100644 --- a/locked-asset/Cargo.toml +++ b/locked-asset/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" publish = false [dependencies.multiversx-sc] -version = "=0.49.0-alpha.4" +version = "=0.49.0" 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.49.0-alpha.4" +version = "=0.49.0" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0-alpha.4" +version = "=0.49.0" diff --git a/locked-asset/distribution/Cargo.toml b/locked-asset/distribution/Cargo.toml index 8ac11907a..efaadf888 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0-alpha.4" +version = "=0.49.0" diff --git a/locked-asset/distribution/meta/Cargo.toml b/locked-asset/distribution/meta/Cargo.toml index fedde7760..b58e7a4ab 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.49.0-alpha.4" +version = "0.49.0" default-features = false diff --git a/locked-asset/distribution/wasm/Cargo.toml b/locked-asset/distribution/wasm/Cargo.toml index 0cdf5c852..87b0878a3 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.49.0-alpha.4" +version = "=0.49.0" [workspace] members = ["."] diff --git a/locked-asset/energy-factory/Cargo.toml b/locked-asset/energy-factory/Cargo.toml index 6cad11412..402f2f90b 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.4" +version = "=0.49.0" [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.49.0-alpha.4" +version = "=0.49.0" diff --git a/locked-asset/energy-factory/meta/Cargo.toml b/locked-asset/energy-factory/meta/Cargo.toml index f07b3d9c7..d82e95153 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.49.0-alpha.4" +version = "0.49.0" default-features = false diff --git a/locked-asset/energy-factory/wasm/Cargo.toml b/locked-asset/energy-factory/wasm/Cargo.toml index f39f72f97..0e7b9e13f 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.49.0-alpha.4" +version = "=0.49.0" [workspace] members = ["."] diff --git a/locked-asset/factory/Cargo.toml b/locked-asset/factory/Cargo.toml index 5f29016ea..1cda39ac2 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.4" +version = "=0.49.0" [dependencies.arrayvec] version = "0.7.1" @@ -49,4 +49,4 @@ hex = "0.4" path = "../simple-lock" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0-alpha.4" +version = "=0.49.0" diff --git a/locked-asset/factory/meta/Cargo.toml b/locked-asset/factory/meta/Cargo.toml index c9bb24529..ff2fccb34 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.49.0-alpha.4" +version = "0.49.0" default-features = false diff --git a/locked-asset/factory/wasm/Cargo.toml b/locked-asset/factory/wasm/Cargo.toml index 6d59b39dc..0241f8fd6 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.49.0-alpha.4" +version = "=0.49.0" [workspace] members = ["."] diff --git a/locked-asset/lkmex-transfer/Cargo.toml b/locked-asset/lkmex-transfer/Cargo.toml index b37373906..81a4f097c 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0-alpha.4" +version = "=0.49.0" [dev-dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.4" +version = "=0.49.0" diff --git a/locked-asset/lkmex-transfer/meta/Cargo.toml b/locked-asset/lkmex-transfer/meta/Cargo.toml index 95616056e..2585e75d0 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.49.0-alpha.4" +version = "0.49.0" default-features = false diff --git a/locked-asset/lkmex-transfer/wasm/Cargo.toml b/locked-asset/lkmex-transfer/wasm/Cargo.toml index b271c9d51..f190ac926 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.49.0-alpha.4" +version = "=0.49.0" [workspace] members = ["."] diff --git a/locked-asset/locked-token-wrapper/Cargo.toml b/locked-asset/locked-token-wrapper/Cargo.toml index a065fda6c..0fb37b7d5 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.49.0-alpha.4" +version = "=0.49.0" [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.4" +version = "=0.49.0" [dependencies.utils] path = "../../common/modules/utils" @@ -44,4 +44,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0-alpha.4" +version = "=0.49.0" diff --git a/locked-asset/locked-token-wrapper/meta/Cargo.toml b/locked-asset/locked-token-wrapper/meta/Cargo.toml index 1343d268c..71bb638ac 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.49.0-alpha.4" +version = "0.49.0" default-features = false diff --git a/locked-asset/locked-token-wrapper/wasm/Cargo.toml b/locked-asset/locked-token-wrapper/wasm/Cargo.toml index 0af4889f5..130852928 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.49.0-alpha.4" +version = "=0.49.0" [workspace] members = ["."] diff --git a/locked-asset/proxy_dex/Cargo.toml b/locked-asset/proxy_dex/Cargo.toml index c292563bc..ddacef972 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.4" +version = "=0.49.0" [dependencies.energy-factory] path = "../energy-factory" @@ -69,7 +69,7 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0-alpha.4" +version = "=0.49.0" [dev-dependencies.pausable] path = "../../common/modules/pausable" diff --git a/locked-asset/proxy_dex/meta/Cargo.toml b/locked-asset/proxy_dex/meta/Cargo.toml index 8d1cc9632..f41cd2347 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.49.0-alpha.4" +version = "0.49.0" default-features = false diff --git a/locked-asset/proxy_dex/wasm/Cargo.toml b/locked-asset/proxy_dex/wasm/Cargo.toml index 72432ab4d..8227052b7 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.49.0-alpha.4" +version = "=0.49.0" [workspace] members = ["."] diff --git a/locked-asset/simple-lock-whitelist/Cargo.toml b/locked-asset/simple-lock-whitelist/Cargo.toml index f44708230..a31645e91 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.4" +version = "=0.49.0" [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.49.0-alpha.4" +version = "=0.49.0" diff --git a/locked-asset/simple-lock-whitelist/meta/Cargo.toml b/locked-asset/simple-lock-whitelist/meta/Cargo.toml index f09b1c6f2..c2f95045f 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.49.0-alpha.4" +version = "0.49.0" default-features = false diff --git a/locked-asset/simple-lock-whitelist/wasm/Cargo.toml b/locked-asset/simple-lock-whitelist/wasm/Cargo.toml index 1816d6644..b9161fe3e 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.49.0-alpha.4" +version = "=0.49.0" [workspace] members = ["."] diff --git a/locked-asset/simple-lock/Cargo.toml b/locked-asset/simple-lock/Cargo.toml index 9d50c173e..a93ca1eca 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.4" +version = "=0.49.0" [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.49.0-alpha.4" +version = "=0.49.0" diff --git a/locked-asset/simple-lock/meta/Cargo.toml b/locked-asset/simple-lock/meta/Cargo.toml index 8cf746dbc..4512e6f83 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.49.0-alpha.4" +version = "0.49.0" default-features = false diff --git a/locked-asset/simple-lock/wasm/Cargo.toml b/locked-asset/simple-lock/wasm/Cargo.toml index c24d5e9bf..a28fb263a 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.49.0-alpha.4" +version = "=0.49.0" [workspace] members = ["."] diff --git a/locked-asset/token-unstake/Cargo.toml b/locked-asset/token-unstake/Cargo.toml index 895951570..2c00a8df8 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.49.0-alpha.4" +version = "=0.49.0" 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.49.0-alpha.4" +version = "=0.49.0" [dev-dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.4" +version = "=0.49.0" diff --git a/locked-asset/token-unstake/meta/Cargo.toml b/locked-asset/token-unstake/meta/Cargo.toml index 919579f7d..52ea170c3 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.49.0-alpha.4" +version = "0.49.0" default-features = false diff --git a/locked-asset/token-unstake/wasm/Cargo.toml b/locked-asset/token-unstake/wasm/Cargo.toml index 3fe2c65e6..8e6772471 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.49.0-alpha.4" +version = "=0.49.0" [workspace] members = ["."] diff --git a/pause-all/Cargo.toml b/pause-all/Cargo.toml index ed1347bcc..772845257 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.49.0-alpha.4" +version = "=0.49.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0-alpha.4" +version = "=0.49.0" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0-alpha.4" +version = "=0.49.0" [dev-dependencies.farm] path = "../dex/farm" diff --git a/pause-all/meta/Cargo.toml b/pause-all/meta/Cargo.toml index 0714f84e4..b913a60a3 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.49.0-alpha.4" +version = "0.49.0" default-features = false diff --git a/pause-all/wasm/Cargo.toml b/pause-all/wasm/Cargo.toml index cde056f99..27ad72626 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.49.0-alpha.4" +version = "=0.49.0" [workspace] members = ["."] From d30b4e04895f3c7840738ad5a7e94939c8cbff18 Mon Sep 17 00:00:00 2001 From: Andrei Marinica Date: Fri, 10 May 2024 12:15:12 +0300 Subject: [PATCH 46/55] fixes after upgrade to 0.49.0 --- .../src/energy_factory_lock_proxy.rs | 14 +- dex/farm/src/pair_proxy.rs | 2 +- dex/governance/src/price_provider_proxy.rs | 2 +- .../proxies/src/energy_factory_proxy.rs | 82 ++++----- .../proxies/src/farm_staking_proxy.rs | 110 ++++++------ .../src/farm_staking_proxy_sc_proxy.rs | 40 ++--- .../src/farm_with_locked_rewards_proxy.rs | 106 ++++++------ dex/interactor/proxies/src/pair_proxy.rs | 158 +++++++++--------- dex/interactor/proxies/src/router_proxy.rs | 74 ++++---- dex/interactor/src/energy_factory.rs | 2 + dex/interactor/src/farm_locked.rs | 15 +- dex/interactor/src/farm_staking_proxy.rs | 2 + dex/pair/src/energy_factory_lock_proxy.rs | 4 +- dex/pair/src/self_proxy.rs | 4 +- dex/proxy-deployer/src/farm_proxy.rs | 12 +- dex/router/src/pair_proxy.rs | 158 +++++++++--------- .../energy-update/src/farm_proxy.rs | 2 +- .../governance-v2/src/fees_collector_proxy.rs | 2 +- .../src/external_contracts_interactions.rs | 6 +- .../src/farm_staking_proxy_methods.rs | 10 +- .../src/farm_with_locked_rewards_proxy.rs | 6 +- .../farm-staking-proxy/src/pair_proxy.rs | 6 +- .../src/locked_asset_factory_proxy.rs | 8 +- .../energy-factory/src/token_unstake_proxy.rs | 2 +- .../src/energy_factory_migration_proxy.rs | 6 +- .../energy_factory_token_transfer_proxy.rs | 4 +- .../energy_factory_token_transfer_proxy.rs | 8 +- .../proxy_dex/src/farm_interactions.rs | 6 +- .../src/farm_with_locked_rewards_proxy.rs | 6 +- locked-asset/proxy_dex/src/pair_proxy.rs | 6 +- .../simple-lock/src/farm_interactions.rs | 6 +- locked-asset/simple-lock/src/farm_proxy.rs | 6 +- locked-asset/simple-lock/src/lp_proxy.rs | 8 +- .../src/energy_factory_unstake_proxy.rs | 4 +- 34 files changed, 444 insertions(+), 443 deletions(-) diff --git a/common/modules/locking_module/src/energy_factory_lock_proxy.rs b/common/modules/locking_module/src/energy_factory_lock_proxy.rs index 8cbe4403f..0dd9b143e 100644 --- a/common/modules/locking_module/src/energy_factory_lock_proxy.rs +++ b/common/modules/locking_module/src/energy_factory_lock_proxy.rs @@ -49,8 +49,8 @@ where /// /// Output payment: LOCKED tokens pub fn lock_tokens_endpoint< - Arg0: CodecInto, - Arg1: CodecInto>>, + Arg0: ProxyArg, + Arg1: ProxyArg>>, >( self, lock_epochs: Arg0, @@ -64,11 +64,11 @@ where } pub fn lock_virtual< - Arg0: CodecInto>, - Arg1: CodecInto>, - Arg2: CodecInto, - Arg3: CodecInto>, - Arg4: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, + Arg2: ProxyArg, + Arg3: ProxyArg>, + Arg4: ProxyArg>, >( self, token_id: Arg0, diff --git a/dex/farm/src/pair_proxy.rs b/dex/farm/src/pair_proxy.rs index 95f3dd107..9c5ffb78c 100644 --- a/dex/farm/src/pair_proxy.rs +++ b/dex/farm/src/pair_proxy.rs @@ -34,7 +34,7 @@ where To: TxTo, Gas: TxGas, { - pub fn remove_liquidity_and_burn_token>>( + pub fn remove_liquidity_and_burn_token>>( self, token_to_buyback_and_burn: Arg0, ) -> TxProxyCall { diff --git a/dex/governance/src/price_provider_proxy.rs b/dex/governance/src/price_provider_proxy.rs index 9d8ae475b..b38d40cf1 100644 --- a/dex/governance/src/price_provider_proxy.rs +++ b/dex/governance/src/price_provider_proxy.rs @@ -34,7 +34,7 @@ where To: TxTo, Gas: TxGas, { - pub fn get_tokens_for_given_position_with_safe_price>>( + pub fn get_tokens_for_given_position_with_safe_price>>( self, liquidity: Arg0, ) -> TxProxyCall< diff --git a/dex/interactor/proxies/src/energy_factory_proxy.rs b/dex/interactor/proxies/src/energy_factory_proxy.rs index 712d682f7..bf98cb7bd 100644 --- a/dex/interactor/proxies/src/energy_factory_proxy.rs +++ b/dex/interactor/proxies/src/energy_factory_proxy.rs @@ -54,11 +54,11 @@ where /// a migrated old LKMEX token will be locked for after the average is calculated /// - lock_options: See `addLockOptions` endpoint doc for details. pub fn init< - Arg0: CodecInto>, - Arg1: CodecInto>, - Arg2: CodecInto>, - Arg3: CodecInto, - Arg4: CodecInto>>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, + Arg2: ProxyArg>, + Arg3: ProxyArg, + Arg4: ProxyArg>>, >( self, base_asset_token_id: Arg0, @@ -119,8 +119,8 @@ where /// /// Output payment: LOCKED tokens pub fn lock_tokens_endpoint< - Arg0: CodecInto, - Arg1: CodecInto>>, + Arg0: ProxyArg, + Arg1: ProxyArg>>, >( self, lock_epochs: Arg0, @@ -148,8 +148,8 @@ where /// Used internally by proxy-dex pub fn extend_lock_period< - Arg0: CodecInto, - Arg1: CodecInto>, + Arg0: ProxyArg, + Arg1: ProxyArg>, >( self, lock_epochs: Arg0, @@ -163,9 +163,9 @@ where } pub fn issue_locked_token< - Arg0: CodecInto>, - Arg1: CodecInto>, - Arg2: CodecInto, + Arg0: ProxyArg>, + Arg1: ProxyArg>, + Arg2: ProxyArg, >( self, token_display_name: Arg0, @@ -205,7 +205,7 @@ where } pub fn get_updated_energy_entry_for_user< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, user: Arg0, @@ -217,7 +217,7 @@ where } pub fn get_energy_amount_for_user< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, user: Arg0, @@ -240,7 +240,7 @@ where /// When calling lockTokens, or reducing lock periods, /// users may only pick one of the whitelisted lock options. pub fn add_lock_options< - Arg0: CodecInto>>, + Arg0: ProxyArg>>, >( self, new_lock_options: Arg0, @@ -274,7 +274,7 @@ where /// The longer the reduction, the bigger the penalty. /// new_lock_period must be one of the available lock options pub fn reduce_lock_period< - Arg0: CodecInto, + Arg0: ProxyArg, >( self, new_lock_period: Arg0, @@ -289,9 +289,9 @@ where /// were to have their lock epochs reduced from `prev_lock_epochs` to /// `new_lock_epochs`. For full unlock, `new_lock_epochs` should be 0. pub fn calculate_penalty_amount< - Arg0: CodecInto>, - Arg1: CodecInto, - Arg2: CodecInto, + Arg0: ProxyArg>, + Arg1: ProxyArg, + Arg2: ProxyArg, >( self, token_amount: Arg0, @@ -309,7 +309,7 @@ where /// - token_unstake_address - The address of the SC that will handle the unbond logic /// By default, all tokens go through an unbond period after unlock pub fn set_token_unstake_address< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, sc_address: Arg0, @@ -321,8 +321,8 @@ where } pub fn revert_unstake< - Arg0: CodecInto>, - Arg1: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, >( self, user: Arg0, @@ -346,7 +346,7 @@ where /// Sets the energy amounts and token amounts for users. Overwrites any existing values. /// Expects any number of pairs of (user address, token amount, energy amount). pub fn set_energy_for_old_tokens< - Arg0: CodecInto, BigUint, BigInt>>>, + Arg0: ProxyArg, BigUint, BigInt>>>, >( self, users_energy: Arg0, @@ -358,9 +358,9 @@ where } pub fn update_energy_after_old_token_unlock< - Arg0: CodecInto>, - Arg1: CodecInto>, - Arg2: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, + Arg2: ProxyArg>, >( self, original_caller: Arg0, @@ -409,7 +409,7 @@ where /// Sets the transfer role for the given address. Defaults to own address. pub fn set_transfer_role< - Arg0: CodecInto>>, + Arg0: ProxyArg>>, >( self, opt_address: Arg0, @@ -422,7 +422,7 @@ where /// Sets the burn role for the given address pub fn set_burn_role< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, address: Arg0, @@ -434,7 +434,7 @@ where } pub fn merge_tokens_endpoint< - Arg0: CodecInto>>, + Arg0: ProxyArg>>, >( self, opt_original_caller: Arg0, @@ -446,11 +446,11 @@ where } pub fn lock_virtual< - Arg0: CodecInto>, - Arg1: CodecInto>, - Arg2: CodecInto, - Arg3: CodecInto>, - Arg4: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, + Arg2: ProxyArg, + Arg3: ProxyArg>, + Arg4: ProxyArg>, >( self, token_id: Arg0, @@ -470,7 +470,7 @@ where } pub fn add_sc_address_to_whitelist< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, address: Arg0, @@ -482,7 +482,7 @@ where } pub fn remove_sc_address_from_whitelist< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, address: Arg0, @@ -494,7 +494,7 @@ where } pub fn is_sc_address_whitelisted< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, address: Arg0, @@ -506,7 +506,7 @@ where } pub fn add_to_token_transfer_whitelist< - Arg0: CodecInto>>, + Arg0: ProxyArg>>, >( self, sc_addresses: Arg0, @@ -518,7 +518,7 @@ where } pub fn remove_from_token_transfer_whitelist< - Arg0: CodecInto>>, + Arg0: ProxyArg>>, >( self, sc_addresses: Arg0, @@ -530,8 +530,8 @@ where } pub fn set_user_energy_after_locked_token_transfer< - Arg0: CodecInto>, - Arg1: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, >( self, user: Arg0, diff --git a/dex/interactor/proxies/src/farm_staking_proxy.rs b/dex/interactor/proxies/src/farm_staking_proxy.rs index e751c4336..a86c13c6c 100644 --- a/dex/interactor/proxies/src/farm_staking_proxy.rs +++ b/dex/interactor/proxies/src/farm_staking_proxy.rs @@ -45,12 +45,12 @@ where Gas: TxGas, { pub fn init< - Arg0: CodecInto>, - Arg1: CodecInto>, - Arg2: CodecInto>, - Arg3: CodecInto, - Arg4: CodecInto>, - Arg5: CodecInto>>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, + Arg2: ProxyArg>, + Arg3: ProxyArg, + Arg4: ProxyArg>, + Arg5: ProxyArg>>, >( self, farming_token_id: Arg0, @@ -108,7 +108,7 @@ where } pub fn set_boosted_yields_rewards_percentage< - Arg0: CodecInto, + Arg0: ProxyArg, >( self, percentage: Arg0, @@ -120,8 +120,8 @@ where } pub fn calculate_rewards_for_given_position< - Arg0: CodecInto>, - Arg1: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, >( self, farm_token_amount: Arg0, @@ -143,7 +143,7 @@ where } pub fn withdraw_rewards< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, withdraw_amount: Arg0, @@ -163,7 +163,7 @@ where } pub fn set_per_block_rewards< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, per_block_amount: Arg0, @@ -175,7 +175,7 @@ where } pub fn set_max_apr< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, max_apr: Arg0, @@ -187,7 +187,7 @@ where } pub fn set_min_unbond_epochs_endpoint< - Arg0: CodecInto, + Arg0: ProxyArg, >( self, min_unbond_epochs: Arg0, @@ -255,7 +255,7 @@ where } pub fn allow_external_claim_boosted_rewards< - Arg0: CodecInto, + Arg0: ProxyArg, >( self, allow_external_claim: Arg0, @@ -267,7 +267,7 @@ where } pub fn get_allow_external_claim_rewards< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, user: Arg0, @@ -319,7 +319,7 @@ where } pub fn user_total_farm_position< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, user: Arg0, @@ -339,9 +339,9 @@ where } pub fn register_farm_token< - Arg0: CodecInto>, - Arg1: CodecInto>, - Arg2: CodecInto, + Arg0: ProxyArg>, + Arg1: ProxyArg>, + Arg2: ProxyArg, >( self, token_display_name: Arg0, @@ -373,7 +373,7 @@ where } pub fn add_sc_address_to_whitelist< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, address: Arg0, @@ -385,7 +385,7 @@ where } pub fn remove_sc_address_from_whitelist< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, address: Arg0, @@ -397,7 +397,7 @@ where } pub fn is_sc_address_whitelisted< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, address: Arg0, @@ -409,7 +409,7 @@ where } pub fn add_to_pause_whitelist< - Arg0: CodecInto>>, + Arg0: ProxyArg>>, >( self, address_list: Arg0, @@ -421,7 +421,7 @@ where } pub fn remove_from_pause_whitelist< - Arg0: CodecInto>>, + Arg0: ProxyArg>>, >( self, address_list: Arg0, @@ -457,7 +457,7 @@ where } pub fn add_admin_endpoint< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, address: Arg0, @@ -469,7 +469,7 @@ where } pub fn remove_admin_endpoint< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, address: Arg0, @@ -481,7 +481,7 @@ where } pub fn update_owner_or_admin_endpoint< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, previous_owner: Arg0, @@ -493,7 +493,7 @@ where } pub fn permissions< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, address: Arg0, @@ -505,7 +505,7 @@ where } pub fn set_burn_role_for_address< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, address: Arg0, @@ -517,8 +517,8 @@ where } pub fn stake_farm_through_proxy< - Arg0: CodecInto>, - Arg1: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, >( self, staked_token_amount: Arg0, @@ -532,7 +532,7 @@ where } pub fn stake_farm_endpoint< - Arg0: CodecInto>>, + Arg0: ProxyArg>>, >( self, opt_original_caller: Arg0, @@ -544,7 +544,7 @@ where } pub fn claim_rewards< - Arg0: CodecInto>>, + Arg0: ProxyArg>>, >( self, opt_original_caller: Arg0, @@ -556,8 +556,8 @@ where } pub fn claim_rewards_with_new_value< - Arg0: CodecInto>, - Arg1: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, >( self, new_farming_amount: Arg0, @@ -579,7 +579,7 @@ where } pub fn unstake_farm< - Arg0: CodecInto>>, + Arg0: ProxyArg>>, >( self, opt_original_caller: Arg0, @@ -591,7 +591,7 @@ where } pub fn unstake_farm_through_proxy< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, original_caller: Arg0, @@ -611,7 +611,7 @@ where } pub fn claim_boosted_rewards< - Arg0: CodecInto>>, + Arg0: ProxyArg>>, >( self, opt_user: Arg0, @@ -639,7 +639,7 @@ where } pub fn accumulated_rewards_for_week< - Arg0: CodecInto, + Arg0: ProxyArg, >( self, week: Arg0, @@ -651,7 +651,7 @@ where } pub fn farm_supply_for_week< - Arg0: CodecInto, + Arg0: ProxyArg, >( self, week: Arg0, @@ -663,7 +663,7 @@ where } pub fn remaining_boosted_rewards_to_distribute< - Arg0: CodecInto, + Arg0: ProxyArg, >( self, week: Arg0, @@ -683,11 +683,11 @@ where } pub fn set_boosted_yields_factors< - Arg0: CodecInto>, - Arg1: CodecInto>, - Arg2: CodecInto>, - Arg3: CodecInto>, - Arg4: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, + Arg2: ProxyArg>, + Arg3: ProxyArg>, + Arg4: ProxyArg>, >( self, max_rewards_factor: Arg0, @@ -732,7 +732,7 @@ where } pub fn get_last_active_week_for_user_view< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, user: Arg0, @@ -744,8 +744,8 @@ where } pub fn get_user_energy_for_week_view< - Arg0: CodecInto>, - Arg1: CodecInto, + Arg0: ProxyArg>, + Arg1: ProxyArg, >( self, user: Arg0, @@ -767,7 +767,7 @@ where } pub fn total_rewards_for_week< - Arg0: CodecInto, + Arg0: ProxyArg, >( self, week: Arg0, @@ -779,7 +779,7 @@ where } pub fn total_energy_for_week< - Arg0: CodecInto, + Arg0: ProxyArg, >( self, week: Arg0, @@ -791,7 +791,7 @@ where } pub fn total_locked_tokens_for_week< - Arg0: CodecInto, + Arg0: ProxyArg, >( self, week: Arg0, @@ -803,7 +803,7 @@ where } pub fn update_energy_for_user< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, user: Arg0, @@ -815,7 +815,7 @@ where } pub fn current_claim_progress< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, user: Arg0, @@ -827,7 +827,7 @@ where } pub fn set_energy_factory_address< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, sc_address: Arg0, diff --git a/dex/interactor/proxies/src/farm_staking_proxy_sc_proxy.rs b/dex/interactor/proxies/src/farm_staking_proxy_sc_proxy.rs index c6f0afd7b..79f082290 100644 --- a/dex/interactor/proxies/src/farm_staking_proxy_sc_proxy.rs +++ b/dex/interactor/proxies/src/farm_staking_proxy_sc_proxy.rs @@ -45,14 +45,14 @@ where Gas: TxGas, { pub fn init< - Arg0: CodecInto>, - Arg1: CodecInto>, - Arg2: CodecInto>, - Arg3: CodecInto>, - Arg4: CodecInto>, - Arg5: CodecInto>, - Arg6: CodecInto>, - Arg7: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, + Arg2: ProxyArg>, + Arg3: ProxyArg>, + Arg4: ProxyArg>, + Arg5: ProxyArg>, + Arg6: ProxyArg>, + Arg7: ProxyArg>, >( self, energy_factory_address: Arg0, @@ -106,9 +106,9 @@ where Gas: TxGas, { pub fn register_dual_yield_token< - Arg0: CodecInto>, - Arg1: CodecInto>, - Arg2: CodecInto, + Arg0: ProxyArg>, + Arg1: ProxyArg>, + Arg2: ProxyArg, >( self, token_display_name: Arg0, @@ -188,7 +188,7 @@ where } pub fn set_energy_factory_address< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, sc_address: Arg0, @@ -208,7 +208,7 @@ where } pub fn add_sc_address_to_whitelist< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, address: Arg0, @@ -220,7 +220,7 @@ where } pub fn remove_sc_address_from_whitelist< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, address: Arg0, @@ -232,7 +232,7 @@ where } pub fn is_sc_address_whitelisted< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, address: Arg0, @@ -244,7 +244,7 @@ where } pub fn stake_farm_tokens< - Arg0: CodecInto>>, + Arg0: ProxyArg>>, >( self, opt_orig_caller: Arg0, @@ -256,7 +256,7 @@ where } pub fn claim_dual_yield_endpoint< - Arg0: CodecInto>>, + Arg0: ProxyArg>>, >( self, opt_orig_caller: Arg0, @@ -268,9 +268,9 @@ where } pub fn unstake_farm_tokens< - Arg0: CodecInto>, - Arg1: CodecInto>, - Arg2: CodecInto>>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, + Arg2: ProxyArg>>, >( self, pair_first_token_min_amount: Arg0, diff --git a/dex/interactor/proxies/src/farm_with_locked_rewards_proxy.rs b/dex/interactor/proxies/src/farm_with_locked_rewards_proxy.rs index d70a8a6dc..cf6f8838c 100644 --- a/dex/interactor/proxies/src/farm_with_locked_rewards_proxy.rs +++ b/dex/interactor/proxies/src/farm_with_locked_rewards_proxy.rs @@ -45,12 +45,12 @@ where Gas: TxGas, { pub fn init< - Arg0: CodecInto>, - Arg1: CodecInto>, - Arg2: CodecInto>, - Arg3: CodecInto>, - Arg4: CodecInto>, - Arg5: CodecInto>>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, + Arg2: ProxyArg>, + Arg3: ProxyArg>, + Arg4: ProxyArg>, + Arg5: ProxyArg>>, >( self, reward_token_id: Arg0, @@ -100,7 +100,7 @@ where Gas: TxGas, { pub fn enter_farm_endpoint< - Arg0: CodecInto>>, + Arg0: ProxyArg>>, >( self, opt_orig_caller: Arg0, @@ -112,7 +112,7 @@ where } pub fn claim_rewards_endpoint< - Arg0: CodecInto>>, + Arg0: ProxyArg>>, >( self, opt_orig_caller: Arg0, @@ -124,7 +124,7 @@ where } pub fn exit_farm_endpoint< - Arg0: CodecInto>>, + Arg0: ProxyArg>>, >( self, opt_orig_caller: Arg0, @@ -136,7 +136,7 @@ where } pub fn merge_farm_tokens_endpoint< - Arg0: CodecInto>>, + Arg0: ProxyArg>>, >( self, opt_orig_caller: Arg0, @@ -148,7 +148,7 @@ where } pub fn claim_boosted_rewards< - Arg0: CodecInto>>, + Arg0: ProxyArg>>, >( self, opt_user: Arg0, @@ -176,7 +176,7 @@ where } pub fn set_per_block_rewards_endpoint< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, per_block_amount: Arg0, @@ -188,7 +188,7 @@ where } pub fn set_boosted_yields_rewards_percentage< - Arg0: CodecInto, + Arg0: ProxyArg, >( self, percentage: Arg0, @@ -200,9 +200,9 @@ where } pub fn calculate_rewards_for_given_position< - Arg0: CodecInto>, - Arg1: CodecInto>, - Arg2: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, + Arg2: ProxyArg>, >( self, user: Arg0, @@ -234,7 +234,7 @@ where } pub fn allow_external_claim_boosted_rewards< - Arg0: CodecInto, + Arg0: ProxyArg, >( self, allow_external_claim: Arg0, @@ -246,7 +246,7 @@ where } pub fn get_allow_external_claim_rewards< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, user: Arg0, @@ -298,7 +298,7 @@ where } pub fn user_total_farm_position< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, user: Arg0, @@ -318,7 +318,7 @@ where } pub fn set_locking_sc_address< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, new_address: Arg0, @@ -330,7 +330,7 @@ where } pub fn set_lock_epochs< - Arg0: CodecInto, + Arg0: ProxyArg, >( self, lock_epochs: Arg0, @@ -358,9 +358,9 @@ where } pub fn register_farm_token< - Arg0: CodecInto>, - Arg1: CodecInto>, - Arg2: CodecInto, + Arg0: ProxyArg>, + Arg1: ProxyArg>, + Arg2: ProxyArg, >( self, token_display_name: Arg0, @@ -392,7 +392,7 @@ where } pub fn add_to_pause_whitelist< - Arg0: CodecInto>>, + Arg0: ProxyArg>>, >( self, address_list: Arg0, @@ -404,7 +404,7 @@ where } pub fn remove_from_pause_whitelist< - Arg0: CodecInto>>, + Arg0: ProxyArg>>, >( self, address_list: Arg0, @@ -440,7 +440,7 @@ where } pub fn add_admin_endpoint< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, address: Arg0, @@ -452,7 +452,7 @@ where } pub fn remove_admin_endpoint< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, address: Arg0, @@ -464,7 +464,7 @@ where } pub fn update_owner_or_admin_endpoint< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, previous_owner: Arg0, @@ -476,7 +476,7 @@ where } pub fn permissions< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, address: Arg0, @@ -488,7 +488,7 @@ where } pub fn add_sc_address_to_whitelist< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, address: Arg0, @@ -500,7 +500,7 @@ where } pub fn remove_sc_address_from_whitelist< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, address: Arg0, @@ -512,7 +512,7 @@ where } pub fn is_sc_address_whitelisted< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, address: Arg0, @@ -524,7 +524,7 @@ where } pub fn set_penalty_percent< - Arg0: CodecInto, + Arg0: ProxyArg, >( self, percent: Arg0, @@ -536,7 +536,7 @@ where } pub fn set_minimum_farming_epochs< - Arg0: CodecInto, + Arg0: ProxyArg, >( self, epochs: Arg0, @@ -548,7 +548,7 @@ where } pub fn set_burn_gas_limit< - Arg0: CodecInto, + Arg0: ProxyArg, >( self, gas_limit: Arg0, @@ -608,7 +608,7 @@ where } pub fn accumulated_rewards_for_week< - Arg0: CodecInto, + Arg0: ProxyArg, >( self, week: Arg0, @@ -620,7 +620,7 @@ where } pub fn farm_supply_for_week< - Arg0: CodecInto, + Arg0: ProxyArg, >( self, week: Arg0, @@ -632,7 +632,7 @@ where } pub fn remaining_boosted_rewards_to_distribute< - Arg0: CodecInto, + Arg0: ProxyArg, >( self, week: Arg0, @@ -652,11 +652,11 @@ where } pub fn set_boosted_yields_factors< - Arg0: CodecInto>, - Arg1: CodecInto>, - Arg2: CodecInto>, - Arg3: CodecInto>, - Arg4: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, + Arg2: ProxyArg>, + Arg3: ProxyArg>, + Arg4: ProxyArg>, >( self, max_rewards_factor: Arg0, @@ -701,7 +701,7 @@ where } pub fn get_last_active_week_for_user_view< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, user: Arg0, @@ -713,8 +713,8 @@ where } pub fn get_user_energy_for_week_view< - Arg0: CodecInto>, - Arg1: CodecInto, + Arg0: ProxyArg>, + Arg1: ProxyArg, >( self, user: Arg0, @@ -736,7 +736,7 @@ where } pub fn total_rewards_for_week< - Arg0: CodecInto, + Arg0: ProxyArg, >( self, week: Arg0, @@ -748,7 +748,7 @@ where } pub fn total_energy_for_week< - Arg0: CodecInto, + Arg0: ProxyArg, >( self, week: Arg0, @@ -760,7 +760,7 @@ where } pub fn total_locked_tokens_for_week< - Arg0: CodecInto, + Arg0: ProxyArg, >( self, week: Arg0, @@ -772,7 +772,7 @@ where } pub fn update_energy_for_user< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, user: Arg0, @@ -784,7 +784,7 @@ where } pub fn current_claim_progress< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, user: Arg0, @@ -796,7 +796,7 @@ where } pub fn set_energy_factory_address< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, sc_address: Arg0, diff --git a/dex/interactor/proxies/src/pair_proxy.rs b/dex/interactor/proxies/src/pair_proxy.rs index 3744445e9..09832c056 100644 --- a/dex/interactor/proxies/src/pair_proxy.rs +++ b/dex/interactor/proxies/src/pair_proxy.rs @@ -45,14 +45,14 @@ where Gas: TxGas, { pub fn init< - Arg0: CodecInto>, - Arg1: CodecInto>, - Arg2: CodecInto>, - Arg3: CodecInto>, - Arg4: CodecInto, - Arg5: CodecInto, - Arg6: CodecInto>, - Arg7: CodecInto>>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, + Arg2: ProxyArg>, + Arg3: ProxyArg>, + Arg4: ProxyArg, + Arg5: ProxyArg, + Arg6: ProxyArg>, + Arg7: ProxyArg>>, >( self, first_token_id: Arg0, @@ -106,7 +106,7 @@ where Gas: TxGas, { pub fn set_lp_token_identifier< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, token_identifier: Arg0, @@ -126,7 +126,7 @@ where } pub fn whitelist_endpoint< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, address: Arg0, @@ -138,7 +138,7 @@ where } pub fn remove_whitelist< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, address: Arg0, @@ -150,9 +150,9 @@ where } pub fn add_trusted_swap_pair< - Arg0: CodecInto>, - Arg1: CodecInto>, - Arg2: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, + Arg2: ProxyArg>, >( self, pair_address: Arg0, @@ -168,8 +168,8 @@ where } pub fn remove_trusted_swap_pair< - Arg0: CodecInto>, - Arg1: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, >( self, first_token: Arg0, @@ -187,8 +187,8 @@ where /// For example, if special fees is 5%, and fees_collector_cut_percentage is 10%, /// then of the 5%, 10% are reserved, and only the rest are split between other pair contracts. pub fn setup_fees_collector< - Arg0: CodecInto>, - Arg1: CodecInto, + Arg0: ProxyArg>, + Arg1: ProxyArg, >( self, fees_collector_address: Arg0, @@ -202,9 +202,9 @@ where } pub fn set_fee_on< - Arg0: CodecInto, - Arg1: CodecInto>, - Arg2: CodecInto>, + Arg0: ProxyArg, + Arg1: ProxyArg>, + Arg2: ProxyArg>, >( self, enabled: Arg0, @@ -268,8 +268,8 @@ where } pub fn set_fee_percent< - Arg0: CodecInto, - Arg1: CodecInto, + Arg0: ProxyArg, + Arg1: ProxyArg, >( self, total_fee_percent: Arg0, @@ -347,7 +347,7 @@ where } pub fn pair_reserve< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, token_id: Arg0, @@ -367,8 +367,8 @@ where } pub fn get_lp_tokens_safe_price_by_default_offset< - Arg0: CodecInto>, - Arg1: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, >( self, pair_address: Arg0, @@ -382,9 +382,9 @@ where } pub fn get_lp_tokens_safe_price_by_round_offset< - Arg0: CodecInto>, - Arg1: CodecInto, - Arg2: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg, + Arg2: ProxyArg>, >( self, pair_address: Arg0, @@ -400,9 +400,9 @@ where } pub fn get_lp_tokens_safe_price_by_timestamp_offset< - Arg0: CodecInto>, - Arg1: CodecInto, - Arg2: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg, + Arg2: ProxyArg>, >( self, pair_address: Arg0, @@ -418,10 +418,10 @@ where } pub fn get_lp_tokens_safe_price< - Arg0: CodecInto>, - Arg1: CodecInto, - Arg2: CodecInto, - Arg3: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg, + Arg2: ProxyArg, + Arg3: ProxyArg>, >( self, pair_address: Arg0, @@ -439,8 +439,8 @@ where } pub fn get_safe_price_by_default_offset< - Arg0: CodecInto>, - Arg1: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, >( self, pair_address: Arg0, @@ -454,9 +454,9 @@ where } pub fn get_safe_price_by_round_offset< - Arg0: CodecInto>, - Arg1: CodecInto, - Arg2: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg, + Arg2: ProxyArg>, >( self, pair_address: Arg0, @@ -472,9 +472,9 @@ where } pub fn get_safe_price_by_timestamp_offset< - Arg0: CodecInto>, - Arg1: CodecInto, - Arg2: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg, + Arg2: ProxyArg>, >( self, pair_address: Arg0, @@ -490,10 +490,10 @@ where } pub fn get_safe_price< - Arg0: CodecInto>, - Arg1: CodecInto, - Arg2: CodecInto, - Arg3: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg, + Arg2: ProxyArg, + Arg3: ProxyArg>, >( self, pair_address: Arg0, @@ -511,8 +511,8 @@ where } pub fn get_price_observation_view< - Arg0: CodecInto>, - Arg1: CodecInto, + Arg0: ProxyArg>, + Arg1: ProxyArg, >( self, pair_address: Arg0, @@ -526,7 +526,7 @@ where } pub fn update_and_get_tokens_for_given_position_with_safe_price< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, liquidity: Arg0, @@ -538,7 +538,7 @@ where } pub fn update_and_get_safe_price< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, input: Arg0, @@ -550,7 +550,7 @@ where } pub fn set_locking_deadline_epoch< - Arg0: CodecInto, + Arg0: ProxyArg, >( self, new_deadline: Arg0, @@ -562,7 +562,7 @@ where } pub fn set_locking_sc_address< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, new_address: Arg0, @@ -574,7 +574,7 @@ where } pub fn set_unlock_epoch< - Arg0: CodecInto, + Arg0: ProxyArg, >( self, new_epoch: Arg0, @@ -610,7 +610,7 @@ where } pub fn add_admin_endpoint< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, address: Arg0, @@ -622,7 +622,7 @@ where } pub fn remove_admin_endpoint< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, address: Arg0, @@ -634,7 +634,7 @@ where } pub fn update_owner_or_admin_endpoint< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, previous_owner: Arg0, @@ -646,7 +646,7 @@ where } pub fn permissions< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, address: Arg0, @@ -658,7 +658,7 @@ where } pub fn add_to_pause_whitelist< - Arg0: CodecInto>>, + Arg0: ProxyArg>>, >( self, address_list: Arg0, @@ -670,7 +670,7 @@ where } pub fn remove_from_pause_whitelist< - Arg0: CodecInto>>, + Arg0: ProxyArg>>, >( self, address_list: Arg0, @@ -714,8 +714,8 @@ where } pub fn add_liquidity< - Arg0: CodecInto>, - Arg1: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, >( self, first_token_amount_min: Arg0, @@ -729,8 +729,8 @@ where } pub fn remove_liquidity< - Arg0: CodecInto>, - Arg1: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, >( self, first_token_amount_min: Arg0, @@ -744,7 +744,7 @@ where } pub fn remove_liquidity_and_burn_token< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, token_to_buyback_and_burn: Arg0, @@ -756,8 +756,8 @@ where } pub fn swap_no_fee< - Arg0: CodecInto>, - Arg1: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, >( self, token_out: Arg0, @@ -771,8 +771,8 @@ where } pub fn swap_tokens_fixed_input< - Arg0: CodecInto>, - Arg1: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, >( self, token_out: Arg0, @@ -786,8 +786,8 @@ where } pub fn swap_tokens_fixed_output< - Arg0: CodecInto>, - Arg1: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, >( self, token_out: Arg0, @@ -801,7 +801,7 @@ where } pub fn get_tokens_for_given_position< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, liquidity: Arg0, @@ -821,8 +821,8 @@ where } pub fn get_amount_out_view< - Arg0: CodecInto>, - Arg1: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, >( self, token_in: Arg0, @@ -836,8 +836,8 @@ where } pub fn get_amount_in_view< - Arg0: CodecInto>, - Arg1: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, >( self, token_wanted: Arg0, @@ -851,8 +851,8 @@ where } pub fn get_equivalent< - Arg0: CodecInto>, - Arg1: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, >( self, token_in: Arg0, diff --git a/dex/interactor/proxies/src/router_proxy.rs b/dex/interactor/proxies/src/router_proxy.rs index acbc39930..a1184f5e6 100644 --- a/dex/interactor/proxies/src/router_proxy.rs +++ b/dex/interactor/proxies/src/router_proxy.rs @@ -44,7 +44,7 @@ where Gas: TxGas, { pub fn init< - Arg0: CodecInto>>, + Arg0: ProxyArg>>, >( self, pair_template_address_opt: Arg0, @@ -84,7 +84,7 @@ where Gas: TxGas, { pub fn pause< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, address: Arg0, @@ -96,7 +96,7 @@ where } pub fn resume< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, address: Arg0, @@ -108,11 +108,11 @@ where } pub fn create_pair_endpoint< - Arg0: CodecInto>, - Arg1: CodecInto>, - Arg2: CodecInto>, - Arg3: CodecInto>>, - Arg4: CodecInto>>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, + Arg2: ProxyArg>, + Arg3: ProxyArg>>, + Arg4: ProxyArg>>, >( self, first_token_id: Arg0, @@ -132,8 +132,8 @@ where } pub fn upgrade_pair_endpoint< - Arg0: CodecInto>, - Arg1: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, >( self, first_token_id: Arg0, @@ -147,9 +147,9 @@ where } pub fn issue_lp_token< - Arg0: CodecInto>, - Arg1: CodecInto>, - Arg2: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, + Arg2: ProxyArg>, >( self, pair_address: Arg0, @@ -165,7 +165,7 @@ where } pub fn set_local_roles< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, pair_address: Arg0, @@ -177,8 +177,8 @@ where } pub fn remove_pair< - Arg0: CodecInto>, - Arg1: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, >( self, first_token_id: Arg0, @@ -192,9 +192,9 @@ where } pub fn set_fee_on< - Arg0: CodecInto>, - Arg1: CodecInto>, - Arg2: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, + Arg2: ProxyArg>, >( self, pair_address: Arg0, @@ -210,9 +210,9 @@ where } pub fn set_fee_off< - Arg0: CodecInto>, - Arg1: CodecInto>, - Arg2: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, + Arg2: ProxyArg>, >( self, pair_address: Arg0, @@ -228,7 +228,7 @@ where } pub fn set_pair_creation_enabled< - Arg0: CodecInto, + Arg0: ProxyArg, >( self, enabled: Arg0, @@ -272,7 +272,7 @@ where } pub fn set_temporary_owner_period< - Arg0: CodecInto, + Arg0: ProxyArg, >( self, period_blocks: Arg0, @@ -284,7 +284,7 @@ where } pub fn set_pair_template_address< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, address: Arg0, @@ -344,8 +344,8 @@ where } pub fn get_pair< - Arg0: CodecInto>, - Arg1: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, >( self, first_token_id: Arg0, @@ -359,7 +359,7 @@ where } pub fn get_pair_tokens< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, pair_address: Arg0, @@ -379,7 +379,7 @@ where } pub fn multi_pair_swap< - Arg0: CodecInto, ManagedBuffer, TokenIdentifier, BigUint>>>, + Arg0: ProxyArg, ManagedBuffer, TokenIdentifier, BigUint>>>, >( self, swap_operations: Arg0, @@ -391,10 +391,10 @@ where } pub fn config_enable_by_user_parameters< - Arg0: CodecInto>, - Arg1: CodecInto>, - Arg2: CodecInto>, - Arg3: CodecInto, + Arg0: ProxyArg>, + Arg1: ProxyArg>, + Arg2: ProxyArg>, + Arg3: ProxyArg, >( self, common_token_id: Arg0, @@ -412,7 +412,7 @@ where } pub fn add_common_tokens_for_user_pairs< - Arg0: CodecInto>>, + Arg0: ProxyArg>>, >( self, tokens: Arg0, @@ -424,7 +424,7 @@ where } pub fn remove_common_tokens_for_user_pairs< - Arg0: CodecInto>>, + Arg0: ProxyArg>>, >( self, tokens: Arg0, @@ -436,7 +436,7 @@ where } pub fn set_swap_enabled_by_user< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, pair_address: Arg0, @@ -448,7 +448,7 @@ where } pub fn try_get_config< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, token_id: Arg0, diff --git a/dex/interactor/src/energy_factory.rs b/dex/interactor/src/energy_factory.rs index ba64f9591..49e13d7c2 100644 --- a/dex/interactor/src/energy_factory.rs +++ b/dex/interactor/src/energy_factory.rs @@ -1,3 +1,5 @@ +#![allow(unused)] + use multiversx_sc_scenario::imports::{ Address, BigUint, ManagedAddress, ReturnsResult, RustBigUint, }; diff --git a/dex/interactor/src/farm_locked.rs b/dex/interactor/src/farm_locked.rs index 9c8dbea75..27201a6e2 100644 --- a/dex/interactor/src/farm_locked.rs +++ b/dex/interactor/src/farm_locked.rs @@ -1,11 +1,8 @@ +#![allow(unused)] + use common_structs::FarmTokenAttributes; -use multiversx_sc_scenario::{ - api::StaticApi, - imports::{ - Address, BigUint, EsdtTokenPayment, ManagedAddress, ManagedVec, ReturnsResult, RustBigUint, - }, -}; -use multiversx_sc_snippets::InteractorPrepareAsync; + +use multiversx_sc_snippets::imports::*; use crate::{ farm_with_locked_rewards_proxy, @@ -28,9 +25,9 @@ pub(crate) async fn enter_farm( .current_farm_with_locked_rewards_address()) .gas(100_000_000u64) .typed(farm_with_locked_rewards_proxy::FarmProxy) - .enter_farm_endpoint(ManagedAddress::from( + .enter_farm_endpoint(OptionalValue::Some(ManagedAddress::from( dex_interact.wallet_address.as_address(), - )) + ))) .payment::>(lp_token.into()) .returns(ReturnsResult) .prepare_async() diff --git a/dex/interactor/src/farm_staking_proxy.rs b/dex/interactor/src/farm_staking_proxy.rs index 88507d620..9079c9980 100644 --- a/dex/interactor/src/farm_staking_proxy.rs +++ b/dex/interactor/src/farm_staking_proxy.rs @@ -1,3 +1,5 @@ +#![allow(unused)] + use multiversx_sc_scenario::{ api::StaticApi, imports::{ diff --git a/dex/pair/src/energy_factory_lock_proxy.rs b/dex/pair/src/energy_factory_lock_proxy.rs index 58d2cf76e..fa41e0f00 100644 --- a/dex/pair/src/energy_factory_lock_proxy.rs +++ b/dex/pair/src/energy_factory_lock_proxy.rs @@ -49,8 +49,8 @@ where /// /// Output payment: LOCKED tokens pub fn lock_tokens_endpoint< - Arg0: CodecInto, - Arg1: CodecInto>>, + Arg0: ProxyArg, + Arg1: ProxyArg>>, >( self, lock_epochs: Arg0, diff --git a/dex/pair/src/self_proxy.rs b/dex/pair/src/self_proxy.rs index 04e44d7df..d4d2534ff 100644 --- a/dex/pair/src/self_proxy.rs +++ b/dex/pair/src/self_proxy.rs @@ -35,8 +35,8 @@ where Gas: TxGas, { pub fn swap_no_fee< - Arg0: CodecInto>, - Arg1: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, >( self, token_out: Arg0, diff --git a/dex/proxy-deployer/src/farm_proxy.rs b/dex/proxy-deployer/src/farm_proxy.rs index 65b8045fe..e6abee5ce 100644 --- a/dex/proxy-deployer/src/farm_proxy.rs +++ b/dex/proxy-deployer/src/farm_proxy.rs @@ -35,12 +35,12 @@ where Gas: TxGas, { pub fn init< - Arg0: CodecInto>, - Arg1: CodecInto>, - Arg2: CodecInto>, - Arg3: CodecInto>, - Arg4: CodecInto>, - Arg5: CodecInto>>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, + Arg2: ProxyArg>, + Arg3: ProxyArg>, + Arg4: ProxyArg>, + Arg5: ProxyArg>>, >( self, reward_token_id: Arg0, diff --git a/dex/router/src/pair_proxy.rs b/dex/router/src/pair_proxy.rs index 0a483e199..cf22114c0 100644 --- a/dex/router/src/pair_proxy.rs +++ b/dex/router/src/pair_proxy.rs @@ -44,14 +44,14 @@ where Gas: TxGas, { pub fn init< - Arg0: CodecInto>, - Arg1: CodecInto>, - Arg2: CodecInto>, - Arg3: CodecInto>, - Arg4: CodecInto, - Arg5: CodecInto, - Arg6: CodecInto>, - Arg7: CodecInto>>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, + Arg2: ProxyArg>, + Arg3: ProxyArg>, + Arg4: ProxyArg, + Arg5: ProxyArg, + Arg6: ProxyArg>, + Arg7: ProxyArg>>, >( self, first_token_id: Arg0, @@ -105,7 +105,7 @@ where Gas: TxGas, { pub fn set_lp_token_identifier< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, token_identifier: Arg0, @@ -125,7 +125,7 @@ where } pub fn whitelist_endpoint< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, address: Arg0, @@ -137,7 +137,7 @@ where } pub fn remove_whitelist< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, address: Arg0, @@ -149,9 +149,9 @@ where } pub fn add_trusted_swap_pair< - Arg0: CodecInto>, - Arg1: CodecInto>, - Arg2: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, + Arg2: ProxyArg>, >( self, pair_address: Arg0, @@ -167,8 +167,8 @@ where } pub fn remove_trusted_swap_pair< - Arg0: CodecInto>, - Arg1: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, >( self, first_token: Arg0, @@ -186,8 +186,8 @@ where /// For example, if special fees is 5%, and fees_collector_cut_percentage is 10%, /// then of the 5%, 10% are reserved, and only the rest are split between other pair contracts. pub fn setup_fees_collector< - Arg0: CodecInto>, - Arg1: CodecInto, + Arg0: ProxyArg>, + Arg1: ProxyArg, >( self, fees_collector_address: Arg0, @@ -201,9 +201,9 @@ where } pub fn set_fee_on< - Arg0: CodecInto, - Arg1: CodecInto>, - Arg2: CodecInto>, + Arg0: ProxyArg, + Arg1: ProxyArg>, + Arg2: ProxyArg>, >( self, enabled: Arg0, @@ -267,8 +267,8 @@ where } pub fn set_fee_percent< - Arg0: CodecInto, - Arg1: CodecInto, + Arg0: ProxyArg, + Arg1: ProxyArg, >( self, total_fee_percent: Arg0, @@ -346,7 +346,7 @@ where } pub fn pair_reserve< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, token_id: Arg0, @@ -366,8 +366,8 @@ where } pub fn get_lp_tokens_safe_price_by_default_offset< - Arg0: CodecInto>, - Arg1: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, >( self, pair_address: Arg0, @@ -381,9 +381,9 @@ where } pub fn get_lp_tokens_safe_price_by_round_offset< - Arg0: CodecInto>, - Arg1: CodecInto, - Arg2: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg, + Arg2: ProxyArg>, >( self, pair_address: Arg0, @@ -399,9 +399,9 @@ where } pub fn get_lp_tokens_safe_price_by_timestamp_offset< - Arg0: CodecInto>, - Arg1: CodecInto, - Arg2: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg, + Arg2: ProxyArg>, >( self, pair_address: Arg0, @@ -417,10 +417,10 @@ where } pub fn get_lp_tokens_safe_price< - Arg0: CodecInto>, - Arg1: CodecInto, - Arg2: CodecInto, - Arg3: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg, + Arg2: ProxyArg, + Arg3: ProxyArg>, >( self, pair_address: Arg0, @@ -438,8 +438,8 @@ where } pub fn get_safe_price_by_default_offset< - Arg0: CodecInto>, - Arg1: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, >( self, pair_address: Arg0, @@ -453,9 +453,9 @@ where } pub fn get_safe_price_by_round_offset< - Arg0: CodecInto>, - Arg1: CodecInto, - Arg2: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg, + Arg2: ProxyArg>, >( self, pair_address: Arg0, @@ -471,9 +471,9 @@ where } pub fn get_safe_price_by_timestamp_offset< - Arg0: CodecInto>, - Arg1: CodecInto, - Arg2: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg, + Arg2: ProxyArg>, >( self, pair_address: Arg0, @@ -489,10 +489,10 @@ where } pub fn get_safe_price< - Arg0: CodecInto>, - Arg1: CodecInto, - Arg2: CodecInto, - Arg3: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg, + Arg2: ProxyArg, + Arg3: ProxyArg>, >( self, pair_address: Arg0, @@ -510,8 +510,8 @@ where } pub fn get_price_observation_view< - Arg0: CodecInto>, - Arg1: CodecInto, + Arg0: ProxyArg>, + Arg1: ProxyArg, >( self, pair_address: Arg0, @@ -525,7 +525,7 @@ where } pub fn update_and_get_tokens_for_given_position_with_safe_price< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, liquidity: Arg0, @@ -537,7 +537,7 @@ where } pub fn update_and_get_safe_price< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, input: Arg0, @@ -549,7 +549,7 @@ where } pub fn set_locking_deadline_epoch< - Arg0: CodecInto, + Arg0: ProxyArg, >( self, new_deadline: Arg0, @@ -561,7 +561,7 @@ where } pub fn set_locking_sc_address< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, new_address: Arg0, @@ -573,7 +573,7 @@ where } pub fn set_unlock_epoch< - Arg0: CodecInto, + Arg0: ProxyArg, >( self, new_epoch: Arg0, @@ -609,7 +609,7 @@ where } pub fn add_admin_endpoint< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, address: Arg0, @@ -621,7 +621,7 @@ where } pub fn remove_admin_endpoint< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, address: Arg0, @@ -633,7 +633,7 @@ where } pub fn update_owner_or_admin_endpoint< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, previous_owner: Arg0, @@ -645,7 +645,7 @@ where } pub fn permissions< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, address: Arg0, @@ -657,7 +657,7 @@ where } pub fn add_to_pause_whitelist< - Arg0: CodecInto>>, + Arg0: ProxyArg>>, >( self, address_list: Arg0, @@ -669,7 +669,7 @@ where } pub fn remove_from_pause_whitelist< - Arg0: CodecInto>>, + Arg0: ProxyArg>>, >( self, address_list: Arg0, @@ -713,8 +713,8 @@ where } pub fn add_liquidity< - Arg0: CodecInto>, - Arg1: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, >( self, first_token_amount_min: Arg0, @@ -728,8 +728,8 @@ where } pub fn remove_liquidity< - Arg0: CodecInto>, - Arg1: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, >( self, first_token_amount_min: Arg0, @@ -743,7 +743,7 @@ where } pub fn remove_liquidity_and_burn_token< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, token_to_buyback_and_burn: Arg0, @@ -755,8 +755,8 @@ where } pub fn swap_no_fee< - Arg0: CodecInto>, - Arg1: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, >( self, token_out: Arg0, @@ -770,8 +770,8 @@ where } pub fn swap_tokens_fixed_input< - Arg0: CodecInto>, - Arg1: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, >( self, token_out: Arg0, @@ -785,8 +785,8 @@ where } pub fn swap_tokens_fixed_output< - Arg0: CodecInto>, - Arg1: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, >( self, token_out: Arg0, @@ -800,7 +800,7 @@ where } pub fn get_tokens_for_given_position< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, liquidity: Arg0, @@ -820,8 +820,8 @@ where } pub fn get_amount_out_view< - Arg0: CodecInto>, - Arg1: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, >( self, token_in: Arg0, @@ -835,8 +835,8 @@ where } pub fn get_amount_in_view< - Arg0: CodecInto>, - Arg1: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, >( self, token_wanted: Arg0, @@ -850,8 +850,8 @@ where } pub fn get_equivalent< - Arg0: CodecInto>, - Arg1: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, >( self, token_in: Arg0, diff --git a/energy-integration/energy-update/src/farm_proxy.rs b/energy-integration/energy-update/src/farm_proxy.rs index 853f78d71..b01a4e7b9 100644 --- a/energy-integration/energy-update/src/farm_proxy.rs +++ b/energy-integration/energy-update/src/farm_proxy.rs @@ -34,7 +34,7 @@ where To: TxTo, Gas: TxGas, { - pub fn update_energy_for_user>>( + pub fn update_energy_for_user>>( self, user: Arg0, ) -> TxProxyCall { diff --git a/energy-integration/governance-v2/src/fees_collector_proxy.rs b/energy-integration/governance-v2/src/fees_collector_proxy.rs index 58f967368..1d5c5dc19 100644 --- a/energy-integration/governance-v2/src/fees_collector_proxy.rs +++ b/energy-integration/governance-v2/src/fees_collector_proxy.rs @@ -40,7 +40,7 @@ where .original_result() } - pub fn total_energy_for_week>( + pub fn total_energy_for_week>( self, week: Arg0, ) -> TxProxyCall> { diff --git a/farm-staking/farm-staking-proxy/src/external_contracts_interactions.rs b/farm-staking/farm-staking-proxy/src/external_contracts_interactions.rs index 3f1213ea7..d7b168300 100644 --- a/farm-staking/farm-staking-proxy/src/external_contracts_interactions.rs +++ b/farm-staking/farm-staking-proxy/src/external_contracts_interactions.rs @@ -27,7 +27,7 @@ pub trait ExternalContractsInteractionsModule: .tx() .to(&lp_farm_address) .typed(farm_with_locked_rewards_proxy::FarmProxy) - .claim_rewards_endpoint(orig_caller) + .claim_rewards_endpoint(OptionalValue::Some(orig_caller)) .single_esdt( &lp_farm_token_id, lp_farm_token_nonce, @@ -56,7 +56,7 @@ pub trait ExternalContractsInteractionsModule: .tx() .to(&lp_farm_address) .typed(farm_with_locked_rewards_proxy::FarmProxy) - .exit_farm_endpoint(orig_caller) + .exit_farm_endpoint(OptionalValue::Some(orig_caller)) .single_esdt( &lp_farm_token_id, lp_farm_token_nonce, @@ -91,7 +91,7 @@ pub trait ExternalContractsInteractionsModule: self.tx() .to(lp_farm_address) .typed(farm_with_locked_rewards_proxy::FarmProxy) - .merge_farm_tokens_endpoint(orig_caller) + .merge_farm_tokens_endpoint(OptionalValue::Some(orig_caller)) .payment(additional_lp_farm_tokens) .returns(ReturnsResult) .sync_call() diff --git a/farm-staking/farm-staking-proxy/src/farm_staking_proxy_methods.rs b/farm-staking/farm-staking-proxy/src/farm_staking_proxy_methods.rs index 8f2a35ebc..3cd20a7b3 100644 --- a/farm-staking/farm-staking-proxy/src/farm_staking_proxy_methods.rs +++ b/farm-staking/farm-staking-proxy/src/farm_staking_proxy_methods.rs @@ -37,8 +37,8 @@ where Gas: TxGas, { pub fn stake_farm_through_proxy< - Arg0: CodecInto>, - Arg1: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, >( self, staked_token_amount: Arg0, @@ -58,8 +58,8 @@ where } pub fn claim_rewards_with_new_value< - Arg0: CodecInto>, - Arg1: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, >( self, new_farming_amount: Arg0, @@ -78,7 +78,7 @@ where .original_result() } - pub fn unstake_farm_through_proxy>>( + pub fn unstake_farm_through_proxy>>( self, original_caller: Arg0, ) -> TxProxyCall< diff --git a/farm-staking/farm-staking-proxy/src/farm_with_locked_rewards_proxy.rs b/farm-staking/farm-staking-proxy/src/farm_with_locked_rewards_proxy.rs index 81b3565c0..e54022393 100644 --- a/farm-staking/farm-staking-proxy/src/farm_with_locked_rewards_proxy.rs +++ b/farm-staking/farm-staking-proxy/src/farm_with_locked_rewards_proxy.rs @@ -36,7 +36,7 @@ where To: TxTo, Gas: TxGas, { - pub fn exit_farm_endpoint>>>( + pub fn exit_farm_endpoint>>>( self, opt_orig_caller: Arg0, ) -> TxProxyCall< @@ -52,7 +52,7 @@ where .original_result() } - pub fn claim_rewards_endpoint>>>( + pub fn claim_rewards_endpoint>>>( self, opt_orig_caller: Arg0, ) -> TxProxyCall< @@ -68,7 +68,7 @@ where .original_result() } - pub fn merge_farm_tokens_endpoint>>>( + pub fn merge_farm_tokens_endpoint>>>( self, opt_orig_caller: Arg0, ) -> TxProxyCall< diff --git a/farm-staking/farm-staking-proxy/src/pair_proxy.rs b/farm-staking/farm-staking-proxy/src/pair_proxy.rs index 62cee6898..abc188bab 100644 --- a/farm-staking/farm-staking-proxy/src/pair_proxy.rs +++ b/farm-staking/farm-staking-proxy/src/pair_proxy.rs @@ -37,8 +37,8 @@ where Gas: TxGas, { pub fn remove_liquidity< - Arg0: CodecInto>, - Arg1: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, >( self, first_token_amount_min: Arg0, @@ -58,7 +58,7 @@ where } pub fn update_and_get_tokens_for_given_position_with_safe_price< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, liquidity: Arg0, diff --git a/locked-asset/distribution/src/locked_asset_factory_proxy.rs b/locked-asset/distribution/src/locked_asset_factory_proxy.rs index 9dacf6ade..8a1ad9229 100644 --- a/locked-asset/distribution/src/locked_asset_factory_proxy.rs +++ b/locked-asset/distribution/src/locked_asset_factory_proxy.rs @@ -36,10 +36,10 @@ where Gas: TxGas, { pub fn create_and_forward_custom_period< - Arg0: CodecInto>, - Arg1: CodecInto>, - Arg2: CodecInto, - Arg3: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, + Arg2: ProxyArg, + Arg3: ProxyArg>, >( self, amount: Arg0, diff --git a/locked-asset/energy-factory/src/token_unstake_proxy.rs b/locked-asset/energy-factory/src/token_unstake_proxy.rs index 9046e156c..2fa5e9ed0 100644 --- a/locked-asset/energy-factory/src/token_unstake_proxy.rs +++ b/locked-asset/energy-factory/src/token_unstake_proxy.rs @@ -36,7 +36,7 @@ where Gas: TxGas, { pub fn deposit_user_tokens< - Arg0: CodecInto>, + Arg0: ProxyArg>, >( self, user: Arg0, diff --git a/locked-asset/factory/src/energy_factory_migration_proxy.rs b/locked-asset/factory/src/energy_factory_migration_proxy.rs index dde858d57..87b1f8416 100644 --- a/locked-asset/factory/src/energy_factory_migration_proxy.rs +++ b/locked-asset/factory/src/energy_factory_migration_proxy.rs @@ -36,9 +36,9 @@ where Gas: TxGas, { pub fn update_energy_after_old_token_unlock< - Arg0: CodecInto>, - Arg1: CodecInto>, - Arg2: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, + Arg2: ProxyArg>, >( self, original_caller: Arg0, diff --git a/locked-asset/lkmex-transfer/src/energy_factory_token_transfer_proxy.rs b/locked-asset/lkmex-transfer/src/energy_factory_token_transfer_proxy.rs index bc6b73769..7fc7fa376 100644 --- a/locked-asset/lkmex-transfer/src/energy_factory_token_transfer_proxy.rs +++ b/locked-asset/lkmex-transfer/src/energy_factory_token_transfer_proxy.rs @@ -37,8 +37,8 @@ where Gas: TxGas, { pub fn set_user_energy_after_locked_token_transfer< - Arg0: CodecInto>, - Arg1: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, >( self, user: Arg0, diff --git a/locked-asset/proxy_dex/src/energy_factory_token_transfer_proxy.rs b/locked-asset/proxy_dex/src/energy_factory_token_transfer_proxy.rs index 7874ee3cc..303760277 100644 --- a/locked-asset/proxy_dex/src/energy_factory_token_transfer_proxy.rs +++ b/locked-asset/proxy_dex/src/energy_factory_token_transfer_proxy.rs @@ -37,8 +37,8 @@ where Gas: TxGas, { pub fn extend_lock_period< - Arg0: CodecInto, - Arg1: CodecInto>, + Arg0: ProxyArg, + Arg1: ProxyArg>, >( self, lock_epochs: Arg0, @@ -52,8 +52,8 @@ where } pub fn set_user_energy_after_locked_token_transfer< - Arg0: CodecInto>, - Arg1: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, >( self, user: Arg0, diff --git a/locked-asset/proxy_dex/src/farm_interactions.rs b/locked-asset/proxy_dex/src/farm_interactions.rs index 8c5749a35..7a4466108 100644 --- a/locked-asset/proxy_dex/src/farm_interactions.rs +++ b/locked-asset/proxy_dex/src/farm_interactions.rs @@ -26,7 +26,7 @@ pub trait FarmInteractionsModule { .tx() .to(&farm_address) .typed(farm_with_locked_rewards_proxy::FarmProxy) - .enter_farm_endpoint(user) + .enter_farm_endpoint(OptionalValue::Some(user)) .single_esdt(&farming_token_id, 0, &farming_token_amount) .returns(ReturnsResult) .sync_call(); @@ -49,7 +49,7 @@ pub trait FarmInteractionsModule { .tx() .to(&farm_address) .typed(farm_with_locked_rewards_proxy::FarmProxy) - .exit_farm_endpoint(user) + .exit_farm_endpoint(OptionalValue::Some(user)) .payment(farm_token) .returns(ReturnsResult) .sync_call(); @@ -72,7 +72,7 @@ pub trait FarmInteractionsModule { .tx() .to(&farm_address) .typed(farm_with_locked_rewards_proxy::FarmProxy) - .claim_rewards_endpoint(user) + .claim_rewards_endpoint(OptionalValue::Some(user)) .payment(farm_token) .returns(ReturnsResult) .sync_call(); diff --git a/locked-asset/proxy_dex/src/farm_with_locked_rewards_proxy.rs b/locked-asset/proxy_dex/src/farm_with_locked_rewards_proxy.rs index 1dd1279b8..1ea21160c 100644 --- a/locked-asset/proxy_dex/src/farm_with_locked_rewards_proxy.rs +++ b/locked-asset/proxy_dex/src/farm_with_locked_rewards_proxy.rs @@ -36,7 +36,7 @@ where To: TxTo, Gas: TxGas, { - pub fn enter_farm_endpoint>>>( + pub fn enter_farm_endpoint>>>( self, opt_orig_caller: Arg0, ) -> TxProxyCall< @@ -52,7 +52,7 @@ where .original_result() } - pub fn exit_farm_endpoint>>>( + pub fn exit_farm_endpoint>>>( self, opt_orig_caller: Arg0, ) -> TxProxyCall< @@ -68,7 +68,7 @@ where .original_result() } - pub fn claim_rewards_endpoint>>>( + pub fn claim_rewards_endpoint>>>( self, opt_orig_caller: Arg0, ) -> TxProxyCall< diff --git a/locked-asset/proxy_dex/src/pair_proxy.rs b/locked-asset/proxy_dex/src/pair_proxy.rs index 4905a98ca..970a32a62 100644 --- a/locked-asset/proxy_dex/src/pair_proxy.rs +++ b/locked-asset/proxy_dex/src/pair_proxy.rs @@ -36,7 +36,7 @@ where To: TxTo, Gas: TxGas, { - pub fn add_liquidity>, Arg1: CodecInto>>( + pub fn add_liquidity>, Arg1: ProxyArg>>( self, first_token_amount_min: Arg0, second_token_amount_min: Arg1, @@ -59,8 +59,8 @@ where } pub fn remove_liquidity< - Arg0: CodecInto>, - Arg1: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, >( self, first_token_amount_min: Arg0, diff --git a/locked-asset/simple-lock/src/farm_interactions.rs b/locked-asset/simple-lock/src/farm_interactions.rs index 991e10b32..8b81d796b 100644 --- a/locked-asset/simple-lock/src/farm_interactions.rs +++ b/locked-asset/simple-lock/src/farm_interactions.rs @@ -48,7 +48,7 @@ pub trait FarmInteractionsModule { .tx() .to(&farm_address) .typed(farm_proxy::FarmProxy) - .enter_farm(caller) + .enter_farm(OptionalValue::Some(caller)) .payment(payment) .returns(ReturnsRawResult) .sync_call(); @@ -77,7 +77,7 @@ pub trait FarmInteractionsModule { .tx() .to(&farm_address) .typed(farm_proxy::FarmProxy) - .exit_farm(caller) + .exit_farm(OptionalValue::Some(caller)) .single_esdt(&farm_token, farm_token_nonce, &farm_token_amount) .returns(ReturnsRawResult) .sync_call(); @@ -106,7 +106,7 @@ pub trait FarmInteractionsModule { .tx() .to(&farm_address) .typed(farm_proxy::FarmProxy) - .claim_rewards(caller) + .claim_rewards(OptionalValue::Some(caller)) .single_esdt(&farm_token, farm_token_nonce, &farm_token_amount) .returns(ReturnsRawResult) .sync_call(); diff --git a/locked-asset/simple-lock/src/farm_proxy.rs b/locked-asset/simple-lock/src/farm_proxy.rs index f3442672b..8e8e111e9 100644 --- a/locked-asset/simple-lock/src/farm_proxy.rs +++ b/locked-asset/simple-lock/src/farm_proxy.rs @@ -38,7 +38,7 @@ where Gas: TxGas, { pub fn enter_farm< - Arg0: CodecInto>>, + Arg0: ProxyArg>>, >( self, opt_orig_caller: Arg0, @@ -50,7 +50,7 @@ where } pub fn exit_farm< - Arg0: CodecInto>>, + Arg0: ProxyArg>>, >( self, opt_orig_caller: Arg0, @@ -62,7 +62,7 @@ where } pub fn claim_rewards< - Arg0: CodecInto>>, + Arg0: ProxyArg>>, >( self, opt_orig_caller: Arg0, diff --git a/locked-asset/simple-lock/src/lp_proxy.rs b/locked-asset/simple-lock/src/lp_proxy.rs index 0251884a6..369b83d9d 100644 --- a/locked-asset/simple-lock/src/lp_proxy.rs +++ b/locked-asset/simple-lock/src/lp_proxy.rs @@ -38,8 +38,8 @@ where Gas: TxGas, { pub fn add_liquidity< - Arg0: CodecInto>, - Arg1: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, >( self, first_token_amount_min: Arg0, @@ -53,8 +53,8 @@ where } pub fn remove_liquidity< - Arg0: CodecInto>, - Arg1: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, >( self, first_token_amount_min: Arg0, diff --git a/locked-asset/token-unstake/src/energy_factory_unstake_proxy.rs b/locked-asset/token-unstake/src/energy_factory_unstake_proxy.rs index 9dbc6d3d2..5721a5f73 100644 --- a/locked-asset/token-unstake/src/energy_factory_unstake_proxy.rs +++ b/locked-asset/token-unstake/src/energy_factory_unstake_proxy.rs @@ -37,8 +37,8 @@ where Gas: TxGas, { pub fn revert_unstake< - Arg0: CodecInto>, - Arg1: CodecInto>, + Arg0: ProxyArg>, + Arg1: ProxyArg>, >( self, user: Arg0, From 801c7536cae6a77667800870781ce486776f2c71 Mon Sep 17 00:00:00 2001 From: Andrei Marinica Date: Fri, 10 May 2024 12:19:24 +0300 Subject: [PATCH 47/55] replaced deprecated call with unified syntax --- locked-asset/proxy_dex/src/external_merging.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/locked-asset/proxy_dex/src/external_merging.rs b/locked-asset/proxy_dex/src/external_merging.rs index 30ef3eb88..407408f31 100644 --- a/locked-asset/proxy_dex/src/external_merging.rs +++ b/locked-asset/proxy_dex/src/external_merging.rs @@ -38,12 +38,12 @@ fn merge_common( endpoint_name: &[u8], tokens: PaymentsVec, ) -> EsdtTokenPayment { - let mut contract_call = ContractCallWithMultiEsdt::>::new( - sc_address, - ManagedBuffer::new_from_bytes(endpoint_name), - tokens, - ); - contract_call.proxy_arg(&original_caller); - - contract_call.execute_on_dest_context() + Tx::new_tx_from_sc() + .to(sc_address) + .raw_call(endpoint_name) + .argument(original_caller) + .payment(tokens) + .original_result::>() + .returns(ReturnsResult) + .sync_call() } From 79a81758c8e12669018238a8820856d3e2e9928c Mon Sep 17 00:00:00 2001 From: Andrei Marinica Date: Fri, 10 May 2024 12:20:59 +0300 Subject: [PATCH 48/55] cleanup, fmt --- dex/interactor/src/dex_interact_cli.rs | 2 +- dex/interactor/src/energy_factory.rs | 5 +---- dex/interactor/src/farm_staking_proxy.rs | 14 ++++++-------- dex/interactor/src/pair.rs | 6 +++++- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/dex/interactor/src/dex_interact_cli.rs b/dex/interactor/src/dex_interact_cli.rs index 8ec2c2f64..ec12bf021 100644 --- a/dex/interactor/src/dex_interact_cli.rs +++ b/dex/interactor/src/dex_interact_cli.rs @@ -17,7 +17,7 @@ pub enum InteractCliCommand { #[command(name = "add_liquidity", about = "Adds liquidity to a pair")] Add(AddArgs), #[command(name = "full_farm", about = "Creates a full farm scenario")] - FullFarm(AddArgs) + FullFarm(AddArgs), } // Second token id is taken from the state diff --git a/dex/interactor/src/energy_factory.rs b/dex/interactor/src/energy_factory.rs index 49e13d7c2..2764de4b8 100644 --- a/dex/interactor/src/energy_factory.rs +++ b/dex/interactor/src/energy_factory.rs @@ -1,9 +1,6 @@ #![allow(unused)] -use multiversx_sc_scenario::imports::{ - Address, BigUint, ManagedAddress, ReturnsResult, RustBigUint, -}; -use multiversx_sc_snippets::InteractorPrepareAsync; +use multiversx_sc_snippets::imports::*; use proxies::energy_factory_proxy; use crate::{ diff --git a/dex/interactor/src/farm_staking_proxy.rs b/dex/interactor/src/farm_staking_proxy.rs index 9079c9980..b2a71fe3d 100644 --- a/dex/interactor/src/farm_staking_proxy.rs +++ b/dex/interactor/src/farm_staking_proxy.rs @@ -1,12 +1,7 @@ #![allow(unused)] -use multiversx_sc_scenario::{ - api::StaticApi, - imports::{ - Address, BigUint, EsdtTokenPayment, ManagedAddress, ManagedVec, ReturnsResult, RustBigUint, - }, -}; -use multiversx_sc_snippets::InteractorPrepareAsync; +use multiversx_sc_snippets::imports::*; + use proxies::farm_staking_proxy_sc_proxy; use crate::{ @@ -18,7 +13,10 @@ use crate::{ }; // views -pub(crate) async fn is_sc_address_whitelisted(dex_interact: &mut DexInteract, address: Address) -> bool { +pub(crate) async fn is_sc_address_whitelisted( + dex_interact: &mut DexInteract, + address: Address, +) -> bool { dex_interact .interactor .query() diff --git a/dex/interactor/src/pair.rs b/dex/interactor/src/pair.rs index 1b1073bba..88b534526 100644 --- a/dex/interactor/src/pair.rs +++ b/dex/interactor/src/pair.rs @@ -2,7 +2,11 @@ use multiversx_sc_scenario::imports::{BigUint, ReturnsResult, TokenIdentifier}; use multiversx_sc_snippets::InteractorPrepareAsync; use proxies::pair_proxy; -use crate::{dex_interact_cli::{AddArgs, SwapArgs}, structs::{InteractorAddLiquidityResultType, InteractorToken}, DexInteract}; +use crate::{ + dex_interact_cli::{AddArgs, SwapArgs}, + structs::{InteractorAddLiquidityResultType, InteractorToken}, + DexInteract, +}; pub(crate) async fn swap_tokens_fixed_input( dex_interact: &mut DexInteract, From 422cb1f510a8dbd5ac397750ad2ff29d95bf39a4 Mon Sep 17 00:00:00 2001 From: Andrei Marinica Date: Fri, 10 May 2024 12:25:15 +0300 Subject: [PATCH 49/55] upgrade to framework version 0.50.0 --- Cargo.lock | 376 ++++++++--- 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 | 574 ++++++++++++++++ dex/farm-with-locked-rewards/wasm/Cargo.toml | 5 +- dex/farm-with-locked-rewards/wasm/src/lib.rs | 4 +- dex/farm/Cargo.toml | 6 +- dex/farm/meta/Cargo.toml | 2 +- dex/farm/wasm/Cargo.lock | 544 +++++++++++++++ dex/farm/wasm/Cargo.toml | 5 +- dex/farm/wasm/src/lib.rs | 4 +- dex/fuzz/Cargo.toml | 4 +- dex/governance/Cargo.toml | 4 +- dex/governance/meta/Cargo.toml | 2 +- dex/governance/wasm/Cargo.lock | 188 ++++++ dex/governance/wasm/Cargo.toml | 5 +- dex/governance/wasm/src/lib.rs | 4 +- dex/interactor/Cargo.toml | 6 +- dex/interactor/proxies/Cargo.toml | 4 +- dex/pair-mock/Cargo.toml | 4 +- dex/pair-mock/meta/Cargo.toml | 2 +- dex/pair-mock/wasm/Cargo.lock | 212 ++++++ dex/pair-mock/wasm/Cargo.toml | 5 +- dex/pair-mock/wasm/src/lib.rs | 2 - dex/pair/Cargo.toml | 4 +- dex/pair/meta/Cargo.toml | 2 +- dex/pair/wasm-pair-full/Cargo.lock | 405 +++++++++++ dex/pair/wasm-pair-full/Cargo.toml | 5 +- dex/pair/wasm-pair-full/src/lib.rs | 2 - dex/pair/wasm-safe-price-view/Cargo.lock | 405 +++++++++++ dex/pair/wasm-safe-price-view/Cargo.toml | 5 +- dex/pair/wasm-safe-price-view/src/lib.rs | 2 - dex/pair/wasm/Cargo.lock | 405 +++++++++++ dex/pair/wasm/Cargo.toml | 5 +- dex/pair/wasm/src/lib.rs | 2 - dex/price-discovery/Cargo.toml | 6 +- dex/price-discovery/meta/Cargo.toml | 2 +- dex/price-discovery/wasm/Cargo.lock | 213 ++++++ dex/price-discovery/wasm/Cargo.toml | 5 +- dex/price-discovery/wasm/src/lib.rs | 4 +- dex/proxy-deployer/Cargo.toml | 4 +- dex/proxy-deployer/meta/Cargo.toml | 2 +- dex/proxy-deployer/wasm/Cargo.lock | 555 +++++++++++++++ dex/proxy-deployer/wasm/Cargo.toml | 5 +- dex/proxy-deployer/wasm/src/lib.rs | 4 +- dex/router/Cargo.toml | 4 +- dex/router/meta/Cargo.toml | 2 +- dex/router/wasm/Cargo.lock | 419 ++++++++++++ dex/router/wasm/Cargo.toml | 5 +- dex/router/wasm/src/lib.rs | 4 +- .../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 | 304 +++++++++ .../energy-factory-mock/wasm/Cargo.toml | 5 +- .../energy-factory-mock/wasm/src/lib.rs | 2 - energy-integration/energy-update/Cargo.toml | 6 +- .../energy-update/meta/Cargo.toml | 2 +- .../energy-update/wasm/Cargo.lock | 554 +++++++++++++++ .../energy-update/wasm/Cargo.toml | 5 +- .../energy-update/wasm/src/lib.rs | 4 +- .../farm-boosted-yields/Cargo.toml | 2 +- energy-integration/fees-collector/Cargo.toml | 6 +- .../fees-collector/meta/Cargo.toml | 2 +- .../fees-collector/wasm/Cargo.lock | 348 ++++++++++ .../fees-collector/wasm/Cargo.toml | 5 +- .../fees-collector/wasm/src/lib.rs | 4 +- energy-integration/governance-v2/Cargo.toml | 4 +- .../governance-v2/meta/Cargo.toml | 2 +- .../governance-v2/wasm/Cargo.lock | 368 ++++++++++ .../governance-v2/wasm/Cargo.toml | 5 +- .../governance-v2/wasm/src/lib.rs | 4 +- farm-staking/farm-staking-proxy/Cargo.toml | 6 +- .../farm-staking-proxy/meta/Cargo.toml | 2 +- .../farm-staking-proxy/wasm/Cargo.lock | 635 ++++++++++++++++++ .../farm-staking-proxy/wasm/Cargo.toml | 5 +- .../farm-staking-proxy/wasm/src/lib.rs | 4 +- farm-staking/farm-staking/Cargo.toml | 6 +- farm-staking/farm-staking/meta/Cargo.toml | 2 +- farm-staking/farm-staking/wasm/Cargo.lock | 575 ++++++++++++++++ farm-staking/farm-staking/wasm/Cargo.toml | 5 +- farm-staking/farm-staking/wasm/src/lib.rs | 4 +- farm-staking/metabonding-staking/Cargo.toml | 6 +- .../metabonding-staking/meta/Cargo.toml | 2 +- .../metabonding-staking/wasm/Cargo.lock | 397 +++++++++++ .../metabonding-staking/wasm/Cargo.toml | 5 +- .../metabonding-staking/wasm/src/lib.rs | 4 +- locked-asset/Cargo.toml | 6 +- locked-asset/distribution/Cargo.toml | 4 +- locked-asset/distribution/meta/Cargo.toml | 2 +- locked-asset/distribution/wasm/Cargo.lock | 397 +++++++++++ locked-asset/distribution/wasm/Cargo.toml | 5 +- locked-asset/distribution/wasm/src/lib.rs | 4 +- locked-asset/energy-factory/Cargo.toml | 6 +- locked-asset/energy-factory/meta/Cargo.toml | 2 +- locked-asset/energy-factory/wasm/Cargo.lock | 288 ++++++++ locked-asset/energy-factory/wasm/Cargo.toml | 5 +- locked-asset/energy-factory/wasm/src/lib.rs | 2 - locked-asset/factory/Cargo.toml | 6 +- locked-asset/factory/meta/Cargo.toml | 2 +- locked-asset/factory/wasm/Cargo.lock | 388 +++++++++++ locked-asset/factory/wasm/Cargo.toml | 5 +- locked-asset/factory/wasm/src/lib.rs | 4 +- locked-asset/lkmex-transfer/Cargo.toml | 6 +- locked-asset/lkmex-transfer/meta/Cargo.toml | 2 +- locked-asset/lkmex-transfer/wasm/Cargo.lock | 319 +++++++++ locked-asset/lkmex-transfer/wasm/Cargo.toml | 5 +- locked-asset/lkmex-transfer/wasm/src/lib.rs | 4 +- locked-asset/locked-token-wrapper/Cargo.toml | 6 +- .../locked-token-wrapper/meta/Cargo.toml | 2 +- .../locked-token-wrapper/wasm/Cargo.lock | 343 ++++++++++ .../locked-token-wrapper/wasm/Cargo.toml | 5 +- .../locked-token-wrapper/wasm/src/lib.rs | 4 +- locked-asset/proxy_dex/Cargo.toml | 6 +- locked-asset/proxy_dex/meta/Cargo.toml | 2 +- locked-asset/proxy_dex/wasm/Cargo.lock | 598 +++++++++++++++++ locked-asset/proxy_dex/wasm/Cargo.toml | 5 +- locked-asset/proxy_dex/wasm/src/lib.rs | 4 +- locked-asset/simple-lock-whitelist/Cargo.toml | 6 +- .../simple-lock-whitelist/meta/Cargo.toml | 2 +- .../simple-lock-whitelist/wasm/Cargo.lock | 258 +++++++ .../simple-lock-whitelist/wasm/Cargo.toml | 5 +- .../simple-lock-whitelist/wasm/src/lib.rs | 4 +- locked-asset/simple-lock/Cargo.toml | 6 +- locked-asset/simple-lock/meta/Cargo.toml | 2 +- locked-asset/simple-lock/wasm/Cargo.lock | 238 +++++++ locked-asset/simple-lock/wasm/Cargo.toml | 5 +- locked-asset/simple-lock/wasm/src/lib.rs | 4 +- locked-asset/token-unstake/Cargo.toml | 6 +- locked-asset/token-unstake/meta/Cargo.toml | 2 +- locked-asset/token-unstake/wasm/Cargo.lock | 325 +++++++++ locked-asset/token-unstake/wasm/Cargo.toml | 5 +- locked-asset/token-unstake/wasm/src/lib.rs | 4 +- pause-all/Cargo.toml | 6 +- pause-all/meta/Cargo.toml | 2 +- pause-all/wasm/Cargo.lock | 223 ++++++ pause-all/wasm/Cargo.toml | 5 +- pause-all/wasm/src/lib.rs | 4 +- 163 files changed, 11026 insertions(+), 333 deletions(-) create mode 100644 dex/farm-with-locked-rewards/wasm/Cargo.lock create mode 100644 dex/farm/wasm/Cargo.lock create mode 100644 dex/governance/wasm/Cargo.lock create mode 100644 dex/pair-mock/wasm/Cargo.lock create mode 100644 dex/pair/wasm-pair-full/Cargo.lock create mode 100644 dex/pair/wasm-safe-price-view/Cargo.lock create mode 100644 dex/pair/wasm/Cargo.lock create mode 100644 dex/price-discovery/wasm/Cargo.lock create mode 100644 dex/proxy-deployer/wasm/Cargo.lock create mode 100644 dex/router/wasm/Cargo.lock create mode 100644 energy-integration/energy-factory-mock/wasm/Cargo.lock create mode 100644 energy-integration/energy-update/wasm/Cargo.lock create mode 100644 energy-integration/fees-collector/wasm/Cargo.lock create mode 100644 energy-integration/governance-v2/wasm/Cargo.lock create mode 100644 farm-staking/farm-staking-proxy/wasm/Cargo.lock create mode 100644 farm-staking/farm-staking/wasm/Cargo.lock create mode 100644 farm-staking/metabonding-staking/wasm/Cargo.lock create mode 100644 locked-asset/distribution/wasm/Cargo.lock create mode 100644 locked-asset/energy-factory/wasm/Cargo.lock create mode 100644 locked-asset/factory/wasm/Cargo.lock create mode 100644 locked-asset/lkmex-transfer/wasm/Cargo.lock create mode 100644 locked-asset/locked-token-wrapper/wasm/Cargo.lock create mode 100644 locked-asset/proxy_dex/wasm/Cargo.lock create mode 100644 locked-asset/simple-lock-whitelist/wasm/Cargo.lock create mode 100644 locked-asset/simple-lock/wasm/Cargo.lock create mode 100644 locked-asset/token-unstake/wasm/Cargo.lock create mode 100644 pause-all/wasm/Cargo.lock diff --git a/Cargo.lock b/Cargo.lock index 3cbaaf004..cf6385f5a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -27,6 +27,18 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if 1.0.0", + "once_cell", + "version_check", + "zerocopy", +] + [[package]] name = "aho-corasick" version = "1.1.2" @@ -90,6 +102,15 @@ version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +[[package]] +name = "arbitrary" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +dependencies = [ + "derive_arbitrary", +] + [[package]] name = "arrayvec" version = "0.7.4" @@ -123,6 +144,12 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + [[package]] name = "bech32" version = "0.9.1" @@ -156,9 +183,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "block-buffer" @@ -388,9 +415,9 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.3.2" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" dependencies = [ "cfg-if 1.0.0", ] @@ -443,6 +470,17 @@ dependencies = [ "zeroize", ] +[[package]] +name = "derive_arbitrary" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "dex-tests" version = "0.0.0" @@ -489,6 +527,17 @@ dependencies = [ "subtle", ] +[[package]] +name = "displaydoc" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "distribution" version = "0.0.0" @@ -1224,9 +1273,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.24" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" +checksum = "816ec7294445779408f36fe57bc5b7fc1cf59664059096c65f905c1c61f58069" dependencies = [ "bytes", "fnv", @@ -1246,6 +1295,9 @@ name = "hashbrown" version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash", +] [[package]] name = "heck" @@ -1288,9 +1340,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.11" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ "bytes", "fnv", @@ -1299,12 +1351,24 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.6" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" dependencies = [ "bytes", "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", "pin-project-lite", ] @@ -1314,12 +1378,6 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" - [[package]] name = "humantime" version = "2.1.0" @@ -1328,39 +1386,58 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.28" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" dependencies = [ "bytes", "futures-channel", - "futures-core", "futures-util", "h2", "http", "http-body", "httparse", - "httpdate", "itoa", "pin-project-lite", - "socket2", + "smallvec", "tokio", - "tower-service", - "tracing", "want", ] [[package]] name = "hyper-tls" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", + "http-body-util", "hyper", + "hyper-util", "native-tls", "tokio", "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "pin-project-lite", + "socket2", + "tokio", + "tower", + "tower-service", + "tracing", ] [[package]] @@ -1653,11 +1730,11 @@ dependencies = [ [[package]] name = "multiversx-chain-vm" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a363734a77774f4095fad6f49c6772b82edd833ed47a7c1ca87db18f68ccfffd" +checksum = "f69520691466bc184475320c27db21137e68be5e959df25c1a14b09e055d0d58" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "colored", "ed25519-dalek", "hex", @@ -1680,33 +1757,35 @@ checksum = "b59072fa0624b55ae5ae3fa6bfa91515bbeb4ac440214bc4a509e2c8806d6e9f" [[package]] name = "multiversx-sc" -version = "0.49.0" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a96d128e19ebcb77e7b4fcf5e299c5e3a684b3daae45441d4476ce665ed7d77" +checksum = "0c9624cfb01497bf386d6b8837fa8e6785d45c8d4e122ba9c31060ecf5fce413" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "hex-literal 0.4.1", "multiversx-sc-codec", "multiversx-sc-derive", "num-traits", + "unwrap-infallible", ] [[package]] name = "multiversx-sc-codec" -version = "0.18.8" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0b18391f871e3eb938823aad052bfab1585d29c6f3983ca478992883ca7f959" +checksum = "35c94397b2fba14e40edfa55905b3f453ed57aa06c9b1960ad6a0ca6bfb7a236" dependencies = [ "arrayvec", "multiversx-sc-codec-derive", "num-bigint", + "unwrap-infallible", ] [[package]] name = "multiversx-sc-codec-derive" -version = "0.18.8" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3332da2eca87f209ddd37d1824667425de4ca08c4af4f37bce900468a078810" +checksum = "cf72a8042da0bc19da0b8f0d4f61b4c66ae853560fefc69cd8fea87bf1aa8c14" dependencies = [ "hex", "proc-macro2", @@ -1716,9 +1795,9 @@ dependencies = [ [[package]] name = "multiversx-sc-derive" -version = "0.49.0" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d88cb41e3592b1f026a6dc11aba1f616a3c3996e2f03e3e7306bbd84bb114a08" +checksum = "754cdc20001c3b51df75784c5d8ce454697d0e86264f1d88da392ea211f662f9" dependencies = [ "hex", "proc-macro2", @@ -1729,9 +1808,9 @@ dependencies = [ [[package]] name = "multiversx-sc-meta" -version = "0.49.0" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16839f6aab27995f106402ec43ff7cb56b3cf2026f40f53eb2fa9350827df80c" +checksum = "1685ec123bf256310f876db64f63a19ce0df9721857981a4910f26c48ddf3dc6" dependencies = [ "clap", "colored", @@ -1749,27 +1828,27 @@ dependencies = [ "serde", "serde_json", "toml", - "wasmparser 0.121.2", + "wasmparser", "wasmprinter", "zip", ] [[package]] name = "multiversx-sc-modules" -version = "0.49.0" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76677b460607cf76c427f7518a4b418f85b6e81e27ae0bf4f143f14b3f4f9621" +checksum = "25824610adec5b01c7b38cd469983940b33a7d11b2c0011af7ad572fe10ac1ae" dependencies = [ "multiversx-sc", ] [[package]] name = "multiversx-sc-scenario" -version = "0.49.0" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7243e4ee488cb0fab83ee654e190a7c3469a38171782e7a7816ac272c6bd549" +checksum = "25f9434d86800639499dc899c4220f615c4a2aa1a998a56d2d635cd4b5fea851" dependencies = [ - "base64", + "base64 0.22.1", "bech32", "clap", "colored", @@ -1789,15 +1868,16 @@ dependencies = [ "serde_json", "sha2 0.10.8", "tokio", + "unwrap-infallible", ] [[package]] name = "multiversx-sc-snippets" -version = "0.49.0" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9ec483133afc807543d0f426a3f61c4b1576c3632c44c56c48d814744f88ebf" +checksum = "9ea3378469d2269eb2791e3f41b7edcb7e385065e2dc8039f378c2bec955a062" dependencies = [ - "base64", + "base64 0.22.1", "env_logger", "futures", "hex", @@ -1810,12 +1890,12 @@ dependencies = [ [[package]] name = "multiversx-sdk" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b93ef8c0da9590019f0997b8b9620f78e37169ac04523d77933eed1abc835cf4" +checksum = "5cb2f8dd4a17ce9c9fa1ab3d80152929702968be6536499f32bd7e2278c2e0fb" dependencies = [ "anyhow", - "base64", + "base64 0.22.1", "bech32", "bip39", "hex", @@ -1863,30 +1943,28 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" dependencies = [ - "autocfg", "num-integer", "num-traits", ] [[package]] name = "num-integer" -version = "0.1.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "autocfg", "num-traits", ] [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] @@ -1928,7 +2006,7 @@ version = "0.10.62" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8cde4d2d9200ad5909f8dac647e29482e07c3a35de8a13fce7c9c7747ad9f671" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "cfg-if 1.0.0", "foreign-types", "libc", @@ -2082,7 +2160,7 @@ version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b8fcc794035347fb64beda2d3b462595dd2753e3f268d89c5aae77e8cf2c310" dependencies = [ - "base64", + "base64 0.21.7", "serde", ] @@ -2096,11 +2174,31 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" name = "permissions_module" version = "0.0.0" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "common_errors", "multiversx-sc", ] +[[package]] +name = "pin-project" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "pin-project-lite" version = "0.2.13" @@ -2150,9 +2248,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" dependencies = [ "unicode-ident", ] @@ -2237,9 +2335,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -2374,20 +2472,23 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "reqwest" -version = "0.11.23" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" +checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" dependencies = [ - "base64", + "base64 0.22.1", "bytes", "encoding_rs", + "futures-channel", "futures-core", "futures-util", "h2", "http", "http-body", + "http-body-util", "hyper", "hyper-tls", + "hyper-util", "ipnet", "js-sys", "log", @@ -2396,9 +2497,11 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", + "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", + "sync_wrapper", "system-configuration", "tokio", "tokio-native-tls", @@ -2483,13 +2586,29 @@ version = "0.38.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "errno", "libc", "linux-raw-sys", "windows-sys 0.52.0", ] +[[package]] +name = "rustls-pemfile" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" +dependencies = [ + "base64 0.22.1", + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" + [[package]] name = "ryu" version = "1.0.16" @@ -2752,15 +2871,21 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "syn" -version = "2.0.48" +version = "2.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + [[package]] name = "system-configuration" version = "0.5.1" @@ -2795,6 +2920,26 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "thiserror" +version = "1.0.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579e9083ca58dd9dcf91a9923bb9054071b9ebbd800b342194c9feb0ee89fc18" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2470041c06ec3ac1ab38d0356a6119054dedaea53e12fbefc0de730a1c08524" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.6.0" @@ -2943,6 +3088,28 @@ dependencies = [ "winnow", ] +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite", + "tokio", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + [[package]] name = "tower-service" version = "0.3.2" @@ -2955,6 +3122,7 @@ version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ + "log", "pin-project-lite", "tracing-core", ] @@ -3007,6 +3175,12 @@ version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" +[[package]] +name = "unwrap-infallible" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" + [[package]] name = "unwrappable" version = "0.0.0" @@ -3152,34 +3326,25 @@ checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" [[package]] name = "wasmparser" -version = "0.119.0" +version = "0.207.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c35daf77afb4f9b14016625144a391085ec2ca99ca9cc53ed291bb53ab5278d" +checksum = "e19bb9f8ab07616da582ef8adb24c54f1424c7ec876720b7da9db8ec0626c92c" dependencies = [ - "bitflags 2.4.2", - "indexmap", - "semver", -] - -[[package]] -name = "wasmparser" -version = "0.121.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dbe55c8f9d0dbd25d9447a5a889ff90c0cc3feaa7395310d3d826b2c703eaab" -dependencies = [ - "bitflags 2.4.2", + "ahash", + "bitflags 2.5.0", + "hashbrown", "indexmap", "semver", ] [[package]] name = "wasmprinter" -version = "0.2.76" +version = "0.207.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cac2a7745372074e5573e365e17100f5a26058740576313784ef03fb900ea8d2" +checksum = "9c2d8a7b4dabb460208e6b4334d9db5766e84505038b2529e69c3d07ac619115" dependencies = [ "anyhow", - "wasmparser 0.119.0", + "wasmparser", ] [[package]] @@ -3398,14 +3563,34 @@ dependencies = [ [[package]] name = "winreg" -version = "0.50.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" dependencies = [ "cfg-if 1.0.0", "windows-sys 0.48.0", ] +[[package]] +name = "zerocopy" +version = "0.7.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "zeroize" version = "1.7.0" @@ -3428,12 +3613,15 @@ dependencies = [ [[package]] name = "zip" -version = "0.6.6" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" +checksum = "ed14a57c18714abaa03196c0714ed36bab969d7457f72d12fb5c2e1ced4c24ae" dependencies = [ - "byteorder", + "arbitrary", "crc32fast", "crossbeam-utils", + "displaydoc", "flate2", + "indexmap", + "thiserror", ] diff --git a/common/common_errors/Cargo.toml b/common/common_errors/Cargo.toml index 8dcc4f67a..393d34db2 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/common_structs/Cargo.toml b/common/common_structs/Cargo.toml index 7ed536099..9e0694258 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.mergeable] diff --git a/common/modules/farm/config/Cargo.toml b/common/modules/farm/config/Cargo.toml index 79be7a17d..9e08f56f1 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/farm/contexts/Cargo.toml b/common/modules/farm/contexts/Cargo.toml index 43d3ed8e5..4ddfcfc27 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0" +version = "=0.50.0" diff --git a/common/modules/farm/events/Cargo.toml b/common/modules/farm/events/Cargo.toml index dfdc417f2..2e956255b 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/farm/farm_base_impl/Cargo.toml b/common/modules/farm/farm_base_impl/Cargo.toml index f11cfb0a0..97c6bb45e 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0" +version = "=0.50.0" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0" +version = "=0.50.0" diff --git a/common/modules/farm/farm_token/Cargo.toml b/common/modules/farm/farm_token/Cargo.toml index ab1bd02d3..70c95bf51 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0" +version = "=0.50.0" diff --git a/common/modules/farm/farm_token_merge/Cargo.toml b/common/modules/farm/farm_token_merge/Cargo.toml index 791ab9356..85e8d1459 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0" +version = "=0.50.0" [workspace] members = ["."] diff --git a/common/modules/farm/rewards/Cargo.toml b/common/modules/farm/rewards/Cargo.toml index acb2dd5bb..916eccaec 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0" +version = "=0.50.0" diff --git a/common/modules/legacy_token_decode_module/Cargo.toml b/common/modules/legacy_token_decode_module/Cargo.toml index 5f5e665f0..732b36610 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.common_structs] diff --git a/common/modules/locking_module/Cargo.toml b/common/modules/locking_module/Cargo.toml index 207d16047..a841300f3 100644 --- a/common/modules/locking_module/Cargo.toml +++ b/common/modules/locking_module/Cargo.toml @@ -8,5 +8,5 @@ edition = "2021" path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/math/Cargo.toml b/common/modules/math/Cargo.toml index d0fa1a11e..2826c1a42 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/pausable/Cargo.toml b/common/modules/pausable/Cargo.toml index 19602f04c..e2dd1dce6 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/permissions_module/Cargo.toml b/common/modules/permissions_module/Cargo.toml index 7c1581b8b..aa6a123e1 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/sc_whitelist_module/Cargo.toml b/common/modules/sc_whitelist_module/Cargo.toml index 9d47e79b0..49aacf5d7 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/token_merge_helper/Cargo.toml b/common/modules/token_merge_helper/Cargo.toml index e9a4aacd0..fea735787 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/token_send/Cargo.toml b/common/modules/token_send/Cargo.toml index 286777549..8ae341546 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/modules/utils/Cargo.toml b/common/modules/utils/Cargo.toml index 1db6bdfd8..719d151cb 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.common_structs] diff --git a/common/traits/fixed-supply-token/Cargo.toml b/common/traits/fixed-supply-token/Cargo.toml index 62548bb2b..38a3e0411 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.49.0" +version = "=0.50.0" diff --git a/common/traits/mergeable/Cargo.toml b/common/traits/mergeable/Cargo.toml index 489e909c4..cb831b78e 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/common/traits/unwrappable/Cargo.toml b/common/traits/unwrappable/Cargo.toml index fa021e4d2..53dc77d1e 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/dex/Cargo.toml b/dex/Cargo.toml index c55e49abf..64afa2718 100644 --- a/dex/Cargo.toml +++ b/dex/Cargo.toml @@ -5,17 +5,17 @@ edition = "2021" publish = false [dependencies.multiversx-sc] -version = "=0.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-modules] -version = "=0.49.0" +version = "=0.50.0" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0" +version = "=0.50.0" [dev-dependencies.config] path = "../common/modules/farm/config" diff --git a/dex/farm-with-locked-rewards/Cargo.toml b/dex/farm-with-locked-rewards/Cargo.toml index e50619f8d..a9c0911d6 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0" +version = "=0.50.0" [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0" +version = "=0.50.0" [dev-dependencies.simple-lock] path = "../../locked-asset/simple-lock" diff --git a/dex/farm-with-locked-rewards/meta/Cargo.toml b/dex/farm-with-locked-rewards/meta/Cargo.toml index 9241e0fc7..c1b1e00ae 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.49.0" +version = "0.50.0" default-features = false diff --git a/dex/farm-with-locked-rewards/wasm/Cargo.lock b/dex/farm-with-locked-rewards/wasm/Cargo.lock new file mode 100644 index 000000000..745de4030 --- /dev/null +++ b/dex/farm-with-locked-rewards/wasm/Cargo.lock @@ -0,0 +1,574 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "common-types" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "config" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "contexts" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "farm_token", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "rewards", + "token_merge_helper", + "token_send", +] + +[[package]] +name = "either" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "energy-query" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", +] + +[[package]] +name = "events" +version = "0.0.0" +dependencies = [ + "common_structs", + "contexts", + "multiversx-sc", +] + +[[package]] +name = "farm" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "energy-query", + "events", + "farm-boosted-yields", + "farm_base_impl", + "farm_token", + "fixed-supply-token", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pair", + "pausable", + "permissions_module", + "rewards", + "sc_whitelist_module", + "token_send", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm-boosted-yields" +version = "0.0.0" +dependencies = [ + "common-types", + "config", + "energy-query", + "multiversx-sc", + "pausable", + "permissions_module", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm-with-locked-rewards" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "energy-factory", + "energy-query", + "events", + "farm", + "farm-boosted-yields", + "farm_base_impl", + "farm_token", + "fixed-supply-token", + "locking_module", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "rewards", + "sc_whitelist_module", + "token_send", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm-with-locked-rewards-wasm" +version = "0.0.0" +dependencies = [ + "farm-with-locked-rewards", + "multiversx-sc-wasm-adapter", +] + +[[package]] +name = "farm_base_impl" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "events", + "farm_token", + "fixed-supply-token", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "rewards", + "token_merge_helper", + "token_send", + "utils", +] + +[[package]] +name = "farm_token" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "fees-collector" +version = "0.0.0" +dependencies = [ + "common-types", + "common_errors", + "energy-factory", + "energy-query", + "locking_module", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "locking_module" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9624cfb01497bf386d6b8837fa8e6785d45c8d4e122ba9c31060ecf5fce413" +dependencies = [ + "bitflags", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c94397b2fba14e40edfa55905b3f453ed57aa06c9b1960ad6a0ca6bfb7a236" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf72a8042da0bc19da0b8f0d4f61b4c66ae853560fefc69cd8fea87bf1aa8c14" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "754cdc20001c3b51df75784c5d8ce454697d0e86264f1d88da392ea211f662f9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25824610adec5b01c7b38cd469983940b33a7d11b2c0011af7ad572fe10ac1ae" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a7f031a91eb7360be47ad19c06ed1246486eb789ef8091df0646de85071f7d" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "pair" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "fees-collector", + "itertools", + "multiversx-sc", + "pausable", + "permissions_module", + "simple-lock", + "token_send", + "utils", +] + +[[package]] +name = "pausable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", + "permissions_module", +] + +[[package]] +name = "permissions_module" +version = "0.0.0" +dependencies = [ + "bitflags", + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "proc-macro2" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "rewards" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "farm_token", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "syn" +version = "2.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "token_merge_helper" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "token_send" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrap-infallible" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "week-timekeeping" +version = "0.0.0" +dependencies = [ + "common-types", + "multiversx-sc", +] + +[[package]] +name = "weekly-rewards-splitting" +version = "0.0.0" +dependencies = [ + "common-types", + "energy-query", + "math", + "multiversx-sc", + "unwrappable", + "week-timekeeping", +] diff --git a/dex/farm-with-locked-rewards/wasm/Cargo.toml b/dex/farm-with-locked-rewards/wasm/Cargo.toml index 3eafc284a..900bacfdd 100644 --- a/dex/farm-with-locked-rewards/wasm/Cargo.toml +++ b/dex/farm-with-locked-rewards/wasm/Cargo.toml @@ -21,11 +21,14 @@ debug = false panic = "abort" overflow-checks = false +[profile.dev] +panic = "abort" + [dependencies.farm-with-locked-rewards] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.49.0" +version = "=0.50.0" [workspace] members = ["."] diff --git a/dex/farm-with-locked-rewards/wasm/src/lib.rs b/dex/farm-with-locked-rewards/wasm/src/lib.rs index 9d1cdb109..37561d256 100644 --- a/dex/farm-with-locked-rewards/wasm/src/lib.rs +++ b/dex/farm-with-locked-rewards/wasm/src/lib.rs @@ -8,11 +8,9 @@ // Upgrade: 1 // Endpoints: 67 // Async Callback: 1 -// Total number of exported functions: 69 +// Total number of exported functions: 70 #![no_std] -#![allow(internal_features)] -#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); diff --git a/dex/farm/Cargo.toml b/dex/farm/Cargo.toml index d29f19944..94dad23a5 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0" +version = "=0.50.0" [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.49.0" +version = "=0.50.0" [dev-dependencies.energy-factory-mock] path = "../../energy-integration/energy-factory-mock" diff --git a/dex/farm/meta/Cargo.toml b/dex/farm/meta/Cargo.toml index 5a31990a7..1ac69b3cc 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.49.0" +version = "0.50.0" default-features = false diff --git a/dex/farm/wasm/Cargo.lock b/dex/farm/wasm/Cargo.lock new file mode 100644 index 000000000..6173d2a0b --- /dev/null +++ b/dex/farm/wasm/Cargo.lock @@ -0,0 +1,544 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "common-types" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "config" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "contexts" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "farm_token", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "rewards", + "token_merge_helper", + "token_send", +] + +[[package]] +name = "either" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "energy-query" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", +] + +[[package]] +name = "events" +version = "0.0.0" +dependencies = [ + "common_structs", + "contexts", + "multiversx-sc", +] + +[[package]] +name = "farm" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "energy-query", + "events", + "farm-boosted-yields", + "farm_base_impl", + "farm_token", + "fixed-supply-token", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pair", + "pausable", + "permissions_module", + "rewards", + "sc_whitelist_module", + "token_send", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm-boosted-yields" +version = "0.0.0" +dependencies = [ + "common-types", + "config", + "energy-query", + "multiversx-sc", + "pausable", + "permissions_module", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm-wasm" +version = "0.0.0" +dependencies = [ + "farm", + "multiversx-sc-wasm-adapter", +] + +[[package]] +name = "farm_base_impl" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "events", + "farm_token", + "fixed-supply-token", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "rewards", + "token_merge_helper", + "token_send", + "utils", +] + +[[package]] +name = "farm_token" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "fees-collector" +version = "0.0.0" +dependencies = [ + "common-types", + "common_errors", + "energy-factory", + "energy-query", + "locking_module", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "locking_module" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9624cfb01497bf386d6b8837fa8e6785d45c8d4e122ba9c31060ecf5fce413" +dependencies = [ + "bitflags", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c94397b2fba14e40edfa55905b3f453ed57aa06c9b1960ad6a0ca6bfb7a236" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf72a8042da0bc19da0b8f0d4f61b4c66ae853560fefc69cd8fea87bf1aa8c14" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "754cdc20001c3b51df75784c5d8ce454697d0e86264f1d88da392ea211f662f9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25824610adec5b01c7b38cd469983940b33a7d11b2c0011af7ad572fe10ac1ae" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a7f031a91eb7360be47ad19c06ed1246486eb789ef8091df0646de85071f7d" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "pair" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "fees-collector", + "itertools", + "multiversx-sc", + "pausable", + "permissions_module", + "simple-lock", + "token_send", + "utils", +] + +[[package]] +name = "pausable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", + "permissions_module", +] + +[[package]] +name = "permissions_module" +version = "0.0.0" +dependencies = [ + "bitflags", + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "proc-macro2" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "rewards" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "farm_token", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "syn" +version = "2.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "token_merge_helper" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "token_send" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrap-infallible" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "week-timekeeping" +version = "0.0.0" +dependencies = [ + "common-types", + "multiversx-sc", +] + +[[package]] +name = "weekly-rewards-splitting" +version = "0.0.0" +dependencies = [ + "common-types", + "energy-query", + "math", + "multiversx-sc", + "unwrappable", + "week-timekeeping", +] diff --git a/dex/farm/wasm/Cargo.toml b/dex/farm/wasm/Cargo.toml index 3defb267b..c3ffff547 100644 --- a/dex/farm/wasm/Cargo.toml +++ b/dex/farm/wasm/Cargo.toml @@ -21,11 +21,14 @@ debug = false panic = "abort" overflow-checks = false +[profile.dev] +panic = "abort" + [dependencies.farm] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.49.0" +version = "=0.50.0" [workspace] members = ["."] diff --git a/dex/farm/wasm/src/lib.rs b/dex/farm/wasm/src/lib.rs index 807d71f10..60fe520f8 100644 --- a/dex/farm/wasm/src/lib.rs +++ b/dex/farm/wasm/src/lib.rs @@ -8,11 +8,9 @@ // Upgrade: 1 // Endpoints: 64 // Async Callback: 1 -// Total number of exported functions: 66 +// Total number of exported functions: 67 #![no_std] -#![allow(internal_features)] -#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); diff --git a/dex/fuzz/Cargo.toml b/dex/fuzz/Cargo.toml index 9e579cfc1..7fbec47af 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-scenario] -version = "=0.49.0" +version = "=0.50.0" [dependencies.pausable] path = "../../common/modules/pausable" diff --git a/dex/governance/Cargo.toml b/dex/governance/Cargo.toml index 46218ccee..1cdaef9b8 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0" +version = "=0.50.0" [dev-dependencies.pair-mock] path = "../pair-mock" diff --git a/dex/governance/meta/Cargo.toml b/dex/governance/meta/Cargo.toml index 00194b668..4bf17d9e9 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.49.0" +version = "0.50.0" default-features = false diff --git a/dex/governance/wasm/Cargo.lock b/dex/governance/wasm/Cargo.lock new file mode 100644 index 000000000..2e4796801 --- /dev/null +++ b/dex/governance/wasm/Cargo.lock @@ -0,0 +1,188 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "governance" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "governance-wasm" +version = "0.0.0" +dependencies = [ + "governance", + "multiversx-sc-wasm-adapter", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "multiversx-sc" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9624cfb01497bf386d6b8837fa8e6785d45c8d4e122ba9c31060ecf5fce413" +dependencies = [ + "bitflags", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c94397b2fba14e40edfa55905b3f453ed57aa06c9b1960ad6a0ca6bfb7a236" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf72a8042da0bc19da0b8f0d4f61b4c66ae853560fefc69cd8fea87bf1aa8c14" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "754cdc20001c3b51df75784c5d8ce454697d0e86264f1d88da392ea211f662f9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a7f031a91eb7360be47ad19c06ed1246486eb789ef8091df0646de85071f7d" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "proc-macro2" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "syn" +version = "2.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrap-infallible" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" diff --git a/dex/governance/wasm/Cargo.toml b/dex/governance/wasm/Cargo.toml index c4e9425f6..9e7a14190 100644 --- a/dex/governance/wasm/Cargo.toml +++ b/dex/governance/wasm/Cargo.toml @@ -21,11 +21,14 @@ debug = false panic = "abort" overflow-checks = false +[profile.dev] +panic = "abort" + [dependencies.governance] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.49.0" +version = "=0.50.0" [workspace] members = ["."] diff --git a/dex/governance/wasm/src/lib.rs b/dex/governance/wasm/src/lib.rs index 2837cd15e..8e699c12c 100644 --- a/dex/governance/wasm/src/lib.rs +++ b/dex/governance/wasm/src/lib.rs @@ -8,11 +8,9 @@ // Upgrade: 1 // Endpoints: 21 // Async Callback (empty): 1 -// Total number of exported functions: 23 +// Total number of exported functions: 24 #![no_std] -#![allow(internal_features)] -#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); diff --git a/dex/interactor/Cargo.toml b/dex/interactor/Cargo.toml index 44fd666dd..94b2ee63b 100644 --- a/dex/interactor/Cargo.toml +++ b/dex/interactor/Cargo.toml @@ -15,13 +15,13 @@ serde = { version = "1.0", features = ["derive"] } toml = "0.8.6" [dependencies.multiversx-sc-modules] -version = "=0.49.0" +version = "=0.50.0" [dependencies.multiversx-sc-snippets] -version = "=0.49.0" +version = "=0.50.0" [dependencies.multiversx-sc-scenario] -version = "=0.49.0" +version = "=0.50.0" [dependencies.proxies] path = "proxies" diff --git a/dex/interactor/proxies/Cargo.toml b/dex/interactor/proxies/Cargo.toml index 8b18a90a0..9f0a365a2 100644 --- a/dex/interactor/proxies/Cargo.toml +++ b/dex/interactor/proxies/Cargo.toml @@ -8,10 +8,10 @@ edition = "2021" path = "src/lib.rs" [dependencies.multiversx-sc] -version = "=0.49.0" +version = "=0.50.0" [dependencies.multiversx-sc-scenario] -version = "=0.49.0" +version = "=0.50.0" [dependencies.common_structs] path = "../../../common/common_structs" diff --git a/dex/pair-mock/Cargo.toml b/dex/pair-mock/Cargo.toml index 9cb06df92..5f88e72f8 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.49.0" +version = "=0.50.0" 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.49.0" +version = "=0.50.0" diff --git a/dex/pair-mock/meta/Cargo.toml b/dex/pair-mock/meta/Cargo.toml index 072414630..ec089e940 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.49.0" +version = "0.50.0" default-features = false diff --git a/dex/pair-mock/wasm/Cargo.lock b/dex/pair-mock/wasm/Cargo.lock new file mode 100644 index 000000000..7c12edd46 --- /dev/null +++ b/dex/pair-mock/wasm/Cargo.lock @@ -0,0 +1,212 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "either" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "multiversx-sc" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9624cfb01497bf386d6b8837fa8e6785d45c8d4e122ba9c31060ecf5fce413" +dependencies = [ + "bitflags", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c94397b2fba14e40edfa55905b3f453ed57aa06c9b1960ad6a0ca6bfb7a236" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf72a8042da0bc19da0b8f0d4f61b4c66ae853560fefc69cd8fea87bf1aa8c14" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "754cdc20001c3b51df75784c5d8ce454697d0e86264f1d88da392ea211f662f9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a7f031a91eb7360be47ad19c06ed1246486eb789ef8091df0646de85071f7d" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "pair-mock" +version = "0.0.0" +dependencies = [ + "common_errors", + "itertools", + "multiversx-sc", +] + +[[package]] +name = "pair-mock-wasm" +version = "0.0.0" +dependencies = [ + "multiversx-sc-wasm-adapter", + "pair-mock", +] + +[[package]] +name = "proc-macro2" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "syn" +version = "2.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrap-infallible" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" diff --git a/dex/pair-mock/wasm/Cargo.toml b/dex/pair-mock/wasm/Cargo.toml index fe2190e3b..3c7592bb8 100644 --- a/dex/pair-mock/wasm/Cargo.toml +++ b/dex/pair-mock/wasm/Cargo.toml @@ -21,11 +21,14 @@ debug = false panic = "abort" overflow-checks = false +[profile.dev] +panic = "abort" + [dependencies.pair-mock] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.49.0" +version = "=0.50.0" [workspace] members = ["."] diff --git a/dex/pair-mock/wasm/src/lib.rs b/dex/pair-mock/wasm/src/lib.rs index e3462d773..4501da7a5 100644 --- a/dex/pair-mock/wasm/src/lib.rs +++ b/dex/pair-mock/wasm/src/lib.rs @@ -10,8 +10,6 @@ // Total number of exported functions: 4 #![no_std] -#![allow(internal_features)] -#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); diff --git a/dex/pair/Cargo.toml b/dex/pair/Cargo.toml index 0c75493e7..f02ec42c4 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0" +version = "=0.50.0" diff --git a/dex/pair/meta/Cargo.toml b/dex/pair/meta/Cargo.toml index d924cd0de..4b073330c 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.49.0" +version = "0.50.0" default-features = false diff --git a/dex/pair/wasm-pair-full/Cargo.lock b/dex/pair/wasm-pair-full/Cargo.lock new file mode 100644 index 000000000..1fc8bae3f --- /dev/null +++ b/dex/pair/wasm-pair-full/Cargo.lock @@ -0,0 +1,405 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "common-types" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "either" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "energy-query" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", +] + +[[package]] +name = "fees-collector" +version = "0.0.0" +dependencies = [ + "common-types", + "common_errors", + "energy-factory", + "energy-query", + "locking_module", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "locking_module" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9624cfb01497bf386d6b8837fa8e6785d45c8d4e122ba9c31060ecf5fce413" +dependencies = [ + "bitflags", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c94397b2fba14e40edfa55905b3f453ed57aa06c9b1960ad6a0ca6bfb7a236" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf72a8042da0bc19da0b8f0d4f61b4c66ae853560fefc69cd8fea87bf1aa8c14" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "754cdc20001c3b51df75784c5d8ce454697d0e86264f1d88da392ea211f662f9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25824610adec5b01c7b38cd469983940b33a7d11b2c0011af7ad572fe10ac1ae" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a7f031a91eb7360be47ad19c06ed1246486eb789ef8091df0646de85071f7d" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "pair" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "fees-collector", + "itertools", + "multiversx-sc", + "pausable", + "permissions_module", + "simple-lock", + "token_send", + "utils", +] + +[[package]] +name = "pair-full-wasm" +version = "0.0.0" +dependencies = [ + "multiversx-sc-wasm-adapter", + "pair", +] + +[[package]] +name = "pausable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", + "permissions_module", +] + +[[package]] +name = "permissions_module" +version = "0.0.0" +dependencies = [ + "bitflags", + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "proc-macro2" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "syn" +version = "2.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "token_send" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrap-infallible" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "week-timekeeping" +version = "0.0.0" +dependencies = [ + "common-types", + "multiversx-sc", +] + +[[package]] +name = "weekly-rewards-splitting" +version = "0.0.0" +dependencies = [ + "common-types", + "energy-query", + "math", + "multiversx-sc", + "unwrappable", + "week-timekeeping", +] diff --git a/dex/pair/wasm-pair-full/Cargo.toml b/dex/pair/wasm-pair-full/Cargo.toml index 293c10a5d..cde3ff079 100644 --- a/dex/pair/wasm-pair-full/Cargo.toml +++ b/dex/pair/wasm-pair-full/Cargo.toml @@ -21,11 +21,14 @@ debug = false panic = "abort" overflow-checks = false +[profile.dev] +panic = "abort" + [dependencies.pair] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.49.0" +version = "=0.50.0" [workspace] members = ["."] diff --git a/dex/pair/wasm-pair-full/src/lib.rs b/dex/pair/wasm-pair-full/src/lib.rs index 500b879d9..5f39165a9 100644 --- a/dex/pair/wasm-pair-full/src/lib.rs +++ b/dex/pair/wasm-pair-full/src/lib.rs @@ -11,8 +11,6 @@ // Total number of exported functions: 66 #![no_std] -#![allow(internal_features)] -#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); diff --git a/dex/pair/wasm-safe-price-view/Cargo.lock b/dex/pair/wasm-safe-price-view/Cargo.lock new file mode 100644 index 000000000..796d00882 --- /dev/null +++ b/dex/pair/wasm-safe-price-view/Cargo.lock @@ -0,0 +1,405 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "common-types" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "either" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "energy-query" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", +] + +[[package]] +name = "fees-collector" +version = "0.0.0" +dependencies = [ + "common-types", + "common_errors", + "energy-factory", + "energy-query", + "locking_module", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "locking_module" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9624cfb01497bf386d6b8837fa8e6785d45c8d4e122ba9c31060ecf5fce413" +dependencies = [ + "bitflags", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c94397b2fba14e40edfa55905b3f453ed57aa06c9b1960ad6a0ca6bfb7a236" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf72a8042da0bc19da0b8f0d4f61b4c66ae853560fefc69cd8fea87bf1aa8c14" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "754cdc20001c3b51df75784c5d8ce454697d0e86264f1d88da392ea211f662f9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25824610adec5b01c7b38cd469983940b33a7d11b2c0011af7ad572fe10ac1ae" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a7f031a91eb7360be47ad19c06ed1246486eb789ef8091df0646de85071f7d" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "pair" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "fees-collector", + "itertools", + "multiversx-sc", + "pausable", + "permissions_module", + "simple-lock", + "token_send", + "utils", +] + +[[package]] +name = "pausable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", + "permissions_module", +] + +[[package]] +name = "permissions_module" +version = "0.0.0" +dependencies = [ + "bitflags", + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "proc-macro2" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "safe-price-view-wasm" +version = "0.0.0" +dependencies = [ + "multiversx-sc-wasm-adapter", + "pair", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "syn" +version = "2.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "token_send" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrap-infallible" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "week-timekeeping" +version = "0.0.0" +dependencies = [ + "common-types", + "multiversx-sc", +] + +[[package]] +name = "weekly-rewards-splitting" +version = "0.0.0" +dependencies = [ + "common-types", + "energy-query", + "math", + "multiversx-sc", + "unwrappable", + "week-timekeeping", +] diff --git a/dex/pair/wasm-safe-price-view/Cargo.toml b/dex/pair/wasm-safe-price-view/Cargo.toml index 7920e9940..c05ddd3c2 100644 --- a/dex/pair/wasm-safe-price-view/Cargo.toml +++ b/dex/pair/wasm-safe-price-view/Cargo.toml @@ -21,11 +21,14 @@ debug = false panic = "abort" overflow-checks = false +[profile.dev] +panic = "abort" + [dependencies.pair] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.49.0" +version = "=0.50.0" [workspace] members = ["."] diff --git a/dex/pair/wasm-safe-price-view/src/lib.rs b/dex/pair/wasm-safe-price-view/src/lib.rs index cc5f99d90..de0966c65 100644 --- a/dex/pair/wasm-safe-price-view/src/lib.rs +++ b/dex/pair/wasm-safe-price-view/src/lib.rs @@ -10,8 +10,6 @@ // Total number of exported functions: 11 #![no_std] -#![allow(internal_features)] -#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); diff --git a/dex/pair/wasm/Cargo.lock b/dex/pair/wasm/Cargo.lock new file mode 100644 index 000000000..5aa04593c --- /dev/null +++ b/dex/pair/wasm/Cargo.lock @@ -0,0 +1,405 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "common-types" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "either" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "energy-query" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", +] + +[[package]] +name = "fees-collector" +version = "0.0.0" +dependencies = [ + "common-types", + "common_errors", + "energy-factory", + "energy-query", + "locking_module", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "locking_module" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9624cfb01497bf386d6b8837fa8e6785d45c8d4e122ba9c31060ecf5fce413" +dependencies = [ + "bitflags", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c94397b2fba14e40edfa55905b3f453ed57aa06c9b1960ad6a0ca6bfb7a236" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf72a8042da0bc19da0b8f0d4f61b4c66ae853560fefc69cd8fea87bf1aa8c14" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "754cdc20001c3b51df75784c5d8ce454697d0e86264f1d88da392ea211f662f9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25824610adec5b01c7b38cd469983940b33a7d11b2c0011af7ad572fe10ac1ae" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a7f031a91eb7360be47ad19c06ed1246486eb789ef8091df0646de85071f7d" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "pair" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "fees-collector", + "itertools", + "multiversx-sc", + "pausable", + "permissions_module", + "simple-lock", + "token_send", + "utils", +] + +[[package]] +name = "pair-wasm" +version = "0.0.0" +dependencies = [ + "multiversx-sc-wasm-adapter", + "pair", +] + +[[package]] +name = "pausable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", + "permissions_module", +] + +[[package]] +name = "permissions_module" +version = "0.0.0" +dependencies = [ + "bitflags", + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "proc-macro2" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "syn" +version = "2.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "token_send" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrap-infallible" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "week-timekeeping" +version = "0.0.0" +dependencies = [ + "common-types", + "multiversx-sc", +] + +[[package]] +name = "weekly-rewards-splitting" +version = "0.0.0" +dependencies = [ + "common-types", + "energy-query", + "math", + "multiversx-sc", + "unwrappable", + "week-timekeeping", +] diff --git a/dex/pair/wasm/Cargo.toml b/dex/pair/wasm/Cargo.toml index 05f0687c6..ab436653a 100644 --- a/dex/pair/wasm/Cargo.toml +++ b/dex/pair/wasm/Cargo.toml @@ -21,11 +21,14 @@ debug = false panic = "abort" overflow-checks = false +[profile.dev] +panic = "abort" + [dependencies.pair] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.49.0" +version = "=0.50.0" [workspace] members = ["."] diff --git a/dex/pair/wasm/src/lib.rs b/dex/pair/wasm/src/lib.rs index 374a01549..7279213ee 100644 --- a/dex/pair/wasm/src/lib.rs +++ b/dex/pair/wasm/src/lib.rs @@ -11,8 +11,6 @@ // Total number of exported functions: 57 #![no_std] -#![allow(internal_features)] -#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); diff --git a/dex/price-discovery/Cargo.toml b/dex/price-discovery/Cargo.toml index b4a6e27c0..f64eb02ce 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0" +version = "=0.50.0" [dependencies.locking_module] path = "../../common/modules/locking_module" @@ -30,4 +30,4 @@ hex = "0.4" path = "../../locked-asset/simple-lock" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0" +version = "=0.50.0" diff --git a/dex/price-discovery/meta/Cargo.toml b/dex/price-discovery/meta/Cargo.toml index 420981d62..8b26d8f80 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.49.0" +version = "0.50.0" default-features = false diff --git a/dex/price-discovery/wasm/Cargo.lock b/dex/price-discovery/wasm/Cargo.lock new file mode 100644 index 000000000..56917519e --- /dev/null +++ b/dex/price-discovery/wasm/Cargo.lock @@ -0,0 +1,213 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "locking_module" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9624cfb01497bf386d6b8837fa8e6785d45c8d4e122ba9c31060ecf5fce413" +dependencies = [ + "bitflags", + "hex-literal 0.4.1", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c94397b2fba14e40edfa55905b3f453ed57aa06c9b1960ad6a0ca6bfb7a236" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf72a8042da0bc19da0b8f0d4f61b4c66ae853560fefc69cd8fea87bf1aa8c14" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "754cdc20001c3b51df75784c5d8ce454697d0e86264f1d88da392ea211f662f9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25824610adec5b01c7b38cd469983940b33a7d11b2c0011af7ad572fe10ac1ae" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a7f031a91eb7360be47ad19c06ed1246486eb789ef8091df0646de85071f7d" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "price-discovery" +version = "0.0.0" +dependencies = [ + "hex-literal 0.3.4", + "locking_module", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "price-discovery-wasm" +version = "0.0.0" +dependencies = [ + "multiversx-sc-wasm-adapter", + "price-discovery", +] + +[[package]] +name = "proc-macro2" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "syn" +version = "2.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrap-infallible" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" diff --git a/dex/price-discovery/wasm/Cargo.toml b/dex/price-discovery/wasm/Cargo.toml index 6b8ba36b7..2802d527a 100644 --- a/dex/price-discovery/wasm/Cargo.toml +++ b/dex/price-discovery/wasm/Cargo.toml @@ -21,11 +21,14 @@ debug = false panic = "abort" overflow-checks = false +[profile.dev] +panic = "abort" + [dependencies.price-discovery] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.49.0" +version = "=0.50.0" [workspace] members = ["."] diff --git a/dex/price-discovery/wasm/src/lib.rs b/dex/price-discovery/wasm/src/lib.rs index bad7eb4e4..5e55db7a5 100644 --- a/dex/price-discovery/wasm/src/lib.rs +++ b/dex/price-discovery/wasm/src/lib.rs @@ -8,11 +8,9 @@ // Upgrade: 1 // Endpoints: 27 // Async Callback: 1 -// Total number of exported functions: 29 +// Total number of exported functions: 30 #![no_std] -#![allow(internal_features)] -#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); diff --git a/dex/proxy-deployer/Cargo.toml b/dex/proxy-deployer/Cargo.toml index 344cf5439..c46460e93 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0" +version = "=0.50.0" diff --git a/dex/proxy-deployer/meta/Cargo.toml b/dex/proxy-deployer/meta/Cargo.toml index 54e0925ab..3b2be5149 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.49.0" +version = "0.50.0" default-features = false diff --git a/dex/proxy-deployer/wasm/Cargo.lock b/dex/proxy-deployer/wasm/Cargo.lock new file mode 100644 index 000000000..bc319ac49 --- /dev/null +++ b/dex/proxy-deployer/wasm/Cargo.lock @@ -0,0 +1,555 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "common-types" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "config" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "contexts" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "farm_token", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "rewards", + "token_merge_helper", + "token_send", +] + +[[package]] +name = "either" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "energy-query" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", +] + +[[package]] +name = "events" +version = "0.0.0" +dependencies = [ + "common_structs", + "contexts", + "multiversx-sc", +] + +[[package]] +name = "farm" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "energy-query", + "events", + "farm-boosted-yields", + "farm_base_impl", + "farm_token", + "fixed-supply-token", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pair", + "pausable", + "permissions_module", + "rewards", + "sc_whitelist_module", + "token_send", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm-boosted-yields" +version = "0.0.0" +dependencies = [ + "common-types", + "config", + "energy-query", + "multiversx-sc", + "pausable", + "permissions_module", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm_base_impl" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "events", + "farm_token", + "fixed-supply-token", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "rewards", + "token_merge_helper", + "token_send", + "utils", +] + +[[package]] +name = "farm_token" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "fees-collector" +version = "0.0.0" +dependencies = [ + "common-types", + "common_errors", + "energy-factory", + "energy-query", + "locking_module", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "locking_module" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9624cfb01497bf386d6b8837fa8e6785d45c8d4e122ba9c31060ecf5fce413" +dependencies = [ + "bitflags", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c94397b2fba14e40edfa55905b3f453ed57aa06c9b1960ad6a0ca6bfb7a236" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf72a8042da0bc19da0b8f0d4f61b4c66ae853560fefc69cd8fea87bf1aa8c14" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "754cdc20001c3b51df75784c5d8ce454697d0e86264f1d88da392ea211f662f9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25824610adec5b01c7b38cd469983940b33a7d11b2c0011af7ad572fe10ac1ae" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a7f031a91eb7360be47ad19c06ed1246486eb789ef8091df0646de85071f7d" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "pair" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "fees-collector", + "itertools", + "multiversx-sc", + "pausable", + "permissions_module", + "simple-lock", + "token_send", + "utils", +] + +[[package]] +name = "pausable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", + "permissions_module", +] + +[[package]] +name = "permissions_module" +version = "0.0.0" +dependencies = [ + "bitflags", + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "proc-macro2" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "proxy-deployer" +version = "0.0.0" +dependencies = [ + "config", + "farm", + "farm_token", + "multiversx-sc", + "pausable", +] + +[[package]] +name = "proxy-deployer-wasm" +version = "0.0.0" +dependencies = [ + "multiversx-sc-wasm-adapter", + "proxy-deployer", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "rewards" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "farm_token", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "syn" +version = "2.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "token_merge_helper" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "token_send" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrap-infallible" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "week-timekeeping" +version = "0.0.0" +dependencies = [ + "common-types", + "multiversx-sc", +] + +[[package]] +name = "weekly-rewards-splitting" +version = "0.0.0" +dependencies = [ + "common-types", + "energy-query", + "math", + "multiversx-sc", + "unwrappable", + "week-timekeeping", +] diff --git a/dex/proxy-deployer/wasm/Cargo.toml b/dex/proxy-deployer/wasm/Cargo.toml index 689bdc768..a0da97693 100644 --- a/dex/proxy-deployer/wasm/Cargo.toml +++ b/dex/proxy-deployer/wasm/Cargo.toml @@ -21,11 +21,14 @@ debug = false panic = "abort" overflow-checks = false +[profile.dev] +panic = "abort" + [dependencies.proxy-deployer] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.49.0" +version = "=0.50.0" [workspace] members = ["."] diff --git a/dex/proxy-deployer/wasm/src/lib.rs b/dex/proxy-deployer/wasm/src/lib.rs index 14253ba21..620fcb058 100644 --- a/dex/proxy-deployer/wasm/src/lib.rs +++ b/dex/proxy-deployer/wasm/src/lib.rs @@ -8,11 +8,9 @@ // Upgrade: 1 // Endpoints: 4 // Async Callback (empty): 1 -// Total number of exported functions: 6 +// Total number of exported functions: 7 #![no_std] -#![allow(internal_features)] -#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); diff --git a/dex/router/Cargo.toml b/dex/router/Cargo.toml index c8194fbbb..d1212c026 100644 --- a/dex/router/Cargo.toml +++ b/dex/router/Cargo.toml @@ -21,7 +21,7 @@ path = "../../common/modules/token_send" path = "../../common/modules/pausable" [dependencies.multiversx-sc] -version = "=0.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.pair] @@ -34,4 +34,4 @@ path = "../../common/modules/locking_module" path = "../../locked-asset/simple-lock" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0" +version = "=0.50.0" diff --git a/dex/router/meta/Cargo.toml b/dex/router/meta/Cargo.toml index 266ca6d0f..1d17d68ad 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.49.0" +version = "0.50.0" default-features = false diff --git a/dex/router/wasm/Cargo.lock b/dex/router/wasm/Cargo.lock new file mode 100644 index 000000000..47dd0c85a --- /dev/null +++ b/dex/router/wasm/Cargo.lock @@ -0,0 +1,419 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "common-types" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "either" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "energy-query" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", +] + +[[package]] +name = "fees-collector" +version = "0.0.0" +dependencies = [ + "common-types", + "common_errors", + "energy-factory", + "energy-query", + "locking_module", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "locking_module" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9624cfb01497bf386d6b8837fa8e6785d45c8d4e122ba9c31060ecf5fce413" +dependencies = [ + "bitflags", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c94397b2fba14e40edfa55905b3f453ed57aa06c9b1960ad6a0ca6bfb7a236" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf72a8042da0bc19da0b8f0d4f61b4c66ae853560fefc69cd8fea87bf1aa8c14" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "754cdc20001c3b51df75784c5d8ce454697d0e86264f1d88da392ea211f662f9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25824610adec5b01c7b38cd469983940b33a7d11b2c0011af7ad572fe10ac1ae" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a7f031a91eb7360be47ad19c06ed1246486eb789ef8091df0646de85071f7d" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "pair" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "fees-collector", + "itertools", + "multiversx-sc", + "pausable", + "permissions_module", + "simple-lock", + "token_send", + "utils", +] + +[[package]] +name = "pausable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", + "permissions_module", +] + +[[package]] +name = "permissions_module" +version = "0.0.0" +dependencies = [ + "bitflags", + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "proc-macro2" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "router" +version = "0.0.0" +dependencies = [ + "common_structs", + "locking_module", + "multiversx-sc", + "pair", + "pausable", + "permissions_module", + "simple-lock", + "token_send", +] + +[[package]] +name = "router-wasm" +version = "0.0.0" +dependencies = [ + "multiversx-sc-wasm-adapter", + "router", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "syn" +version = "2.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "token_send" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrap-infallible" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "week-timekeeping" +version = "0.0.0" +dependencies = [ + "common-types", + "multiversx-sc", +] + +[[package]] +name = "weekly-rewards-splitting" +version = "0.0.0" +dependencies = [ + "common-types", + "energy-query", + "math", + "multiversx-sc", + "unwrappable", + "week-timekeeping", +] diff --git a/dex/router/wasm/Cargo.toml b/dex/router/wasm/Cargo.toml index b5b9b8034..3213134f1 100644 --- a/dex/router/wasm/Cargo.toml +++ b/dex/router/wasm/Cargo.toml @@ -21,11 +21,14 @@ debug = false panic = "abort" overflow-checks = false +[profile.dev] +panic = "abort" + [dependencies.router] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.49.0" +version = "=0.50.0" [workspace] members = ["."] diff --git a/dex/router/wasm/src/lib.rs b/dex/router/wasm/src/lib.rs index 995274940..d2a19fcaa 100644 --- a/dex/router/wasm/src/lib.rs +++ b/dex/router/wasm/src/lib.rs @@ -8,11 +8,9 @@ // Upgrade: 1 // Endpoints: 31 // Async Callback: 1 -// Total number of exported functions: 33 +// Total number of exported functions: 34 #![no_std] -#![allow(internal_features)] -#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); diff --git a/energy-integration/common-modules/energy-query/Cargo.toml b/energy-integration/common-modules/energy-query/Cargo.toml index fd5fdcf8b..5e0de6e80 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.energy-factory] diff --git a/energy-integration/common-modules/week-timekeeping/Cargo.toml b/energy-integration/common-modules/week-timekeeping/Cargo.toml index 4314f957a..55d8a8fbc 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.common-types] diff --git a/energy-integration/common-modules/weekly-rewards-splitting/Cargo.toml b/energy-integration/common-modules/weekly-rewards-splitting/Cargo.toml index d77461b5f..d37d5279c 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.energy-query] diff --git a/energy-integration/common-types/Cargo.toml b/energy-integration/common-types/Cargo.toml index bc066d60b..a72a0c365 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] diff --git a/energy-integration/energy-factory-mock/Cargo.toml b/energy-integration/energy-factory-mock/Cargo.toml index 8210f7f8a..bf66e0855 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0" +version = "=0.50.0" diff --git a/energy-integration/energy-factory-mock/meta/Cargo.toml b/energy-integration/energy-factory-mock/meta/Cargo.toml index f5b0b13cb..89f8c8715 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.49.0" +version = "0.50.0" default-features = false diff --git a/energy-integration/energy-factory-mock/wasm/Cargo.lock b/energy-integration/energy-factory-mock/wasm/Cargo.lock new file mode 100644 index 000000000..28389ff49 --- /dev/null +++ b/energy-integration/energy-factory-mock/wasm/Cargo.lock @@ -0,0 +1,304 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "energy-factory-mock" +version = "0.0.0" +dependencies = [ + "energy-query", + "multiversx-sc", +] + +[[package]] +name = "energy-factory-mock-wasm" +version = "0.0.0" +dependencies = [ + "energy-factory-mock", + "multiversx-sc-wasm-adapter", +] + +[[package]] +name = "energy-query" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9624cfb01497bf386d6b8837fa8e6785d45c8d4e122ba9c31060ecf5fce413" +dependencies = [ + "bitflags", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c94397b2fba14e40edfa55905b3f453ed57aa06c9b1960ad6a0ca6bfb7a236" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf72a8042da0bc19da0b8f0d4f61b4c66ae853560fefc69cd8fea87bf1aa8c14" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "754cdc20001c3b51df75784c5d8ce454697d0e86264f1d88da392ea211f662f9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25824610adec5b01c7b38cd469983940b33a7d11b2c0011af7ad572fe10ac1ae" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a7f031a91eb7360be47ad19c06ed1246486eb789ef8091df0646de85071f7d" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "proc-macro2" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "syn" +version = "2.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrap-infallible" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] diff --git a/energy-integration/energy-factory-mock/wasm/Cargo.toml b/energy-integration/energy-factory-mock/wasm/Cargo.toml index 5c74db241..86a0b6a44 100644 --- a/energy-integration/energy-factory-mock/wasm/Cargo.toml +++ b/energy-integration/energy-factory-mock/wasm/Cargo.toml @@ -21,11 +21,14 @@ debug = false panic = "abort" overflow-checks = false +[profile.dev] +panic = "abort" + [dependencies.energy-factory-mock] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.49.0" +version = "=0.50.0" [workspace] members = ["."] diff --git a/energy-integration/energy-factory-mock/wasm/src/lib.rs b/energy-integration/energy-factory-mock/wasm/src/lib.rs index c52b88848..400849b5a 100644 --- a/energy-integration/energy-factory-mock/wasm/src/lib.rs +++ b/energy-integration/energy-factory-mock/wasm/src/lib.rs @@ -10,8 +10,6 @@ // Total number of exported functions: 6 #![no_std] -#![allow(internal_features)] -#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); diff --git a/energy-integration/energy-update/Cargo.toml b/energy-integration/energy-update/Cargo.toml index def1196b8..e10ee4388 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0" +version = "=0.50.0" [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.49.0" +version = "=0.50.0" diff --git a/energy-integration/energy-update/meta/Cargo.toml b/energy-integration/energy-update/meta/Cargo.toml index dc5eb4e7f..bc988e19f 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.49.0" +version = "0.50.0" default-features = false diff --git a/energy-integration/energy-update/wasm/Cargo.lock b/energy-integration/energy-update/wasm/Cargo.lock new file mode 100644 index 000000000..73cbb940c --- /dev/null +++ b/energy-integration/energy-update/wasm/Cargo.lock @@ -0,0 +1,554 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "common-types" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "config" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "contexts" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "farm_token", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "rewards", + "token_merge_helper", + "token_send", +] + +[[package]] +name = "either" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "energy-query" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", +] + +[[package]] +name = "energy-update" +version = "0.0.0" +dependencies = [ + "farm", + "multiversx-sc", + "multiversx-sc-modules", + "weekly-rewards-splitting", +] + +[[package]] +name = "energy-update-wasm" +version = "0.0.0" +dependencies = [ + "energy-update", + "multiversx-sc-wasm-adapter", +] + +[[package]] +name = "events" +version = "0.0.0" +dependencies = [ + "common_structs", + "contexts", + "multiversx-sc", +] + +[[package]] +name = "farm" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "energy-query", + "events", + "farm-boosted-yields", + "farm_base_impl", + "farm_token", + "fixed-supply-token", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pair", + "pausable", + "permissions_module", + "rewards", + "sc_whitelist_module", + "token_send", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm-boosted-yields" +version = "0.0.0" +dependencies = [ + "common-types", + "config", + "energy-query", + "multiversx-sc", + "pausable", + "permissions_module", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm_base_impl" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "events", + "farm_token", + "fixed-supply-token", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "rewards", + "token_merge_helper", + "token_send", + "utils", +] + +[[package]] +name = "farm_token" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "fees-collector" +version = "0.0.0" +dependencies = [ + "common-types", + "common_errors", + "energy-factory", + "energy-query", + "locking_module", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "locking_module" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9624cfb01497bf386d6b8837fa8e6785d45c8d4e122ba9c31060ecf5fce413" +dependencies = [ + "bitflags", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c94397b2fba14e40edfa55905b3f453ed57aa06c9b1960ad6a0ca6bfb7a236" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf72a8042da0bc19da0b8f0d4f61b4c66ae853560fefc69cd8fea87bf1aa8c14" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "754cdc20001c3b51df75784c5d8ce454697d0e86264f1d88da392ea211f662f9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25824610adec5b01c7b38cd469983940b33a7d11b2c0011af7ad572fe10ac1ae" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a7f031a91eb7360be47ad19c06ed1246486eb789ef8091df0646de85071f7d" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "pair" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "fees-collector", + "itertools", + "multiversx-sc", + "pausable", + "permissions_module", + "simple-lock", + "token_send", + "utils", +] + +[[package]] +name = "pausable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", + "permissions_module", +] + +[[package]] +name = "permissions_module" +version = "0.0.0" +dependencies = [ + "bitflags", + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "proc-macro2" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "rewards" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "farm_token", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "syn" +version = "2.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "token_merge_helper" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "token_send" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrap-infallible" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "week-timekeeping" +version = "0.0.0" +dependencies = [ + "common-types", + "multiversx-sc", +] + +[[package]] +name = "weekly-rewards-splitting" +version = "0.0.0" +dependencies = [ + "common-types", + "energy-query", + "math", + "multiversx-sc", + "unwrappable", + "week-timekeeping", +] diff --git a/energy-integration/energy-update/wasm/Cargo.toml b/energy-integration/energy-update/wasm/Cargo.toml index 5de83835a..080cba928 100644 --- a/energy-integration/energy-update/wasm/Cargo.toml +++ b/energy-integration/energy-update/wasm/Cargo.toml @@ -21,11 +21,14 @@ debug = false panic = "abort" overflow-checks = false +[profile.dev] +panic = "abort" + [dependencies.energy-update] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.49.0" +version = "=0.50.0" [workspace] members = ["."] diff --git a/energy-integration/energy-update/wasm/src/lib.rs b/energy-integration/energy-update/wasm/src/lib.rs index 7c2a439a0..7d5e5998a 100644 --- a/energy-integration/energy-update/wasm/src/lib.rs +++ b/energy-integration/energy-update/wasm/src/lib.rs @@ -8,11 +8,9 @@ // Upgrade: 1 // Endpoints: 1 // Async Callback (empty): 1 -// Total number of exported functions: 3 +// Total number of exported functions: 4 #![no_std] -#![allow(internal_features)] -#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); diff --git a/energy-integration/farm-boosted-yields/Cargo.toml b/energy-integration/farm-boosted-yields/Cargo.toml index 2a47f3648..bc159bead 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.config] diff --git a/energy-integration/fees-collector/Cargo.toml b/energy-integration/fees-collector/Cargo.toml index a31e4a860..f821e166e 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0" +version = "=0.50.0" [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.49.0" +version = "=0.50.0" [dev-dependencies.sc_whitelist_module] path = "../../common/modules/sc_whitelist_module" diff --git a/energy-integration/fees-collector/meta/Cargo.toml b/energy-integration/fees-collector/meta/Cargo.toml index ab9d510ed..5d715d7b0 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.49.0" +version = "0.50.0" default-features = false diff --git a/energy-integration/fees-collector/wasm/Cargo.lock b/energy-integration/fees-collector/wasm/Cargo.lock new file mode 100644 index 000000000..125787332 --- /dev/null +++ b/energy-integration/fees-collector/wasm/Cargo.lock @@ -0,0 +1,348 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "common-types" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "energy-query" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", +] + +[[package]] +name = "fees-collector" +version = "0.0.0" +dependencies = [ + "common-types", + "common_errors", + "energy-factory", + "energy-query", + "locking_module", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "fees-collector-wasm" +version = "0.0.0" +dependencies = [ + "fees-collector", + "multiversx-sc-wasm-adapter", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "locking_module" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9624cfb01497bf386d6b8837fa8e6785d45c8d4e122ba9c31060ecf5fce413" +dependencies = [ + "bitflags", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c94397b2fba14e40edfa55905b3f453ed57aa06c9b1960ad6a0ca6bfb7a236" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf72a8042da0bc19da0b8f0d4f61b4c66ae853560fefc69cd8fea87bf1aa8c14" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "754cdc20001c3b51df75784c5d8ce454697d0e86264f1d88da392ea211f662f9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25824610adec5b01c7b38cd469983940b33a7d11b2c0011af7ad572fe10ac1ae" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a7f031a91eb7360be47ad19c06ed1246486eb789ef8091df0646de85071f7d" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "proc-macro2" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "syn" +version = "2.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrap-infallible" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "week-timekeeping" +version = "0.0.0" +dependencies = [ + "common-types", + "multiversx-sc", +] + +[[package]] +name = "weekly-rewards-splitting" +version = "0.0.0" +dependencies = [ + "common-types", + "energy-query", + "math", + "multiversx-sc", + "unwrappable", + "week-timekeeping", +] diff --git a/energy-integration/fees-collector/wasm/Cargo.toml b/energy-integration/fees-collector/wasm/Cargo.toml index e42dac8a1..2a2eca742 100644 --- a/energy-integration/fees-collector/wasm/Cargo.toml +++ b/energy-integration/fees-collector/wasm/Cargo.toml @@ -21,11 +21,14 @@ debug = false panic = "abort" overflow-checks = false +[profile.dev] +panic = "abort" + [dependencies.fees-collector] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.49.0" +version = "=0.50.0" [workspace] members = ["."] diff --git a/energy-integration/fees-collector/wasm/src/lib.rs b/energy-integration/fees-collector/wasm/src/lib.rs index 1be8d7b4c..283f21a67 100644 --- a/energy-integration/fees-collector/wasm/src/lib.rs +++ b/energy-integration/fees-collector/wasm/src/lib.rs @@ -8,11 +8,9 @@ // Upgrade: 1 // Endpoints: 38 // Async Callback (empty): 1 -// Total number of exported functions: 40 +// Total number of exported functions: 41 #![no_std] -#![allow(internal_features)] -#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); diff --git a/energy-integration/governance-v2/Cargo.toml b/energy-integration/governance-v2/Cargo.toml index 6a912a8d6..ebb354d55 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.49.0" +version = "=0.50.0" 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.49.0" +version = "=0.50.0" [dev-dependencies.energy-factory-mock] path = "../energy-factory-mock" diff --git a/energy-integration/governance-v2/meta/Cargo.toml b/energy-integration/governance-v2/meta/Cargo.toml index cd7b9d3b5..2b8bda2a8 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.49.0" +version = "0.50.0" default-features = false diff --git a/energy-integration/governance-v2/wasm/Cargo.lock b/energy-integration/governance-v2/wasm/Cargo.lock new file mode 100644 index 000000000..d7b32d16e --- /dev/null +++ b/energy-integration/governance-v2/wasm/Cargo.lock @@ -0,0 +1,368 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "common-types" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "energy-query" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", +] + +[[package]] +name = "fees-collector" +version = "0.0.0" +dependencies = [ + "common-types", + "common_errors", + "energy-factory", + "energy-query", + "locking_module", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "governance-v2" +version = "0.0.0" +dependencies = [ + "energy-query", + "fees-collector", + "multiversx-sc", + "permissions_module", + "weekly-rewards-splitting", +] + +[[package]] +name = "governance-v2-wasm" +version = "0.0.0" +dependencies = [ + "governance-v2", + "multiversx-sc-wasm-adapter", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "locking_module" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9624cfb01497bf386d6b8837fa8e6785d45c8d4e122ba9c31060ecf5fce413" +dependencies = [ + "bitflags", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c94397b2fba14e40edfa55905b3f453ed57aa06c9b1960ad6a0ca6bfb7a236" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf72a8042da0bc19da0b8f0d4f61b4c66ae853560fefc69cd8fea87bf1aa8c14" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "754cdc20001c3b51df75784c5d8ce454697d0e86264f1d88da392ea211f662f9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25824610adec5b01c7b38cd469983940b33a7d11b2c0011af7ad572fe10ac1ae" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a7f031a91eb7360be47ad19c06ed1246486eb789ef8091df0646de85071f7d" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "permissions_module" +version = "0.0.0" +dependencies = [ + "bitflags", + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "proc-macro2" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "syn" +version = "2.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrap-infallible" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "week-timekeeping" +version = "0.0.0" +dependencies = [ + "common-types", + "multiversx-sc", +] + +[[package]] +name = "weekly-rewards-splitting" +version = "0.0.0" +dependencies = [ + "common-types", + "energy-query", + "math", + "multiversx-sc", + "unwrappable", + "week-timekeeping", +] diff --git a/energy-integration/governance-v2/wasm/Cargo.toml b/energy-integration/governance-v2/wasm/Cargo.toml index fa41ae068..454f54564 100644 --- a/energy-integration/governance-v2/wasm/Cargo.toml +++ b/energy-integration/governance-v2/wasm/Cargo.toml @@ -21,11 +21,14 @@ debug = false panic = "abort" overflow-checks = false +[profile.dev] +panic = "abort" + [dependencies.governance-v2] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.49.0" +version = "=0.50.0" [workspace] members = ["."] diff --git a/energy-integration/governance-v2/wasm/src/lib.rs b/energy-integration/governance-v2/wasm/src/lib.rs index f01aaec5e..0211fca5a 100644 --- a/energy-integration/governance-v2/wasm/src/lib.rs +++ b/energy-integration/governance-v2/wasm/src/lib.rs @@ -8,11 +8,9 @@ // Upgrade: 1 // Endpoints: 29 // Async Callback (empty): 1 -// Total number of exported functions: 31 +// Total number of exported functions: 32 #![no_std] -#![allow(internal_features)] -#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); diff --git a/farm-staking/farm-staking-proxy/Cargo.toml b/farm-staking/farm-staking-proxy/Cargo.toml index 1c35dcc82..7f1382982 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0" +version = "=0.50.0" [dependencies.farm] path = "../../dex/farm" @@ -67,7 +67,7 @@ path = "../../energy-integration/common-modules/energy-query" num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0" +version = "=0.50.0" [dev-dependencies.farm_token] path = "../../common/modules/farm/farm_token" diff --git a/farm-staking/farm-staking-proxy/meta/Cargo.toml b/farm-staking/farm-staking-proxy/meta/Cargo.toml index 1ee61cd44..e88c9a1e6 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.49.0" +version = "0.50.0" default-features = false diff --git a/farm-staking/farm-staking-proxy/wasm/Cargo.lock b/farm-staking/farm-staking-proxy/wasm/Cargo.lock new file mode 100644 index 000000000..ff18f1cd8 --- /dev/null +++ b/farm-staking/farm-staking-proxy/wasm/Cargo.lock @@ -0,0 +1,635 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "common-types" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "config" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "contexts" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "farm_token", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "rewards", + "token_merge_helper", + "token_send", +] + +[[package]] +name = "either" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "energy-query" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", +] + +[[package]] +name = "events" +version = "0.0.0" +dependencies = [ + "common_structs", + "contexts", + "multiversx-sc", +] + +[[package]] +name = "farm" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "energy-query", + "events", + "farm-boosted-yields", + "farm_base_impl", + "farm_token", + "fixed-supply-token", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pair", + "pausable", + "permissions_module", + "rewards", + "sc_whitelist_module", + "token_send", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm-boosted-yields" +version = "0.0.0" +dependencies = [ + "common-types", + "config", + "energy-query", + "multiversx-sc", + "pausable", + "permissions_module", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm-staking" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "energy-factory", + "energy-query", + "events", + "farm", + "farm-boosted-yields", + "farm_base_impl", + "farm_token", + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pair", + "pausable", + "permissions_module", + "rewards", + "sc_whitelist_module", + "token_send", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm-staking-proxy" +version = "0.0.0" +dependencies = [ + "common_structs", + "config", + "energy-query", + "farm", + "farm-staking", + "farm-with-locked-rewards", + "fixed-supply-token", + "hex-literal 0.3.4", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pair", + "pausable", + "rewards", + "sc_whitelist_module", + "token_send", + "unwrappable", + "utils", +] + +[[package]] +name = "farm-staking-proxy-wasm" +version = "0.0.0" +dependencies = [ + "farm-staking-proxy", + "multiversx-sc-wasm-adapter", +] + +[[package]] +name = "farm-with-locked-rewards" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "energy-factory", + "energy-query", + "events", + "farm", + "farm-boosted-yields", + "farm_base_impl", + "farm_token", + "fixed-supply-token", + "locking_module", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "rewards", + "sc_whitelist_module", + "token_send", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm_base_impl" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "events", + "farm_token", + "fixed-supply-token", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "rewards", + "token_merge_helper", + "token_send", + "utils", +] + +[[package]] +name = "farm_token" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "fees-collector" +version = "0.0.0" +dependencies = [ + "common-types", + "common_errors", + "energy-factory", + "energy-query", + "locking_module", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "locking_module" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9624cfb01497bf386d6b8837fa8e6785d45c8d4e122ba9c31060ecf5fce413" +dependencies = [ + "bitflags", + "hex-literal 0.4.1", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c94397b2fba14e40edfa55905b3f453ed57aa06c9b1960ad6a0ca6bfb7a236" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf72a8042da0bc19da0b8f0d4f61b4c66ae853560fefc69cd8fea87bf1aa8c14" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "754cdc20001c3b51df75784c5d8ce454697d0e86264f1d88da392ea211f662f9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25824610adec5b01c7b38cd469983940b33a7d11b2c0011af7ad572fe10ac1ae" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a7f031a91eb7360be47ad19c06ed1246486eb789ef8091df0646de85071f7d" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "pair" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "fees-collector", + "itertools", + "multiversx-sc", + "pausable", + "permissions_module", + "simple-lock", + "token_send", + "utils", +] + +[[package]] +name = "pausable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", + "permissions_module", +] + +[[package]] +name = "permissions_module" +version = "0.0.0" +dependencies = [ + "bitflags", + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "proc-macro2" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "rewards" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "farm_token", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "syn" +version = "2.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "token_merge_helper" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "token_send" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrap-infallible" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "week-timekeeping" +version = "0.0.0" +dependencies = [ + "common-types", + "multiversx-sc", +] + +[[package]] +name = "weekly-rewards-splitting" +version = "0.0.0" +dependencies = [ + "common-types", + "energy-query", + "math", + "multiversx-sc", + "unwrappable", + "week-timekeeping", +] diff --git a/farm-staking/farm-staking-proxy/wasm/Cargo.toml b/farm-staking/farm-staking-proxy/wasm/Cargo.toml index 9e2510ff6..edc6eefb2 100644 --- a/farm-staking/farm-staking-proxy/wasm/Cargo.toml +++ b/farm-staking/farm-staking-proxy/wasm/Cargo.toml @@ -21,11 +21,14 @@ debug = false panic = "abort" overflow-checks = false +[profile.dev] +panic = "abort" + [dependencies.farm-staking-proxy] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.49.0" +version = "=0.50.0" [workspace] members = ["."] diff --git a/farm-staking/farm-staking-proxy/wasm/src/lib.rs b/farm-staking/farm-staking-proxy/wasm/src/lib.rs index 4828cb23a..3f9abd0a4 100644 --- a/farm-staking/farm-staking-proxy/wasm/src/lib.rs +++ b/farm-staking/farm-staking-proxy/wasm/src/lib.rs @@ -8,11 +8,9 @@ // Upgrade: 1 // Endpoints: 17 // Async Callback: 1 -// Total number of exported functions: 19 +// Total number of exported functions: 20 #![no_std] -#![allow(internal_features)] -#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); diff --git a/farm-staking/farm-staking/Cargo.toml b/farm-staking/farm-staking/Cargo.toml index dffb76152..342372cf7 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0" +version = "=0.50.0" [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0" +version = "=0.50.0" diff --git a/farm-staking/farm-staking/meta/Cargo.toml b/farm-staking/farm-staking/meta/Cargo.toml index 4cf7ca5cf..59328107e 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.49.0" +version = "0.50.0" default-features = false diff --git a/farm-staking/farm-staking/wasm/Cargo.lock b/farm-staking/farm-staking/wasm/Cargo.lock new file mode 100644 index 000000000..fee6f5959 --- /dev/null +++ b/farm-staking/farm-staking/wasm/Cargo.lock @@ -0,0 +1,575 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "common-types" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "config" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "contexts" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "farm_token", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "rewards", + "token_merge_helper", + "token_send", +] + +[[package]] +name = "either" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "energy-query" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", +] + +[[package]] +name = "events" +version = "0.0.0" +dependencies = [ + "common_structs", + "contexts", + "multiversx-sc", +] + +[[package]] +name = "farm" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "energy-query", + "events", + "farm-boosted-yields", + "farm_base_impl", + "farm_token", + "fixed-supply-token", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pair", + "pausable", + "permissions_module", + "rewards", + "sc_whitelist_module", + "token_send", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm-boosted-yields" +version = "0.0.0" +dependencies = [ + "common-types", + "config", + "energy-query", + "multiversx-sc", + "pausable", + "permissions_module", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm-staking" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "energy-factory", + "energy-query", + "events", + "farm", + "farm-boosted-yields", + "farm_base_impl", + "farm_token", + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pair", + "pausable", + "permissions_module", + "rewards", + "sc_whitelist_module", + "token_send", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm-staking-wasm" +version = "0.0.0" +dependencies = [ + "farm-staking", + "multiversx-sc-wasm-adapter", +] + +[[package]] +name = "farm_base_impl" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "events", + "farm_token", + "fixed-supply-token", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "rewards", + "token_merge_helper", + "token_send", + "utils", +] + +[[package]] +name = "farm_token" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "fees-collector" +version = "0.0.0" +dependencies = [ + "common-types", + "common_errors", + "energy-factory", + "energy-query", + "locking_module", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "locking_module" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9624cfb01497bf386d6b8837fa8e6785d45c8d4e122ba9c31060ecf5fce413" +dependencies = [ + "bitflags", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c94397b2fba14e40edfa55905b3f453ed57aa06c9b1960ad6a0ca6bfb7a236" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf72a8042da0bc19da0b8f0d4f61b4c66ae853560fefc69cd8fea87bf1aa8c14" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "754cdc20001c3b51df75784c5d8ce454697d0e86264f1d88da392ea211f662f9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25824610adec5b01c7b38cd469983940b33a7d11b2c0011af7ad572fe10ac1ae" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a7f031a91eb7360be47ad19c06ed1246486eb789ef8091df0646de85071f7d" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "pair" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "fees-collector", + "itertools", + "multiversx-sc", + "pausable", + "permissions_module", + "simple-lock", + "token_send", + "utils", +] + +[[package]] +name = "pausable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", + "permissions_module", +] + +[[package]] +name = "permissions_module" +version = "0.0.0" +dependencies = [ + "bitflags", + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "proc-macro2" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "rewards" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "farm_token", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "syn" +version = "2.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "token_merge_helper" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "token_send" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrap-infallible" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "week-timekeeping" +version = "0.0.0" +dependencies = [ + "common-types", + "multiversx-sc", +] + +[[package]] +name = "weekly-rewards-splitting" +version = "0.0.0" +dependencies = [ + "common-types", + "energy-query", + "math", + "multiversx-sc", + "unwrappable", + "week-timekeeping", +] diff --git a/farm-staking/farm-staking/wasm/Cargo.toml b/farm-staking/farm-staking/wasm/Cargo.toml index ce93309d7..faab53534 100644 --- a/farm-staking/farm-staking/wasm/Cargo.toml +++ b/farm-staking/farm-staking/wasm/Cargo.toml @@ -21,11 +21,14 @@ debug = false panic = "abort" overflow-checks = false +[profile.dev] +panic = "abort" + [dependencies.farm-staking] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.49.0" +version = "=0.50.0" [workspace] members = ["."] diff --git a/farm-staking/farm-staking/wasm/src/lib.rs b/farm-staking/farm-staking/wasm/src/lib.rs index e0df648cc..4842309c2 100644 --- a/farm-staking/farm-staking/wasm/src/lib.rs +++ b/farm-staking/farm-staking/wasm/src/lib.rs @@ -8,11 +8,9 @@ // Upgrade: 1 // Endpoints: 70 // Async Callback: 1 -// Total number of exported functions: 72 +// Total number of exported functions: 73 #![no_std] -#![allow(internal_features)] -#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); diff --git a/farm-staking/metabonding-staking/Cargo.toml b/farm-staking/metabonding-staking/Cargo.toml index 3c2c48b5b..9bf6e00f2 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0" +version = "=0.50.0" [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.49.0" +version = "=0.50.0" [dev-dependencies.common_structs] path = "../../common/common_structs" diff --git a/farm-staking/metabonding-staking/meta/Cargo.toml b/farm-staking/metabonding-staking/meta/Cargo.toml index 63856cd6d..b9b1c8070 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.49.0" +version = "0.50.0" default-features = false diff --git a/farm-staking/metabonding-staking/wasm/Cargo.lock b/farm-staking/metabonding-staking/wasm/Cargo.lock new file mode 100644 index 000000000..75a851650 --- /dev/null +++ b/farm-staking/metabonding-staking/wasm/Cargo.lock @@ -0,0 +1,397 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "either" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "factory" +version = "0.0.0" +dependencies = [ + "arrayvec", + "common_errors", + "common_structs", + "energy-factory", + "itertools", + "multiversx-sc", + "multiversx-sc-modules", + "token_merge_helper", + "token_send", + "wee_alloc", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "libc" +version = "0.2.154" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "memory_units" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "metabonding-staking" +version = "0.0.0" +dependencies = [ + "factory", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "metabonding-staking-wasm" +version = "0.0.0" +dependencies = [ + "metabonding-staking", + "multiversx-sc-wasm-adapter", +] + +[[package]] +name = "multiversx-sc" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9624cfb01497bf386d6b8837fa8e6785d45c8d4e122ba9c31060ecf5fce413" +dependencies = [ + "bitflags", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c94397b2fba14e40edfa55905b3f453ed57aa06c9b1960ad6a0ca6bfb7a236" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf72a8042da0bc19da0b8f0d4f61b4c66ae853560fefc69cd8fea87bf1aa8c14" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "754cdc20001c3b51df75784c5d8ce454697d0e86264f1d88da392ea211f662f9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25824610adec5b01c7b38cd469983940b33a7d11b2c0011af7ad572fe10ac1ae" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a7f031a91eb7360be47ad19c06ed1246486eb789ef8091df0646de85071f7d" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "proc-macro2" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "syn" +version = "2.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "token_merge_helper" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "token_send" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrap-infallible" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "wee_alloc" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" +dependencies = [ + "cfg-if", + "libc", + "memory_units", + "winapi", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/farm-staking/metabonding-staking/wasm/Cargo.toml b/farm-staking/metabonding-staking/wasm/Cargo.toml index a48b6938b..5d466662c 100644 --- a/farm-staking/metabonding-staking/wasm/Cargo.toml +++ b/farm-staking/metabonding-staking/wasm/Cargo.toml @@ -21,11 +21,14 @@ debug = false panic = "abort" overflow-checks = false +[profile.dev] +panic = "abort" + [dependencies.metabonding-staking] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.49.0" +version = "=0.50.0" [workspace] members = ["."] diff --git a/farm-staking/metabonding-staking/wasm/src/lib.rs b/farm-staking/metabonding-staking/wasm/src/lib.rs index 7bdb3be27..22b6f6de2 100644 --- a/farm-staking/metabonding-staking/wasm/src/lib.rs +++ b/farm-staking/metabonding-staking/wasm/src/lib.rs @@ -8,11 +8,9 @@ // Upgrade: 1 // Endpoints: 10 // Async Callback (empty): 1 -// Total number of exported functions: 12 +// Total number of exported functions: 13 #![no_std] -#![allow(internal_features)] -#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); diff --git a/locked-asset/Cargo.toml b/locked-asset/Cargo.toml index 5c3aa07d6..dd86bff37 100644 --- a/locked-asset/Cargo.toml +++ b/locked-asset/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" publish = false [dependencies.multiversx-sc] -version = "=0.49.0" +version = "=0.50.0" 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.49.0" +version = "=0.50.0" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0" +version = "=0.50.0" diff --git a/locked-asset/distribution/Cargo.toml b/locked-asset/distribution/Cargo.toml index efaadf888..d16f60056 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0" +version = "=0.50.0" diff --git a/locked-asset/distribution/meta/Cargo.toml b/locked-asset/distribution/meta/Cargo.toml index b58e7a4ab..3e261746b 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.49.0" +version = "0.50.0" default-features = false diff --git a/locked-asset/distribution/wasm/Cargo.lock b/locked-asset/distribution/wasm/Cargo.lock new file mode 100644 index 000000000..5b6cf143a --- /dev/null +++ b/locked-asset/distribution/wasm/Cargo.lock @@ -0,0 +1,397 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "distribution" +version = "0.0.0" +dependencies = [ + "common_structs", + "factory", + "multiversx-sc", +] + +[[package]] +name = "distribution-wasm" +version = "0.0.0" +dependencies = [ + "distribution", + "multiversx-sc-wasm-adapter", +] + +[[package]] +name = "either" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "factory" +version = "0.0.0" +dependencies = [ + "arrayvec", + "common_errors", + "common_structs", + "energy-factory", + "itertools", + "multiversx-sc", + "multiversx-sc-modules", + "token_merge_helper", + "token_send", + "wee_alloc", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "libc" +version = "0.2.154" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "memory_units" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9624cfb01497bf386d6b8837fa8e6785d45c8d4e122ba9c31060ecf5fce413" +dependencies = [ + "bitflags", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c94397b2fba14e40edfa55905b3f453ed57aa06c9b1960ad6a0ca6bfb7a236" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf72a8042da0bc19da0b8f0d4f61b4c66ae853560fefc69cd8fea87bf1aa8c14" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "754cdc20001c3b51df75784c5d8ce454697d0e86264f1d88da392ea211f662f9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25824610adec5b01c7b38cd469983940b33a7d11b2c0011af7ad572fe10ac1ae" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a7f031a91eb7360be47ad19c06ed1246486eb789ef8091df0646de85071f7d" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "proc-macro2" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "syn" +version = "2.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "token_merge_helper" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "token_send" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrap-infallible" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "wee_alloc" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" +dependencies = [ + "cfg-if", + "libc", + "memory_units", + "winapi", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/locked-asset/distribution/wasm/Cargo.toml b/locked-asset/distribution/wasm/Cargo.toml index 87b0878a3..a2cb6d21a 100644 --- a/locked-asset/distribution/wasm/Cargo.toml +++ b/locked-asset/distribution/wasm/Cargo.toml @@ -21,11 +21,14 @@ debug = false panic = "abort" overflow-checks = false +[profile.dev] +panic = "abort" + [dependencies.distribution] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.49.0" +version = "=0.50.0" [workspace] members = ["."] diff --git a/locked-asset/distribution/wasm/src/lib.rs b/locked-asset/distribution/wasm/src/lib.rs index 1e4191e89..4f919ac08 100644 --- a/locked-asset/distribution/wasm/src/lib.rs +++ b/locked-asset/distribution/wasm/src/lib.rs @@ -8,11 +8,9 @@ // Upgrade: 1 // Endpoints: 15 // Async Callback (empty): 1 -// Total number of exported functions: 17 +// Total number of exported functions: 18 #![no_std] -#![allow(internal_features)] -#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); diff --git a/locked-asset/energy-factory/Cargo.toml b/locked-asset/energy-factory/Cargo.toml index 402f2f90b..0ab81ad76 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0" +version = "=0.50.0" [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.49.0" +version = "=0.50.0" diff --git a/locked-asset/energy-factory/meta/Cargo.toml b/locked-asset/energy-factory/meta/Cargo.toml index d82e95153..77b30ff9f 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.49.0" +version = "0.50.0" default-features = false diff --git a/locked-asset/energy-factory/wasm/Cargo.lock b/locked-asset/energy-factory/wasm/Cargo.lock new file mode 100644 index 000000000..bcdd9ccd2 --- /dev/null +++ b/locked-asset/energy-factory/wasm/Cargo.lock @@ -0,0 +1,288 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "energy-factory-wasm" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc-wasm-adapter", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9624cfb01497bf386d6b8837fa8e6785d45c8d4e122ba9c31060ecf5fce413" +dependencies = [ + "bitflags", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c94397b2fba14e40edfa55905b3f453ed57aa06c9b1960ad6a0ca6bfb7a236" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf72a8042da0bc19da0b8f0d4f61b4c66ae853560fefc69cd8fea87bf1aa8c14" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "754cdc20001c3b51df75784c5d8ce454697d0e86264f1d88da392ea211f662f9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25824610adec5b01c7b38cd469983940b33a7d11b2c0011af7ad572fe10ac1ae" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a7f031a91eb7360be47ad19c06ed1246486eb789ef8091df0646de85071f7d" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "proc-macro2" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "syn" +version = "2.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrap-infallible" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] diff --git a/locked-asset/energy-factory/wasm/Cargo.toml b/locked-asset/energy-factory/wasm/Cargo.toml index 0e7b9e13f..8899f1de4 100644 --- a/locked-asset/energy-factory/wasm/Cargo.toml +++ b/locked-asset/energy-factory/wasm/Cargo.toml @@ -21,11 +21,14 @@ debug = false panic = "abort" overflow-checks = false +[profile.dev] +panic = "abort" + [dependencies.energy-factory] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.49.0" +version = "=0.50.0" [workspace] members = ["."] diff --git a/locked-asset/energy-factory/wasm/src/lib.rs b/locked-asset/energy-factory/wasm/src/lib.rs index eb42f733b..fafdc534e 100644 --- a/locked-asset/energy-factory/wasm/src/lib.rs +++ b/locked-asset/energy-factory/wasm/src/lib.rs @@ -11,8 +11,6 @@ // Total number of exported functions: 36 #![no_std] -#![allow(internal_features)] -#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); diff --git a/locked-asset/factory/Cargo.toml b/locked-asset/factory/Cargo.toml index 1cda39ac2..0f715b4cc 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0" +version = "=0.50.0" [dependencies.arrayvec] version = "0.7.1" @@ -49,4 +49,4 @@ hex = "0.4" path = "../simple-lock" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0" +version = "=0.50.0" diff --git a/locked-asset/factory/meta/Cargo.toml b/locked-asset/factory/meta/Cargo.toml index ff2fccb34..9e4dff543 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.49.0" +version = "0.50.0" default-features = false diff --git a/locked-asset/factory/wasm/Cargo.lock b/locked-asset/factory/wasm/Cargo.lock new file mode 100644 index 000000000..fb3dbd95b --- /dev/null +++ b/locked-asset/factory/wasm/Cargo.lock @@ -0,0 +1,388 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "either" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "factory" +version = "0.0.0" +dependencies = [ + "arrayvec", + "common_errors", + "common_structs", + "energy-factory", + "itertools", + "multiversx-sc", + "multiversx-sc-modules", + "token_merge_helper", + "token_send", + "wee_alloc", +] + +[[package]] +name = "factory-wasm" +version = "0.0.0" +dependencies = [ + "factory", + "multiversx-sc-wasm-adapter", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "libc" +version = "0.2.154" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "memory_units" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9624cfb01497bf386d6b8837fa8e6785d45c8d4e122ba9c31060ecf5fce413" +dependencies = [ + "bitflags", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c94397b2fba14e40edfa55905b3f453ed57aa06c9b1960ad6a0ca6bfb7a236" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf72a8042da0bc19da0b8f0d4f61b4c66ae853560fefc69cd8fea87bf1aa8c14" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "754cdc20001c3b51df75784c5d8ce454697d0e86264f1d88da392ea211f662f9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25824610adec5b01c7b38cd469983940b33a7d11b2c0011af7ad572fe10ac1ae" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a7f031a91eb7360be47ad19c06ed1246486eb789ef8091df0646de85071f7d" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "proc-macro2" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "syn" +version = "2.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "token_merge_helper" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "token_send" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrap-infallible" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "wee_alloc" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" +dependencies = [ + "cfg-if", + "libc", + "memory_units", + "winapi", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/locked-asset/factory/wasm/Cargo.toml b/locked-asset/factory/wasm/Cargo.toml index 0241f8fd6..934a4da5f 100644 --- a/locked-asset/factory/wasm/Cargo.toml +++ b/locked-asset/factory/wasm/Cargo.toml @@ -21,11 +21,14 @@ debug = false panic = "abort" overflow-checks = false +[profile.dev] +panic = "abort" + [dependencies.factory] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.49.0" +version = "=0.50.0" [workspace] members = ["."] diff --git a/locked-asset/factory/wasm/src/lib.rs b/locked-asset/factory/wasm/src/lib.rs index 970c7303f..8b83df95b 100644 --- a/locked-asset/factory/wasm/src/lib.rs +++ b/locked-asset/factory/wasm/src/lib.rs @@ -8,11 +8,9 @@ // Upgrade: 1 // Endpoints: 24 // Async Callback: 1 -// Total number of exported functions: 26 +// Total number of exported functions: 27 #![no_std] -#![allow(internal_features)] -#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); diff --git a/locked-asset/lkmex-transfer/Cargo.toml b/locked-asset/lkmex-transfer/Cargo.toml index 81a4f097c..19b6cfb02 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] [dev-dependencies] num-bigint = "0.4.2" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0" +version = "=0.50.0" [dev-dependencies.multiversx-sc-modules] -version = "=0.49.0" +version = "=0.50.0" diff --git a/locked-asset/lkmex-transfer/meta/Cargo.toml b/locked-asset/lkmex-transfer/meta/Cargo.toml index 2585e75d0..ea39614bf 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.49.0" +version = "0.50.0" default-features = false diff --git a/locked-asset/lkmex-transfer/wasm/Cargo.lock b/locked-asset/lkmex-transfer/wasm/Cargo.lock new file mode 100644 index 000000000..3ff152024 --- /dev/null +++ b/locked-asset/lkmex-transfer/wasm/Cargo.lock @@ -0,0 +1,319 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "energy-query" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "lkmex-transfer" +version = "0.0.0" +dependencies = [ + "common_structs", + "energy-factory", + "energy-query", + "legacy_token_decode_module", + "multiversx-sc", + "permissions_module", + "simple-lock", + "utils", +] + +[[package]] +name = "lkmex-transfer-wasm" +version = "0.0.0" +dependencies = [ + "lkmex-transfer", + "multiversx-sc-wasm-adapter", +] + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9624cfb01497bf386d6b8837fa8e6785d45c8d4e122ba9c31060ecf5fce413" +dependencies = [ + "bitflags", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c94397b2fba14e40edfa55905b3f453ed57aa06c9b1960ad6a0ca6bfb7a236" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf72a8042da0bc19da0b8f0d4f61b4c66ae853560fefc69cd8fea87bf1aa8c14" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "754cdc20001c3b51df75784c5d8ce454697d0e86264f1d88da392ea211f662f9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25824610adec5b01c7b38cd469983940b33a7d11b2c0011af7ad572fe10ac1ae" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a7f031a91eb7360be47ad19c06ed1246486eb789ef8091df0646de85071f7d" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "permissions_module" +version = "0.0.0" +dependencies = [ + "bitflags", + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "proc-macro2" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "syn" +version = "2.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrap-infallible" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] diff --git a/locked-asset/lkmex-transfer/wasm/Cargo.toml b/locked-asset/lkmex-transfer/wasm/Cargo.toml index f190ac926..3767a805c 100644 --- a/locked-asset/lkmex-transfer/wasm/Cargo.toml +++ b/locked-asset/lkmex-transfer/wasm/Cargo.toml @@ -21,11 +21,14 @@ debug = false panic = "abort" overflow-checks = false +[profile.dev] +panic = "abort" + [dependencies.lkmex-transfer] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.49.0" +version = "=0.50.0" [workspace] members = ["."] diff --git a/locked-asset/lkmex-transfer/wasm/src/lib.rs b/locked-asset/lkmex-transfer/wasm/src/lib.rs index bc20909e1..24d976e2b 100644 --- a/locked-asset/lkmex-transfer/wasm/src/lib.rs +++ b/locked-asset/lkmex-transfer/wasm/src/lib.rs @@ -8,11 +8,9 @@ // Upgrade: 1 // Endpoints: 11 // Async Callback (empty): 1 -// Total number of exported functions: 13 +// Total number of exported functions: 14 #![no_std] -#![allow(internal_features)] -#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); diff --git a/locked-asset/locked-token-wrapper/Cargo.toml b/locked-asset/locked-token-wrapper/Cargo.toml index 0fb37b7d5..c8eaa697c 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.49.0" +version = "=0.50.0" [dependencies.multiversx-sc-modules] -version = "=0.49.0" +version = "=0.50.0" [dependencies.utils] path = "../../common/modules/utils" @@ -44,4 +44,4 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0" +version = "=0.50.0" diff --git a/locked-asset/locked-token-wrapper/meta/Cargo.toml b/locked-asset/locked-token-wrapper/meta/Cargo.toml index 71bb638ac..063f461ab 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.49.0" +version = "0.50.0" default-features = false diff --git a/locked-asset/locked-token-wrapper/wasm/Cargo.lock b/locked-asset/locked-token-wrapper/wasm/Cargo.lock new file mode 100644 index 000000000..755559230 --- /dev/null +++ b/locked-asset/locked-token-wrapper/wasm/Cargo.lock @@ -0,0 +1,343 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "energy-factory-mock" +version = "0.0.0" +dependencies = [ + "energy-query", + "multiversx-sc", +] + +[[package]] +name = "energy-query" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "lkmex-transfer" +version = "0.0.0" +dependencies = [ + "common_structs", + "energy-factory", + "energy-query", + "legacy_token_decode_module", + "multiversx-sc", + "permissions_module", + "simple-lock", + "utils", +] + +[[package]] +name = "locked-token-wrapper" +version = "0.0.0" +dependencies = [ + "common_structs", + "energy-factory", + "energy-factory-mock", + "energy-query", + "legacy_token_decode_module", + "lkmex-transfer", + "multiversx-sc", + "multiversx-sc-modules", + "simple-lock", + "utils", +] + +[[package]] +name = "locked-token-wrapper-wasm" +version = "0.0.0" +dependencies = [ + "locked-token-wrapper", + "multiversx-sc-wasm-adapter", +] + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9624cfb01497bf386d6b8837fa8e6785d45c8d4e122ba9c31060ecf5fce413" +dependencies = [ + "bitflags", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c94397b2fba14e40edfa55905b3f453ed57aa06c9b1960ad6a0ca6bfb7a236" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf72a8042da0bc19da0b8f0d4f61b4c66ae853560fefc69cd8fea87bf1aa8c14" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "754cdc20001c3b51df75784c5d8ce454697d0e86264f1d88da392ea211f662f9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25824610adec5b01c7b38cd469983940b33a7d11b2c0011af7ad572fe10ac1ae" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a7f031a91eb7360be47ad19c06ed1246486eb789ef8091df0646de85071f7d" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "permissions_module" +version = "0.0.0" +dependencies = [ + "bitflags", + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "proc-macro2" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "syn" +version = "2.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrap-infallible" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] diff --git a/locked-asset/locked-token-wrapper/wasm/Cargo.toml b/locked-asset/locked-token-wrapper/wasm/Cargo.toml index 130852928..4264b46d6 100644 --- a/locked-asset/locked-token-wrapper/wasm/Cargo.toml +++ b/locked-asset/locked-token-wrapper/wasm/Cargo.toml @@ -21,11 +21,14 @@ debug = false panic = "abort" overflow-checks = false +[profile.dev] +panic = "abort" + [dependencies.locked-token-wrapper] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.49.0" +version = "=0.50.0" [workspace] members = ["."] diff --git a/locked-asset/locked-token-wrapper/wasm/src/lib.rs b/locked-asset/locked-token-wrapper/wasm/src/lib.rs index bba9f768f..97c8b9704 100644 --- a/locked-asset/locked-token-wrapper/wasm/src/lib.rs +++ b/locked-asset/locked-token-wrapper/wasm/src/lib.rs @@ -8,11 +8,9 @@ // Upgrade: 1 // Endpoints: 8 // Async Callback: 1 -// Total number of exported functions: 10 +// Total number of exported functions: 11 #![no_std] -#![allow(internal_features)] -#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); diff --git a/locked-asset/proxy_dex/Cargo.toml b/locked-asset/proxy_dex/Cargo.toml index ddacef972..4a26427e8 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0" +version = "=0.50.0" [dependencies.energy-factory] path = "../energy-factory" @@ -69,7 +69,7 @@ num-traits = "0.2" hex = "0.4" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0" +version = "=0.50.0" [dev-dependencies.pausable] path = "../../common/modules/pausable" diff --git a/locked-asset/proxy_dex/meta/Cargo.toml b/locked-asset/proxy_dex/meta/Cargo.toml index f41cd2347..47d80db67 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.49.0" +version = "0.50.0" default-features = false diff --git a/locked-asset/proxy_dex/wasm/Cargo.lock b/locked-asset/proxy_dex/wasm/Cargo.lock new file mode 100644 index 000000000..e4268ed28 --- /dev/null +++ b/locked-asset/proxy_dex/wasm/Cargo.lock @@ -0,0 +1,598 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "common-types" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "config" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "contexts" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "farm_token", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "rewards", + "token_merge_helper", + "token_send", +] + +[[package]] +name = "either" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "energy-query" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", +] + +[[package]] +name = "events" +version = "0.0.0" +dependencies = [ + "common_structs", + "contexts", + "multiversx-sc", +] + +[[package]] +name = "farm" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "energy-query", + "events", + "farm-boosted-yields", + "farm_base_impl", + "farm_token", + "fixed-supply-token", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pair", + "pausable", + "permissions_module", + "rewards", + "sc_whitelist_module", + "token_send", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm-boosted-yields" +version = "0.0.0" +dependencies = [ + "common-types", + "config", + "energy-query", + "multiversx-sc", + "pausable", + "permissions_module", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm-with-locked-rewards" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "energy-factory", + "energy-query", + "events", + "farm", + "farm-boosted-yields", + "farm_base_impl", + "farm_token", + "fixed-supply-token", + "locking_module", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "rewards", + "sc_whitelist_module", + "token_send", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "farm_base_impl" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "contexts", + "events", + "farm_token", + "fixed-supply-token", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "rewards", + "token_merge_helper", + "token_send", + "utils", +] + +[[package]] +name = "farm_token" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "fees-collector" +version = "0.0.0" +dependencies = [ + "common-types", + "common_errors", + "energy-factory", + "energy-query", + "locking_module", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "utils", + "week-timekeeping", + "weekly-rewards-splitting", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "locking_module" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9624cfb01497bf386d6b8837fa8e6785d45c8d4e122ba9c31060ecf5fce413" +dependencies = [ + "bitflags", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c94397b2fba14e40edfa55905b3f453ed57aa06c9b1960ad6a0ca6bfb7a236" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf72a8042da0bc19da0b8f0d4f61b4c66ae853560fefc69cd8fea87bf1aa8c14" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "754cdc20001c3b51df75784c5d8ce454697d0e86264f1d88da392ea211f662f9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25824610adec5b01c7b38cd469983940b33a7d11b2c0011af7ad572fe10ac1ae" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a7f031a91eb7360be47ad19c06ed1246486eb789ef8091df0646de85071f7d" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "pair" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "fees-collector", + "itertools", + "multiversx-sc", + "pausable", + "permissions_module", + "simple-lock", + "token_send", + "utils", +] + +[[package]] +name = "pausable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", + "permissions_module", +] + +[[package]] +name = "permissions_module" +version = "0.0.0" +dependencies = [ + "bitflags", + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "proc-macro2" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "proxy_dex" +version = "0.0.0" +dependencies = [ + "common_structs", + "energy-factory", + "energy-query", + "farm", + "farm-with-locked-rewards", + "fixed-supply-token", + "itertools", + "legacy_token_decode_module", + "locking_module", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "pair", + "sc_whitelist_module", + "simple-lock", + "token_merge_helper", + "token_send", + "utils", +] + +[[package]] +name = "proxy_dex-wasm" +version = "0.0.0" +dependencies = [ + "multiversx-sc-wasm-adapter", + "proxy_dex", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "rewards" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "config", + "farm_token", + "multiversx-sc", + "multiversx-sc-modules", + "pausable", + "permissions_module", + "token_send", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "syn" +version = "2.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "token_merge_helper" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "token_send" +version = "0.0.0" +dependencies = [ + "common_errors", + "common_structs", + "multiversx-sc", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrap-infallible" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "week-timekeeping" +version = "0.0.0" +dependencies = [ + "common-types", + "multiversx-sc", +] + +[[package]] +name = "weekly-rewards-splitting" +version = "0.0.0" +dependencies = [ + "common-types", + "energy-query", + "math", + "multiversx-sc", + "unwrappable", + "week-timekeeping", +] diff --git a/locked-asset/proxy_dex/wasm/Cargo.toml b/locked-asset/proxy_dex/wasm/Cargo.toml index 8227052b7..fce8a946d 100644 --- a/locked-asset/proxy_dex/wasm/Cargo.toml +++ b/locked-asset/proxy_dex/wasm/Cargo.toml @@ -21,11 +21,14 @@ debug = false panic = "abort" overflow-checks = false +[profile.dev] +panic = "abort" + [dependencies.proxy_dex] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.49.0" +version = "=0.50.0" [workspace] members = ["."] diff --git a/locked-asset/proxy_dex/wasm/src/lib.rs b/locked-asset/proxy_dex/wasm/src/lib.rs index 1ca63b26b..c04d97990 100644 --- a/locked-asset/proxy_dex/wasm/src/lib.rs +++ b/locked-asset/proxy_dex/wasm/src/lib.rs @@ -8,11 +8,9 @@ // Upgrade: 1 // Endpoints: 30 // Async Callback: 1 -// Total number of exported functions: 32 +// Total number of exported functions: 33 #![no_std] -#![allow(internal_features)] -#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); diff --git a/locked-asset/simple-lock-whitelist/Cargo.toml b/locked-asset/simple-lock-whitelist/Cargo.toml index a31645e91..792fd36da 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0" +version = "=0.50.0" [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.49.0" +version = "=0.50.0" diff --git a/locked-asset/simple-lock-whitelist/meta/Cargo.toml b/locked-asset/simple-lock-whitelist/meta/Cargo.toml index c2f95045f..4a3fcfd57 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.49.0" +version = "0.50.0" default-features = false diff --git a/locked-asset/simple-lock-whitelist/wasm/Cargo.lock b/locked-asset/simple-lock-whitelist/wasm/Cargo.lock new file mode 100644 index 000000000..4c4d61015 --- /dev/null +++ b/locked-asset/simple-lock-whitelist/wasm/Cargo.lock @@ -0,0 +1,258 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9624cfb01497bf386d6b8837fa8e6785d45c8d4e122ba9c31060ecf5fce413" +dependencies = [ + "bitflags", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c94397b2fba14e40edfa55905b3f453ed57aa06c9b1960ad6a0ca6bfb7a236" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf72a8042da0bc19da0b8f0d4f61b4c66ae853560fefc69cd8fea87bf1aa8c14" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "754cdc20001c3b51df75784c5d8ce454697d0e86264f1d88da392ea211f662f9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25824610adec5b01c7b38cd469983940b33a7d11b2c0011af7ad572fe10ac1ae" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a7f031a91eb7360be47ad19c06ed1246486eb789ef8091df0646de85071f7d" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "proc-macro2" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "simple-lock-whitelist" +version = "0.0.0" +dependencies = [ + "multiversx-sc", + "multiversx-sc-modules", + "simple-lock", + "utils", +] + +[[package]] +name = "simple-lock-whitelist-wasm" +version = "0.0.0" +dependencies = [ + "multiversx-sc-wasm-adapter", + "simple-lock-whitelist", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "syn" +version = "2.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrap-infallible" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] diff --git a/locked-asset/simple-lock-whitelist/wasm/Cargo.toml b/locked-asset/simple-lock-whitelist/wasm/Cargo.toml index b9161fe3e..053d87ba5 100644 --- a/locked-asset/simple-lock-whitelist/wasm/Cargo.toml +++ b/locked-asset/simple-lock-whitelist/wasm/Cargo.toml @@ -21,11 +21,14 @@ debug = false panic = "abort" overflow-checks = false +[profile.dev] +panic = "abort" + [dependencies.simple-lock-whitelist] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.49.0" +version = "=0.50.0" [workspace] members = ["."] diff --git a/locked-asset/simple-lock-whitelist/wasm/src/lib.rs b/locked-asset/simple-lock-whitelist/wasm/src/lib.rs index f6d692858..ddd9defd7 100644 --- a/locked-asset/simple-lock-whitelist/wasm/src/lib.rs +++ b/locked-asset/simple-lock-whitelist/wasm/src/lib.rs @@ -8,11 +8,9 @@ // Upgrade: 1 // Endpoints: 25 // Async Callback: 1 -// Total number of exported functions: 27 +// 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!(); diff --git a/locked-asset/simple-lock/Cargo.toml b/locked-asset/simple-lock/Cargo.toml index a93ca1eca..f8fb45a45 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0" +version = "=0.50.0" [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.49.0" +version = "=0.50.0" diff --git a/locked-asset/simple-lock/meta/Cargo.toml b/locked-asset/simple-lock/meta/Cargo.toml index 4512e6f83..e2d935a87 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.49.0" +version = "0.50.0" default-features = false diff --git a/locked-asset/simple-lock/wasm/Cargo.lock b/locked-asset/simple-lock/wasm/Cargo.lock new file mode 100644 index 000000000..972e4050a --- /dev/null +++ b/locked-asset/simple-lock/wasm/Cargo.lock @@ -0,0 +1,238 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9624cfb01497bf386d6b8837fa8e6785d45c8d4e122ba9c31060ecf5fce413" +dependencies = [ + "bitflags", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c94397b2fba14e40edfa55905b3f453ed57aa06c9b1960ad6a0ca6bfb7a236" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf72a8042da0bc19da0b8f0d4f61b4c66ae853560fefc69cd8fea87bf1aa8c14" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "754cdc20001c3b51df75784c5d8ce454697d0e86264f1d88da392ea211f662f9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25824610adec5b01c7b38cd469983940b33a7d11b2c0011af7ad572fe10ac1ae" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a7f031a91eb7360be47ad19c06ed1246486eb789ef8091df0646de85071f7d" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "proc-macro2" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "simple-lock-wasm" +version = "0.0.0" +dependencies = [ + "multiversx-sc-wasm-adapter", + "simple-lock", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "syn" +version = "2.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrap-infallible" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] diff --git a/locked-asset/simple-lock/wasm/Cargo.toml b/locked-asset/simple-lock/wasm/Cargo.toml index a28fb263a..718ff5591 100644 --- a/locked-asset/simple-lock/wasm/Cargo.toml +++ b/locked-asset/simple-lock/wasm/Cargo.toml @@ -21,11 +21,14 @@ debug = false panic = "abort" overflow-checks = false +[profile.dev] +panic = "abort" + [dependencies.simple-lock] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.49.0" +version = "=0.50.0" [workspace] members = ["."] diff --git a/locked-asset/simple-lock/wasm/src/lib.rs b/locked-asset/simple-lock/wasm/src/lib.rs index a5b7adeb3..eeafb6cb1 100644 --- a/locked-asset/simple-lock/wasm/src/lib.rs +++ b/locked-asset/simple-lock/wasm/src/lib.rs @@ -8,11 +8,9 @@ // Upgrade: 1 // Endpoints: 19 // Async Callback: 1 -// Total number of exported functions: 21 +// Total number of exported functions: 22 #![no_std] -#![allow(internal_features)] -#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); diff --git a/locked-asset/token-unstake/Cargo.toml b/locked-asset/token-unstake/Cargo.toml index 2c00a8df8..73d0b31ce 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.49.0" +version = "=0.50.0" 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.49.0" +version = "=0.50.0" [dev-dependencies.multiversx-sc-modules] -version = "=0.49.0" +version = "=0.50.0" diff --git a/locked-asset/token-unstake/meta/Cargo.toml b/locked-asset/token-unstake/meta/Cargo.toml index 52ea170c3..599e68a1d 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.49.0" +version = "0.50.0" default-features = false diff --git a/locked-asset/token-unstake/wasm/Cargo.lock b/locked-asset/token-unstake/wasm/Cargo.lock new file mode 100644 index 000000000..298a825bc --- /dev/null +++ b/locked-asset/token-unstake/wasm/Cargo.lock @@ -0,0 +1,325 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "common-types" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "common_structs" +version = "0.0.0" +dependencies = [ + "fixed-supply-token", + "math", + "mergeable", + "multiversx-sc", + "unwrappable", +] + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "energy-factory" +version = "0.0.0" +dependencies = [ + "common_structs", + "legacy_token_decode_module", + "math", + "mergeable", + "multiversx-sc", + "multiversx-sc-modules", + "sc_whitelist_module", + "simple-lock", + "unwrappable", + "utils", +] + +[[package]] +name = "energy-query" +version = "0.0.0" +dependencies = [ + "energy-factory", + "multiversx-sc", +] + +[[package]] +name = "fixed-supply-token" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "legacy_token_decode_module" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "utils", +] + +[[package]] +name = "math" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "mergeable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9624cfb01497bf386d6b8837fa8e6785d45c8d4e122ba9c31060ecf5fce413" +dependencies = [ + "bitflags", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c94397b2fba14e40edfa55905b3f453ed57aa06c9b1960ad6a0ca6bfb7a236" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf72a8042da0bc19da0b8f0d4f61b4c66ae853560fefc69cd8fea87bf1aa8c14" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "754cdc20001c3b51df75784c5d8ce454697d0e86264f1d88da392ea211f662f9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25824610adec5b01c7b38cd469983940b33a7d11b2c0011af7ad572fe10ac1ae" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a7f031a91eb7360be47ad19c06ed1246486eb789ef8091df0646de85071f7d" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "proc-macro2" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "sc_whitelist_module" +version = "0.0.0" +dependencies = [ + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "simple-lock" +version = "0.0.0" +dependencies = [ + "common_structs", + "multiversx-sc", + "multiversx-sc-modules", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "syn" +version = "2.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "token-unstake" +version = "0.0.0" +dependencies = [ + "common_structs", + "energy-factory", + "energy-query", + "mergeable", + "multiversx-sc", + "simple-lock", + "utils", + "week-timekeeping", +] + +[[package]] +name = "token-unstake-wasm" +version = "0.0.0" +dependencies = [ + "multiversx-sc-wasm-adapter", + "token-unstake", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrap-infallible" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" + +[[package]] +name = "unwrappable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "utils" +version = "0.0.0" +dependencies = [ + "common_structs", + "fixed-supply-token", + "mergeable", + "multiversx-sc", +] + +[[package]] +name = "week-timekeeping" +version = "0.0.0" +dependencies = [ + "common-types", + "multiversx-sc", +] diff --git a/locked-asset/token-unstake/wasm/Cargo.toml b/locked-asset/token-unstake/wasm/Cargo.toml index 8e6772471..7c18f245e 100644 --- a/locked-asset/token-unstake/wasm/Cargo.toml +++ b/locked-asset/token-unstake/wasm/Cargo.toml @@ -21,11 +21,14 @@ debug = false panic = "abort" overflow-checks = false +[profile.dev] +panic = "abort" + [dependencies.token-unstake] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.49.0" +version = "=0.50.0" [workspace] members = ["."] diff --git a/locked-asset/token-unstake/wasm/src/lib.rs b/locked-asset/token-unstake/wasm/src/lib.rs index 81a2358bf..ea93ce423 100644 --- a/locked-asset/token-unstake/wasm/src/lib.rs +++ b/locked-asset/token-unstake/wasm/src/lib.rs @@ -8,11 +8,9 @@ // Upgrade: 1 // Endpoints: 10 // Async Callback (empty): 1 -// Total number of exported functions: 12 +// Total number of exported functions: 13 #![no_std] -#![allow(internal_features)] -#![feature(lang_items)] multiversx_sc_wasm_adapter::allocator!(); multiversx_sc_wasm_adapter::panic_handler!(); diff --git a/pause-all/Cargo.toml b/pause-all/Cargo.toml index 772845257..e16cf5ed3 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.49.0" +version = "=0.50.0" features = ["esdt-token-payment-legacy-decode"] [dependencies.multiversx-sc-modules] -version = "=0.49.0" +version = "=0.50.0" [dev-dependencies.multiversx-sc-scenario] -version = "=0.49.0" +version = "=0.50.0" [dev-dependencies.farm] path = "../dex/farm" diff --git a/pause-all/meta/Cargo.toml b/pause-all/meta/Cargo.toml index b913a60a3..3be3db838 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.49.0" +version = "0.50.0" default-features = false diff --git a/pause-all/wasm/Cargo.lock b/pause-all/wasm/Cargo.lock new file mode 100644 index 000000000..f3046ee4d --- /dev/null +++ b/pause-all/wasm/Cargo.lock @@ -0,0 +1,223 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "common_errors" +version = "0.0.0" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "endian-type" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "multiversx-sc" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9624cfb01497bf386d6b8837fa8e6785d45c8d4e122ba9c31060ecf5fce413" +dependencies = [ + "bitflags", + "hex-literal", + "multiversx-sc-codec", + "multiversx-sc-derive", + "num-traits", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c94397b2fba14e40edfa55905b3f453ed57aa06c9b1960ad6a0ca6bfb7a236" +dependencies = [ + "arrayvec", + "multiversx-sc-codec-derive", + "unwrap-infallible", +] + +[[package]] +name = "multiversx-sc-codec-derive" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf72a8042da0bc19da0b8f0d4f61b4c66ae853560fefc69cd8fea87bf1aa8c14" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "multiversx-sc-derive" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "754cdc20001c3b51df75784c5d8ce454697d0e86264f1d88da392ea211f662f9" +dependencies = [ + "hex", + "proc-macro2", + "quote", + "radix_trie", + "syn", +] + +[[package]] +name = "multiversx-sc-modules" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25824610adec5b01c7b38cd469983940b33a7d11b2c0011af7ad572fe10ac1ae" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "multiversx-sc-wasm-adapter" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a7f031a91eb7360be47ad19c06ed1246486eb789ef8091df0646de85071f7d" +dependencies = [ + "multiversx-sc", +] + +[[package]] +name = "nibble_vec" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +dependencies = [ + "smallvec", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "pausable" +version = "0.0.0" +dependencies = [ + "multiversx-sc", + "permissions_module", +] + +[[package]] +name = "pause-all" +version = "0.0.0" +dependencies = [ + "multiversx-sc", + "multiversx-sc-modules", + "pausable", +] + +[[package]] +name = "pause-all-wasm" +version = "0.0.0" +dependencies = [ + "multiversx-sc-wasm-adapter", + "pause-all", +] + +[[package]] +name = "permissions_module" +version = "0.0.0" +dependencies = [ + "bitflags", + "common_errors", + "multiversx-sc", +] + +[[package]] +name = "proc-macro2" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radix_trie" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" +dependencies = [ + "endian-type", + "nibble_vec", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "syn" +version = "2.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unwrap-infallible" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" diff --git a/pause-all/wasm/Cargo.toml b/pause-all/wasm/Cargo.toml index 27ad72626..66bd159c6 100644 --- a/pause-all/wasm/Cargo.toml +++ b/pause-all/wasm/Cargo.toml @@ -21,11 +21,14 @@ debug = false panic = "abort" overflow-checks = false +[profile.dev] +panic = "abort" + [dependencies.pause-all] path = ".." [dependencies.multiversx-sc-wasm-adapter] -version = "=0.49.0" +version = "=0.50.0" [workspace] members = ["."] diff --git a/pause-all/wasm/src/lib.rs b/pause-all/wasm/src/lib.rs index 0bd3bc7ff..88f01cb87 100644 --- a/pause-all/wasm/src/lib.rs +++ b/pause-all/wasm/src/lib.rs @@ -8,11 +8,9 @@ // Upgrade: 1 // Endpoints: 7 // Async Callback (empty): 1 -// Total number of exported functions: 9 +// 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!(); From 5fa59c6e7fdfaedceee2a674f29fe62e9d4e08fc Mon Sep 17 00:00:00 2001 From: Andrei Marinica Date: Fri, 10 May 2024 12:46:18 +0300 Subject: [PATCH 50/55] removed feature: trait_alias --- common/modules/farm/contexts/src/mod.rs | 1 - .../farm/contexts/src/storage_cache.rs | 11 ++++++++-- .../farm_base_impl/src/base_traits_impl.rs | 17 ++++++++++++-- common/modules/farm/farm_base_impl/src/lib.rs | 1 - .../weekly-rewards-splitting/src/base_impl.rs | 22 ++++++++++++++++--- .../weekly-rewards-splitting/src/lib.rs | 1 - .../farm-staking/src/base_impl_wrapper.rs | 18 +++++++++++++-- farm-staking/farm-staking/src/lib.rs | 1 - 8 files changed, 59 insertions(+), 13 deletions(-) diff --git a/common/modules/farm/contexts/src/mod.rs b/common/modules/farm/contexts/src/mod.rs index e8f133eb6..a1ceed191 100644 --- a/common/modules/farm/contexts/src/mod.rs +++ b/common/modules/farm/contexts/src/mod.rs @@ -1,5 +1,4 @@ #![no_std] -#![feature(trait_alias)] pub mod claim_rewards_context; pub mod enter_farm_context; diff --git a/common/modules/farm/contexts/src/storage_cache.rs b/common/modules/farm/contexts/src/storage_cache.rs index 4e14ea2ec..76f4cfc1d 100644 --- a/common/modules/farm/contexts/src/storage_cache.rs +++ b/common/modules/farm/contexts/src/storage_cache.rs @@ -3,8 +3,15 @@ multiversx_sc::derive_imports!(); use pausable::State; -pub trait FarmContracTraitBounds = - config::ConfigModule + rewards::RewardsModule + farm_token::FarmTokenModule; +pub trait FarmContracTraitBounds: + config::ConfigModule + rewards::RewardsModule + farm_token::FarmTokenModule +{ +} + +impl FarmContracTraitBounds for T where + T: config::ConfigModule + rewards::RewardsModule + farm_token::FarmTokenModule +{ +} pub struct StorageCache<'a, C: FarmContracTraitBounds> { sc_ref: &'a C, 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..38de1946a 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 @@ -4,18 +4,31 @@ use common_structs::{FarmToken, FarmTokenAttributes, Nonce}; use config::ConfigModule; use contexts::storage_cache::StorageCache; use core::marker::PhantomData; +use farm_token::FarmTokenModule; use fixed_supply_token::FixedSupplyToken; use mergeable::Mergeable; use multiversx_sc_modules::transfer_role_proxy::PaymentsVec; use rewards::RewardsModule; -pub trait AllBaseFarmImplTraits = +pub trait AllBaseFarmImplTraits: rewards::RewardsModule + + config::ConfigModule + + farm_token::FarmTokenModule + + permissions_module::PermissionsModule + + pausable::PausableModule + + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule +{ +} + +impl AllBaseFarmImplTraits for T where + T: rewards::RewardsModule + config::ConfigModule + farm_token::FarmTokenModule + permissions_module::PermissionsModule + pausable::PausableModule - + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule; + + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule +{ +} pub trait FarmContract { type FarmSc: AllBaseFarmImplTraits; diff --git a/common/modules/farm/farm_base_impl/src/lib.rs b/common/modules/farm/farm_base_impl/src/lib.rs index f63df2820..aeae3efaf 100644 --- a/common/modules/farm/farm_base_impl/src/lib.rs +++ b/common/modules/farm/farm_base_impl/src/lib.rs @@ -1,7 +1,6 @@ #![no_std] #![allow(clippy::too_many_arguments)] #![feature(exact_size_is_empty)] -#![feature(trait_alias)] #![feature(associated_type_defaults)] multiversx_sc::imports!(); diff --git a/energy-integration/common-modules/weekly-rewards-splitting/src/base_impl.rs b/energy-integration/common-modules/weekly-rewards-splitting/src/base_impl.rs index c8579672d..de8783686 100644 --- a/energy-integration/common-modules/weekly-rewards-splitting/src/base_impl.rs +++ b/energy-integration/common-modules/weekly-rewards-splitting/src/base_impl.rs @@ -3,16 +3,32 @@ multiversx_sc::imports!(); use common_types::PaymentsVec; use week_timekeeping::Week; -use crate::{events, ClaimProgress}; +use crate::{ + events, global_info::WeeklyRewardsGlobalInfo, + update_claim_progress_energy::UpdateClaimProgressEnergyModule, ClaimProgress, +}; -pub trait AllBaseWeeklyRewardsSplittingImplTraits = +pub trait AllBaseWeeklyRewardsSplittingImplTraits: crate::WeeklyRewardsSplittingModule + + energy_query::EnergyQueryModule + + week_timekeeping::WeekTimekeepingModule + + crate::global_info::WeeklyRewardsGlobalInfo + + crate::locked_token_buckets::WeeklyRewardsLockedTokenBucketsModule + + events::WeeklyRewardsSplittingEventsModule + + crate::update_claim_progress_energy::UpdateClaimProgressEnergyModule +{ +} + +impl AllBaseWeeklyRewardsSplittingImplTraits for T where + T: crate::WeeklyRewardsSplittingModule + energy_query::EnergyQueryModule + week_timekeeping::WeekTimekeepingModule + crate::global_info::WeeklyRewardsGlobalInfo + crate::locked_token_buckets::WeeklyRewardsLockedTokenBucketsModule + events::WeeklyRewardsSplittingEventsModule - + crate::update_claim_progress_energy::UpdateClaimProgressEnergyModule; + + crate::update_claim_progress_energy::UpdateClaimProgressEnergyModule +{ +} pub trait WeeklyRewardsSplittingTraitsModule { type WeeklyRewardsSplittingMod: AllBaseWeeklyRewardsSplittingImplTraits; diff --git a/energy-integration/common-modules/weekly-rewards-splitting/src/lib.rs b/energy-integration/common-modules/weekly-rewards-splitting/src/lib.rs index 9268023bd..ba3c02d56 100644 --- a/energy-integration/common-modules/weekly-rewards-splitting/src/lib.rs +++ b/energy-integration/common-modules/weekly-rewards-splitting/src/lib.rs @@ -1,5 +1,4 @@ #![no_std] -#![feature(trait_alias)] #![feature(int_roundings)] multiversx_sc::imports!(); diff --git a/farm-staking/farm-staking/src/base_impl_wrapper.rs b/farm-staking/farm-staking/src/base_impl_wrapper.rs index 2b671677f..357d2f048 100644 --- a/farm-staking/farm-staking/src/base_impl_wrapper.rs +++ b/farm-staking/farm-staking/src/base_impl_wrapper.rs @@ -9,15 +9,29 @@ use multiversx_sc_modules::transfer_role_proxy::PaymentsVec; use crate::token_attributes::StakingFarmTokenAttributes; -pub trait FarmStakingTraits = +pub trait FarmStakingTraits: crate::custom_rewards::CustomRewardsModule + + rewards::RewardsModule + + config::ConfigModule + + farm_token::FarmTokenModule + + pausable::PausableModule + + permissions_module::PermissionsModule + + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule + + farm_boosted_yields::FarmBoostedYieldsModule +{ +} + +impl FarmStakingTraits for T where + T: crate::custom_rewards::CustomRewardsModule + rewards::RewardsModule + config::ConfigModule + farm_token::FarmTokenModule + pausable::PausableModule + permissions_module::PermissionsModule + multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule - + farm_boosted_yields::FarmBoostedYieldsModule; + + farm_boosted_yields::FarmBoostedYieldsModule +{ +} pub struct FarmStakingWrapper where diff --git a/farm-staking/farm-staking/src/lib.rs b/farm-staking/farm-staking/src/lib.rs index 5d321d8ad..5fa3f120d 100644 --- a/farm-staking/farm-staking/src/lib.rs +++ b/farm-staking/farm-staking/src/lib.rs @@ -1,6 +1,5 @@ #![no_std] #![allow(clippy::from_over_into)] -#![feature(trait_alias)] multiversx_sc::imports!(); multiversx_sc::derive_imports!(); From bb0f3391c638ffa3fba8fdbd9ec933e443030e62 Mon Sep 17 00:00:00 2001 From: Andrei Marinica Date: Fri, 10 May 2024 12:58:01 +0300 Subject: [PATCH 51/55] removed feature: exact_size_is_empty --- common/modules/farm/farm_base_impl/src/lib.rs | 1 - dex/farm-with-locked-rewards/src/lib.rs | 1 - dex/farm/src/lib.rs | 1 - locked-asset/factory/src/lib.rs | 1 - locked-asset/factory/src/locked_asset_token_merge.rs | 2 +- locked-asset/proxy_dex/src/lib.rs | 1 - 6 files changed, 1 insertion(+), 6 deletions(-) diff --git a/common/modules/farm/farm_base_impl/src/lib.rs b/common/modules/farm/farm_base_impl/src/lib.rs index aeae3efaf..c3f3e46b9 100644 --- a/common/modules/farm/farm_base_impl/src/lib.rs +++ b/common/modules/farm/farm_base_impl/src/lib.rs @@ -1,6 +1,5 @@ #![no_std] #![allow(clippy::too_many_arguments)] -#![feature(exact_size_is_empty)] #![feature(associated_type_defaults)] multiversx_sc::imports!(); diff --git a/dex/farm-with-locked-rewards/src/lib.rs b/dex/farm-with-locked-rewards/src/lib.rs index 6b5b334a2..a6e97e203 100644 --- a/dex/farm-with-locked-rewards/src/lib.rs +++ b/dex/farm-with-locked-rewards/src/lib.rs @@ -1,6 +1,5 @@ #![no_std] #![allow(clippy::too_many_arguments)] -#![feature(exact_size_is_empty)] multiversx_sc::imports!(); multiversx_sc::derive_imports!(); diff --git a/dex/farm/src/lib.rs b/dex/farm/src/lib.rs index 0472872bf..9904af34f 100644 --- a/dex/farm/src/lib.rs +++ b/dex/farm/src/lib.rs @@ -1,6 +1,5 @@ #![no_std] #![allow(clippy::too_many_arguments)] -#![feature(exact_size_is_empty)] multiversx_sc::imports!(); multiversx_sc::derive_imports!(); diff --git a/locked-asset/factory/src/lib.rs b/locked-asset/factory/src/lib.rs index 8cbf8b36c..1c5ffc5d4 100644 --- a/locked-asset/factory/src/lib.rs +++ b/locked-asset/factory/src/lib.rs @@ -1,5 +1,4 @@ #![no_std] -#![feature(exact_size_is_empty)] mod attr_ex_helper; mod cache; diff --git a/locked-asset/factory/src/locked_asset_token_merge.rs b/locked-asset/factory/src/locked_asset_token_merge.rs index 995d13528..f6345b183 100644 --- a/locked-asset/factory/src/locked_asset_token_merge.rs +++ b/locked-asset/factory/src/locked_asset_token_merge.rs @@ -49,7 +49,7 @@ pub trait LockedAssetTokenMergeModule: &self, payments: ManagedVecRefIterator>, ) -> (BigUint, LockedAssetTokenAttributesEx) { - require!(!payments.is_empty(), "Cannot merge with 0 tokens"); + require!(payments.len() > 0, "Cannot merge with 0 tokens"); let mut tokens = ManagedVec::new(); let mut sum_amount = BigUint::zero(); diff --git a/locked-asset/proxy_dex/src/lib.rs b/locked-asset/proxy_dex/src/lib.rs index 3fd6d99f7..fab31b15a 100644 --- a/locked-asset/proxy_dex/src/lib.rs +++ b/locked-asset/proxy_dex/src/lib.rs @@ -1,6 +1,5 @@ #![no_std] #![allow(clippy::too_many_arguments)] -#![feature(exact_size_is_empty)] multiversx_sc::imports!(); multiversx_sc::derive_imports!(); From 28d2b994850aa3eb83153cbd29914f3d5b348551 Mon Sep 17 00:00:00 2001 From: Andrei Marinica Date: Fri, 10 May 2024 12:59:54 +0300 Subject: [PATCH 52/55] removed feature: int_roundings --- .../common-modules/weekly-rewards-splitting/src/lib.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/energy-integration/common-modules/weekly-rewards-splitting/src/lib.rs b/energy-integration/common-modules/weekly-rewards-splitting/src/lib.rs index ba3c02d56..456bf60d2 100644 --- a/energy-integration/common-modules/weekly-rewards-splitting/src/lib.rs +++ b/energy-integration/common-modules/weekly-rewards-splitting/src/lib.rs @@ -1,5 +1,4 @@ #![no_std] -#![feature(int_roundings)] multiversx_sc::imports!(); multiversx_sc::derive_imports!(); From 6ffe0476879fde4f79921b9531c9e7765fe0e8db Mon Sep 17 00:00:00 2001 From: Andrei Marinica Date: Fri, 10 May 2024 13:11:18 +0300 Subject: [PATCH 53/55] removed feature: associated_type_defaults --- common/modules/farm/farm_base_impl/src/base_traits_impl.rs | 5 +++-- common/modules/farm/farm_base_impl/src/lib.rs | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/modules/farm/farm_base_impl/src/base_traits_impl.rs b/common/modules/farm/farm_base_impl/src/base_traits_impl.rs index 38de1946a..fec015bc3 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 @@ -43,8 +43,7 @@ pub trait FarmContract { + FixedSupplyToken<::Api> + FarmToken<::Api> + From::Api>> - + Into::Api>> = - FarmTokenAttributes<::Api>; + + Into::Api>>; #[inline] fn mint_rewards( @@ -272,4 +271,6 @@ where T: AllBaseFarmImplTraits, { type FarmSc = T; + + type AttributesType = FarmTokenAttributes<::Api>; } diff --git a/common/modules/farm/farm_base_impl/src/lib.rs b/common/modules/farm/farm_base_impl/src/lib.rs index c3f3e46b9..00c0d2672 100644 --- a/common/modules/farm/farm_base_impl/src/lib.rs +++ b/common/modules/farm/farm_base_impl/src/lib.rs @@ -1,6 +1,5 @@ #![no_std] #![allow(clippy::too_many_arguments)] -#![feature(associated_type_defaults)] multiversx_sc::imports!(); multiversx_sc::derive_imports!(); From acc527e6868efa6cbf150e9bd6e878b5def1859d Mon Sep 17 00:00:00 2001 From: Andrei Marinica Date: Fri, 10 May 2024 13:12:24 +0300 Subject: [PATCH 54/55] warning fix --- energy-integration/governance-v2/tests/gov_test_setup/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/energy-integration/governance-v2/tests/gov_test_setup/mod.rs b/energy-integration/governance-v2/tests/gov_test_setup/mod.rs index 489fec3b3..b461d2faa 100644 --- a/energy-integration/governance-v2/tests/gov_test_setup/mod.rs +++ b/energy-integration/governance-v2/tests/gov_test_setup/mod.rs @@ -35,6 +35,7 @@ pub const USER_ENERGY: u64 = 1_000_000; pub const GAS_LIMIT: u64 = 1_000_000; #[derive(Clone)] +#[allow(dead_code)] pub struct Payment { pub token: Vec, pub nonce: u64, From 3a75566a5131a3eef7c8d0972bb8f05f693e0973 Mon Sep 17 00:00:00 2001 From: Mihai Calin Luca Date: Fri, 10 May 2024 12:37:36 +0200 Subject: [PATCH 55/55] proxy regen and sc-config proxy paths fix --- Cargo.lock | 1 + dex/farm-with-locked-rewards/sc-config.toml | 2 +- dex/interactor/Cargo.toml | 3 + .../proxies/src/energy_factory_proxy.rs | 100 ++++++--- .../src/farm_staking_proxy_sc_proxy.rs | 57 +++-- ...king_proxy.rs => farm_staking_sc_proxy.rs} | 206 +++++++++++------- .../src/farm_with_locked_rewards_proxy.rs | 203 +++++++++++------ dex/interactor/proxies/src/lib.rs | 4 +- dex/interactor/proxies/src/pair_proxy.rs | 194 +++++++++++------ dex/interactor/proxies/src/router_proxy.rs | 101 ++++++--- dex/pair/sc-config.toml | 3 + dex/router/sc-config.toml | 2 +- dex/router/src/pair_proxy.rs | 193 ++++++++++------ .../farm-staking-proxy/sc-config.toml | 2 +- farm-staking/farm-staking/sc-config.toml | 2 +- locked-asset/energy-factory/sc-config.toml | 2 +- 16 files changed, 705 insertions(+), 370 deletions(-) rename dex/interactor/proxies/src/{farm_staking_proxy.rs => farm_staking_sc_proxy.rs} (72%) diff --git a/Cargo.lock b/Cargo.lock index cf6385f5a..a2b9faaf8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1482,6 +1482,7 @@ version = "0.0.0" dependencies = [ "clap", "common_structs", + "multiversx-sc", "multiversx-sc-modules", "multiversx-sc-scenario", "multiversx-sc-snippets", diff --git a/dex/farm-with-locked-rewards/sc-config.toml b/dex/farm-with-locked-rewards/sc-config.toml index 4fcffdbfc..ae510f3aa 100644 --- a/dex/farm-with-locked-rewards/sc-config.toml +++ b/dex/farm-with-locked-rewards/sc-config.toml @@ -1,2 +1,2 @@ [[proxy]] -path = "../interactor/src/farm_with_locked_rewards_proxy.rs" +path = "../interactor/proxies/src/farm_with_locked_rewards_proxy.rs" diff --git a/dex/interactor/Cargo.toml b/dex/interactor/Cargo.toml index 94b2ee63b..18419b3f0 100644 --- a/dex/interactor/Cargo.toml +++ b/dex/interactor/Cargo.toml @@ -14,6 +14,9 @@ clap = { version = "4.4.7", features = ["derive"] } serde = { version = "1.0", features = ["derive"] } toml = "0.8.6" +[dependencies.multiversx-sc] +version = "=0.50.0" + [dependencies.multiversx-sc-modules] version = "=0.50.0" diff --git a/dex/interactor/proxies/src/energy_factory_proxy.rs b/dex/interactor/proxies/src/energy_factory_proxy.rs index bf98cb7bd..d594b83d7 100644 --- a/dex/interactor/proxies/src/energy_factory_proxy.rs +++ b/dex/interactor/proxies/src/energy_factory_proxy.rs @@ -8,7 +8,6 @@ #![allow(clippy::all)] use multiversx_sc::proxy_imports::*; -use multiversx_sc_scenario::multiversx_sc; pub struct SimpleLockEnergyProxy; @@ -66,8 +65,9 @@ where old_locked_asset_factory_address: Arg2, min_migrated_token_locked_period: Arg3, lock_options: Arg4, - ) -> TxProxyDeploy { + ) -> TxTypedDeploy { self.wrapped_tx + .payment(NotPayable) .raw_deploy() .argument(&base_asset_token_id) .argument(&legacy_token_id) @@ -89,8 +89,9 @@ where { pub fn upgrade( self, - ) -> TxProxyUpgrade { + ) -> TxTypedUpgrade { self.wrapped_tx + .payment(NotPayable) .raw_upgrade() .original_result() } @@ -125,7 +126,7 @@ where self, lock_epochs: Arg0, opt_destination: Arg1, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx .raw_call("lockTokens") .argument(&lock_epochs) @@ -140,7 +141,7 @@ where /// Output payments: the originally locked tokens pub fn unlock_tokens_endpoint( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx .raw_call("unlockTokens") .original_result() @@ -154,7 +155,7 @@ where self, lock_epochs: Arg0, user: Arg1, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx .raw_call("extendLockPeriod") .argument(&lock_epochs) @@ -171,7 +172,7 @@ where token_display_name: Arg0, token_ticker: Arg1, num_decimals: Arg2, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx .raw_call("issueLockedToken") .argument(&token_display_name) @@ -182,24 +183,27 @@ where pub fn locked_token( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getLockedTokenId") .original_result() } pub fn base_asset_token_id( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getBaseAssetTokenId") .original_result() } pub fn legacy_locked_token_id( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getLegacyLockedTokenId") .original_result() } @@ -209,8 +213,9 @@ where >( self, user: Arg0, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getEnergyEntryForUser") .argument(&user) .original_result() @@ -221,8 +226,9 @@ where >( self, user: Arg0, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getEnergyAmountForUser") .argument(&user) .original_result() @@ -244,8 +250,9 @@ where >( self, new_lock_options: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("addLockOptions") .argument(&new_lock_options) .original_result() @@ -253,8 +260,9 @@ where pub fn get_lock_options_view( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getLockOptions") .original_result() } @@ -264,7 +272,7 @@ where /// Tokens can be unlocked through another SC after the unbond period has passed. pub fn unlock_early( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx .raw_call("unlockEarly") .original_result() @@ -278,7 +286,7 @@ where >( self, new_lock_period: Arg0, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx .raw_call("reduceLockPeriod") .argument(&new_lock_period) @@ -297,8 +305,9 @@ where token_amount: Arg0, prev_lock_epochs: Arg1, new_lock_epochs: Arg2, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getPenaltyAmount") .argument(&token_amount) .argument(&prev_lock_epochs) @@ -313,8 +322,9 @@ where >( self, sc_address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setTokenUnstakeAddress") .argument(&sc_address) .original_result() @@ -327,7 +337,7 @@ where self, user: Arg0, new_energy: Arg1, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx .raw_call("revertUnstake") .argument(&user) @@ -337,8 +347,9 @@ where pub fn token_unstake_sc_address( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getTokenUnstakeScAddress") .original_result() } @@ -350,8 +361,9 @@ where >( self, users_energy: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setEnergyForOldTokens") .argument(&users_energy) .original_result() @@ -366,8 +378,9 @@ where original_caller: Arg0, initial_epoch_amount_pairs: Arg1, final_epoch_amount_pairs: Arg2, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("updateEnergyAfterOldTokenUnlock") .argument(&original_caller) .argument(&initial_epoch_amount_pairs) @@ -377,7 +390,7 @@ where pub fn migrate_old_tokens( self, - ) -> TxProxyCall>> { + ) -> TxTypedCall>> { self.wrapped_tx .raw_call("migrateOldTokens") .original_result() @@ -385,24 +398,27 @@ where pub fn pause_endpoint( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("pause") .original_result() } pub fn unpause_endpoint( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("unpause") .original_result() } pub fn paused_status( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("isPaused") .original_result() } @@ -413,8 +429,9 @@ where >( self, opt_address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setTransferRoleLockedToken") .argument(&opt_address) .original_result() @@ -426,8 +443,9 @@ where >( self, address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setBurnRoleLockedToken") .argument(&address) .original_result() @@ -438,7 +456,7 @@ where >( self, opt_original_caller: Arg0, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx .raw_call("mergeTokens") .argument(&opt_original_caller) @@ -458,8 +476,9 @@ where lock_epochs: Arg2, dest_address: Arg3, energy_address: Arg4, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("lockVirtual") .argument(&token_id) .argument(&amount) @@ -474,8 +493,9 @@ where >( self, address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("addSCAddressToWhitelist") .argument(&address) .original_result() @@ -486,8 +506,9 @@ where >( self, address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("removeSCAddressFromWhitelist") .argument(&address) .original_result() @@ -498,8 +519,9 @@ where >( self, address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("isSCAddressWhitelisted") .argument(&address) .original_result() @@ -510,8 +532,9 @@ where >( self, sc_addresses: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("addToTokenTransferWhitelist") .argument(&sc_addresses) .original_result() @@ -522,8 +545,9 @@ where >( self, sc_addresses: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("removeFromTokenTransferWhitelist") .argument(&sc_addresses) .original_result() @@ -536,8 +560,9 @@ where self, user: Arg0, energy: Arg1, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setUserEnergyAfterLockedTokenTransfer") .argument(&user) .argument(&energy) @@ -545,6 +570,7 @@ where } } +#[type_abi] #[derive(TopEncode, TopDecode, NestedEncode, NestedDecode, Clone, PartialEq, Debug)] pub struct Energy where @@ -555,12 +581,14 @@ where pub total_locked_tokens: BigUint, } +#[type_abi] #[derive(TopEncode, TopDecode)] pub struct LockOption { pub lock_epochs: u64, pub penalty_start_percentage: u64, } +#[type_abi] #[derive(TopEncode, TopDecode)] pub struct EnergyUpdatedEvent where diff --git a/dex/interactor/proxies/src/farm_staking_proxy_sc_proxy.rs b/dex/interactor/proxies/src/farm_staking_proxy_sc_proxy.rs index 79f082290..83461b9b7 100644 --- a/dex/interactor/proxies/src/farm_staking_proxy_sc_proxy.rs +++ b/dex/interactor/proxies/src/farm_staking_proxy_sc_proxy.rs @@ -8,7 +8,6 @@ #![allow(clippy::all)] use multiversx_sc::proxy_imports::*; -use multiversx_sc_scenario::multiversx_sc; pub struct FarmStakingProxyProxy; @@ -63,8 +62,9 @@ where lp_farm_token_id: Arg5, staking_farm_token_id: Arg6, lp_token_id: Arg7, - ) -> TxProxyDeploy { + ) -> TxTypedDeploy { self.wrapped_tx + .payment(NotPayable) .raw_deploy() .argument(&energy_factory_address) .argument(&lp_farm_address) @@ -89,8 +89,9 @@ where { pub fn upgrade( self, - ) -> TxProxyUpgrade { + ) -> TxTypedUpgrade { self.wrapped_tx + .payment(NotPayable) .raw_upgrade() .original_result() } @@ -114,7 +115,7 @@ where token_display_name: Arg0, token_ticker: Arg1, num_decimals: Arg2, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx .raw_call("registerDualYieldToken") .argument(&token_display_name) @@ -125,64 +126,72 @@ where pub fn dual_yield_token( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getDualYieldTokenId") .original_result() } pub fn lp_farm_address( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getLpFarmAddress") .original_result() } pub fn staking_farm_address( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getStakingFarmAddress") .original_result() } pub fn pair_address( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getPairAddress") .original_result() } pub fn staking_token_id( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getStakingTokenId") .original_result() } pub fn staking_farm_token_id( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getFarmTokenId") .original_result() } pub fn lp_token_id( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getLpTokenId") .original_result() } pub fn lp_farm_token_id( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getLpFarmTokenId") .original_result() } @@ -192,8 +201,9 @@ where >( self, sc_address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setEnergyFactoryAddress") .argument(&sc_address) .original_result() @@ -201,8 +211,9 @@ where pub fn energy_factory_address( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getEnergyFactoryAddress") .original_result() } @@ -212,8 +223,9 @@ where >( self, address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("addSCAddressToWhitelist") .argument(&address) .original_result() @@ -224,8 +236,9 @@ where >( self, address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("removeSCAddressFromWhitelist") .argument(&address) .original_result() @@ -236,8 +249,9 @@ where >( self, address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("isSCAddressWhitelisted") .argument(&address) .original_result() @@ -248,7 +262,7 @@ where >( self, opt_orig_caller: Arg0, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx .raw_call("stakeFarmTokens") .argument(&opt_orig_caller) @@ -260,7 +274,7 @@ where >( self, opt_orig_caller: Arg0, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx .raw_call("claimDualYield") .argument(&opt_orig_caller) @@ -276,7 +290,7 @@ where pair_first_token_min_amount: Arg0, pair_second_token_min_amount: Arg1, opt_orig_caller: Arg2, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx .raw_call("unstakeFarmTokens") .argument(&pair_first_token_min_amount) @@ -286,6 +300,7 @@ where } } +#[type_abi] #[derive(TopEncode, TopDecode)] pub struct StakeProxyResult where @@ -296,6 +311,7 @@ where pub lp_farm_boosted_rewards: EsdtTokenPayment, } +#[type_abi] #[derive(TopEncode, TopDecode)] pub struct ClaimDualYieldResult where @@ -306,6 +322,7 @@ where pub new_dual_yield_tokens: EsdtTokenPayment, } +#[type_abi] #[derive(TopEncode, TopDecode)] pub struct UnstakeResult where diff --git a/dex/interactor/proxies/src/farm_staking_proxy.rs b/dex/interactor/proxies/src/farm_staking_sc_proxy.rs similarity index 72% rename from dex/interactor/proxies/src/farm_staking_proxy.rs rename to dex/interactor/proxies/src/farm_staking_sc_proxy.rs index a86c13c6c..63a0bc9ab 100644 --- a/dex/interactor/proxies/src/farm_staking_proxy.rs +++ b/dex/interactor/proxies/src/farm_staking_sc_proxy.rs @@ -8,7 +8,6 @@ #![allow(clippy::all)] use multiversx_sc::proxy_imports::*; -use multiversx_sc_scenario::multiversx_sc; pub struct FarmStakingProxy; @@ -59,8 +58,9 @@ where min_unbond_epochs: Arg3, owner: Arg4, admins: Arg5, - ) -> TxProxyDeploy { + ) -> TxTypedDeploy { self.wrapped_tx + .payment(NotPayable) .raw_deploy() .argument(&farming_token_id) .argument(&division_safety_constant) @@ -83,8 +83,9 @@ where { pub fn upgrade( self, - ) -> TxProxyUpgrade { + ) -> TxTypedUpgrade { self.wrapped_tx + .payment(NotPayable) .raw_upgrade() .original_result() } @@ -101,7 +102,7 @@ where { pub fn merge_farm_tokens_endpoint( self, - ) -> TxProxyCall, EsdtTokenPayment>> { + ) -> TxTypedCall, EsdtTokenPayment>> { self.wrapped_tx .raw_call("mergeFarmTokens") .original_result() @@ -112,8 +113,9 @@ where >( self, percentage: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setBoostedYieldsRewardsPercentage") .argument(&percentage) .original_result() @@ -126,8 +128,9 @@ where self, farm_token_amount: Arg0, attributes: Arg1, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("calculateRewardsForGivenPosition") .argument(&farm_token_amount) .argument(&attributes) @@ -136,7 +139,7 @@ where pub fn top_up_rewards( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx .raw_call("topUpRewards") .original_result() @@ -147,7 +150,7 @@ where >( self, withdraw_amount: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx .raw_call("withdrawRewards") .argument(&withdraw_amount) @@ -156,8 +159,9 @@ where pub fn end_produce_rewards( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("endProduceRewards") .original_result() } @@ -167,8 +171,9 @@ where >( self, per_block_amount: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setPerBlockRewardAmount") .argument(&per_block_amount) .original_result() @@ -179,8 +184,9 @@ where >( self, max_apr: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setMaxApr") .argument(&max_apr) .original_result() @@ -191,8 +197,9 @@ where >( self, min_unbond_epochs: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setMinUnbondEpochs") .argument(&min_unbond_epochs) .original_result() @@ -200,56 +207,63 @@ where pub fn start_produce_rewards_endpoint( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("startProduceRewards") .original_result() } pub fn accumulated_rewards( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getAccumulatedRewards") .original_result() } pub fn reward_capacity( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getRewardCapacity") .original_result() } pub fn max_annual_percentage_rewards( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getAnnualPercentageRewards") .original_result() } pub fn min_unbond_epochs( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getMinUnbondEpochs") .original_result() } pub fn reward_per_share( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getRewardPerShare") .original_result() } pub fn reward_reserve( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getRewardReserve") .original_result() } @@ -259,8 +273,9 @@ where >( self, allow_external_claim: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("allowExternalClaimBoostedRewards") .argument(&allow_external_claim) .original_result() @@ -271,8 +286,9 @@ where >( self, user: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getAllowExternalClaimRewards") .argument(&user) .original_result() @@ -280,40 +296,45 @@ where pub fn farming_token_id( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getFarmingTokenId") .original_result() } pub fn reward_token_id( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getRewardTokenId") .original_result() } pub fn per_block_reward_amount( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getPerBlockRewardAmount") .original_result() } pub fn last_reward_block_nonce( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getLastRewardBlockNonce") .original_result() } pub fn division_safety_constant( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getDivisionSafetyConstant") .original_result() } @@ -323,8 +344,9 @@ where >( self, user: Arg0, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getUserTotalFarmPosition") .argument(&user) .original_result() @@ -332,8 +354,9 @@ where pub fn farm_position_migration_nonce( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getFarmPositionMigrationNonce") .original_result() } @@ -347,7 +370,7 @@ where token_display_name: Arg0, token_ticker: Arg1, num_decimals: Arg2, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx .raw_call("registerFarmToken") .argument(&token_display_name) @@ -358,16 +381,18 @@ where pub fn farm_token( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getFarmTokenId") .original_result() } pub fn farm_token_supply( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getFarmTokenSupply") .original_result() } @@ -377,8 +402,9 @@ where >( self, address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("addSCAddressToWhitelist") .argument(&address) .original_result() @@ -389,8 +415,9 @@ where >( self, address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("removeSCAddressFromWhitelist") .argument(&address) .original_result() @@ -401,8 +428,9 @@ where >( self, address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("isSCAddressWhitelisted") .argument(&address) .original_result() @@ -413,8 +441,9 @@ where >( self, address_list: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("addToPauseWhitelist") .argument(&address_list) .original_result() @@ -425,8 +454,9 @@ where >( self, address_list: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("removeFromPauseWhitelist") .argument(&address_list) .original_result() @@ -434,24 +464,27 @@ where pub fn pause( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("pause") .original_result() } pub fn resume( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("resume") .original_result() } pub fn state( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getState") .original_result() } @@ -461,8 +494,9 @@ where >( self, address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("addAdmin") .argument(&address) .original_result() @@ -473,8 +507,9 @@ where >( self, address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("removeAdmin") .argument(&address) .original_result() @@ -485,8 +520,9 @@ where >( self, previous_owner: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("updateOwnerOrAdmin") .argument(&previous_owner) .original_result() @@ -497,8 +533,9 @@ where >( self, address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getPermissions") .argument(&address) .original_result() @@ -509,8 +546,9 @@ where >( self, address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setBurnRoleForAddress") .argument(&address) .original_result() @@ -523,7 +561,7 @@ where self, staked_token_amount: Arg0, original_caller: Arg1, - ) -> TxProxyCall, EsdtTokenPayment>> { + ) -> TxTypedCall, EsdtTokenPayment>> { self.wrapped_tx .raw_call("stakeFarmThroughProxy") .argument(&staked_token_amount) @@ -536,7 +574,7 @@ where >( self, opt_original_caller: Arg0, - ) -> TxProxyCall, EsdtTokenPayment>> { + ) -> TxTypedCall, EsdtTokenPayment>> { self.wrapped_tx .raw_call("stakeFarm") .argument(&opt_original_caller) @@ -548,7 +586,7 @@ where >( self, opt_original_caller: Arg0, - ) -> TxProxyCall, EsdtTokenPayment>> { + ) -> TxTypedCall, EsdtTokenPayment>> { self.wrapped_tx .raw_call("claimRewards") .argument(&opt_original_caller) @@ -562,7 +600,7 @@ where self, new_farming_amount: Arg0, original_caller: Arg1, - ) -> TxProxyCall, EsdtTokenPayment>> { + ) -> TxTypedCall, EsdtTokenPayment>> { self.wrapped_tx .raw_call("claimRewardsWithNewValue") .argument(&new_farming_amount) @@ -572,7 +610,7 @@ where pub fn compound_rewards( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx .raw_call("compoundRewards") .original_result() @@ -583,7 +621,7 @@ where >( self, opt_original_caller: Arg0, - ) -> TxProxyCall, EsdtTokenPayment>> { + ) -> TxTypedCall, EsdtTokenPayment>> { self.wrapped_tx .raw_call("unstakeFarm") .argument(&opt_original_caller) @@ -595,7 +633,7 @@ where >( self, original_caller: Arg0, - ) -> TxProxyCall, EsdtTokenPayment>> { + ) -> TxTypedCall, EsdtTokenPayment>> { self.wrapped_tx .raw_call("unstakeFarmThroughProxy") .argument(&original_caller) @@ -604,7 +642,7 @@ where pub fn unbond_farm( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx .raw_call("unbondFarm") .original_result() @@ -615,8 +653,9 @@ where >( self, opt_user: Arg0, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("claimBoostedRewards") .argument(&opt_user) .original_result() @@ -624,16 +663,18 @@ where pub fn collect_undistributed_boosted_rewards( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("collectUndistributedBoostedRewards") .original_result() } pub fn boosted_yields_rewards_percentage( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getBoostedYieldsRewardsPercentage") .original_result() } @@ -643,8 +684,9 @@ where >( self, week: Arg0, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getAccumulatedRewardsForWeek") .argument(&week) .original_result() @@ -655,8 +697,9 @@ where >( self, week: Arg0, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getFarmSupplyForWeek") .argument(&week) .original_result() @@ -667,8 +710,9 @@ where >( self, week: Arg0, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getRemainingBoostedRewardsToDistribute") .argument(&week) .original_result() @@ -676,8 +720,9 @@ where pub fn undistributed_boosted_rewards( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getUndistributedBoostedRewards") .original_result() } @@ -695,8 +740,9 @@ where user_rewards_farm_const: Arg2, min_energy_amount: Arg3, min_farm_amount: Arg4, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setBoostedYieldsFactors") .argument(&max_rewards_factor) .argument(&user_rewards_energy_const) @@ -708,8 +754,9 @@ where pub fn get_boosted_yields_factors( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getBoostedYieldsFactors") .original_result() } @@ -717,16 +764,18 @@ where /// Week starts from 1 pub fn get_current_week( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getCurrentWeek") .original_result() } pub fn first_week_start_epoch( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getFirstWeekStartEpoch") .original_result() } @@ -736,8 +785,9 @@ where >( self, user: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getLastActiveWeekForUser") .argument(&user) .original_result() @@ -750,8 +800,9 @@ where self, user: Arg0, week: Arg1, - ) -> TxProxyCall>> { + ) -> TxTypedCall>> { self.wrapped_tx + .payment(NotPayable) .raw_call("getUserEnergyForWeek") .argument(&user) .argument(&week) @@ -760,8 +811,9 @@ where pub fn last_global_update_week( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getLastGlobalUpdateWeek") .original_result() } @@ -771,8 +823,9 @@ where >( self, week: Arg0, - ) -> TxProxyCall>> { + ) -> TxTypedCall>> { self.wrapped_tx + .payment(NotPayable) .raw_call("getTotalRewardsForWeek") .argument(&week) .original_result() @@ -783,8 +836,9 @@ where >( self, week: Arg0, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getTotalEnergyForWeek") .argument(&week) .original_result() @@ -795,8 +849,9 @@ where >( self, week: Arg0, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getTotalLockedTokensForWeek") .argument(&week) .original_result() @@ -807,8 +862,9 @@ where >( self, user: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("updateEnergyForUser") .argument(&user) .original_result() @@ -819,8 +875,9 @@ where >( self, user: Arg0, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getCurrentClaimProgress") .argument(&user) .original_result() @@ -831,8 +888,9 @@ where >( self, sc_address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setEnergyFactoryAddress") .argument(&sc_address) .original_result() @@ -840,13 +898,15 @@ where pub fn energy_factory_address( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getEnergyFactoryAddress") .original_result() } } +#[type_abi] #[derive(TopEncode, TopDecode)] pub struct StakingFarmTokenAttributes where diff --git a/dex/interactor/proxies/src/farm_with_locked_rewards_proxy.rs b/dex/interactor/proxies/src/farm_with_locked_rewards_proxy.rs index cf6f8838c..aec16b897 100644 --- a/dex/interactor/proxies/src/farm_with_locked_rewards_proxy.rs +++ b/dex/interactor/proxies/src/farm_with_locked_rewards_proxy.rs @@ -8,7 +8,6 @@ #![allow(clippy::all)] use multiversx_sc::proxy_imports::*; -use multiversx_sc_scenario::multiversx_sc; pub struct FarmProxy; @@ -59,8 +58,9 @@ where pair_contract_address: Arg3, owner: Arg4, admins: Arg5, - ) -> TxProxyDeploy { + ) -> TxTypedDeploy { self.wrapped_tx + .payment(NotPayable) .raw_deploy() .argument(&reward_token_id) .argument(&farming_token_id) @@ -83,8 +83,9 @@ where { pub fn upgrade( self, - ) -> TxProxyUpgrade { + ) -> TxTypedUpgrade { self.wrapped_tx + .payment(NotPayable) .raw_upgrade() .original_result() } @@ -104,7 +105,7 @@ where >( self, opt_orig_caller: Arg0, - ) -> TxProxyCall, EsdtTokenPayment>> { + ) -> TxTypedCall, EsdtTokenPayment>> { self.wrapped_tx .raw_call("enterFarm") .argument(&opt_orig_caller) @@ -116,7 +117,7 @@ where >( self, opt_orig_caller: Arg0, - ) -> TxProxyCall, EsdtTokenPayment>> { + ) -> TxTypedCall, EsdtTokenPayment>> { self.wrapped_tx .raw_call("claimRewards") .argument(&opt_orig_caller) @@ -128,7 +129,7 @@ where >( self, opt_orig_caller: Arg0, - ) -> TxProxyCall, EsdtTokenPayment>> { + ) -> TxTypedCall, EsdtTokenPayment>> { self.wrapped_tx .raw_call("exitFarm") .argument(&opt_orig_caller) @@ -140,7 +141,7 @@ where >( self, opt_orig_caller: Arg0, - ) -> TxProxyCall, EsdtTokenPayment>> { + ) -> TxTypedCall, EsdtTokenPayment>> { self.wrapped_tx .raw_call("mergeFarmTokens") .argument(&opt_orig_caller) @@ -152,8 +153,9 @@ where >( self, opt_user: Arg0, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("claimBoostedRewards") .argument(&opt_user) .original_result() @@ -161,16 +163,18 @@ where pub fn start_produce_rewards_endpoint( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("startProduceRewards") .original_result() } pub fn end_produce_rewards_endpoint( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("endProduceRewards") .original_result() } @@ -180,8 +184,9 @@ where >( self, per_block_amount: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setPerBlockRewardAmount") .argument(&per_block_amount) .original_result() @@ -192,8 +197,9 @@ where >( self, percentage: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setBoostedYieldsRewardsPercentage") .argument(&percentage) .original_result() @@ -208,8 +214,9 @@ where user: Arg0, farm_token_amount: Arg1, attributes: Arg2, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("calculateRewardsForGivenPosition") .argument(&user) .argument(&farm_token_amount) @@ -219,16 +226,18 @@ where pub fn reward_per_share( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getRewardPerShare") .original_result() } pub fn reward_reserve( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getRewardReserve") .original_result() } @@ -238,8 +247,9 @@ where >( self, allow_external_claim: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("allowExternalClaimBoostedRewards") .argument(&allow_external_claim) .original_result() @@ -250,8 +260,9 @@ where >( self, user: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getAllowExternalClaimRewards") .argument(&user) .original_result() @@ -259,40 +270,45 @@ where pub fn farming_token_id( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getFarmingTokenId") .original_result() } pub fn reward_token_id( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getRewardTokenId") .original_result() } pub fn per_block_reward_amount( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getPerBlockRewardAmount") .original_result() } pub fn last_reward_block_nonce( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getLastRewardBlockNonce") .original_result() } pub fn division_safety_constant( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getDivisionSafetyConstant") .original_result() } @@ -302,8 +318,9 @@ where >( self, user: Arg0, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getUserTotalFarmPosition") .argument(&user) .original_result() @@ -311,8 +328,9 @@ where pub fn farm_position_migration_nonce( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getFarmPositionMigrationNonce") .original_result() } @@ -322,8 +340,9 @@ where >( self, new_address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setLockingScAddress") .argument(&new_address) .original_result() @@ -334,8 +353,9 @@ where >( self, lock_epochs: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setLockEpochs") .argument(&lock_epochs) .original_result() @@ -343,16 +363,18 @@ where pub fn locking_sc_address( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getLockingScAddress") .original_result() } pub fn lock_epochs( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getLockEpochs") .original_result() } @@ -366,7 +388,7 @@ where token_display_name: Arg0, token_ticker: Arg1, num_decimals: Arg2, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx .raw_call("registerFarmToken") .argument(&token_display_name) @@ -377,16 +399,18 @@ where pub fn farm_token( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getFarmTokenId") .original_result() } pub fn farm_token_supply( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getFarmTokenSupply") .original_result() } @@ -396,8 +420,9 @@ where >( self, address_list: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("addToPauseWhitelist") .argument(&address_list) .original_result() @@ -408,8 +433,9 @@ where >( self, address_list: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("removeFromPauseWhitelist") .argument(&address_list) .original_result() @@ -417,24 +443,27 @@ where pub fn pause( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("pause") .original_result() } pub fn resume( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("resume") .original_result() } pub fn state( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getState") .original_result() } @@ -444,8 +473,9 @@ where >( self, address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("addAdmin") .argument(&address) .original_result() @@ -456,8 +486,9 @@ where >( self, address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("removeAdmin") .argument(&address) .original_result() @@ -468,8 +499,9 @@ where >( self, previous_owner: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("updateOwnerOrAdmin") .argument(&previous_owner) .original_result() @@ -480,8 +512,9 @@ where >( self, address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getPermissions") .argument(&address) .original_result() @@ -492,8 +525,9 @@ where >( self, address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("addSCAddressToWhitelist") .argument(&address) .original_result() @@ -504,8 +538,9 @@ where >( self, address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("removeSCAddressFromWhitelist") .argument(&address) .original_result() @@ -516,8 +551,9 @@ where >( self, address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("isSCAddressWhitelisted") .argument(&address) .original_result() @@ -528,8 +564,9 @@ where >( self, percent: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("set_penalty_percent") .argument(&percent) .original_result() @@ -540,8 +577,9 @@ where >( self, epochs: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("set_minimum_farming_epochs") .argument(&epochs) .original_result() @@ -552,8 +590,9 @@ where >( self, gas_limit: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("set_burn_gas_limit") .argument(&gas_limit) .original_result() @@ -561,48 +600,54 @@ where pub fn penalty_percent( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getPenaltyPercent") .original_result() } pub fn minimum_farming_epochs( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getMinimumFarmingEpoch") .original_result() } pub fn burn_gas_limit( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getBurnGasLimit") .original_result() } pub fn pair_contract_address( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getPairContractManagedAddress") .original_result() } pub fn collect_undistributed_boosted_rewards( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("collectUndistributedBoostedRewards") .original_result() } pub fn boosted_yields_rewards_percentage( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getBoostedYieldsRewardsPercentage") .original_result() } @@ -612,8 +657,9 @@ where >( self, week: Arg0, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getAccumulatedRewardsForWeek") .argument(&week) .original_result() @@ -624,8 +670,9 @@ where >( self, week: Arg0, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getFarmSupplyForWeek") .argument(&week) .original_result() @@ -636,8 +683,9 @@ where >( self, week: Arg0, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getRemainingBoostedRewardsToDistribute") .argument(&week) .original_result() @@ -645,8 +693,9 @@ where pub fn undistributed_boosted_rewards( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getUndistributedBoostedRewards") .original_result() } @@ -664,8 +713,9 @@ where user_rewards_farm_const: Arg2, min_energy_amount: Arg3, min_farm_amount: Arg4, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setBoostedYieldsFactors") .argument(&max_rewards_factor) .argument(&user_rewards_energy_const) @@ -677,8 +727,9 @@ where pub fn get_boosted_yields_factors( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getBoostedYieldsFactors") .original_result() } @@ -686,16 +737,18 @@ where /// Week starts from 1 pub fn get_current_week( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getCurrentWeek") .original_result() } pub fn first_week_start_epoch( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getFirstWeekStartEpoch") .original_result() } @@ -705,8 +758,9 @@ where >( self, user: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getLastActiveWeekForUser") .argument(&user) .original_result() @@ -719,8 +773,9 @@ where self, user: Arg0, week: Arg1, - ) -> TxProxyCall>> { + ) -> TxTypedCall>> { self.wrapped_tx + .payment(NotPayable) .raw_call("getUserEnergyForWeek") .argument(&user) .argument(&week) @@ -729,8 +784,9 @@ where pub fn last_global_update_week( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getLastGlobalUpdateWeek") .original_result() } @@ -740,8 +796,9 @@ where >( self, week: Arg0, - ) -> TxProxyCall>> { + ) -> TxTypedCall>> { self.wrapped_tx + .payment(NotPayable) .raw_call("getTotalRewardsForWeek") .argument(&week) .original_result() @@ -752,8 +809,9 @@ where >( self, week: Arg0, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getTotalEnergyForWeek") .argument(&week) .original_result() @@ -764,8 +822,9 @@ where >( self, week: Arg0, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getTotalLockedTokensForWeek") .argument(&week) .original_result() @@ -776,8 +835,9 @@ where >( self, user: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("updateEnergyForUser") .argument(&user) .original_result() @@ -788,8 +848,9 @@ where >( self, user: Arg0, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getCurrentClaimProgress") .argument(&user) .original_result() @@ -800,8 +861,9 @@ where >( self, sc_address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setEnergyFactoryAddress") .argument(&sc_address) .original_result() @@ -809,8 +871,9 @@ where pub fn energy_factory_address( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getEnergyFactoryAddress") .original_result() } diff --git a/dex/interactor/proxies/src/lib.rs b/dex/interactor/proxies/src/lib.rs index a532c5878..ef6b1b707 100644 --- a/dex/interactor/proxies/src/lib.rs +++ b/dex/interactor/proxies/src/lib.rs @@ -1,13 +1,13 @@ pub mod energy_factory_proxy; -pub mod farm_staking_proxy; pub mod farm_staking_proxy_sc_proxy; +pub mod farm_staking_sc_proxy; pub mod farm_with_locked_rewards_proxy; pub mod pair_proxy; pub mod router_proxy; pub use energy_factory_proxy::*; -pub use farm_staking_proxy::*; pub use farm_staking_proxy_sc_proxy::*; +pub use farm_staking_sc_proxy::*; pub use farm_with_locked_rewards_proxy::*; pub use pair_proxy::*; pub use router_proxy::*; diff --git a/dex/interactor/proxies/src/pair_proxy.rs b/dex/interactor/proxies/src/pair_proxy.rs index 09832c056..cdecef331 100644 --- a/dex/interactor/proxies/src/pair_proxy.rs +++ b/dex/interactor/proxies/src/pair_proxy.rs @@ -8,7 +8,6 @@ #![allow(clippy::all)] use multiversx_sc::proxy_imports::*; -use multiversx_sc_scenario::multiversx_sc; pub struct PairProxy; @@ -63,8 +62,9 @@ where special_fee_percent: Arg5, initial_liquidity_adder: Arg6, admins: Arg7, - ) -> TxProxyDeploy { + ) -> TxTypedDeploy { self.wrapped_tx + .payment(NotPayable) .raw_deploy() .argument(&first_token_id) .argument(&second_token_id) @@ -89,8 +89,9 @@ where { pub fn upgrade( self, - ) -> TxProxyUpgrade { + ) -> TxTypedUpgrade { self.wrapped_tx + .payment(NotPayable) .raw_upgrade() .original_result() } @@ -110,8 +111,9 @@ where >( self, token_identifier: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setLpTokenIdentifier") .argument(&token_identifier) .original_result() @@ -119,8 +121,9 @@ where pub fn is_fee_enabled( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getFeeState") .original_result() } @@ -130,8 +133,9 @@ where >( self, address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("whitelist") .argument(&address) .original_result() @@ -142,8 +146,9 @@ where >( self, address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("removeWhitelist") .argument(&address) .original_result() @@ -158,8 +163,9 @@ where pair_address: Arg0, first_token: Arg1, second_token: Arg2, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("addTrustedSwapPair") .argument(&pair_address) .argument(&first_token) @@ -174,8 +180,9 @@ where self, first_token: Arg0, second_token: Arg1, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("removeTrustedSwapPair") .argument(&first_token) .argument(&second_token) @@ -193,8 +200,9 @@ where self, fees_collector_address: Arg0, fees_collector_cut_percentage: Arg1, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setupFeesCollector") .argument(&fees_collector_address) .argument(&fees_collector_cut_percentage) @@ -210,8 +218,9 @@ where enabled: Arg0, fee_to_address: Arg1, fee_token: Arg2, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setFeeOn") .argument(&enabled) .argument(&fee_to_address) @@ -221,48 +230,54 @@ where pub fn get_fee_destinations( self, - ) -> TxProxyCall, TokenIdentifier)>> { + ) -> TxTypedCall, TokenIdentifier)>> { self.wrapped_tx + .payment(NotPayable) .raw_call("getFeeDestinations") .original_result() } pub fn get_trusted_swap_pairs( self, - ) -> TxProxyCall, ManagedAddress)>> { + ) -> TxTypedCall, ManagedAddress)>> { self.wrapped_tx + .payment(NotPayable) .raw_call("getTrustedSwapPairs") .original_result() } pub fn get_whitelisted_managed_addresses( self, - ) -> TxProxyCall>> { + ) -> TxTypedCall>> { self.wrapped_tx + .payment(NotPayable) .raw_call("getWhitelistedManagedAddresses") .original_result() } pub fn fees_collector_address( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getFeesCollectorAddress") .original_result() } pub fn fees_collector_cut_percentage( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getFeesCollectorCutPercentage") .original_result() } pub fn set_state_active_no_swaps( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setStateActiveNoSwaps") .original_result() } @@ -274,8 +289,9 @@ where self, total_fee_percent: Arg0, special_fee_percent: Arg1, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setFeePercents") .argument(&total_fee_percent) .argument(&special_fee_percent) @@ -284,64 +300,72 @@ where pub fn get_lp_token_identifier( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getLpTokenIdentifier") .original_result() } pub fn total_fee_percent( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getTotalFeePercent") .original_result() } pub fn special_fee_percent( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getSpecialFee") .original_result() } pub fn router_address( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getRouterManagedAddress") .original_result() } pub fn first_token_id( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getFirstTokenId") .original_result() } pub fn second_token_id( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getSecondTokenId") .original_result() } pub fn lp_token_supply( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getTotalSupply") .original_result() } pub fn initial_liquidity_adder( self, - ) -> TxProxyCall>> { + ) -> TxTypedCall>> { self.wrapped_tx + .payment(NotPayable) .raw_call("getInitialLiquidtyAdder") .original_result() } @@ -351,8 +375,9 @@ where >( self, token_id: Arg0, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getReserve") .argument(&token_id) .original_result() @@ -360,8 +385,9 @@ where pub fn safe_price_current_index( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getSafePriceCurrentIndex") .original_result() } @@ -373,8 +399,9 @@ where self, pair_address: Arg0, liquidity: Arg1, - ) -> TxProxyCall, EsdtTokenPayment>> { + ) -> TxTypedCall, EsdtTokenPayment>> { self.wrapped_tx + .payment(NotPayable) .raw_call("getLpTokensSafePriceByDefaultOffset") .argument(&pair_address) .argument(&liquidity) @@ -390,8 +417,9 @@ where pair_address: Arg0, round_offset: Arg1, liquidity: Arg2, - ) -> TxProxyCall, EsdtTokenPayment>> { + ) -> TxTypedCall, EsdtTokenPayment>> { self.wrapped_tx + .payment(NotPayable) .raw_call("getLpTokensSafePriceByRoundOffset") .argument(&pair_address) .argument(&round_offset) @@ -408,8 +436,9 @@ where pair_address: Arg0, timestamp_offset: Arg1, liquidity: Arg2, - ) -> TxProxyCall, EsdtTokenPayment>> { + ) -> TxTypedCall, EsdtTokenPayment>> { self.wrapped_tx + .payment(NotPayable) .raw_call("getLpTokensSafePriceByTimestampOffset") .argument(&pair_address) .argument(×tamp_offset) @@ -428,8 +457,9 @@ where start_round: Arg1, end_round: Arg2, liquidity: Arg3, - ) -> TxProxyCall, EsdtTokenPayment>> { + ) -> TxTypedCall, EsdtTokenPayment>> { self.wrapped_tx + .payment(NotPayable) .raw_call("getLpTokensSafePrice") .argument(&pair_address) .argument(&start_round) @@ -445,8 +475,9 @@ where self, pair_address: Arg0, input_payment: Arg1, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getSafePriceByDefaultOffset") .argument(&pair_address) .argument(&input_payment) @@ -462,8 +493,9 @@ where pair_address: Arg0, round_offset: Arg1, input_payment: Arg2, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getSafePriceByRoundOffset") .argument(&pair_address) .argument(&round_offset) @@ -480,8 +512,9 @@ where pair_address: Arg0, timestamp_offset: Arg1, input_payment: Arg2, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getSafePriceByTimestampOffset") .argument(&pair_address) .argument(×tamp_offset) @@ -500,8 +533,9 @@ where start_round: Arg1, end_round: Arg2, input_payment: Arg3, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getSafePrice") .argument(&pair_address) .argument(&start_round) @@ -517,8 +551,9 @@ where self, pair_address: Arg0, search_round: Arg1, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getPriceObservation") .argument(&pair_address) .argument(&search_round) @@ -530,8 +565,9 @@ where >( self, liquidity: Arg0, - ) -> TxProxyCall, EsdtTokenPayment>> { + ) -> TxTypedCall, EsdtTokenPayment>> { self.wrapped_tx + .payment(NotPayable) .raw_call("updateAndGetTokensForGivenPositionWithSafePrice") .argument(&liquidity) .original_result() @@ -542,8 +578,9 @@ where >( self, input: Arg0, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("updateAndGetSafePrice") .argument(&input) .original_result() @@ -554,8 +591,9 @@ where >( self, new_deadline: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setLockingDeadlineEpoch") .argument(&new_deadline) .original_result() @@ -566,8 +604,9 @@ where >( self, new_address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setLockingScAddress") .argument(&new_address) .original_result() @@ -578,8 +617,9 @@ where >( self, new_epoch: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setUnlockEpoch") .argument(&new_epoch) .original_result() @@ -587,24 +627,27 @@ where pub fn locking_sc_address( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getLockingScAddress") .original_result() } pub fn unlock_epoch( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getUnlockEpoch") .original_result() } pub fn locking_deadline_epoch( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getLockingDeadlineEpoch") .original_result() } @@ -614,8 +657,9 @@ where >( self, address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("addAdmin") .argument(&address) .original_result() @@ -626,8 +670,9 @@ where >( self, address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("removeAdmin") .argument(&address) .original_result() @@ -638,8 +683,9 @@ where >( self, previous_owner: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("updateOwnerOrAdmin") .argument(&previous_owner) .original_result() @@ -650,8 +696,9 @@ where >( self, address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getPermissions") .argument(&address) .original_result() @@ -662,8 +709,9 @@ where >( self, address_list: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("addToPauseWhitelist") .argument(&address_list) .original_result() @@ -674,8 +722,9 @@ where >( self, address_list: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("removeFromPauseWhitelist") .argument(&address_list) .original_result() @@ -683,31 +732,34 @@ where pub fn pause( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("pause") .original_result() } pub fn resume( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("resume") .original_result() } pub fn state( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getState") .original_result() } pub fn add_initial_liquidity( self, - ) -> TxProxyCall, EsdtTokenPayment, EsdtTokenPayment>> { + ) -> TxTypedCall, EsdtTokenPayment, EsdtTokenPayment>> { self.wrapped_tx .raw_call("addInitialLiquidity") .original_result() @@ -720,7 +772,7 @@ where self, first_token_amount_min: Arg0, second_token_amount_min: Arg1, - ) -> TxProxyCall, EsdtTokenPayment, EsdtTokenPayment>> { + ) -> TxTypedCall, EsdtTokenPayment, EsdtTokenPayment>> { self.wrapped_tx .raw_call("addLiquidity") .argument(&first_token_amount_min) @@ -735,7 +787,7 @@ where self, first_token_amount_min: Arg0, second_token_amount_min: Arg1, - ) -> TxProxyCall, EsdtTokenPayment>> { + ) -> TxTypedCall, EsdtTokenPayment>> { self.wrapped_tx .raw_call("removeLiquidity") .argument(&first_token_amount_min) @@ -748,7 +800,7 @@ where >( self, token_to_buyback_and_burn: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx .raw_call("removeLiquidityAndBuyBackAndBurnToken") .argument(&token_to_buyback_and_burn) @@ -762,7 +814,7 @@ where self, token_out: Arg0, destination_address: Arg1, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx .raw_call("swapNoFeeAndForward") .argument(&token_out) @@ -777,7 +829,7 @@ where self, token_out: Arg0, amount_out_min: Arg1, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx .raw_call("swapTokensFixedInput") .argument(&token_out) @@ -792,7 +844,7 @@ where self, token_out: Arg0, amount_out: Arg1, - ) -> TxProxyCall, EsdtTokenPayment>> { + ) -> TxTypedCall, EsdtTokenPayment>> { self.wrapped_tx .raw_call("swapTokensFixedOutput") .argument(&token_out) @@ -805,8 +857,9 @@ where >( self, liquidity: Arg0, - ) -> TxProxyCall, EsdtTokenPayment>> { + ) -> TxTypedCall, EsdtTokenPayment>> { self.wrapped_tx + .payment(NotPayable) .raw_call("getTokensForGivenPosition") .argument(&liquidity) .original_result() @@ -814,8 +867,9 @@ where pub fn get_reserves_and_total_supply( self, - ) -> TxProxyCall, BigUint, BigUint>> { + ) -> TxTypedCall, BigUint, BigUint>> { self.wrapped_tx + .payment(NotPayable) .raw_call("getReservesAndTotalSupply") .original_result() } @@ -827,8 +881,9 @@ where self, token_in: Arg0, amount_in: Arg1, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getAmountOut") .argument(&token_in) .argument(&amount_in) @@ -842,8 +897,9 @@ where self, token_wanted: Arg0, amount_wanted: Arg1, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getAmountIn") .argument(&token_wanted) .argument(&amount_wanted) @@ -857,8 +913,9 @@ where self, token_in: Arg0, amount_in: Arg1, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getEquivalent") .argument(&token_in) .argument(&amount_in) @@ -866,6 +923,7 @@ where } } +#[type_abi] #[derive(TopEncode, TopDecode)] pub struct SwapEvent where @@ -884,6 +942,7 @@ where pub timestamp: u64, } +#[type_abi] #[derive(TopEncode, TopDecode)] pub struct SwapNoFeeAndForwardEvent where @@ -900,6 +959,7 @@ where pub timestamp: u64, } +#[type_abi] #[derive(TopEncode, TopDecode)] pub struct AddLiquidityEvent where @@ -920,6 +980,7 @@ where pub timestamp: u64, } +#[type_abi] #[derive(TopEncode, TopDecode)] pub struct RemoveLiquidityEvent where @@ -940,6 +1001,7 @@ where pub timestamp: u64, } +#[type_abi] #[derive(TopEncode, TopDecode)] pub struct PriceObservation where diff --git a/dex/interactor/proxies/src/router_proxy.rs b/dex/interactor/proxies/src/router_proxy.rs index a1184f5e6..5e0610e5b 100644 --- a/dex/interactor/proxies/src/router_proxy.rs +++ b/dex/interactor/proxies/src/router_proxy.rs @@ -48,8 +48,9 @@ where >( self, pair_template_address_opt: Arg0, - ) -> TxProxyDeploy { + ) -> TxTypedDeploy { self.wrapped_tx + .payment(NotPayable) .raw_deploy() .argument(&pair_template_address_opt) .original_result() @@ -67,8 +68,9 @@ where { pub fn upgrade( self, - ) -> TxProxyUpgrade { + ) -> TxTypedUpgrade { self.wrapped_tx + .payment(NotPayable) .raw_upgrade() .original_result() } @@ -88,8 +90,9 @@ where >( self, address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("pause") .argument(&address) .original_result() @@ -100,8 +103,9 @@ where >( self, address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("resume") .argument(&address) .original_result() @@ -120,8 +124,9 @@ where initial_liquidity_adder: Arg2, opt_fee_percents: Arg3, admins: Arg4, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("createPair") .argument(&first_token_id) .argument(&second_token_id) @@ -138,8 +143,9 @@ where self, first_token_id: Arg0, second_token_id: Arg1, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("upgradePair") .argument(&first_token_id) .argument(&second_token_id) @@ -155,7 +161,7 @@ where pair_address: Arg0, lp_token_display_name: Arg1, lp_token_ticker: Arg2, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx .raw_call("issueLpToken") .argument(&pair_address) @@ -169,8 +175,9 @@ where >( self, pair_address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setLocalRoles") .argument(&pair_address) .original_result() @@ -183,8 +190,9 @@ where self, first_token_id: Arg0, second_token_id: Arg1, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("removePair") .argument(&first_token_id) .argument(&second_token_id) @@ -200,8 +208,9 @@ where pair_address: Arg0, fee_to_address: Arg1, fee_token: Arg2, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setFeeOn") .argument(&pair_address) .argument(&fee_to_address) @@ -218,8 +227,9 @@ where pair_address: Arg0, fee_to_address: Arg1, fee_token: Arg2, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setFeeOff") .argument(&pair_address) .argument(&fee_to_address) @@ -232,8 +242,9 @@ where >( self, enabled: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setPairCreationEnabled") .argument(&enabled) .original_result() @@ -241,32 +252,36 @@ where pub fn migrate_pair_map( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("migratePairMap") .original_result() } pub fn pair_creation_enabled( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getPairCreationEnabled") .original_result() } pub fn state( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getState") .original_result() } pub fn owner( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getOwner") .original_result() } @@ -276,8 +291,9 @@ where >( self, period_blocks: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setTemporaryOwnerPeriod") .argument(&period_blocks) .original_result() @@ -288,8 +304,9 @@ where >( self, address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setPairTemplateAddress") .argument(&address) .original_result() @@ -297,48 +314,54 @@ where pub fn pair_template_address( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getPairTemplateAddress") .original_result() } pub fn temporary_owner_period( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getTemporaryOwnerPeriod") .original_result() } pub fn common_tokens_for_user_pairs( self, - ) -> TxProxyCall>> { + ) -> TxTypedCall>> { self.wrapped_tx + .payment(NotPayable) .raw_call("getCommonTokensForUserPairs") .original_result() } pub fn get_all_pairs_addresses( self, - ) -> TxProxyCall>> { + ) -> TxTypedCall>> { self.wrapped_tx + .payment(NotPayable) .raw_call("getAllPairsManagedAddresses") .original_result() } pub fn get_all_token_pairs( self, - ) -> TxProxyCall>> { + ) -> TxTypedCall>> { self.wrapped_tx + .payment(NotPayable) .raw_call("getAllPairTokens") .original_result() } pub fn get_all_pair_contract_metadata( self, - ) -> TxProxyCall>> { + ) -> TxTypedCall>> { self.wrapped_tx + .payment(NotPayable) .raw_call("getAllPairContractMetadata") .original_result() } @@ -350,8 +373,9 @@ where self, first_token_id: Arg0, second_token_id: Arg1, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getPair") .argument(&first_token_id) .argument(&second_token_id) @@ -363,8 +387,9 @@ where >( self, pair_address: Arg0, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getPairTokens") .argument(&pair_address) .original_result() @@ -372,8 +397,9 @@ where pub fn clear_pair_temporary_owner_storage( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("clearPairTemporaryOwnerStorage") .original_result() } @@ -383,7 +409,7 @@ where >( self, swap_operations: Arg0, - ) -> TxProxyCall>> { + ) -> TxTypedCall>> { self.wrapped_tx .raw_call("multiPairSwap") .argument(&swap_operations) @@ -401,8 +427,9 @@ where locked_token_id: Arg1, min_locked_token_value: Arg2, min_lock_period_epochs: Arg3, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("configEnableByUserParameters") .argument(&common_token_id) .argument(&locked_token_id) @@ -416,8 +443,9 @@ where >( self, tokens: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("addCommonTokensForUserPairs") .argument(&tokens) .original_result() @@ -428,8 +456,9 @@ where >( self, tokens: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("removeCommonTokensForUserPairs") .argument(&tokens) .original_result() @@ -440,7 +469,7 @@ where >( self, pair_address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx .raw_call("setSwapEnabledByUser") .argument(&pair_address) @@ -452,14 +481,16 @@ where >( self, token_id: Arg0, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getEnableSwapByUserConfig") .argument(&token_id) .original_result() } } +#[type_abi] #[derive(TopEncode, TopDecode)] pub struct PairTokens where @@ -469,6 +500,7 @@ where pub second_token_id: TokenIdentifier, } +#[type_abi] #[derive(TopEncode, TopDecode)] pub struct PairContractMetadata where @@ -479,6 +511,7 @@ where pub address: ManagedAddress, } +#[type_abi] #[derive(TopEncode, TopDecode)] pub struct CreatePairEvent where @@ -495,6 +528,7 @@ where pub timestamp: u64, } +#[type_abi] #[derive(TopEncode, TopDecode)] pub struct UserPairSwapEnabledEvent where @@ -506,6 +540,7 @@ where pub pair_address: ManagedAddress, } +#[type_abi] #[derive(TopEncode, TopDecode)] pub struct EnableSwapByUserConfig where diff --git a/dex/pair/sc-config.toml b/dex/pair/sc-config.toml index 812f93140..7ba56cf8e 100644 --- a/dex/pair/sc-config.toml +++ b/dex/pair/sc-config.toml @@ -19,6 +19,9 @@ add-labels = ["safe-price-view"] [[proxy]] path = "../router/src/pair_proxy.rs" +[[proxy]] +path = "../interactor/proxies/src/pair_proxy.rs" + [[proxy.path-rename]] from = "permissions::Permissions" to = "Permissions" diff --git a/dex/router/sc-config.toml b/dex/router/sc-config.toml index 437fade89..fb11e3469 100644 --- a/dex/router/sc-config.toml +++ b/dex/router/sc-config.toml @@ -1,2 +1,2 @@ [[proxy]] -path = "../interactor/src/router_proxy.rs" +path = "../interactor/proxies/src/router_proxy.rs" diff --git a/dex/router/src/pair_proxy.rs b/dex/router/src/pair_proxy.rs index cf22114c0..cdecef331 100644 --- a/dex/router/src/pair_proxy.rs +++ b/dex/router/src/pair_proxy.rs @@ -62,8 +62,9 @@ where special_fee_percent: Arg5, initial_liquidity_adder: Arg6, admins: Arg7, - ) -> TxProxyDeploy { + ) -> TxTypedDeploy { self.wrapped_tx + .payment(NotPayable) .raw_deploy() .argument(&first_token_id) .argument(&second_token_id) @@ -88,8 +89,9 @@ where { pub fn upgrade( self, - ) -> TxProxyUpgrade { + ) -> TxTypedUpgrade { self.wrapped_tx + .payment(NotPayable) .raw_upgrade() .original_result() } @@ -109,8 +111,9 @@ where >( self, token_identifier: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setLpTokenIdentifier") .argument(&token_identifier) .original_result() @@ -118,8 +121,9 @@ where pub fn is_fee_enabled( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getFeeState") .original_result() } @@ -129,8 +133,9 @@ where >( self, address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("whitelist") .argument(&address) .original_result() @@ -141,8 +146,9 @@ where >( self, address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("removeWhitelist") .argument(&address) .original_result() @@ -157,8 +163,9 @@ where pair_address: Arg0, first_token: Arg1, second_token: Arg2, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("addTrustedSwapPair") .argument(&pair_address) .argument(&first_token) @@ -173,8 +180,9 @@ where self, first_token: Arg0, second_token: Arg1, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("removeTrustedSwapPair") .argument(&first_token) .argument(&second_token) @@ -192,8 +200,9 @@ where self, fees_collector_address: Arg0, fees_collector_cut_percentage: Arg1, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setupFeesCollector") .argument(&fees_collector_address) .argument(&fees_collector_cut_percentage) @@ -209,8 +218,9 @@ where enabled: Arg0, fee_to_address: Arg1, fee_token: Arg2, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setFeeOn") .argument(&enabled) .argument(&fee_to_address) @@ -220,48 +230,54 @@ where pub fn get_fee_destinations( self, - ) -> TxProxyCall, TokenIdentifier)>> { + ) -> TxTypedCall, TokenIdentifier)>> { self.wrapped_tx + .payment(NotPayable) .raw_call("getFeeDestinations") .original_result() } pub fn get_trusted_swap_pairs( self, - ) -> TxProxyCall, ManagedAddress)>> { + ) -> TxTypedCall, ManagedAddress)>> { self.wrapped_tx + .payment(NotPayable) .raw_call("getTrustedSwapPairs") .original_result() } pub fn get_whitelisted_managed_addresses( self, - ) -> TxProxyCall>> { + ) -> TxTypedCall>> { self.wrapped_tx + .payment(NotPayable) .raw_call("getWhitelistedManagedAddresses") .original_result() } pub fn fees_collector_address( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getFeesCollectorAddress") .original_result() } pub fn fees_collector_cut_percentage( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getFeesCollectorCutPercentage") .original_result() } pub fn set_state_active_no_swaps( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setStateActiveNoSwaps") .original_result() } @@ -273,8 +289,9 @@ where self, total_fee_percent: Arg0, special_fee_percent: Arg1, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setFeePercents") .argument(&total_fee_percent) .argument(&special_fee_percent) @@ -283,64 +300,72 @@ where pub fn get_lp_token_identifier( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getLpTokenIdentifier") .original_result() } pub fn total_fee_percent( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getTotalFeePercent") .original_result() } pub fn special_fee_percent( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getSpecialFee") .original_result() } pub fn router_address( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getRouterManagedAddress") .original_result() } pub fn first_token_id( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getFirstTokenId") .original_result() } pub fn second_token_id( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getSecondTokenId") .original_result() } pub fn lp_token_supply( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getTotalSupply") .original_result() } pub fn initial_liquidity_adder( self, - ) -> TxProxyCall>> { + ) -> TxTypedCall>> { self.wrapped_tx + .payment(NotPayable) .raw_call("getInitialLiquidtyAdder") .original_result() } @@ -350,8 +375,9 @@ where >( self, token_id: Arg0, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getReserve") .argument(&token_id) .original_result() @@ -359,8 +385,9 @@ where pub fn safe_price_current_index( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getSafePriceCurrentIndex") .original_result() } @@ -372,8 +399,9 @@ where self, pair_address: Arg0, liquidity: Arg1, - ) -> TxProxyCall, EsdtTokenPayment>> { + ) -> TxTypedCall, EsdtTokenPayment>> { self.wrapped_tx + .payment(NotPayable) .raw_call("getLpTokensSafePriceByDefaultOffset") .argument(&pair_address) .argument(&liquidity) @@ -389,8 +417,9 @@ where pair_address: Arg0, round_offset: Arg1, liquidity: Arg2, - ) -> TxProxyCall, EsdtTokenPayment>> { + ) -> TxTypedCall, EsdtTokenPayment>> { self.wrapped_tx + .payment(NotPayable) .raw_call("getLpTokensSafePriceByRoundOffset") .argument(&pair_address) .argument(&round_offset) @@ -407,8 +436,9 @@ where pair_address: Arg0, timestamp_offset: Arg1, liquidity: Arg2, - ) -> TxProxyCall, EsdtTokenPayment>> { + ) -> TxTypedCall, EsdtTokenPayment>> { self.wrapped_tx + .payment(NotPayable) .raw_call("getLpTokensSafePriceByTimestampOffset") .argument(&pair_address) .argument(×tamp_offset) @@ -427,8 +457,9 @@ where start_round: Arg1, end_round: Arg2, liquidity: Arg3, - ) -> TxProxyCall, EsdtTokenPayment>> { + ) -> TxTypedCall, EsdtTokenPayment>> { self.wrapped_tx + .payment(NotPayable) .raw_call("getLpTokensSafePrice") .argument(&pair_address) .argument(&start_round) @@ -444,8 +475,9 @@ where self, pair_address: Arg0, input_payment: Arg1, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getSafePriceByDefaultOffset") .argument(&pair_address) .argument(&input_payment) @@ -461,8 +493,9 @@ where pair_address: Arg0, round_offset: Arg1, input_payment: Arg2, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getSafePriceByRoundOffset") .argument(&pair_address) .argument(&round_offset) @@ -479,8 +512,9 @@ where pair_address: Arg0, timestamp_offset: Arg1, input_payment: Arg2, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getSafePriceByTimestampOffset") .argument(&pair_address) .argument(×tamp_offset) @@ -499,8 +533,9 @@ where start_round: Arg1, end_round: Arg2, input_payment: Arg3, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getSafePrice") .argument(&pair_address) .argument(&start_round) @@ -516,8 +551,9 @@ where self, pair_address: Arg0, search_round: Arg1, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getPriceObservation") .argument(&pair_address) .argument(&search_round) @@ -529,8 +565,9 @@ where >( self, liquidity: Arg0, - ) -> TxProxyCall, EsdtTokenPayment>> { + ) -> TxTypedCall, EsdtTokenPayment>> { self.wrapped_tx + .payment(NotPayable) .raw_call("updateAndGetTokensForGivenPositionWithSafePrice") .argument(&liquidity) .original_result() @@ -541,8 +578,9 @@ where >( self, input: Arg0, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("updateAndGetSafePrice") .argument(&input) .original_result() @@ -553,8 +591,9 @@ where >( self, new_deadline: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setLockingDeadlineEpoch") .argument(&new_deadline) .original_result() @@ -565,8 +604,9 @@ where >( self, new_address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setLockingScAddress") .argument(&new_address) .original_result() @@ -577,8 +617,9 @@ where >( self, new_epoch: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("setUnlockEpoch") .argument(&new_epoch) .original_result() @@ -586,24 +627,27 @@ where pub fn locking_sc_address( self, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getLockingScAddress") .original_result() } pub fn unlock_epoch( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getUnlockEpoch") .original_result() } pub fn locking_deadline_epoch( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getLockingDeadlineEpoch") .original_result() } @@ -613,8 +657,9 @@ where >( self, address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("addAdmin") .argument(&address) .original_result() @@ -625,8 +670,9 @@ where >( self, address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("removeAdmin") .argument(&address) .original_result() @@ -637,8 +683,9 @@ where >( self, previous_owner: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("updateOwnerOrAdmin") .argument(&previous_owner) .original_result() @@ -649,8 +696,9 @@ where >( self, address: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getPermissions") .argument(&address) .original_result() @@ -661,8 +709,9 @@ where >( self, address_list: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("addToPauseWhitelist") .argument(&address_list) .original_result() @@ -673,8 +722,9 @@ where >( self, address_list: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("removeFromPauseWhitelist") .argument(&address_list) .original_result() @@ -682,31 +732,34 @@ where pub fn pause( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("pause") .original_result() } pub fn resume( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("resume") .original_result() } pub fn state( self, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx + .payment(NotPayable) .raw_call("getState") .original_result() } pub fn add_initial_liquidity( self, - ) -> TxProxyCall, EsdtTokenPayment, EsdtTokenPayment>> { + ) -> TxTypedCall, EsdtTokenPayment, EsdtTokenPayment>> { self.wrapped_tx .raw_call("addInitialLiquidity") .original_result() @@ -719,7 +772,7 @@ where self, first_token_amount_min: Arg0, second_token_amount_min: Arg1, - ) -> TxProxyCall, EsdtTokenPayment, EsdtTokenPayment>> { + ) -> TxTypedCall, EsdtTokenPayment, EsdtTokenPayment>> { self.wrapped_tx .raw_call("addLiquidity") .argument(&first_token_amount_min) @@ -734,7 +787,7 @@ where self, first_token_amount_min: Arg0, second_token_amount_min: Arg1, - ) -> TxProxyCall, EsdtTokenPayment>> { + ) -> TxTypedCall, EsdtTokenPayment>> { self.wrapped_tx .raw_call("removeLiquidity") .argument(&first_token_amount_min) @@ -747,7 +800,7 @@ where >( self, token_to_buyback_and_burn: Arg0, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx .raw_call("removeLiquidityAndBuyBackAndBurnToken") .argument(&token_to_buyback_and_burn) @@ -761,7 +814,7 @@ where self, token_out: Arg0, destination_address: Arg1, - ) -> TxProxyCall { + ) -> TxTypedCall { self.wrapped_tx .raw_call("swapNoFeeAndForward") .argument(&token_out) @@ -776,7 +829,7 @@ where self, token_out: Arg0, amount_out_min: Arg1, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx .raw_call("swapTokensFixedInput") .argument(&token_out) @@ -791,7 +844,7 @@ where self, token_out: Arg0, amount_out: Arg1, - ) -> TxProxyCall, EsdtTokenPayment>> { + ) -> TxTypedCall, EsdtTokenPayment>> { self.wrapped_tx .raw_call("swapTokensFixedOutput") .argument(&token_out) @@ -804,8 +857,9 @@ where >( self, liquidity: Arg0, - ) -> TxProxyCall, EsdtTokenPayment>> { + ) -> TxTypedCall, EsdtTokenPayment>> { self.wrapped_tx + .payment(NotPayable) .raw_call("getTokensForGivenPosition") .argument(&liquidity) .original_result() @@ -813,8 +867,9 @@ where pub fn get_reserves_and_total_supply( self, - ) -> TxProxyCall, BigUint, BigUint>> { + ) -> TxTypedCall, BigUint, BigUint>> { self.wrapped_tx + .payment(NotPayable) .raw_call("getReservesAndTotalSupply") .original_result() } @@ -826,8 +881,9 @@ where self, token_in: Arg0, amount_in: Arg1, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getAmountOut") .argument(&token_in) .argument(&amount_in) @@ -841,8 +897,9 @@ where self, token_wanted: Arg0, amount_wanted: Arg1, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getAmountIn") .argument(&token_wanted) .argument(&amount_wanted) @@ -856,8 +913,9 @@ where self, token_in: Arg0, amount_in: Arg1, - ) -> TxProxyCall> { + ) -> TxTypedCall> { self.wrapped_tx + .payment(NotPayable) .raw_call("getEquivalent") .argument(&token_in) .argument(&amount_in) @@ -865,6 +923,7 @@ where } } +#[type_abi] #[derive(TopEncode, TopDecode)] pub struct SwapEvent where @@ -883,6 +942,7 @@ where pub timestamp: u64, } +#[type_abi] #[derive(TopEncode, TopDecode)] pub struct SwapNoFeeAndForwardEvent where @@ -899,6 +959,7 @@ where pub timestamp: u64, } +#[type_abi] #[derive(TopEncode, TopDecode)] pub struct AddLiquidityEvent where @@ -919,6 +980,7 @@ where pub timestamp: u64, } +#[type_abi] #[derive(TopEncode, TopDecode)] pub struct RemoveLiquidityEvent where @@ -939,6 +1001,7 @@ where pub timestamp: u64, } +#[type_abi] #[derive(TopEncode, TopDecode)] pub struct PriceObservation where diff --git a/farm-staking/farm-staking-proxy/sc-config.toml b/farm-staking/farm-staking-proxy/sc-config.toml index 2fea6bd24..c42785448 100644 --- a/farm-staking/farm-staking-proxy/sc-config.toml +++ b/farm-staking/farm-staking-proxy/sc-config.toml @@ -1,2 +1,2 @@ [[proxy]] -path = "../../dex/interactor/src/farm_staking_proxy_sc_proxy.rs" +path = "../../dex/interactor/proxies/src/farm_staking_proxy_sc_proxy.rs" diff --git a/farm-staking/farm-staking/sc-config.toml b/farm-staking/farm-staking/sc-config.toml index 780249791..4cd888336 100644 --- a/farm-staking/farm-staking/sc-config.toml +++ b/farm-staking/farm-staking/sc-config.toml @@ -1,2 +1,2 @@ [[proxy]] -path = "../../dex/interactor/src/farm_staking_proxy.rs" +path = "../../dex/interactor/proxies/src/farm_staking_sc_proxy.rs" diff --git a/locked-asset/energy-factory/sc-config.toml b/locked-asset/energy-factory/sc-config.toml index ac8f646d8..d02760de8 100644 --- a/locked-asset/energy-factory/sc-config.toml +++ b/locked-asset/energy-factory/sc-config.toml @@ -1,2 +1,2 @@ [[proxy]] -path = "../../dex/interactor/src/energy_factory_proxy.rs" +path = "../../dex/interactor/proxies/src/energy_factory_proxy.rs"