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

Add talent protocol discount validator #97

Merged
merged 8 commits into from
Oct 18, 2024

Conversation

stevieraykatz
Copy link
Collaborator

@stevieraykatz stevieraykatz commented Oct 14, 2024

We're adding a discount validator for users with minted Builder Scores over some set threshold. This PR implements the discount validator associated with this integration.

@cb-heimdall
Copy link
Collaborator

cb-heimdall commented Oct 14, 2024

✅ Heimdall Review Status

Requirement Status More Info
Reviews 2/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

///
/// @return `true` if the validation data provided is determined to be valid for the specified claimer, else `false`.
function isValidDiscountRegistration(address claimer, bytes calldata) external view returns (bool) {
return (talentProtocol.getScoreByAddress(claimer) >= threshold);
Copy link
Collaborator

Choose a reason for hiding this comment

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

We are fully relying on the TalentProtocol team (a non-coinbase product) to only put valid scores in. We should assume that this can be abused, and limit the discount amounts.

https://github.com/talentprotocol/contracts/blob/master/contracts/passport/PassportBuilderScore.sol#L62

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Duly noted. We have control over whether this discount is active or not on our RegistrarController so I think that's sufficient control. Additionally, we can always update the discount amount associated with this integration.

@stevieraykatz stevieraykatz marked this pull request as ready for review October 15, 2024 01:34
@abdulla-cb abdulla-cb self-requested a review October 17, 2024 16:22
@stevieraykatz stevieraykatz merged commit 4e64f80 into main Oct 18, 2024
6 checks passed
@stevieraykatz stevieraykatz deleted the add-talent-protocol-discount branch October 18, 2024 17:34
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.

4 participants