Request form
Discrete Staking Rewards Example
  • ERC20
  • Staking
  • Rewards
  • No-Code Deploy
  • Docs
    Source
    ChefGPT

    Discrete Staking Rewards Example

    Similar to the staking rewards contract. Difference is that reward amount may vary at each second.

    balanceOf(address) :
    The amount a user currently has staked.
    calculateRewardsEarned(address) :
    The amount an address has already earned.
    claim() :
    Claims rewards that have already been earned.
    rewardToken() :
    The reward token address.
    stake(uint256) :
    Stakes more of the staking token.
    stakingToken() :
    The staking token address
    totalSupply() :
    The total amount of the staking token that is currently staked.
    unstake(uint256) :
    Unstakes an amount of the staking token.
    updateRewardIndex(uint256) :
    Adds more rewards to the staking contract to increase the duration that rewards are paid out.
    DiscreteStakingRewards.sol
    ABI:
    Bytecode:

    6 downloads

    Solidity Version

    v0.8.17
    solidity-by-example / Discrete Staking Rewards Example
  • ERC20
  • Staking
  • Rewards
  • No-Code Deploy
  • Docs
    Source
    ChefGPT
    Expand
    Share

    Discrete Staking Rewards Example

    Similar to the staking rewards contract. Difference is that reward amount may vary at each second.

    balanceOf(address) :
    The amount a user currently has staked.
    calculateRewardsEarned(address) :
    The amount an address has already earned.
    claim() :
    Claims rewards that have already been earned.
    rewardToken() :
    The reward token address.
    stake(uint256) :
    Stakes more of the staking token.
    stakingToken() :
    The staking token address
    totalSupply() :
    The total amount of the staking token that is currently staked.
    unstake(uint256) :
    Unstakes an amount of the staking token.
    updateRewardIndex(uint256) :
    Adds more rewards to the staking contract to increase the duration that rewards are paid out.
    DiscreteStakingRewards.sol
    ABI:
    Bytecode:

    Get Cookin'
    star icon6

    6 downloads

    Solidity Version

    v0.8.17