-
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
feat: migration of fuses to v2 #17
base: main
Are you sure you want to change the base?
feat: migration of fuses to v2 #17
Conversation
Pull Request Test Coverage Report for Build 13384803637Details
💛 - Coveralls |
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.
Can you provide a more detailed design rationale? I'm not really understanding why we need to have registrar-controlled settings (and is this intended to mean settings controlled by a third party designated as the registrar, or settings controlled by the owner of the parent name?
address public parentRegistry; | ||
uint256 public parentTokenId; |
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.
Generally we've avoided introducing these unless absolutely necessary.
uint256 public parentTokenId; | ||
|
||
// TODO: uint32 for now whilst we iterate on the settings | ||
mapping(uint256 tokenId => uint32 flags) public settings; |
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.
Let's call this flags
instead of settings
.
// TODO: uint32 for now whilst we iterate on the settings | ||
mapping(uint256 tokenId => uint32 flags) public settings; | ||
// Fuse: PARENT_CANNOT_CONTROL - the parent registry will have to lock this subregistry to its parent node + also set this setting here | ||
uint32 public constant SETTING_REGISTRAR_OWNER_HAS_CONTROL = 0x1; |
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.
I think this should be 'registry' not 'registrar'.
// Fuse: CANNOT_RENEW | ||
uint32 public constant SETTING_OWNER_RENEWALS_LOCKED = 0x8; | ||
// Fuse: CANNOT_TRANSFER | ||
uint32 public constant SETTING_OWNER_TRANSFER_LOCKED = 0x16; |
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.
uint32 public constant SETTING_OWNER_TRANSFER_LOCKED = 0x16; | |
uint32 public constant SETTING_OWNER_TRANSFER_LOCKED = 0x10; |
// Fuse: CANNOT_TRANSFER | ||
uint32 public constant SETTING_OWNER_TRANSFER_LOCKED = 0x16; | ||
|
||
uint32 public constant SETTINGS_OWNER_MASK = 0x28; // 11100 |
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.
uint32 public constant SETTINGS_OWNER_MASK = 0x28; // 11100 | |
uint32 public constant SETTINGS_OWNER_MASK = 0x1C; // 1 1100 |
} | ||
|
||
function updateOwnerSettings(uint256 _tokenId, uint32 _settings) public onlyTokenOwner(_tokenId) | ||
withSettings(_tokenId, SETTING_OWNER_SETTINGS_LOCKED, 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.
These can be combined into one check.
Notes: