Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jamesbachini/Uniswap-v4-Tests
A test suite for working with Uniswap v4 Hooks
https://github.com/jamesbachini/Uniswap-v4-Tests
Last synced: about 1 month ago
JSON representation
A test suite for working with Uniswap v4 Hooks
- Host: GitHub
- URL: https://github.com/jamesbachini/Uniswap-v4-Tests
- Owner: jamesbachini
- License: mit
- Created: 2023-06-20T15:44:52.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-06-20T15:52:03.000Z (over 1 year ago)
- Last Synced: 2024-08-01T18:24:31.204Z (4 months ago)
- Language: Solidity
- Size: 3.38 MB
- Stars: 10
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-uniswap-v4-hooks - Uniswap v4 Tests
- awesome-uniswap-hooks - Uniswap v4 Tests
- awesome-uniswap-v4-resources - Uniswap v4 Tests
- awesome-uniswap-v4-resources - Uniswap v4 Tests
README
# Uniswap v4 Tests
A Uniswap v4 hook which creates an afterSwap hook to check if price is above or below 1:1 for a stable pair. After a swap takes place if price is below 1:1 it will rebalance the pool either by adding liquidity or making a swap.
Test in foundry (recommend using WSL or a unix based OS)
```
curl -L https://foundry.paradigm.xyz | bash
source /home/james/.bashrc
foundryup
forge install https://github.com/Uniswap/v4-core --no-commit
forge install openzeppelin/openzeppelin-contracts --no-commit
forge install marktoda/forge-gas-snapshot --no-commit
forge test
```More info on Uniswap v4 hooks at https://jamesbachini.com/uniswap-v4-hooks/