Staking Rewards | Solidity 0.8
Channel: Smart Contract Programmer
Date: 2022-08-11

Code for staking rewards contract.

0:00 - State variables and constructor
4:02 - Functions overview
6:01 - setRewardsDuration
7:40 - notifyRewardAmount
11:15 - stake
13:02 - earned
14:58 - rewardPerToken
16:42 - lastTimeRewardApplicable
18:30 - updateRewards
21:02 - Attach modifier updateRewards
21:50 - getReward
23:10 - Fix code
23:36 - Demo on Remix

Code
https://solidity-by-example.org/defi/staking-rewards

Take a course
https://www.smartcontract.engineer/

#Solidity #SmartContract #Ethereum  #スマートコントラクト

Remix
https://remix.ethereum.org

Follow 
https://odysee.com/@SmartContractProgrammer:8
https://twitter.com/ProgrammerSmart
https://discord.gg/bt8FK2wkcW
https://t.me/smartcontractprogrammer
https://smartcontractprogrammer.com