The StakingRewards contract allows to stake tokens for certain duration and get rewards according to their staked shares. In other words, it rewards users for staking ERC20 tokens with more ERC20 tokens in return.
You can access this Module and the code here: https://bit.ly/3zzyocs
How to Use
- Prepares staking token, rewards token address, and rewards duration.
- Owner funds rewards token.
- Users can stake staking tokens, rewards amount will be calculated by shares.
- Users can unstake tokens if requires or exit staking.
- Users can claim rewards anytime.
- Owner can fund again after rewards duration.
Functions
#WRITE
- recoverERC20
- renounceOwnership
- setRewardsDuration
- stake
- transferOwnership
- unstake
- claim
- exit
- fund
#READ
- balanceOf
- earned
- lastTimeRewardApplicable
- lastUpdateTime
- owner
- paused
- periodFinish
- rewardPerToken
- rewardPerTokenStored
- rewardRate
- rewards
- rewardsDuration
- rewardsToken
- stakingToken
- getRewardForDuration
- userRewardPerTokenPaid
You can access this Module and the code here: https://bit.ly/3zzyocs
If you still haven’t signed up to Bunzz, what are you waiting for?
Sign up here https://app.bunzz.dev/signup and get your smart contracts deployed in 5 minutes through our great GUI.