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

[ENHANCE] Implement V2 UI (expiry, custom args, rules/groups) #109

Open
lachlanglen opened this issue Apr 22, 2024 · 3 comments · Fixed by #112
Open

[ENHANCE] Implement V2 UI (expiry, custom args, rules/groups) #109

lachlanglen opened this issue Apr 22, 2024 · 3 comments · Fixed by #112
Assignees
Labels
enhancement small enhancement / improvement from existing feature

Comments

@lachlanglen
Copy link
Contributor

lachlanglen commented Apr 22, 2024

Summary

See V2 contract interface. This is currently deployed to v2new.staging.nadabot.near and has been populated with data from production. Current contract admins are plugrel.near, lachlan.near, wendersonpires.near & carina.akaia.near. As an admin you should be able to make any necessary write actions in order to test the UI.

See V2 designs - see DEV NOTE comments for clarification & feel free to add additional comments in Figma, comment on this ticket or post in TG for any additional clarification!

A note on terminology: "provider" and "stamp" are almost synonymous - a provider is essentially a stamp definition, and a stamp is an individual instance of that provider that is attached to a user, and records the timestamp of when the user verified this stamp. As a user, there are two steps to getting a stamp. The first step is to go to the provider's URL (Provider.external_url) and complete the requirements to obtain their stamp (e.g. connect your twitter, scan your face, fill out your NEAR Social profile etc). This adds a record on the provider's contract, and then the user must add the record on the Nadabot contract by calling add_stamp(). This method verifies that the user has the target stamp, and adds a record as such to the Nadabot contract.

Description

Overview:

The Nadabot V2 contract adds a few new concepts:

1. Expiry

stamp_validity_ms has been added to the Provider struct, which gives admins the ability to expire stamps. When one of the humanity methods is called (e.g. is_human or get_human_score), the timestamp of the user verifying the stamp is compared to the current block timestamp, and if the delta is greater than Provider.stamp_validity_ms then the stamp is considered to have expired and will be ignored. A user can always reverify their stamp once it has expired (or before it has expired, if they wish).

Screenshot 2024-04-23 at 3 41 55 PM

Screenshot 2024-04-23 at 3 42 22 PM

Screenshot 2024-04-23 at 3 43 10 PM

2. Custom args

In V1, providers were required to implement a contract method with a signature that adhered exactly to our specification (accepting a single argument named "account_id", and returning a boolean). However, this did not provide adequate flexibility to providers, so we have adapted this slightly, allowing custom (but hardcoded) args that are stored on the provider (Provider.custom_args) and are added to the args map at the point of verification. Use cases include SBTs where a "class" might be required, or a social verifier that requires a platform arg like lens or farcaster.

Screenshot 2024-04-23 at 3 44 34 PM

Screenshot 2024-04-23 at 3 44 54 PM

3. Groups/Rules

A group is a collection of providers, and a rule is a required element of a group which indicates the relationship between providers in the group, and how a user's score changes if they hold more than one stamp in that group. There are currently 5 types of rules, as outlined here.

Even though technically speaking a rule belongs to a group, the rule (not the group) is the primary user-facing entity. So "rule" and "group" are quasi-synonymous from a user's perspective. Rules affect a user's score, and are a tool that contract admins can use to tweak humanity scoring to incentivize desired behavior and disincentivize botting.

Screenshot 2024-04-23 at 3 48 38 PM

Screenshot 2024-04-23 at 3 48 57 PM

Screenshot 2024-04-23 at 3 51 51 PM

Screenshot 2024-04-23 at 3 52 08 PM

Screenshot 2024-04-23 at 3 52 20 PM

Screenshot 2024-04-23 at 3 52 27 PM

Screenshot 2024-04-23 at 3 52 35 PM

Screenshot 2024-04-23 at 3 52 43 PM

Screenshot 2024-04-23 at 3 52 48 PM

Screenshot 2024-04-23 at 3 53 01 PM

Blacklisting is also added in nadabot v2, but will be implemented in a separate ticket.

Acceptance Criteria

[List of criteria that must be met for the enhancement to be considered accepted]

Additional Information

[Any other relevant information, such as links to related issues or pull requests]

@lachlanglen lachlanglen added the enhancement small enhancement / improvement from existing feature label Apr 22, 2024
@lachlanglen lachlanglen moved this from Ready to Open Questions (not ready for dev) in PotLock Engineering Apr 22, 2024
@lachlanglen lachlanglen changed the title [ENHANCE] WIP - Implement V2 UI (expiry, custom args, rules/groups & blacklisting) [ENHANCE] Implement V2 UI (expiry, custom args, rules/groups & blacklisting) Apr 23, 2024
@lachlanglen lachlanglen moved this from Open Questions (not ready for dev) to Ready in PotLock Engineering Apr 23, 2024
@carina-akaia carina-akaia moved this from Ready to In progress in PotLock Engineering Apr 24, 2024
@carina-akaia
Copy link
Collaborator

carina-akaia commented Apr 30, 2024

@lachlanglen just to clarify: is "admin's comments" functionality within the scope of this story?

@lachlanglen
Copy link
Contributor Author

@carina-akaia yes, if you can add that would be appreciated. There will be a few little things like this that are not entirely related to V2 but are some elements that were missed in V1. Thanks!

@carina-akaia carina-akaia linked a pull request May 2, 2024 that will close this issue
Merged
@lachlanglen lachlanglen changed the title [ENHANCE] Implement V2 UI (expiry, custom args, rules/groups & blacklisting) [ENHANCE] Implement V2 UI (expiry, custom args, rules/groups) May 17, 2024
@lachlanglen
Copy link
Contributor Author

@carina-akaia I split out blacklisting into a separate ticket - see here

@carina-akaia carina-akaia moved this from In progress to In review in PotLock Engineering Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement small enhancement / improvement from existing feature
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants