{"_id":"@avedith/pooltogether-contracts","name":"@avedith/pooltogether-contracts","dist-tags":{"latest":"3.4.6"},"versions":{"3.4.6":{"name":"@avedith/pooltogether-contracts","version":"3.4.6","description":"PoolManager Prize Linked Savings Account Pool Smart Contracts","main":"index.js","license":"GPL-3.0","scripts":{"reinstall":"rm -rf node_modules/ && rm -f yarn.lock && yarn","verify":"yarn hint && yarn test","hint":"solhint \"contracts/**/*.sol\"","test":"HIDE_DEPLOY_LOG=true OPTIMIZER_DISABLED=true hardhat test","compile":"hardhat --show-stack-traces --max-memory 8192 compile","start":"echo 'Starting node for local testing....\n'; rm -rf deployments/localhost_31337; DISABLE_HARNESS=true hardhat node","start-gas":"echo 'Starting node for gas testing....\n'; rm -rf deployments/localhost_31337; DISABLE_HARNESS=true hardhat node","start-fork":"rm -rf deployments/localhost; cp -r deployments/mainnet deployments/localhost && FORK_ENABLED=true hardhat node --no-deploy","redeploy-fork":"rm -rf deployments/localhost; yarn deploy localhost","impersonate-accounts":"hardhat run ./scripts/fork/impersonateAccounts.js --network localhost","stop-impersonate":"hardhat run ./scripts/fork/stopImpersonation.js --network localhost","fork-whale":"hardhat --network fork run ./scripts/fork-whale.js","verify-contract-version-match":"./scripts/matchVersions.js","fork-run":"hardhat run --network localhost","console":"hardhat console --network","coverage":"yarn clean && HIDE_DEPLOY_LOG=true OPTIMIZER_DISABLED=true node --max-old-space-size=4096 ./node_modules/.bin/hardhat coverage --network coverage --temp build","gas":"REPORT_GAS=true hardhat test --network localhost","deploy":"hardhat deploy --write true --network","deploy-drips":"hardhat run ./js/deployDripTokens.js --network","testnet-txs":"hardhat run ./js/runTestnetTransactions.js --network","etherscan-verify":"hardhat run ./scripts/verify.js --network","etherscan-verify-bsc":"hardhat --config hardhat.config.bsc.js run ./scripts/verify.js --network","etherscan-verify-polygon":"hardhat --config hardhat.config.polygon.js run ./scripts/verify.js --network","deploy-ctoken-local":"./scripts/deployCTokenMock.js -n localhost -a $LOCAL_ADMIN_ADDRESS","clean":"rm -rf abis artifacts build .build-openzeppelin cache coverage coverage.json test-results.xml .cache-openzeppelin deployments/localhost deployments/localhost_*; mkdir abis","prepack":"yarn clean && yarn compile","postpublish":"PACKAGE_VERSION=$(./scripts/package-version.sh) && git tag -ae v$PACKAGE_VERSION && git push --tags","update-gitbook-networks":"./scripts/update-gitbook-networks.sh","mint":"hardhat run --network localhost scripts/mint.js","display-faucets":"hardhat run --network mainnet scripts/displayFaucetInfo.js","echidna:build":"docker build -t pool-contracts/echidna . -f Dockerfile.echidna","echidna":"yarn echidna:build && docker run -v \"$PWD\":/src pool-contracts/echidna"},"dependencies":{"@openzeppelin/contracts-upgradeable":"3.4.0","@pooltogether/fixed-point":"1.0.0-beta.2","@pooltogether/pooltogether-rng-contracts":"1.0.0","@pooltogether/uniform-random-number":"1.0.0-beta.1","@pooltogether/yield-source-interface":"^1.0.1","sortition-sum-tree-factory":"0.1.0"},"devDependencies":{"@nomiclabs/hardhat-ethers":"^2.0.2","@nomiclabs/hardhat-etherscan":"^2.1.4","@nomiclabs/hardhat-waffle":"^2.0.1","@resolver-engine/core":"0.3.3","@truffle/hdwallet-provider":"1.0.34","chai":"4.2.0","chalk":"4.0.0","debug":"4.1.1","ethereum-waffle":"^3.3.0","ethers":"^5.0.0","find":"^0.3.0","ganache-cli":"^6.12.0","hardhat":"2.6.6","hardhat-abi-exporter":"2.3.0","hardhat-deploy":"0.9.4","hardhat-deploy-ethers":"0.3.0-beta.11","minimist":"^1.2.5","mocha-junit-reporter":"1.23.3","shelljs":"0.8.3","solc":"0.6.4","solhint":"3.0.0","solidity-coverage":"0.7.15"},"gitHead":"d00420837cbbe2062908974f29d33d4bc68bf886","_id":"@avedith/pooltogether-contracts@3.4.6","_nodeVersion":"14.15.3","_npmVersion":"6.14.9","dist":{"integrity":"sha512-VskCzQbPWg1CfFBbd8y/a406SBMz4/u1SUz/gOtP1uQHjSNOk42R47fR1pOn599gcO4r8LsOdvJg5n0gig9w8g==","shasum":"61ec618e5b4a08b76400587ea1b02eebd3e4f291","tarball":"https://registry.npmjs.org/@avedith/pooltogether-contracts/-/pooltogether-contracts-3.4.6.tgz","fileCount":527,"unpackedSize":60080163,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDcviTXZ4ekrzIix7IqQqvVRP3RKsiLn/KoxqAj5Zq8pAIhAIZS3dxf5u22q4yriMYZwWo1dB+fbgb+DqdmeW2u5mQO"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiYTABACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo/KA//ebBwq1cQs1G9QEWj5haN5CmlWlEhZe+5tuLPBrQdmjMZrMeI\r\ndwFb1c/nDGmD+cEKdcWzF0qxQenhdkdyHZuwKgCDW0TNfyf1lz0uB2VmiNaj\r\nItaf8HhZnLPtDTX2N8TBobzsyKSgYtbpd7G3kirfoDwXx/JWiHdGz2rtw35A\r\ntJfGZqnZsCcl6l0IKUXiGcnd5k2X0syFPttDDPI8QGBPWQzaOFwEyhNzEmVH\r\nwyb5nS4cvNuKhYaBaZ5q5JleQGsEMU0AyFcW+5NeW2AbzQIjRXY+ogn52ufr\r\nFe+VfmdHMXGidLwoEzzGT6JCEhBbEn+hA4zvfWUgaTsXxip1FhdK9Xh2exev\r\n1VLRwEOzrJT93vSkVci0pl96okuwRZAflOrnd5hAmyV9DNB0Cis29PjerSI+\r\nVw5wNZzLnSg5XnbA/iAtpcillrgLMWCkIlExzaNT/PdkTNeeM63qBWLLDAQY\r\namKcKT3Y61x/ABD9LRFvUeCJfmgVwhm1QH40rXT6ygHO0Xo99mVNb9t4w73T\r\nE2TIZ7OqW21q5XSFTpycqIZ3DZIZcXFOtbwTek80xjObV1ihiu4LyjBtjn1l\r\nW3S4bX9peiR/ZLbUF/ybZsVSZJZyUqJaGg9m1BHjmZYr0XZV1VNq5NU4IlpN\r\n8NV5X26ZB1GB8+CF/JtsDCBDS6OHUDG7a9M=\r\n=fs7t\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"avedith","email":"avedith@avedith.dev"},"directories":{},"maintainers":[{"name":"avedith","email":"avedith@avedith.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/pooltogether-contracts_3.4.6_1650536449212_0.9641368618075834"},"_hasShrinkwrap":false}},"time":{"created":"2022-04-21T10:20:49.155Z","3.4.6":"2022-04-21T10:20:49.581Z","modified":"2022-04-21T10:20:49.739Z"},"maintainers":[{"name":"avedith","email":"avedith@avedith.dev"}],"description":"PoolManager Prize Linked Savings Account Pool Smart Contracts","license":"GPL-3.0","readme":"\r\n<p align=\"center\">\r\n  <a href=\"https://github.com/pooltogether/pooltogether--brand-assets\">\r\n    <img src=\"https://github.com/pooltogether/pooltogether--brand-assets/blob/977e03604c49c63314450b5d432fe57d34747c66/logo/pooltogether-logo--purple-gradient.png?raw=true\" alt=\"PoolTogether Brand\" style=\"max-width:100%;\" width=\"200\">\r\n  </a>\r\n</p>\r\n\r\n<br />\r\n\r\n# PoolTogether Prize Savings Protocol\r\n\r\n[![<PoolTogether>](https://circleci.com/gh/pooltogether/pooltogether-pool-contracts.svg?style=shield)](https://circleci.com/gh/pooltogether/pooltogether-pool-contracts) [![Coverage Status](https://coveralls.io/repos/github/pooltogether/pooltogether-pool-contracts/badge.svg?branch=master&service=github&kill_cache=2)](https://coveralls.io/github/pooltogether/pooltogether-pool-contracts?branch=master) [![built-with openzeppelin](https://img.shields.io/badge/built%20with-OpenZeppelin-3677FF)](https://docs.openzeppelin.com/)\r\n\r\nThe [PoolTogether](https://www.pooltogether.com/) Prize Savings Protocol Ethereum smart contracts.\r\n\r\nFor an overview of the concepts and API please see the [documentation](https://docs.pooltogether.com/)\r\n\r\n# Setup\r\n\r\nThis project is available as an NPM package:\r\n\r\n```bash\r\n$ yarn add @pooltogether/pooltogether-contracts\r\n```\r\n\r\n# Usage\r\n\r\n## Artifacts\r\n\r\nThere are deployment artifacts available in the `deployments/` directory. For example, to pull in the PoolWithMultipleWinnersBuilder artifact:\r\n\r\n```javascript\r\nconst PoolWithMultipleWinnersBuilder = require('@pooltogether/pooltogether-contracts/deployments/rinkeby/PoolWithMultipleWinnersBuilder.json')\r\nconst {\r\n  abi, \r\n  address, \r\n  receipt\r\n } = PoolWithMultipleWinnersBuilder\r\n```\r\n\r\n## ABIs\r\n\r\nApplication Binary Interfaces for all PoolTogether contracts and related contracts are available in the `abis/` directory.\r\n\r\nFor example, to pull in the PrizePool ABI:\r\n\r\n```javascript\r\nconst PrizePool = require('@pooltogether/pooltogether-contracts/abis/PrizePool.json')\r\n```\r\n\r\n# Development\r\n\r\nFirst clone this repository and enter the directory.\r\n\r\nInstall dependencies:\r\n\r\n```\r\n$ yarn\r\n```\r\n\r\nWe use [direnv](https://direnv.net/) to manage environment variables.  You'll likely need to install it.\r\n\r\n# Testing\r\n\r\nWe use [Hardhat](https://hardhat.dev) and [hardhat-deploy](https://github.com/wighawag/hardhat-deploy)\r\n\r\nTo run unit & integration tests:\r\n\r\n```sh\r\n$ yarn test\r\n```\r\n\r\nTo run coverage:\r\n\r\n```sh\r\n$ yarn coverage\r\n```\r\n\r\nTo run fuzz tests:\r\n\r\n```sh\r\n$ yarn echidna\r\n```\r\n\r\n# Fork Testing\r\n\r\nEnsure your environment variables are set up.  Make sure your Alchemy URL is set.  Now start a local fork:\r\n\r\n```sh\r\n$ yarn start-fork\r\n```\r\n\r\nSetup account impersonation and transfer eth:\r\n\r\n```sh\r\n$ ./scripts/setup.sh\r\n```\r\n\r\n# Deployment\r\n\r\n## Deploy Locally\r\n\r\nStart a local node and deploy the top-level contracts:\r\n\r\n```bash\r\n$ yarn start\r\n```\r\n\r\nNOTE: When you run this command it will reset the local blockchain.\r\n\r\n## Connect Locally\r\n\r\nStart up a [Hardhat Console](https://hardhat.dev/guides/hardhat-console.html):\r\n\r\n```bash\r\n$ hardhat console --network localhost\r\n```\r\n\r\nNow you can load up the deployed contracts using [hardhat-deploy](https://github.com/wighawag/hardhat-deploy):\r\n\r\n```javascript\r\n> await deployments.all()\r\n```\r\n\r\nIf you want to send transactions, you can get the signers like so:\r\n\r\n```javascript\r\n> let signers = await ethers.getSigners()\r\n```\r\n\r\nLet's mint some Dai for ourselves:\r\n\r\n```javascript\r\n> let dai = await ethers.getContractAt('ERC20Mintable', (await deployments.get('Dai')).address, signers[0])\r\n> await dai.mint(signers[0]._address, ethers.utils.parseEther('10000'))\r\n> ethers.utils.formatEther(await dai.balanceOf(signers[0]._address))\r\n```\r\n\r\n## Deploy to Live Networks\r\n\r\nCopy over .envrc.example to .envrc\r\n\r\n```\r\n$ cp .envrc.example .envrc\r\n```\r\n\r\nMake sure to update the enviroment variables with suitable values.\r\n\r\nNow enable the env vars using [direnv](https://direnv.net/docs/installation.html)\r\n\r\n```\r\n$ direnv allow\r\n```\r\n\r\nNow deploy to a network like so:\r\n\r\n```\r\n$ yarn deploy rinkeby\r\n```\r\n\r\nIt will update the `deployments/` dir.\r\n","readmeFilename":"README.md"}