-
Notifications
You must be signed in to change notification settings - Fork 4
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
Eth registrar #7
base: main
Are you sure you want to change the base?
Conversation
|
||
uint256 public immutable MIN_COMMIT_AGE; | ||
uint256 public immutable MAX_COMMIT_AGE; | ||
uint256 public constant MIN_REGISTRATION_DURATION = 28 days; |
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.
Given that we have an owner, maybe we want to make this configurable?
uint256 public immutable MIN_COMMIT_AGE; | ||
uint256 public immutable MAX_COMMIT_AGE; | ||
uint256 public constant MIN_REGISTRATION_DURATION = 28 days; | ||
mapping(bytes32 => uint256) public commitments; |
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.
Solidity supports naming mapping keys and values now, which would add clarity here.
mapping(bytes32 => uint256) public commitments; | |
mapping(bytes32 hash => uint256 inception) public commitments; |
uint256 public immutable MAX_COMMIT_AGE; | ||
uint256 public constant MIN_REGISTRATION_DURATION = 28 days; | ||
mapping(bytes32 => uint256) public commitments; | ||
bytes32 public constant ETH_LABELHASH = keccak256(abi.encodePacked("eth")); |
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 can save some bytecode by making this a module level constant (and therefore not a public variable).
uint256 public constant MIN_REGISTRATION_DURATION = 28 days; | ||
mapping(bytes32 => uint256) public commitments; | ||
bytes32 public constant ETH_LABELHASH = keccak256(abi.encodePacked("eth")); | ||
ETHRegistry public registry; |
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 can be immutable, right?
|
||
event NameRegistered( | ||
string label, | ||
bytes32 labelHash, |
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.
Is this necessary?
uint64 expires = currentExpiry + duration; | ||
|
||
// Check if the provided value is sufficient | ||
IPriceOracle.Price memory price = rentPrice(label, 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.
Does this just swallow any extra?
@@ -0,0 +1,237 @@ | |||
// import { loadFixture } from '@nomicfoundation/hardhat-toolbox-viem/network-helpers.js' |
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.
Should this be commented out?
Eth registrar on the premise that the commit + registrations happen on L2.
Todo: