🚀. Socket Launch Week Day 3:Socket Firewall Now Blocks Malicious VS Code and Open VSX Extensions.Learn more
Sign In

@leap-network/v4-timelocks

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@leap-network/v4-timelocks

PoolTogether V4 Timelocks

latest
npmnpm
Version
1.1.2
Version published
Maintainers
1
Created
Source

PoolTogether V4 Timelocks Contracts

Tests Coverage Status built-with openzeppelin GPLv3 license

Have questions or want the latest news?
Join the PoolTogether Discord or follow us on Twitter:

Discord Twitter

Documentation
https://v4.docs.pooltogether.com

Deployments

Overview

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.

DrawCalculatorTimelock

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 DrawCalculatorTimelock routes calculate execution through a DrawCalculator contract for the linked PrizeDistributor contract.

L1TimelockTrigger

The L1TimelockTrigger contract pushes DrawLib.Draw and DrawLib.PrizeDistribution params onto the DrawBuffer and PrizeDistributionBuffer contracts.

L2TimelockTrigger

The L2TimelockTrigger pushes DrawLib.PrizeDistribution params onto a PrizeDistributionBuffer contract.

Core and Periphery contracts:

Getting Started

The project is made available as a NPM package.

yarn add @leap-network/pooltogether-contracts

The repo can be cloned from Github for contributions.

git clone https://github.com/pooltogether/v4-timelock
yarn

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.

Testing

We use Hardhat and hardhat-deploy

To run unit & integration tests:

yarn test

To run coverage:

yarn coverage

Fork Testing

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:

./scripts/setup.sh

Deployment

Deploy Locally

Start a local node and deploy the top-level contracts:

yarn start

NOTE: When you run this command it will reset the local blockchain.

Testnets

Deployment is maintained in a different repo.

Mainnet

Deployment is maintained in a different repo.

FAQs

Package last updated on 07 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts