-
Notifications
You must be signed in to change notification settings - Fork 7
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
Badger registry 2.0 #10
Conversation
…n now be promted to "deprecated"
contracts/BadgerRegistry.sol
Outdated
//@dev Anyone can add a vault to here, it will be indexed by their address | ||
function add(string memory version, address vault) public { | ||
function add( | ||
string memory version, |
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.
not sure its covered in the spec although it would be nice to have guards here for input validation wrt version and allow some kind of management on release versions available to ensure proper usage of functionality
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.
Yes makes a lot of sense. I've added a VersionGuard modifier with requires a supported version. To ensure that checking the version has O(1) compatibility I used an Bytes32Set for storing the versions using Keccak256 hash for this.
…en checking if a version is supported
Closed in favour of #12 |
I'm submitting this pull request to implement the new Badger Dao registry. I've done the following steps to fulfill the task:
Implemented a role-based access control based on the requirements. Now there are 3 roles used within the contract:
To protect functions from being accessed by unauthorized users I've created two modifiers
Added Metadata to vaults. The function "add" now accepts a new parameter "metadata" of type string. Which can be used to store arbitrary strings as metadata of a certain vault.
Modified the return values of "getVaults" and "getFilteredProductionVaults". They are now returning an array that contains two arrays "vaultAddresses" and "vaultMetadata"
Modified the struct "VaultData". It has now a new field called metadata that is used to store the vaults metadata.
Modified the function "set" and "deleteKey" so they are now using to mappings "keys" and "addresses" to storge the needed values in both ways. Also renamed function names from "set" to "addKey" and events from "Set" to "KeyAdded".
Replaced "initialized" function with a constructor.
There is still an ongoing question regarding the "devote" function. I think this function can be removed since the process of devotion is now replaced by promoting to "deprecated".
If any further features could make sense to build please let me know I would love to build them!
If there are any questions left please feel free to reach me out
Discord : Alex245#0896