{"id":15291895,"url":"https://github.com/mehdikhosa50/peoplesstakingdapp","last_synced_at":"2025-05-07T05:05:27.957Z","repository":{"id":257214285,"uuid":"857525927","full_name":"MehdiKhosa50/PeoplesStakingDapp","owner":"MehdiKhosa50","description":"A Solidity-based staking system that allows users to stake ERC20 tokens and earn rewards over time. Built with Hardhat and OpenZeppelin, this project implements secure staking, withdrawal, and reward claiming functionalities, complete with comprehensive testing.","archived":false,"fork":false,"pushed_at":"2024-09-15T21:31:36.000Z","size":237,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T05:05:19.696Z","etag":null,"topics":["chai-mocha","ethersjs","hardhat","javascript","openzeppelin","solidity","staking-rewards","unit-testing"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MehdiKhosa50.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-14T21:57:20.000Z","updated_at":"2025-01-24T11:41:37.000Z","dependencies_parsed_at":"2024-10-23T13:59:04.632Z","dependency_job_id":null,"html_url":"https://github.com/MehdiKhosa50/PeoplesStakingDapp","commit_stats":null,"previous_names":["mehdikhosa50/peoplesstakingdapp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MehdiKhosa50%2FPeoplesStakingDapp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MehdiKhosa50%2FPeoplesStakingDapp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MehdiKhosa50%2FPeoplesStakingDapp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MehdiKhosa50%2FPeoplesStakingDapp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MehdiKhosa50","download_url":"https://codeload.github.com/MehdiKhosa50/PeoplesStakingDapp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252817010,"owners_count":21808705,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chai-mocha","ethersjs","hardhat","javascript","openzeppelin","solidity","staking-rewards","unit-testing"],"created_at":"2024-09-30T16:15:01.704Z","updated_at":"2025-05-07T05:05:27.941Z","avatar_url":"https://github.com/MehdiKhosa50.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"𝐒𝐭𝐚𝐤𝐢𝐧𝐠 𝐒𝐦𝐚𝐫𝐭 𝐂𝐨𝐧𝐭𝐫𝐚𝐜𝐭 𝐏𝐫𝐨𝐣𝐞𝐜𝐭\n\n#Overview\nThis project implements a staking smart contract system using Solidity and Hardhat. Users can stake ERC20 tokens and earn rewards over time. The system includes a main Staking contract, along with separate ERC20 tokens for staking and rewards.\n\n𝐅𝐞𝐚𝐭𝐮𝐫𝐞𝐬\nStake ERC20 tokens\nEarn rewards based on staking duration and amount\nWithdraw staked tokens\nClaim accumulated rewards\nConfigurable reward rate\n\n\n𝐓𝐞𝐜𝐡𝐧𝐨𝐥𝐨𝐠𝐢𝐞𝐬 𝐔𝐬𝐞𝐝\nSolidity ^0.8.0\nHardhat\nEthers.js\nOpenZeppelin Contracts\nChai (for testing)\n\n𝐏𝐫𝐨𝐣𝐞𝐜𝐭 𝐒𝐭𝐫𝐮𝐜𝐭𝐮𝐫𝐞\n├── contracts/\n│   ├── Staking.sol\n│   ├── RewardToken.sol\n│   └── StakedToken.sol\n├── test/\n│   └── Staking.js\n├── scripts/\n├── hardhat.config.js\n└── package.json\nSetup\n\n𝐂𝐥𝐨𝐧𝐞 𝐭𝐡𝐞 𝐫𝐞𝐩𝐨𝐬𝐢𝐭𝐨𝐫𝐲:\ngit clone \u003crepository-url\u003e\ncd \u003cproject-directory\u003e\n\n𝐈𝐧𝐬𝐭𝐚𝐥𝐥 𝐝𝐞𝐩𝐞𝐧𝐝𝐞𝐧𝐜𝐢𝐞𝐬:\nnpm install\n\n𝐂𝐨𝐦𝐩𝐢𝐥𝐞 𝐭𝐡𝐞 𝐜𝐨𝐧𝐭𝐫𝐚𝐜𝐭𝐬:\nnpx hardhat compile\n\n𝐑𝐮𝐧 𝐭𝐞𝐬𝐭𝐬:\nnpx hardhat test\n\n𝐑𝐮𝐧𝐧𝐢𝐧𝐠 𝐓𝐞𝐬𝐭𝐬:\nThe project includes a comprehensive test suite. To run the tests:\nnpx hardhat test\nThis will run all tests in the test/ directory.\nDeployment\n𝐓𝐨 𝐝𝐞𝐩𝐥𝐨𝐲 𝐭𝐡𝐞 𝐜𝐨𝐧𝐭𝐫𝐚𝐜𝐭𝐬 𝐭𝐨 𝐚 𝐧𝐞𝐭𝐰𝐨𝐫𝐤:\n\nSet up your network configuration in hardhat.config.js\nCreate a deployment script in the scripts/ directory\n𝐑𝐮𝐧 𝐭𝐡𝐞 𝐝𝐞𝐩𝐥𝐨𝐲𝐦𝐞𝐧𝐭 𝐬𝐜𝐫𝐢𝐩𝐭:\nnpx hardhat run scripts/deploy.js --network \u003cnetwork-name\u003e\n\n𝐂𝐨𝐧𝐭𝐫𝐚𝐜𝐭 𝐃𝐞𝐭𝐚𝐢𝐥𝐬\nStaking.sol\nThe main contract that handles staking, withdrawing, and reward distribution.\n\n𝐊𝐞𝐲 𝐟𝐮𝐧𝐜𝐭𝐢𝐨𝐧𝐬:\nStake(uint256 _amount): Stake tokens\nWithdraw(uint256 _amount): Withdraw staked tokens\nClaimReward(): Claim accumulated rewards\n\nRewardToken.sol and StakedToken.sol\nERC20 token contracts for the reward and staked tokens respectively.\nSecurity Considerations\n\nThe contract uses OpenZeppelin's SafeMath library to prevent overflow/underflow issues.\nToken transfers are checked for success to prevent silent failures.\nThe contract includes access control to prevent unauthorized actions.\n\n𝐇𝐨𝐰𝐞𝐯𝐞𝐫, 𝐛𝐞𝐟𝐨𝐫𝐞 𝐝𝐞𝐩𝐥𝐨𝐲𝐢𝐧𝐠 𝐭𝐨 𝐚 𝐥𝐢𝐯𝐞 𝐧𝐞𝐭𝐰𝐨𝐫𝐤:\n\nConduct a thorough code review.\nConsider getting a professional audit, especially if significant value will be managed by the contract.\nTest extensively on a testnet before deploying to mainnet.\n\nContributing\nContributions are welcome! Please feel free to submit a Pull Request.\n𝐋𝐢𝐜𝐞𝐧𝐬𝐞\n𝐓𝐡𝐢𝐬 𝐩𝐫𝐨𝐣𝐞𝐜𝐭 𝐢𝐬 𝐥𝐢𝐜𝐞𝐧𝐬𝐞𝐝 𝐮𝐧𝐝𝐞𝐫 𝐭𝐡𝐞 𝐌𝐈𝐓 𝐋𝐢𝐜𝐞𝐧𝐬𝐞.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmehdikhosa50%2Fpeoplesstakingdapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmehdikhosa50%2Fpeoplesstakingdapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmehdikhosa50%2Fpeoplesstakingdapp/lists"}