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 ERC721 discount validator #66

Merged
merged 1 commit into from
Jul 15, 2024
Merged

Add ERC721 discount validator #66

merged 1 commit into from
Jul 15, 2024

Conversation

stevieraykatz
Copy link
Collaborator

This generic discount validator allows us to offer discounts to an arbitrary soul-bound ERC721 token. We don't explicitly check tokenIds; just the presence of a nonzero balance for the stored token address.

/// This discount validator should only be used for "soul-bound" tokens.
///
/// @author Coinbase (https://github.com/base-org/usernames)
contract ERC721DiscountValidator is IDiscountValidator {
Copy link
Contributor

Choose a reason for hiding this comment

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

how will we distribute?

Copy link
Contributor

Choose a reason for hiding this comment

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

the NFT

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For launch we're integrating the buildathon NFT which they're distributing

///
/// @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 (token.balanceOf(claimer) > 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

how do we track if they already claimed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

RegistrarController tracks discount claimants

@stevieraykatz stevieraykatz merged commit 013f4a8 into main Jul 15, 2024
1 of 3 checks passed
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.

2 participants