{"id":20162623,"url":"https://github.com/codeamt/soliditystakingfornfts","last_synced_at":"2025-07-12T13:34:27.995Z","repository":{"id":201923680,"uuid":"458751592","full_name":"codeamt/SolidityStakingForNFTs","owner":"codeamt","description":"A simple staking environment; users stake erc-20 tokens to yield erc-1155 tokens (NFTs)","archived":false,"fork":false,"pushed_at":"2022-02-14T08:26:33.000Z","size":260,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-03T02:45:23.070Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Solidity","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/codeamt.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}},"created_at":"2022-02-13T08:27:11.000Z","updated_at":"2022-02-14T08:41:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"7210a0aa-00d8-4e0a-aa17-ae5e80711a1e","html_url":"https://github.com/codeamt/SolidityStakingForNFTs","commit_stats":null,"previous_names":["codeamt/soliditystakingfornfts"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/codeamt/SolidityStakingForNFTs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeamt%2FSolidityStakingForNFTs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeamt%2FSolidityStakingForNFTs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeamt%2FSolidityStakingForNFTs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeamt%2FSolidityStakingForNFTs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeamt","download_url":"https://codeload.github.com/codeamt/SolidityStakingForNFTs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeamt%2FSolidityStakingForNFTs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265002549,"owners_count":23696076,"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":[],"created_at":"2024-11-14T00:25:57.867Z","updated_at":"2025-07-12T13:34:27.945Z","avatar_url":"https://github.com/codeamt.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Solidity Staking for Non-Fungible Tokens (NFTs)\n\nA simple staking environment; users stake erc-20 tokens to yield ERC-1155 tokens. This contract was developed and tested with HardHat.\n\n## How the contract works: \n\n- User deposits NFTs to contract, worth x amount of \"points\" (ERC-20 \"TestTokens\").\n- User can also increase point balance, by depositing/staking TestTokens\n- If a User has enough points (meets a points threshold, they can use points to claim NFTs\n- Points are accumulated at configurable emission rate \n\n## Key Features\n\n- Applied use case of ERC-1155 Multi-token Standard \n- Supports staking for dedicated ERC-20 token (e.g., TestToken)\n- Point emission rate proportional to staked TestTokens\n- Yielding entire NFT collections or single collectibles\n- Pause/resume functionality\n- Supports full exit, withdrawing NFTs and TestTokens in a single transaction\n\n## Contract Functions\n0. The Constructor \n```\nconstructor(uint256 _emissionRate, IERC20 _testToken) public;\n```\n\n1. Depositing NFTs\n```\nfunction addNFT(\n    address contractAddress, \n    uint256 id, \n    uint256 total, \n    ui external;nt256 price\n) external;\n```\n\n2. Deposit TestTokens\n```\nfunction deposit(uint256 _amount) external;\n```\n\n3. Viewing Point Balance \n```\nfunction pointsBalance(address userAddress) public view returns (uint256);\n```\n\n4. Claim specific NFTs for Points\n```\nfunction claim(uint256 _nftIndex, uint256 quantity) public;\n```\n\n5. Claim random NFTs for points \n```\nfunction claimRandom() public; \n```\n\n6. Withdraw TestTokens \n```\nfunction withdraw(uint256 amount) public;\n```\n\n7. Make an Exit\n```\nfunction exit() external; \n```\n\n## Local Development\n\n#### Accessing the Code and Compiling Contact:\n\n```\n$ git clone https://github.com/codeamt/SolidityStakingForNFTs \u0026\u0026 cd SolidityStakingForNFTs\n$ npm install \n$ npx hardhat compile\n```\n\n#### Running Tests:\n\n```\n$ npx hardhat test\n```\n\n#### Running example script utilizing \n\n```\n$ npx hardhat node\n$ node scripts/sample-script.js\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeamt%2Fsoliditystakingfornfts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeamt%2Fsoliditystakingfornfts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeamt%2Fsoliditystakingfornfts/lists"}