Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/generationsoftware/pt-v5-vault
https://github.com/generationsoftware/pt-v5-vault
pooltogether solidity
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/generationsoftware/pt-v5-vault
- Owner: GenerationSoftware
- License: mit
- Created: 2023-07-04T20:38:01.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-18T00:31:50.000Z (4 months ago)
- Last Synced: 2024-09-19T02:57:47.999Z (4 months ago)
- Topics: pooltogether, solidity
- Language: Solidity
- Homepage:
- Size: 806 KB
- Stars: 60
- Watchers: 2
- Forks: 36
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PoolTogether V5 Vault
[![Code Coverage](https://github.com/GenerationSoftware/pt-v5-vault/actions/workflows/coverage.yml/badge.svg)](https://github.com/GenerationSoftware/pt-v5-vault/actions/workflows/coverage.yml)
[![built-with openzeppelin](https://img.shields.io/badge/built%20with-OpenZeppelin-3677FF)](https://docs.openzeppelin.com/)
![MIT license](https://img.shields.io/badge/license-MIT-blue)Have questions or want the latest news?
Join the PoolTogether Discord or follow us on Twitter:[![Discord](https://badgen.net/badge/icon/discord?icon=discord&label)](https://pooltogether.com/discord)
[![Twitter](https://badgen.net/badge/icon/twitter?icon=twitter&label)](https://twitter.com/PoolTogether_)## Overview
In PoolTogether V5 deposits are held in prize vaults. Prize vaults are [ERC4626](https://eips.ethereum.org/EIPS/eip-4626) compatible and are the entry point for users interacting with the PoolTogether protocol. Users deposit an underlying asset (i.e. USDC) in this contract which is then funnelled to a yield source and in exchange users receive an ERC20 token representing their share of deposits in the vault.
- Balances are stored in a TWAB Controller.
- Yield is forwarded to the Liquidator to be sold.## Development
### Installation
You may have to install the following tools to use this repository:
- [Foundry](https://github.com/foundry-rs/foundry) to compile and test contracts
- [direnv](https://direnv.net/) to handle environment variables
- [lcov](https://github.com/linux-test-project/lcov) to generate the code coverage reportInstall dependencies:
```
npm i
```### Env
Copy `.envrc.example` and write down the env variables needed to run this project.
```
cp .envrc.example .envrc
```Once your env variables are setup, load them with:
```
direnv allow
```### Compile
Run the following command to compile the contracts:
```
npm run compile
```### Coverage
Forge is used for coverage, run it with:
```
npm run coverage
```You can then consult the report by opening `coverage/index.html`:
```
open coverage/index.html
```### Code quality
[Husky](https://typicode.github.io/husky/#/) is used to run [lint-staged](https://github.com/okonet/lint-staged) and tests when committing.
[Prettier](https://prettier.io) is used to format TypeScript and Solidity code. Use it by running:
```
npm run format
```[Solhint](https://protofire.github.io/solhint/) is used to lint Solidity files. Run it with:
```
npm run hint
```### Tests
You can run tests with the following commands:
- **unit tests:** `npm run test`
- **fuzz tests:** `npm run fuzz`
- **invariant tests:** `npm run invariant`
- **integration tests:** `npm run integration` (*informative for which integrations have potential issues*)### CI
A default Github Actions workflow is setup to execute on push and pull request.
It will build the contracts and run the test coverage.
You can modify it here: [.github/workflows/coverage.yml](.github/workflows/coverage.yml)
For the coverage to work, you will need to setup the relevant `{X}_RPC_URL` repository secrets in the settings of your Github repository.