forked from snapshot-labs/snapshot-strategies
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[passport-gated] Passport migration (snapshot-labs#1158)
* Passport API Integration Migrated the first version of using the Passport API instead of the SDK. * Passport API Validation Strategy Updated passport-gated and passport-weighted validation strategies to call the Passport API rather than the SDK. * updated passport API validation Updated passport-gated and passport-weighted validation strategies to call the Passport API rather than the SDK. * Updated .gitignore * Removed .history file * Update src/validations/basic/index.ts Co-authored-by: Chaitanya <[email protected]> * Update src/validations/passport-weighted/schema.json Co-authored-by: Chaitanya <[email protected]> * Update src/validations/passport-gated/examples.json Co-authored-by: Chaitanya <[email protected]> * Removed submitting and signing passport We updated the passport API to no longer require a signed message by the user to submit a passport. I updated that functionality in the validation functions * Update package.json * Updated passport-gated Passport-gated now checks for specific stamps and a minimum threshold passport score * removed score check in passport-gated Passport-gated no longer checks for Passport score. Now passport-gated just checks if the stamps match. * Update src/validations/passport-gated/README.md Co-authored-by: Sam <[email protected]> * Update src/validations/passport-gated/README.md * Update src/validations/passport-gated/README.md * Update src/validations/passport-gated/index.ts * Add back expiry and creation timestamp check and check operator * Update yarn.lock --------- Co-authored-by: Chaitanya <[email protected]> Co-authored-by: Sam <[email protected]>
- Loading branch information
1 parent
519e775
commit e08497a
Showing
12 changed files
with
629 additions
and
620 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,5 @@ dist | |
# Remove some common IDE working directories | ||
.idea | ||
.vscode | ||
.env | ||
.history |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,29 @@ | ||
# Gitcoin passport gated validation | ||
# Gitcoin Passport Gated Validation | ||
|
||
This repository provides a passport-gated validation strategy for Snapshot. The implementation integrates with the Gitcoin API to validate whether a user is authorized to vote on a proposal. | ||
|
||
## Prerequisites | ||
|
||
Before using this code, ensure that you have the following information stored in a `.env` file at the project root: | ||
|
||
- `PASSPORT_API_KEY=<your-api-key>` | ||
|
||
## Overview | ||
|
||
This implementation uses the Gitcoin Passport API to check whether a user has a valid passport by looking for their stamps. | ||
|
||
## Code Explanation | ||
|
||
The main function in this codebase checks stamps for a user and returns a boolean value indicating whether the user has a valid passport. | ||
|
||
## Modifications | ||
|
||
The original code utilized the Passport SDK to check if the user has a valid passport and stamps. | ||
|
||
[Coming Soon] However, with the introduction of the Passport API, we can now simplify the process by checking for a score. | ||
|
||
## Last Modified | ||
|
||
This code was last modified on June 1, 2023. | ||
|
||
Feel free to customize and extend this implementation to suit your specific needs. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,31 @@ | ||
# Gitcoin passport weighted validation | ||
|
||
This repository provides a passport-weighted validation strategy for Snapshot. The implementation integrates with the Gitcoin API to validate whether a user is authorized to vote on a proposal. | ||
|
||
## Prerequisites | ||
|
||
Before using this code, ensure that you have the following information stored in a `.env` file at the project root: | ||
|
||
- `NEXT_PUBLIC_GC_API_KEY=<your-api-key>` | ||
- `NEXT_PUBLIC_GC_SCORER_ID=<your-scorer-id>` | ||
|
||
## Overview | ||
|
||
This implementation uses the Gitcoin Passport API to check whether a user has a passport score thats above the minScore threshold value. | ||
|
||
## Code Explanation | ||
|
||
The main function in this codebase returns a threshold score based on the user's passport. | ||
|
||
## Modifications | ||
|
||
The original code utilized the Passport SDK to check if the user meets the passport score threshold. However, with the introduction of the Passport API, we can now simplify the process by checking directly for the score. | ||
|
||
## Last Modified | ||
|
||
This code was last modified on May 11, 2023. | ||
|
||
Feel free to customize and extend this implementation to suit your specific needs. | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.