V4 Timelocks Contracts
Timelock 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.
The DrawCalculatorTimelock adds a timelock for PrizeDistributor to execute a claim with the most recently pushed PrizeDistribution params pushed.
L1TimelockTrigger & L2TimelockTrigger
Both L1TimelockTrigger/L2TimelockTrigger contracts set a timelock or a "cooldown" period in the linked
DrawCalculatorTimelock contract. The
calculate execution through a
DrawCalculator contract for the linked
L1TimelockTrigger contract pushes
DrawLib.PrizeDistribution params onto the
DrawLib.PrizeDistribution params onto a
The project is made available as a NPM package.
$ yarn add @pooltogether/pooltogether-contracts
The repo can be cloned from Github for contributions.
$ git clone https://github.com/pooltogether/v4-timelock
We use direnv to manage environment variables. You'll likely need to install it.
cp .envrc.example .envrc
To run fork scripts, deploy or perform any operation with a mainnet/testnet node you will need an Infura API key.
We use Hardhat and hardhat-deploy
To run unit & integration tests:
$ yarn test
To run coverage:
$ yarn coverage
Ensure your environment variables are set up. Make sure your Alchemy URL is set. Now start a local fork:
$ yarn start-fork
Setup account impersonation and transfer eth:
Start a local node and deploy the top-level contracts:
$ yarn start
NOTE: When you run this command it will reset the local blockchain.