Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove farm penalty code #966

Merged
merged 26 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 32 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ members = [
"energy-integration/fees-collector/meta",
"energy-integration/governance-v2",
"energy-integration/governance-v2/meta",
"energy-integration/timestamp-oracle",
"energy-integration/timestamp-oracle/meta",

"farm-staking/farm-staking",
"farm-staking/farm-staking/meta",
Expand Down
1 change: 1 addition & 0 deletions common/common_structs/src/alias_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ pub type Nonce = u64;
pub type Epoch = u64;
pub type Week = usize;
pub type Percent = u64;
pub type Timestamp = u64;
pub type PaymentsVec<M> = ManagedVec<M, EsdtTokenPayment<M>>;
pub type UnlockPeriod<M> = UnlockSchedule<M>;
pub type OldLockedTokenAttributes<M> = LockedAssetTokenAttributesEx<M>;
Expand Down
16 changes: 0 additions & 16 deletions common/modules/farm/farm_base_impl/src/base_traits_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,22 +185,6 @@ pub trait FarmContract {
new_attributes.into()
}

fn get_exit_penalty(
_sc: &Self::FarmSc,
_total_exit_amount: &BigUint<<Self::FarmSc as ContractBase>::Api>,
_token_attributes: &Self::AttributesType,
) -> BigUint<<Self::FarmSc as ContractBase>::Api> {
BigUint::zero()
}

fn apply_penalty(
_sc: &Self::FarmSc,
_total_exit_amount: &mut BigUint<<Self::FarmSc as ContractBase>::Api>,
_token_attributes: &Self::AttributesType,
_storage_cache: &StorageCache<Self::FarmSc>,
) {
}

fn check_and_update_user_farm_position(
sc: &Self::FarmSc,
user: &ManagedAddress<<Self::FarmSc as ContractBase>::Api>,
Expand Down
18 changes: 9 additions & 9 deletions common/modules/permissions_module/src/permissions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ impl TopDecode for Permissions {

impl TypeAbiFrom<Self> for Permissions {}

impl TypeAbi for Permissions {
type Unmanaged = Self;
impl TypeAbi for Permissions {
type Unmanaged = Self;

fn type_name() -> multiversx_sc::abi::TypeName {
core::any::type_name::<u32>().into()
}
fn type_name() -> multiversx_sc::abi::TypeName {
core::any::type_name::<u32>().into()
}

fn type_name_rust() -> multiversx_sc::abi::TypeName {
core::any::type_name::<u32>().into()
}
}
fn type_name_rust() -> multiversx_sc::abi::TypeName {
core::any::type_name::<u32>().into()
}
}
3 changes: 3 additions & 0 deletions dex/farm-with-locked-rewards/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,6 @@ version = "=0.53.2"

[dev-dependencies.simple-lock]
path = "../../locked-asset/simple-lock"

[dev-dependencies.timestamp-oracle]
path = "../../energy-integration/timestamp-oracle"
4 changes: 2 additions & 2 deletions dex/farm-with-locked-rewards/src/external_interaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ multiversx_sc::imports!();
use common_structs::FarmTokenAttributes;
use farm::{
base_functions::{self, ClaimRewardsResultType},
exit_penalty, EnterFarmResultType,
EnterFarmResultType,
};

use crate::NoMintWrapper;
Expand All @@ -20,7 +20,6 @@ pub trait ExternalInteractionsModule:
+ events::EventsModule
+ multiversx_sc_modules::default_issue_callbacks::DefaultIssueCallbacksModule
+ base_functions::BaseFunctionsModule
+ exit_penalty::ExitPenaltyModule
+ locking_module::lock_with_energy_module::LockWithEnergyModule
+ farm_base_impl::base_farm_init::BaseFarmInitModule
+ farm_base_impl::base_farm_validation::BaseFarmValidationModule
Expand All @@ -30,6 +29,7 @@ pub trait ExternalInteractionsModule:
+ farm_base_impl::exit_farm::BaseExitFarmModule
+ farm_boosted_yields::FarmBoostedYieldsModule
+ farm_boosted_yields::boosted_yields_factors::BoostedYieldsFactorsModule
+ farm_boosted_yields::custom_reward_logic::CustomRewardLogicModule
+ week_timekeeping::WeekTimekeepingModule
+ weekly_rewards_splitting::WeeklyRewardsSplittingModule
+ weekly_rewards_splitting::events::WeeklyRewardsSplittingEventsModule
Expand Down
Loading