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

Gitcoin Passport hook #13208

Closed
julien51 opened this issue Jan 16, 2024 · 9 comments · Fixed by #13426, #13433, #13434, #13435 or #13436
Closed

Gitcoin Passport hook #13208

julien51 opened this issue Jan 16, 2024 · 9 comments · Fixed by #13426, #13433, #13434, #13435 or #13436
Assignees
Labels
💰bounty There's a bounty on this issue!

Comments

@julien51
Copy link
Member

Can we create a Hook for onKeyPurchase that would require the recipient of the NFT to have a Gitcoin passport?

@julien51 julien51 added the 💰bounty There's a bounty on this issue! label Jan 16, 2024
@julien51
Copy link
Member Author

We could also add one for PolygonId.

@julien51
Copy link
Member Author

And proof of humanity #13208

@julien51
Copy link
Member Author

julien51 commented Feb 9, 2024

Let's start with the Gitcoin hook!
The goal of the system is to let a lock manager "restrict" who can purchase memberships on their locks based on having a valid Gitcoin Passport. To get there we need to perform multiple things.

  • Create a smart-contract hook (very similar to the Guild Hook or the CaptchaHook) that will 'fail' the transaction, unless the signer is one of the backend Locksmith signers. That contract will in fact be pretty much identical, and we could maybe just ruse the CaptchaHook for simplicity.

  • Create a backend API call which, given a user address, will verify that the user has a valid Gitcoin passport. If they do, sign a response (again, similar to the CaptchaHook behavior) which can then be passed as a param to the purchase transaction.

  • Update the front-end

    • In the lock settings, let the lock manager "select" the new Gitcoin Passport Hook
    • In the checkout flow, adds the verification step and show a message to the user if they do not have the right Gitcoin passport.

Let me know if you have questions! We are attaching a 500 USDC bounty to this feature!

@0xTxbi
Copy link
Contributor

0xTxbi commented Feb 9, 2024

Let's start with the Gitcoin hook!

The goal of the system is to let a lock manager "restrict" who can purchase memberships on their locks based on having a valid Gitcoin Passport. To get there we need to perform multiple things.

  • Create a smart-contract hook (very similar to the Guild Hook or the CaptchaHook) that will 'fail' the transaction, unless the signer is one of the backend Locksmith signers. That contract will in fact be pretty much identical, and we could maybe just ruse the CaptchaHook for simplicity.

  • Create a backend API call which, given a user address, will verify that the user has a valid Gitcoin passport. If they do, sign a response (again, similar to the CaptchaHook behavior) which can then be passed as a param to the purchase transaction.

  • Update the front-end

    • In the lock settings, let the lock manager "select" the new Gitcoin Passport Hook

    • In the checkout flow, adds the verification step and show a message to the user if they do not have the right Gitcoin passport.

Let me know if you have questions! We are attaching a 500 USDC bounty to this feature!

got it!

thanks for the details! i'll begin working on this.

@julien51
Copy link
Member Author

julien51 commented Mar 4, 2024

@0xTxbi Any progress on this? We have someone else who is interested on taking that one. Please respond within 48 hours!

@0xTxbi
Copy link
Contributor

0xTxbi commented Mar 4, 2024

progress has been made. would make a PR for the GitcoinHook contract and its necessary test and deploy scripts. At the moment, it is deployed on the Sepolia network.

It has also being integrated into the backend and the logic for verifying gitcoin passport scores has been added. currently enhancing how the UX for verification would be for users in the checkout UI

@0xTxbi
Copy link
Contributor

0xTxbi commented Mar 4, 2024

then a few questions for clarity. for the backend, I see Captcha uses the old routing structure, while that for the Guiild hook uses the V2 controller and route.

I am currently following the V2 API structure for the backend API call for the gitcoin verification logic. is that fine?

@julien51
Copy link
Member Author

julien51 commented Mar 5, 2024

progress has been made. would make a PR for the GitcoinHook contract and its necessary test and deploy scripts. At the moment, it is deployed on the Sepolia network.

That's the right way!

I am currently following the V2 API structure for the backend API call for the gitcoin verification logic. is that fine?

Yes! using v2 routes is better!

Please, do keep us in the loop as you make progress and feel free to open a "draft" PR so we can start looking at it and guide you better!

@julien51
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment