You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we have similar reward calculation logic implemented in both the launchpad and gov/staker packages. This leads to code duplication and potential maintenance issues. We should extract the common functionality into a shared reward package to improve code reusability and maintainability.
Proposed Solution
Create a new reward package that contains the common reward calculation logic. This package will provide base structures and interfaces that can be extended by both the launchpad and staker packages for their specific needs.
Key Components
Common Structures:
RewardInfo: Base structure for storing staking and reward information
Description
Background
Currently, we have similar reward calculation logic implemented in both the
launchpad
andgov/staker
packages. This leads to code duplication and potential maintenance issues. We should extract the common functionality into a sharedreward
package to improve code reusability and maintainability.Proposed Solution
Create a new
reward
package that contains the common reward calculation logic. This package will provide base structures and interfaces that can be extended by both thelaunchpad
andstaker
packages for their specific needs.Key Components
Common Structures:
RewardInfo
: Base structure for storing staking and reward informationRewardCalculator
: Interface defining core reward calculation methodsBaseRewardState
: Base structure for managing reward stateFunctions to be Extracted:
AddStake
reward.BaseRewardState
RemoveStake
reward.BaseRewardState
CalculateReward
reward.BaseRewardState
Info
reward.BaseRewardState
GetRewardInfo
PriceAccumulationUint64
reward.BaseRewardState
finalize/UpdateRewards
reward.BaseRewardState
UpdateRewards
Launchpad-specific:
Staker-specific:
The text was updated successfully, but these errors were encountered: