-
Notifications
You must be signed in to change notification settings - Fork 5
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: first attempt at v2 ETH registrar #15
base: main
Are you sure you want to change the base?
Conversation
Is this now obsolete? https://github.com/ensdomains/namechain/pull/7/files |
Shouldn't EthRegistrar now be called EthRegistryController?
|
Pull Request Test Coverage Report for Build 13645233447Details
💛 - Coveralls |
Don't we need to implement |
I'm not sure. @Arachnid ? |
Yes, the controller will still need to have a commit-reveal implementation. |
@Arachnid Got the commit-reveal in there. As for the v1 reverse resolver stuff, should I put that in too? |
error CommitmentTooNew(bytes32 commitment); | ||
error CommitmentTooOld(bytes32 commitment); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should probably include the commitment's actual age and the limit.
error CommitmentTooNew(bytes32 commitment); | ||
error CommitmentTooOld(bytes32 commitment); | ||
error NameNotAvailable(string name); | ||
error InsufficientValue(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably include the expected value and the actual value.
|
||
error MaxCommitmentAgeTooLow(); | ||
error UnexpiredCommitmentExists(bytes32 commitment); | ||
error DurationTooShort(uint64 duration); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should include the min duration.
uint256 public immutable minCommitmentAge; | ||
uint256 public immutable maxCommitmentAge; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should consider making these mutable, since the contract already has an owner.
address subregistry = address(registry.getSubregistry(name)); | ||
return subregistry == address(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to permit users to set their subregistry to 0 for valid names if they don't have subdomains. We should probably check the expiration date, instead.
if (commitments[commitment] + maxCommitmentAge >= block.timestamp) { | ||
revert UnexpiredCommitmentExists(commitment); | ||
} | ||
commitments[commitment] = block.timestamp; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should emit an event when a commitment is recorded.
function register( | ||
string calldata name, | ||
address owner, | ||
IRegistry subregistry, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be useful to allow setting the resolver at the same time as registering.
IRegistry subregistry, | ||
uint96 flags, | ||
uint64 duration | ||
) external payable onlyRole(CONTROLLER_ROLE) returns (uint256 tokenId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
) external payable onlyRole(CONTROLLER_ROLE) returns (uint256 tokenId) { | |
) external payable returns (uint256 tokenId) { |
I think we want this to be publicly callable now, right?
* @param name The name to renew. | ||
* @param duration The duration of the renewal. | ||
*/ | ||
function renew(string calldata name, uint64 duration) external payable onlyRole(CONTROLLER_ROLE) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function renew(string calldata name, uint64 duration) external payable onlyRole(CONTROLLER_ROLE) { | |
function renew(string calldata name, uint64 duration) external payable { |
payable(msg.sender).transfer(msg.value - totalPrice); | ||
} | ||
|
||
emit NameRenewed(name, duration, tokenId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should include the new expiration date.
No, we'll use batch calls and smart accounts to handle that. |
No description provided.