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

feat(registry): is_community_verified #73

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

robert-zaremba
Copy link
Contributor

@robert-zaremba robert-zaremba commented Aug 22, 2023

The graylist is not going to be explicit. Nobody is going to load users to flag them as graylist.
Instead, the definition of graylist is that it's an account without reputation. So we are proposing the following method, that resambles is_human:

  • is_community_verified which will return list of proofs that the account has been verified by a community. This is meant to be consistent with is_human which has been proven to be useful.

TODO:

  • decide if we want to return a list of proofs or a boolean

contracts/registry/src/lib.rs Show resolved Hide resolved
fn _is_human(&self, account: &AccountId) -> SBTs {
if self._is_banned(&account) {
return vec![];
fn _is_human(&self, account: &AccountId, no_skip_ban: bool) -> SBTs {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need no_skip_ban ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can put conditions in one if

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to not repeat that check in case we are coming from is_community_verified

@amityadav0
Copy link
Contributor

Are we going to update flag list to use TokenId instead of AccountId ?

/// If `is_human` is false, then the `is_human` check is skipped and empty list is
/// returned. Otherwise `is_human` is assumed to be required and if the IAH check fails,
/// the community verification is skipped (so two empty lists are returned).
pub fn is_community_verified(&self, account: AccountId, is_human: bool) -> (SBTs, SBTs) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need the is human here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to avoid is_human call

Copy link
Contributor

@sczembor sczembor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left few comments. I am not sure why do we return two proofs? Do we need the iah:bool? I think if we consider someone not gray listed then we assume hes a human. The only case is when someone is human, but not community verified. Could you explain it?

/// returned. Otherwise `is_human` is assumed to be required and if the IAH check fails,
/// the community verification is skipped (so two empty lists are returned).
/// returned.
/// EXPERIMENTAL: the function API can change in the future.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add here ? Maybe if first SBTs is empty that means it is not community verified

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.

None yet

3 participants