Overview
v4-template is an invaluable tool for building v4 hooks.
It is part of a broader tool set which includes
- v4-router: A simple and optimized router for swapping on Uniswap V4. ABI inspired by UniswapV2Router02.
- uniswap-hooks: from OpenZeppelin a library of v4 hook functions using
solc 0.8.26
- hookmate: A library for Uniswap v4 hook development. I personally love this as it allows me to use later versions of the solidity compiler rather than being forced to use
solc 0.8.26.
- v4-template: A template for writing Uniswap v4 Hooks 🦄 from Uniswap Foundation
A Potential Development Approach
When writing a new protocol. I wanted the following
- The ability to write Solidity using the latest Solidity compiler. At the time of writing
solc 0.8.30
- The ability to interact with the latest versions of v4-core and v4-periphery
- Consistent use of a swapRouter for testing, ideally v4-router
- Ability to build upon v4-router to offer additional functionality. In my case I need to support async swaps for swap-based intents.
My approach
Jincubator Repositories
Closing Thoughts
It would great to see a consolidation of the codebases above to use a consistent approach including
Please reach out to me if you want to collaborate on any of the above my contact details can be found at https://github.com/johnwhitton
Reference code
gitmodules
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "lib/v4-core"]
path = lib/v4-core
url = https://github.com/Uniswap/v4-core
[submodule "lib/v4-periphery"]
path = lib/v4-periphery
url = https://github.com/Uniswap/v4-periphery
[submodule "lib/hookmate"]
path = lib/hookmate
url = https://github.com/jincubator/hookmate.git
[submodule "lib/the-compact"]
path = lib/the-compact
url = https://github.com/jincubator/the-compact
[submodule "lib/solmate"]
path = lib/solmate
url = https://github.com/transmissions11/solmate
[submodule "lib/create3-factory"]
path = lib/create3-factory
url = https://github.com/jincubator/create3-factory
Overview
v4-template is an invaluable tool for building v4 hooks.
It is part of a broader tool set which includes
solc 0.8.26solc 0.8.26.A Potential Development Approach
When writing a new protocol. I wanted the following
solc 0.8.30My approach
Jincubator Repositories
(https://github.com/Uniswap/v4-periphery). This request.
Closing Thoughts
It would great to see a consolidation of the codebases above to use a consistent approach including
solc 0.8.30perhaps by taking advantage of hookmatePlease reach out to me if you want to collaborate on any of the above my contact details can be found at https://github.com/johnwhitton
Reference code
gitmodules