{"_id":"@chanceprotocol/pooltogether-rng-contracts","name":"@chanceprotocol/pooltogether-rng-contracts","dist-tags":{"latest":"1.5.3"},"versions":{"1.5.3":{"name":"@chanceprotocol/pooltogether-rng-contracts","author":{"name":"PoolTogether, Inc."},"version":"1.5.3","description":"PoolTogether RNG Service Smart Contracts","license":"GPL-3.0","main":"index.js","dependencies":{"@chanceprotocol/owner-manager-contracts":"1.1.0"},"devDependencies":{"@chainlink/contracts":"0.4.0","@nomiclabs/hardhat-ethers":"2.0.4","@nomiclabs/hardhat-etherscan":"3.0.0","@nomiclabs/hardhat-waffle":"2.0.2","@openzeppelin/contracts":"4.7.3","@resolver-engine/core":"0.3.3","@types/node":"17.0.12","chai":"4.3.6","debug":"4.3.3","ethereum-waffle":"3.4.0","ethers":"5.5.3","hardhat":"2.8.3","hardhat-abi-exporter":"2.8.0","hardhat-dependency-compiler":"1.1.2","hardhat-deploy":"0.9.28","hardhat-deploy-ethers":"0.3.0-beta.13","hardhat-gas-reporter":"1.0.7","mocha-junit-reporter":"2.0.2","prettier":"2.5.1","prettier-plugin-solidity":"1.0.0-beta.19","solc":"0.8.6","solc-0.8":"npm:solc@0.8.6","solhint":"3.3.6","solidity-coverage":"0.7.18","solidity-docgen":"0.5.16","ts-node":"10.4.0","typescript":"4.5.5"},"scripts":{"docs":"solidity-docgen --solc-module solc-0.8 -i contracts -o docs -t templates","reinstall":"rm -rf node_modules/ && rm -f yarn.lock && yarn clean && yarn","verify":"yarn hint && yarn test","hint":"solhint \"contracts/**/*.sol\"","test":"yarn clean-test && hardhat test","compile":"hardhat --show-stack-traces --max-memory 8192 compile","coverage":"HIDE_DEPLOY_LOG=true OPTIMIZER_DISABLED=true hardhat coverage","coverage:file":"HIDE_DEPLOY_LOG=true OPTIMIZER_DISABLED=true hardhat coverage --testfiles","gas":"REPORT_GAS=true hardhat test","start":"DEBUG=* hardhat node","deploy":"hardhat deploy --write true --network","clean":"rm -rf artifacts cache","clean-test":"rm -rf deployments/hardhatevm_31337 test-results.xml","format":"prettier --config .prettierrc --write \"**/*.*.{ts,js}\" \"contracts/**/*.sol\"","format:file":"prettier --config .prettierrc --write","etherscan-verify":"hardhat etherscan-verify --solc-input --api-key $ETHERSCAN_API_KEY --network"},"_id":"@chanceprotocol/pooltogether-rng-contracts@1.5.3","_integrity":"sha512-VkNKE9ftmKhKMM6wmi2r7zfqenXPKOe3eCvDurZQ5VwBjmx9b+ckroZv1gz9tb/SL6Bni2ENQc1HXK3JSgJCUQ==","_resolved":"/tmp/733d9800941b49937ea5a78a4952ee11/chanceprotocol-pooltogether-rng-contracts-1.5.3.tgz","_from":"file:chanceprotocol-pooltogether-rng-contracts-1.5.3.tgz","_nodeVersion":"16.15.1","_npmVersion":"9.6.5","dist":{"integrity":"sha512-VkNKE9ftmKhKMM6wmi2r7zfqenXPKOe3eCvDurZQ5VwBjmx9b+ckroZv1gz9tb/SL6Bni2ENQc1HXK3JSgJCUQ==","shasum":"d8f7679cc8d44ff2c1e84860c4938eac5a56d8ab","tarball":"https://registry.npmjs.org/@chanceprotocol/pooltogether-rng-contracts/-/pooltogether-rng-contracts-1.5.3.tgz","fileCount":132,"unpackedSize":12286062,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD9AmJMHmPxG79vniDGO6pHtKHxzAtY203TvfTFzVHWUQIhAIbJ/iAJOkHnZVLYogSLoJXterIZ8Ey2bjn7Pf/SLdiQ"}]},"_npmUser":{"name":"chanceprotocol","email":"chance@netixsol.com"},"directories":{},"maintainers":[{"name":"chanceprotocol","email":"chance@netixsol.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pooltogether-rng-contracts_1.5.3_1692257329667_0.20476100013345944"},"_hasShrinkwrap":false}},"time":{"created":"2023-08-17T07:28:49.595Z","1.5.3":"2023-08-17T07:28:49.999Z","modified":"2023-08-17T07:28:50.254Z"},"maintainers":[{"name":"chanceprotocol","email":"chance@netixsol.com"}],"description":"PoolTogether RNG Service Smart Contracts","author":{"name":"PoolTogether, Inc."},"license":"GPL-3.0","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> const signer = (await ethers.getSigners())[0]\n> const d = await deployments.all()\n> const chainlink = await ethers.getContractAt('RNGChainlink', d.RNGChainlink.address, signer)\n> 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 & Deploy\n\n```sh\n$ yarn start\n```\n\nDeploy to an Ethereum Network\n","readmeFilename":"README.md"}