StakingRewards Smart Contract Module in Bunzz

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

  1. Prepares staking token, rewards token address, and rewards duration.
  2. Owner funds rewards token.
  3. Users can stake staking tokens, rewards amount will be calculated by shares.
  4. Users can unstake tokens if requires or exit staking.
  5. Users can claim rewards anytime.
  6. 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.

Share this article: