The allocation memo below dives into The Uniswap Foundation’s grant to OpenZeppelin for the creation of a Hooks Contracts Library for Uniswap v4.
Over the last year, the introduction of v4 hooks has begun to drive innovation across the Uniswap community. Today, developers have created hundreds of hooks: with hooks for dynamic fees, attestation, custom liquidity curves, and more. Building on this momentum, we’re excited to announce a grant of $850,000 to OpenZeppelin for the development of a Hooks Contracts Library for the Uniswap v4. This initiative will offer developers a robust, standardized codebase to work from to reduce the risk of vulnerabilities.
The OpenZeppelin Hooks Contracts Library for v4 is designed to minimize coding risk by employing battle-tested smart contract libraries for Ethereum. This initiative is crucial to provide developers with the necessary tools to enhance v4. By building on the OpenZeppelin Contract Library, developers can create innovative and secure applications that improve the v4 user experience.
The development of the OpenZeppelin v4 Hooks Contract Library will unfold in three stages:
Abstract Hooks
This initial phase will focus on building a smart contract library allowing developers to see dynamic fee hooks and custom accounting hooks. A comprehensive testing suite will ensure these hooks maintain critical invariants and perform reliably.
Accounting Improvement Hooks
The second phase will introduce a smart contract library of hooks that address current limitations of AMMs, leveraging the code developed in the first Phase of this grant. Some customizations to be built include an anti-JIT hook and an anti-sandwich hook.
User Experience Hooks
The final phase will publish a library of tools to improve the experience of developers and users of Uniswap v4, including hooks to allow for new order types and TWAMM. It will also include the development of a Uniswap Hook Wizard interface that allows developers to combine smart contracts developed in each phase of this grant, with the support of development environments like Hardhat and Foundry.
A ten-week security audit will follow to ensure the integrity of the developed contract library. And, all smart contracts will be included in the OpenZeppelin Contracts Library.
OpenZeppelin is a blockchain security company known for its smart contract libraries and security audits. Their widely-used OpenZeppelin Contracts library helps developers build secure decentralized applications on Ethereum. The Uniswap Foundation has enlisted OpenZeppelin’s auditing services in the past, including to audit v4’s code.
Joao Amaral Santos, Project Manager on OpenZeppelin’s security services team, reflects on the significance of the new development: "Just as a lot of developers were able to onboard into the tricky world of smart contract development using Solidity with the OpenZeppelin Solidity Contracts library, a new wave of Uniswap developers will get that chance with the Hooks library. Giving back to the community with open-sourced development is our mission with this grant."
The v4 Hooks Contracts Library will be a cornerstone for v4 developers, equipping them with the tools to innovate within a secure framework. As we continue to support and expand our developer community, initiatives like this are vital for advancing the community and ensuring the Protocol’s resilience and adaptability.