Skip to content

Commit

Permalink
add getAllowExternalClaimRewards view in farms
Browse files Browse the repository at this point in the history
  • Loading branch information
psorinionut committed Dec 14, 2023
1 parent 928ade7 commit 56a8e77
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
6 changes: 6 additions & 0 deletions common/modules/farm/config/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ pub trait ConfigModule: pausable::PausableModule + permissions_module::Permissio
.set(user_total_farm_position);
}

#[view(getAllowExternalClaimRewards)]
fn get_allow_external_claim_rewards(&self, user: ManagedAddress) -> bool {
let user_total_farm_position = self.get_user_total_farm_position(&user);
user_total_farm_position.allow_external_claim_boosted_rewards
}

#[inline]
fn is_active(&self) -> bool {
let state = self.state().get();
Expand Down
5 changes: 3 additions & 2 deletions dex/farm-with-locked-rewards/wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
////////////////////////////////////////////////////

// Init: 1
// Endpoints: 67
// Endpoints: 68
// Async Callback: 1
// Total number of exported functions: 69
// Total number of exported functions: 70

#![no_std]

Expand Down Expand Up @@ -35,6 +35,7 @@ multiversx_sc_wasm_adapter::endpoints! {
getRewardPerShare => reward_per_share
getRewardReserve => reward_reserve
allowExternalClaimBoostedRewards => allow_external_claim_boosted_rewards
getAllowExternalClaimRewards => get_allow_external_claim_rewards
getFarmingTokenId => farming_token_id
getRewardTokenId => reward_token_id
getPerBlockRewardAmount => per_block_reward_amount
Expand Down
5 changes: 3 additions & 2 deletions dex/farm/wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
////////////////////////////////////////////////////

// Init: 1
// Endpoints: 64
// Endpoints: 65
// Async Callback: 1
// Total number of exported functions: 66
// Total number of exported functions: 67

#![no_std]

Expand Down Expand Up @@ -36,6 +36,7 @@ multiversx_sc_wasm_adapter::endpoints! {
getRewardPerShare => reward_per_share
getRewardReserve => reward_reserve
allowExternalClaimBoostedRewards => allow_external_claim_boosted_rewards
getAllowExternalClaimRewards => get_allow_external_claim_rewards
getFarmingTokenId => farming_token_id
getRewardTokenId => reward_token_id
getPerBlockRewardAmount => per_block_reward_amount
Expand Down
5 changes: 3 additions & 2 deletions farm-staking/farm-staking/wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
////////////////////////////////////////////////////

// Init: 1
// Endpoints: 69
// Endpoints: 70
// Async Callback: 1
// Total number of exported functions: 71
// Total number of exported functions: 72

#![no_std]

Expand Down Expand Up @@ -38,6 +38,7 @@ multiversx_sc_wasm_adapter::endpoints! {
getRewardPerShare => reward_per_share
getRewardReserve => reward_reserve
allowExternalClaimBoostedRewards => allow_external_claim_boosted_rewards
getAllowExternalClaimRewards => get_allow_external_claim_rewards
getFarmingTokenId => farming_token_id
getRewardTokenId => reward_token_id
getPerBlockRewardAmount => per_block_reward_amount
Expand Down

0 comments on commit 56a8e77

Please sign in to comment.