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

fix: Coupon mintlist system #101

Open
wants to merge 15 commits into
base: development
Choose a base branch
from
Open

Conversation

JamesEarle
Copy link
Collaborator

This change creates a mintlist system based on a verified signer we control having signed off on each "coupon" that an account can use in registration of a subdomain. If the user presents a message that was not signed by our dedicated coupon signer (TBD what account this is) then it is not considered a valid claim.

What still needs to happen

  • changes to the deployment campaign so the EIP712Helper contract is set properly
  • Decision on what account we use as a signer

Considerations:

  • Using this system relies on the assumption that we first get the owner of a domain to sign a message stating that they allow our coupon signer to sign messages on their behalf. Once we've collected this signature, we can create the data they've provided.
  • There is some deciding to do around what the unique data is in each coupon. We can use the domain label as an intrinsically unique piece of data but there is question about how that might be considered forceful by an owner, allowing a specific user to only mint a specific domain, and so alternatives could be some unique ID but this requires we keep track of what has been used on chain in some mapping
  • Tooling around how we create this data is still to be determined. They could upload a JSON file of addresses, or fill a web form, etc. and we have to intake that data and transform it into proper coupons structured as below
// typescript
type Coupon = {
 parentHash : string;
 registrantAddress : string;
 subdomainLabel : string;
}


// solidity
struct Coupon {
 bytes32 parentHash;
 address registrantAddress
 string domainLabel;
}

Copy link

openzeppelin-code bot commented Feb 8, 2024

fix: Coupon mintlist system

Generated at commit: 1132ff952346b4d67d6e88edb998cf38e535580d

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
0
0
0
5
25
30
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
2
29
31

For more details view the full report in OpenZeppelin Code Inspector

Copy link

codecov bot commented Feb 9, 2024

Codecov Report

Merging #101 (1132ff9) into development (8f67434) will increase coverage by 0.00%.
Report is 2 commits behind head on development.
The diff coverage is 100.00%.

Additional details and impacted files
@@             Coverage Diff              @@
##           development     #101   +/-   ##
============================================
  Coverage        99.80%   99.80%           
============================================
  Files               11       12    +1     
  Lines              512      514    +2     
  Branches           127      128    +1     
============================================
+ Hits               511      513    +2     
  Misses               1        1           

string memory version
) EIP712(name, version) {}

function hashCoupon(Coupon memory coupon) public view override returns (bytes32) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

can this be a pure function?

// idea around creating signer in `hashCoupon` or similar
// then storing that data, and in recreation we have to get the address that signed?
// how do we bulk sign?
address private constant COUPON_SIGNER = 0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65;
Copy link
Collaborator

Choose a reason for hiding this comment

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

yeah, this should be a state var.

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