-
Notifications
You must be signed in to change notification settings - Fork 495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
On Chain Hook Registry #185
Comments
Just jotting down an alternative.... Maybe we can publish a something like:
Then an offchain hooks list can query these fields on the actual hook addresses should they be implemented? |
Brief prototype of the ERC721 implementation, although I may be leaning towards @snreynolds idea now. https://github.com/akarys92/v4-periphery/blob/HookRegistry/src/base/HookRegistry.sol |
Takeaway -
|
What about including some kind of digital fingerprint for the hook contract, like a bytes32 variable containing the hash of the deployed bytecode. Therefore any changes to the bytecode, or similar/deceptive looking hook contracts will generate unique values. |
Component
General design optimization (improving efficiency, cleanliness, or developer experience)
Describe the suggested feature and problem it solves.
Problem
Uniswap V4 supports a new concept called a hook where any developer can create an arbitrary contract that does some functionality in the swap process. This poses a problem for integrators with Uniswap V4 in both routing and interfaces.
Approach
To address these problems I propose HookRegistry, an ERC-721 based registry for managing hook contracts used in Uniswap V4.
HookRegistry allows the deployer of a hook contract to mint an NFT with metadata about the hook stored. Additionally, it enables auditors to sign these NFTs with a known key they publish, providing a mechanism for integrators to verify audits on chain and display metadata to users off-chain. An example of the recommended metadata structure would be:
Ideally this protocol would be deployed as part of the v4-periphery so that it sits on every chain Uniswap V4 is deployed to.
Describe the desired implementation.
The Hook Registry should be an ERC-721 compatible contract that supports the following functionality:
Describe alternatives.
Off Chain Approach
Similar to TokenLists, we could maintain an off chain standard for publishing hook metadata and audit information like the following:
We could then provide a set of tools that allows hook deployers and auditors to sign metadata just as they would on chain as well as tools that allow integrators to verify those signatures.
Although this would be a lighter weight implementation, it would require ongoing management from teams like Uniswap who would need to host these lists in perpetuity.
Additional context.
Open to other approaches!
The text was updated successfully, but these errors were encountered: