{"id":20001991,"url":"https://github.com/pooltogether/pooltogether-reserve-contracts","last_synced_at":"2026-06-10T17:31:14.297Z","repository":{"id":53188033,"uuid":"350442627","full_name":"pooltogether/pooltogether-reserve-contracts","owner":"pooltogether","description":"Configurable Reserve contracts for PoolTogether prize pools","archived":false,"fork":false,"pushed_at":"2021-06-11T22:57:00.000Z","size":704,"stargazers_count":2,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-28T20:43:46.233Z","etag":null,"topics":[],"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/pooltogether.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}},"created_at":"2021-03-22T18:07:40.000Z","updated_at":"2022-03-29T04:17:10.000Z","dependencies_parsed_at":"2022-09-14T14:10:35.958Z","dependency_job_id":null,"html_url":"https://github.com/pooltogether/pooltogether-reserve-contracts","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/pooltogether/pooltogether-reserve-contracts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pooltogether%2Fpooltogether-reserve-contracts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pooltogether%2Fpooltogether-reserve-contracts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pooltogether%2Fpooltogether-reserve-contracts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pooltogether%2Fpooltogether-reserve-contracts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pooltogether","download_url":"https://codeload.github.com/pooltogether/pooltogether-reserve-contracts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pooltogether%2Fpooltogether-reserve-contracts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34163253,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"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:21.853Z","updated_at":"2026-06-10T17:31:14.280Z","avatar_url":"https://github.com/pooltogether.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PoolTogether Reserve\n[![Coverage Status](https://coveralls.io/repos/github/pooltogether/pooltogether-reserve-contracts/badge.svg?branch=main)](https://coveralls.io/github/pooltogether/pooltogether-reserve-contracts?branch=main)\n\n[![CircleCI](https://circleci.com/gh/pooltogether/pooltogether-reserve-contracts.svg?style=svg)](https://circleci.com/gh/pooltogether/pooltogether-reserve-contracts)\n\nPoolTogether captures a portion of the yield produced by the prize pools as \"reserve\".  The percentage of yield that is captured is called the \"reserve rate\".\n\nCurrently (before this implementation) there is a single, global reserve rate that is applied to all pools.  However, PoolTogether governance will like to set a higher reserve rate for governance-managed pools, and do not wish to affect community pools.\n\nThe Configurable Reserve contracts outline a new Reserve interface that will allow governance to configure a reserve rate for each pool separately, as well as setting an opt-out default rate across all prize pools.\n\n# Interface\n\nA prize pools reserve rate can be set by calling:\n```solidity\nfunction setReserveRateMantissa(address[] calldata sources,  uint224[] calldata _reserveRates, bool[] calldata useCustom) external;\n```\nThe `useCustom` boolean flag overrides the use of the default pool-wide reserve rate. \nNote that only the owner of the contract can call this function. In the case of PoolTogether the owner will be the governance (timelock) contract.\n\n\nA prize pools reserve rate can be viewed by calling:\n```solidity\nfunction reserveRateMantissa(address source) external view returns (uint256);\n```\n\nThe default reserve rate across all prize pools can be set with: \n```solidity\nfunction setDefaultReserveRateMantissa(uint224 _reserveRateMantissa) external override\n```\nNote: only the contract owner can call this function. \n\n\nThe concept of a withdrawStrategist allows the reserve to be withdrawn by a custom `withdrawStrategist` address. This can be set by calling:\n```solidity\nfunction setWithdrawStrategist(address _strategist) external override onlyOwner{\n```\nNote: only the contract ower can call this function. \n\n\nThe actual reserve amount can be withdrawn from a prize pool by either the contract owner or the `withdrawStrategist` by calling:\n```solidity\n function withdrawReserve(address prizePool, address to) external override onlyOwnerOrWithdrawStrategist returns (uint256)\n```\n\n# Setup\nTo setup repo install with:\n`yarn`\n\nSetup environmental variables with:\n`cp .envrc.example .envrc`\nand fill `.envrc` with your own variables and api keys.\n\nImport the environmental variables with:\n`direnv allow`\n\n# To deploy\n## Locally\nTo deploy locally for development run:\n`yarn deploy localhost`\n\n## To a network\nEnsure HDWALLET_MNEMONIC is set in .envrc and run:\n`yarn deploy \u003cnetwork-name\u003e`\n\n### To verify\nEnsure ETHERSCAN_API_KEY is set in .envrc and run:\n`yarn verify \u003cnetwork-name\u003e`\n\n# Testing\n## Locally\nTo test the contracts locally run:\n`yarn \u0026\u0026 yarn test`\n\n## Coverage\nTo display contract coverage run: \n`yarn coverage`\n\n\n## To fork test\nAfter specifying the fork block in `hardhat.networks.js`, start the mainnet fork with:\n `yarn start-fork`\n\nIn another terminal window run:\n`yarn fork-run ./scripts/setupReserve.js`\n\n\n# Connecting the ConfigurableReserve to the Prize Pools\nThe prize pools lookup where the reserve rates are set at the ReserveRegistry (https://etherscan.io/address/0x3e8b9901dbfe766d3fe44b36c180a1bca2b9a295).\n\nThis Registry contract is owned by the PoolTogether governance system (specifically the timelock contract).\n\nThis Registry can now be updated to instead point at the ConfigurableReserve (https://etherscan.io/address/0xd1797D46C3E825fce5215a0259D3426a5c49455C) by the timelock calling:\n\n```solidity\nfunction register(address _pointer) external onlyOwner\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpooltogether%2Fpooltogether-reserve-contracts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpooltogether%2Fpooltogether-reserve-contracts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpooltogether%2Fpooltogether-reserve-contracts/lists"}