{"id":20001994,"url":"https://github.com/pooltogether/pooltogether-rng-contracts","last_synced_at":"2026-05-14T19:06:23.356Z","repository":{"id":42462100,"uuid":"275048070","full_name":"pooltogether/pooltogether-rng-contracts","owner":"pooltogether","description":"PoolTogether RNG Service","archived":false,"fork":false,"pushed_at":"2023-06-19T19:53:19.000Z","size":4030,"stargazers_count":20,"open_issues_count":1,"forks_count":20,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-11-29T01:30:45.748Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pooltogether.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2020-06-26T01:18:05.000Z","updated_at":"2024-06-10T01:51:47.000Z","dependencies_parsed_at":"2024-11-13T05:30:07.546Z","dependency_job_id":null,"html_url":"https://github.com/pooltogether/pooltogether-rng-contracts","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/pooltogether/pooltogether-rng-contracts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pooltogether%2Fpooltogether-rng-contracts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pooltogether%2Fpooltogether-rng-contracts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pooltogether%2Fpooltogether-rng-contracts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pooltogether%2Fpooltogether-rng-contracts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pooltogether","download_url":"https://codeload.github.com/pooltogether/pooltogether-rng-contracts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pooltogether%2Fpooltogether-rng-contracts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33039275,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-13T05:19:23.508Z","updated_at":"2026-05-14T19:06:23.339Z","avatar_url":"https://github.com/pooltogether.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PoolTogether Prize Savings Protocol - RNG Service\n\n![Tests](https://github.com/pooltogether/pooltogether-rng-contracts/actions/workflows/main.yml/badge.svg)\n[![Coverage Status](https://coveralls.io/repos/github/pooltogether/pooltogether-rng-contracts/badge.svg?branch=master)](https://coveralls.io/github/pooltogether/pooltogether-rng-contracts?branch=master)\n[![built-with openzeppelin](https://img.shields.io/badge/built%20with-OpenZeppelin-3677FF)](https://docs.openzeppelin.com/)\n[![GPLv3 license](https://img.shields.io/badge/License-GPLv3-blue.svg)](http://perso.crans.org/besson/LICENSE.html)\n\nThe [PoolTogether](https://www.pooltogether.com/) Prize Savings Protocol Ethereum smart contracts.\n\nSee the [documentation](https://v4.docs.pooltogether.com)\n\n# Deployments\n\n- [Ethereum](https://v4.docs.pooltogether.com/protocol/deployments/rng#ethereum)\n- [Polygon](https://v4.docs.pooltogether.com/protocol/deployments/rng#polygon)\n\n# RNG contracts in this repository\n- [RNGBlockhash](/contracts/RNGBlockhash.sol)\n- [RNGChainlink](/contracts/RNGChainlink.sol)\n- [RNGChainlinkV2](/contracts/RNGChainlinkV2.sol)\n\n# External RNG contracts\n- [RNGWitnet](https://github.com/drcpu-github/rng-witnet-pooltogether)\n\nThe RNGWitnet contract is a custom-built solution to request a [random number](https://docs.witnet.io/smart-contracts/witnet-randomness-oracle) from the [Witnet oracle](https://witnet.io/). It is hosted in a separate repository as it is built using the Python-based Brownie development suite.\n\n# Setup\n\nInstall Dependencies\n\n```sh\n$ yarn\n```\n\nCopy over .envrc.example to .envrc\n\n```sh\n$ cp .envrc.example .envrc\n```\n\nMake sure to update the enviroment variables with suitable values.\n\nNow enable the env vars using [direnv](https://direnv.net/docs/installation.html)\n\n```sh\n$ direnv allow\n```\n\n# Interacting using Hardhat Console\n\nYou can interact with the contract using the buidler console:\n\n```sh\n$ npx hardhat console --network [network]\n```\n\nThen you can interact with deployed contracts:\n\n```javascript\n\u003e const signer = (await ethers.getSigners())[0]\n\u003e const d = await deployments.all()\n\u003e const chainlink = await ethers.getContractAt('RNGChainlink', d.RNGChainlink.address, signer)\n\u003e const link = await ethers.getContractAt('IERC20', (await chainlink.getLink()), signer)\n```\n\n# Deploying\n\nYou can deploy using the deploy script:\n\n```sh\n$ yarn deploy [network]\n```\n\nWhere [network] can be `mainnet`, `rinkeby`, `ropsten`, or `kovan`.\n\nNow you should verify the contracts on Etherscan:\n\n```sh\n$ yarn etherscan-verify [network]\n```\n\nThe network option is the same as above.\n\n# Development\n\nVerify Codebase (hint + test)\n\n```sh\n$ yarn verify\n```\n\nRun Static Code Analysis\n\n```sh\n$ yarn hint\n```\n\nRun Tests\n\n```sh\n$ yarn test\n```\n\nRun Coverage\n\n```sh\n$ yarn coverage\n```\n\nRun Gas Report\n\n```sh\n$ yarn gas\n```\n\nStart Local TestRPC \u0026 Deploy\n\n```sh\n$ yarn start\n```\n\nDeploy to an Ethereum Network\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpooltogether%2Fpooltogether-rng-contracts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpooltogether%2Fpooltogether-rng-contracts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpooltogether%2Fpooltogether-rng-contracts/lists"}