UniswapFlashLiquidation
: A Uniswap V3 swap to flash liquidate yield on PoolTogether V5.
UniswapV2WethPairFlashLiquidator
: Instantly dump yield from Prize Vaults whose assets are Uniswap LP pairs.
UniswapFlashLiquidation
:0x5927b63e88764d6250b7801ebfdeb7b6c1ac35d0
UniswapV2WethPairFlashLiquidator
:0xB56D699B27ca6ee4a76e68e585999E552105C10f
UniswapFlashLiquidation
:0xe2368DF1f78Bc5B714b7f502DE8e2B545c6Fe7EC
UniswapV2WethPairFlashLiquidator
:0x0d51a33975024e8afc55fde9f6b070c10aa71dd9
- run
npm i
andforge build
- set your environment vars in
.envrc
- run
direnv allow
- run
npm run liquidate:pusdce
ornpm run liquidate:pweth
The easiest way to get started is by clicking the Use this template button at the top right of this page.
If you prefer to go the CLI way:
forge init my-project --template https://github.com/pooltogether/foundry-template
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.