Early Return in Harvest Function Prevents Reward Distribution
Summary
The harvest function always returns early due to the condition amount < rewards[providerAsset].duration, preventing reward distribution.
Vulnerability Detail
The harvest function includes a condition that checks if the amount of rewards is less than the duration:
if (duration == 0 || amount < rewards[providerAsset].duration) return;
If this condition is always true, the function will return early and not proceed with the reward distribution, making the harvest function ineffective
Impact
The harvest function will never distribute rewards, leading to stakers not receiving their earned rewards and potentially disrupting the incentive mechanism of the staking contract.
Afriaudit
Medium
Early Return in Harvest Function Prevents Reward Distribution
Summary
The harvest function always returns early due to the condition amount < rewards[providerAsset].duration, preventing reward distribution.
Vulnerability Detail
The harvest function includes a condition that checks if the amount of rewards is less than the duration:
If this condition is always true, the function will return early and not proceed with the reward distribution, making the harvest function ineffective
Impact
The harvest function will never distribute rewards, leading to stakers not receiving their earned rewards and potentially disrupting the incentive mechanism of the staking contract.
Code Snippet
Tool used
Manual Review
Recommendation
remove that check.
Duplicate of #11