{"repo":"arhamj/staking-rewards-contract","free":true,"listed":false,"github":"https://github.com/arhamj/staking-rewards-contract","clone":"git clone https://github.com/arhamj/staking-rewards-contract.git","description":"Solidity smart contract for ERC20 token staking. Single token staking, LP token staking, etc.","language":"Solidity","stars":14,"topics":["solidity","smart-contracts","staking-rewards"],"license":"MIT","category":"blockchain-web3","readme_excerpt":"Staking Rewards Contract A time-based ERC20 staking rewards contract, derived from the Synthetix StakingRewards design. Users deposit a staking token and continuously accrue a rewards token over a configurable distribution period. Contracts - StakingRewards.sol — core staking contract. Users stake , withdraw , getReward , or exit . The owner can recover non-staking ERC20s and configure the rewards duration; the designated rewards distributor calls notifyRewardAmount to start or top up a reward epoch. - StakingRewardUpdater.sol — helper used by the deployer to roll multiple expired StakingRewards instances into a new epoch in one transaction (accept ownership, set duration, fund, notify, hand ownership back). - RewardsDistributionRecipient.sol , Owned.sol , Pausable.sol — access control and pause primitives used by the core contract. - interfaces/IStakingRewards.sol — external interface. - utils/ERC20Token.sol — minimal ERC20 used in tests/migrations. Requirements - Node.js and npm - Truffle ( npm install -g truffle ) - Solidity 0.5.16 (resolved automatically by Truffle) Setup Build Develop Launches the Truffle development console with an in-memory chain: Deploy Configure a network in truffle-config.js , then update the constructor arguments in migrations/3 deploy staking rewards.js (owner, rewards distributor, rewards token, staking token) and run: Usage 1. Deploy StakingRewards with the owner, rewards distributor, rewards token, and staking token addresses. 2. Optionally cal","default_branch":null,"files":null,"tree":[],"storefront":"/r/arhamj","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/arhamj/staking-rewards-contract/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}