Skip to content
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

Hooks #8

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from
Draft

Hooks #8

wants to merge 13 commits into from

Conversation

spengrah
Copy link
Member

This PR creates a new version of MCH that adds an optional hook to be called when a hat is claimed.

For example, a hook could be set up to claim signing permissions in HatsSignerGate in the same transaction during which the signer hat is claimed.

@spengrah
Copy link
Member Author

I'm interested in reviewers perspectives on how the implementation effects other parts of the hats stack, such as the ancillary subgraph, main app, and claims app. Obviously adding hooks will require changes to other areas of the stack, but I want to make sure that those changes are sane and as simple as possible.

I've endeavored to preserve all existing functionality, ie i've added new claim...WithHook and set...AndHook functions rather than inserting the hook logic into the existing functions. Do you think that's the right move?

Also, the hook set event is singular, mainly because there will be times when an org wants to deploy a new MCH instance with claimable hats where some of those don't have hooks, and I didn't want to have to dynamically create/populate arrays to fit into batch hook set events. Do you think that would create difficulties or complications for the subgraph?

@spengrah
Copy link
Member Author

spengrah commented Jan 30, 2025

I've deployed test contracts to sepolia as a demo for using a mint hook to claim a hat and HSG signer permissions in a single tx. You can see it in action here:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant