The contract allows users to stake ERC20 tokens in exchange for rewards. Users can stake tokens, withdraw their staked tokens, and claim rewards based on their staking duration and the amount staked.
- Staking: Users can stake ERC20 tokens.
- Withdrawal: Users can withdraw their staked tokens.
- Reward Claiming: Users can claim rewards based on their staking activity.
- Incentives: Reward multipliers based on staking duration and amount.
-
Reward Per Token Calculation:
accumulatedRewardPerToken = accumulatedRewardPerToken + ((block.timestamp - lastRewardUpdate) * baseRewardRate * 10^tokenDecimals) / totalStaked
-
Total Earned Rewards Calculation:
totalRewards = sum(calculateEarnedRewards(events[i], account) for i in range(staker.processedIndex, len(events)))
-
Earned Rewards Calculation:
earnedRewards = (stakingEvent.amount * combinedMultiplier * baseRewardRate * stakingDuration) / 10^tokenDecimals
where:
combinedMultiplier = (timeMultiplier * tierMultiplier) / 10^tokenDecimals
Note: Development on this contract is ongoing, and additional features and advanced improvements are planned in future commits