A collection of code examples for builders looking to build with the PoolTogether V5 protocol.
- Awarding Prizes to NFT Holders
- Boosting Prizes on a Vault
- Minting Tokens to Prize Winners
- Donating Prizes back to the Prize Pool
For more info on prize hooks, see the guide to prize hooks.
For more info on custom vaults, see the guide to creating a vault.
For more info on how to liquidate yield, see the guide to liquidating yield.
You may have to install the following tools to use this repository:
- Foundry to compile and test contracts
- direnv to handle environment variables
- lcov to generate the code coverage report
Install dependencies:
npm i
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
Run the following command to compile the contracts:
npm run compile
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
Husky is used to run lint-staged and tests when committing.
Prettier is used to format TypeScript and Solidity code. Use it by running:
npm run format
Solhint is used to lint Solidity files. Run it with:
npm run hint
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
For the coverage to work, you will need to setup the MAINNET_RPC_URL
repository secret in the settings of your Github repository.