-
Notifications
You must be signed in to change notification settings - Fork 39
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
Registry of Balancer standard contracts (v2) #1219
base: main
Are you sure you want to change the base?
Conversation
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.
Thanks @EndymionJkb, looks good! I have a few comments / questions, but otherwise LGTM.
Bottom line, I'm trying to simplify the management of the mappings as much as possible (3 feels already too much to me, but I understand it's required to use it in the way it's intended to). That being said, the more we can split the source of truth from the aliases, the better.
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.
Sorry for being so annoying 😇 but I think there's some room to simplify the code.
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.
Cool!
Description
Based on #1206, this is designed to be a more straight-forward implementation that still covers all the use cases, but is less error-prone and without troublesome edge cases.
It maintains name => address, and address => info (i.e., state) mappings, but through guaranteeing uniqueness conceptually acts like a single name => address => info data structure, only split to enable querying by either name or address.
These entries are fixed once created (except that
isActive
can be set to false through deprecation), but it is possible to deregister (delete) a contract, which is the simplest mechanism to fix errors, without complex "replacement" logic.The "alias" use case is enabled with another mapping, and a single function to add or update an alias. This separates concerns, and prevents possible corruption of the core index (e.g., setting an alias that is the same name as a real contract, which could break things if allowed on the main registry).
Type of change
Checklist:
main
, or there's a description of how to mergeIssue Resolution