https://github.com/pooltogether/v4-core
Core contracts for PoolTogether v4 🌊 🏆
https://github.com/pooltogether/v4-core
Last synced: over 1 year ago
JSON representation
Core contracts for PoolTogether v4 🌊 🏆
- Host: GitHub
- URL: https://github.com/pooltogether/v4-core
- Owner: pooltogether
- License: gpl-3.0
- Created: 2021-06-23T23:13:09.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-11-11T17:29:19.000Z (over 2 years ago)
- Last Synced: 2025-01-12T13:14:29.296Z (over 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 2.47 MB
- Stars: 201
- Watchers: 9
- Forks: 50
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PoolTogether V4 Core Smart Contracts

[](https://coveralls.io/github/pooltogether/v4-core?branch=master)
[](https://docs.openzeppelin.com/)
[](http://perso.crans.org/besson/LICENSE.html)
Have questions or want the latest news?
Join the PoolTogether Discord or follow us on Twitter:
[](https://pooltogether.com/discord)
[](https://twitter.com/PoolTogether_)
**Documentation**
https://v4.docs.pooltogether.com
**Deployments**
- [Ethereum](https://v4.docs.pooltogether.com/protocol/deployments/mainnet#mainnet)
- [Polygon](https://v4.docs.pooltogether.com/protocol/deployments/mainnet#polygon)
- [Avalanche](https://v4.docs.pooltogether.com/protocol/deployments/mainnet#avalanche)
- [Optimism](https://v4.docs.pooltogether.com/protocol/deployments/mainnet/#optimism)
# Overview
- [ControlledToken](/contracts/ControlledToken.sol)
- [DrawBeacon](/contracts/DrawBeacon.sol)
- [DrawBuffer](/contracts/DrawBuffer.sol)
- [DrawCalculator](/contracts/DrawCalculator.sol)
- [EIP2612PermitAndDeposit](/contracts/permit/EIP2612PermitAndDeposit.sol)
- [PrizeDistributionBuffer](/contracts/PrizeDistributionBuffer.sol)
- [PrizeDistributor](/contracts/PrizeDistributor.sol)
- [PrizeSplitStrategy](/contracts/prize-strategy/PrizeSplitStrategy.sol)
- [Reserve](/contracts/Reserve.sol)
- [StakePrizePool](/contracts/prize-pool/StakePrizePool.sol)
- [Ticket](/contracts/Ticket.sol)
- [YieldSourcePrizePool](/contracts/prize-pool/YieldSourcePrizePool.sol)
Periphery and supporting contracts:
- https://github.com/pooltogether/v4-periphery
- https://github.com/pooltogether/v4-oracle-timelocks
# Getting Started
The project is made available as a NPM package.
```sh
$ yarn add @pooltogether/pooltogether-contracts
```
The repo can be cloned from Github for contributions.
```sh
$ git clone https://github.com/pooltogether/v4-core
```
```sh
$ yarn
```
We use [direnv](https://direnv.net/) to manage environment variables. You'll likely need to install it.
```sh
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](https://hardhat.dev) and [hardhat-deploy](https://github.com/wighawag/hardhat-deploy)
To run unit & integration tests:
```sh
$ yarn test
```
To run coverage:
```sh
$ yarn coverage
```
# Deployment
## Testnets
Deployment is maintained in a different [repo](https://github.com/pooltogether/v4-testnet).
## Mainnet
Deployment is maintained in a different [repo](https://github.com/pooltogether/v4-mainnet).