{"id":20001934,"url":"https://github.com/pooltogether/v4-timelocks","last_synced_at":"2026-05-15T05:34:26.731Z","repository":{"id":45142498,"uuid":"408623990","full_name":"pooltogether/v4-timelocks","owner":"pooltogether","description":"Timelock contracts for v4 contracts","archived":false,"fork":false,"pushed_at":"2022-02-08T00:45:13.000Z","size":1288,"stargazers_count":3,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-12T13:14:28.998Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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}},"created_at":"2021-09-20T22:58:03.000Z","updated_at":"2022-04-05T14:14:39.000Z","dependencies_parsed_at":"2022-08-26T03:26:31.206Z","dependency_job_id":null,"html_url":"https://github.com/pooltogether/v4-timelocks","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":"pooltogether/pooltogether-contracts-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pooltogether%2Fv4-timelocks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pooltogether%2Fv4-timelocks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pooltogether%2Fv4-timelocks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pooltogether%2Fv4-timelocks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pooltogether","download_url":"https://codeload.github.com/pooltogether/v4-timelocks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241439791,"owners_count":19963098,"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-13T05:19:10.008Z","updated_at":"2026-05-15T05:34:26.669Z","avatar_url":"https://github.com/pooltogether.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PoolTogether V4 Timelocks Contracts\n\n![Tests](https://github.com/pooltogether/v4-timelocks/actions/workflows/main.yml/badge.svg)\n[![Coverage Status](https://coveralls.io/repos/github/pooltogether/v4-timelocks/badge.svg?branch=master)](https://coveralls.io/github/pooltogether/v4-timelocks?branch=master\u0026asdf=1)\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\n\u003cstrong\u003eHave questions or want the latest news?\u003c/strong\u003e\n\u003cbr/\u003eJoin the PoolTogether Discord or follow us on Twitter:\n\n[![Discord](https://badgen.net/badge/icon/discord?icon=discord\u0026label)](https://discord.gg/JFBPMxv5tr)\n[![Twitter](https://badgen.net/badge/icon/twitter?icon=twitter\u0026label)](https://twitter.com/PoolTogether_)\n\n**Documentation**\u003cbr\u003e\nhttps://v4.docs.pooltogether.com\n\n**Deployments**\u003cbr\u003e\n- [Ethereum](https://v4.docs.pooltogether.com/protocol/deployments/mainnet#mainnet)\n- [Polygon](https://v4.docs.pooltogether.com/protocol/deployments/mainnet#polygon)\n- [Avalanche](https://v4.docs.pooltogether.com/protocol/deployments/mainnet#avalanche)\n\n# Overview\n- [BeaconTimelockTrigger](/contracts/BeaconTimelockTrigger.sol)\n- [DrawCalculatorTimelock](/contracts/DrawCalculatorTimelock.sol)\n- [L1TimelockTrigger](/contracts/L1TimelockTrigger.sol)\n- [L2TimelockTrigger](/contracts/L2TimelockTrigger.sol)\n- [ReceiverTimelockTrigger](/contracts/ReceiverTimelockTrigger.sol)\n\nTimelock contracts assist with Phase 1 in the roll-out of V4. Granting authority to the operations teams to prevent a \"bad actor\" oracle from incorrectly setting a draw or prize distribution params. \n\n### DrawCalculatorTimelock\nThe DrawCalculatorTimelock adds a timelock for PrizeDistributor to execute a claim with the most recently pushed PrizeDistribution params pushed. \n\n### L1TimelockTrigger \u0026 L2TimelockTrigger\nBoth L1TimelockTrigger/L2TimelockTrigger contracts set a timelock or a \"cooldown\" period in the linked `DrawCalculatorTimelock` contract. The `DrawCalculatorTimelock` routes `calculate` execution through a `DrawCalculator` contract for the linked `PrizeDistributor` contract.\n\n### L1TimelockTrigger\nThe `L1TimelockTrigger` contract pushes `DrawLib.Draw` and `DrawLib.PrizeDistribution` params onto the `DrawBuffer` and `PrizeDistributionBuffer` contracts.\n\n### L2TimelockTrigger\nThe `L2TimelockTrigger` pushes `DrawLib.PrizeDistribution` params onto a `PrizeDistributionBuffer` contract.\n\n**Core and Periphery contracts:**\n\n- https://github.com/pooltogether/v4-core\n- https://github.com/pooltogether/v4-periphery\n\n# Getting Started\n\nThe project is made available as a NPM package.\n\n```sh\n$ yarn add @pooltogether/pooltogether-contracts\n```\n\nThe repo can be cloned from Github for contributions.\n\n```sh\n$ git clone https://github.com/pooltogether/v4-timelock\n```\n\n```sh\n$ yarn\n```\n\nWe use [direnv](https://direnv.net/) to manage environment variables.  You'll likely need to install it.\n\n```sh\ncp .envrc.example .envrc\n```\n\nTo run fork scripts, deploy or perform any operation with a mainnet/testnet node you will need an Infura API key.\n\n# Testing\n\nWe use [Hardhat](https://hardhat.dev) and [hardhat-deploy](https://github.com/wighawag/hardhat-deploy)\n\nTo run unit \u0026 integration tests:\n\n```sh\n$ yarn test\n```\n\nTo run coverage:\n\n```sh\n$ yarn coverage\n```\n\n# Fork Testing\n\nEnsure your environment variables are set up.  Make sure your Alchemy URL is set.  Now start a local fork:\n\n```sh\n$ yarn start-fork\n```\n\nSetup account impersonation and transfer eth:\n\n```sh\n$ ./scripts/setup.sh\n```\n\n# Deployment\n\n## Deploy Locally\n\nStart a local node and deploy the top-level contracts:\n\n```bash\n$ yarn start\n```\n\nNOTE: When you run this command it will reset the local blockchain.\n\n## Testnets\nDeployment is maintained in a different [repo](https://github.com/pooltogether/v4-testnet).\n\n## Mainnet\nDeployment is maintained in a different [repo](https://github.com/pooltogether/v4-mainnet).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpooltogether%2Fv4-timelocks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpooltogether%2Fv4-timelocks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpooltogether%2Fv4-timelocks/lists"}