-
Notifications
You must be signed in to change notification settings - Fork 1
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
Convert module role hats to mutable #1
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.
In addition to the comments, the rest of the functions documentation includes still the previous names - OWNER_HAT
and ARBITRATOR_HAT
. Regarding emitting events in the setup, it's easier with the events but we can also parse the initialization data in the subgraph handler if necessary, so both work.
src/AllowlistEligibility.sol
Outdated
|
||
/** | ||
* @notice Set a new arbitrator hat | ||
* @dev Only callable by a wearer of the current arbitratorHat, and only if the target hat is mutable |
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.
Documentation fix: "ownerHat" instead of "arbitratorHat". Or is the intention here is to provide the permission to the arbitrator?
src/AllowlistEligibility.sol
Outdated
/** | ||
* @dev Set a new owner hat | ||
* @param _newOwnerHat The new owner hat | ||
*/ | ||
function _setOwnerHat(uint256 _newOwnerHat) public { | ||
ownerHat = _newOwnerHat; | ||
|
||
emit OwnerHatSet(_newOwnerHat); | ||
} | ||
|
||
/** | ||
* @dev Set a new arbitrator hat | ||
* @param _newArbitratorHat The new arbitrator hat | ||
*/ | ||
function _setArbitratorHat(uint256 _newArbitratorHat) public { | ||
arbitratorHat = _newArbitratorHat; | ||
|
||
emit ArbitratorHatSet(_newArbitratorHat); | ||
} | ||
|
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.
The functions visibility is accidentally public
README.md
Outdated
### Humanistic Functionality | ||
|
||
- Wearer(s) of the `ownerHat` can manually revoke an account's hat by calling `removeAccountAndBurnHat()`. | ||
- Wearer(s) of the `arbitrator` can manually put an account in bad standing and burn their hat `setStandingForAccountAndBurnHat()`. |
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.
arbitratorHat
instead of arbitrator
README.md
Outdated
|
||
- Wearer(s) of the `ownerHat` can simply add account(s) to the allowlist by calling `addAccount()` or `addAccounts()`. | ||
- Wearer(s) of the `ownerHat` can simply remove account(s) from the allowlist by calling `removeAccount()` or `removeAccounts()`. | ||
- Wearer(s) of the `arbitrator` can simply set the standing of account(s) by calling `setStandingForAccount()` or `setStandingForAccounts()`. |
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.
arbitratorHat
instead of arbitrator
README.md
Outdated
@@ -4,20 +4,22 @@ A [Hats Protocol](https://github.com/hats-protocol/hats-protocol) eligibility mo | |||
|
|||
## Overview and Usage | |||
|
|||
This module sets up a simple allowlist to determine eligibility for a hat. For a given account (i.e., potential hat wearer), the allowlist stores values for that account's eligibility and standing for the hat. The wearer(s) of the `OWNER_HAT` can add or remove accounts from the allowlist. The wearer(s) of the `ARBITRATOR_HAT` can set the standing of accounts. | |||
This module sets up a simple allowlist to determine eligibility for a hat. For a given account (i.e., potential hat wearer), the allowlist stores values for that account's eligibility and standing for the hat. The wearer(s) of the `ownerHat` can add or remove accounts from the allowlist. The wearer(s) of the `arbitrator` can set the standing of accounts. |
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.
arbitratorHat
instead of arbitrator
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.
lgtm
Converts ownerHat and arbitratorHat from immutable "constants" to mutable storage values.
The reason to do this is that this module is stateful, which adds friction to migrating to a new instance in order to update owner or arbitrator roles.
There are two primary benefits of immutable config on modules
We can get the benefits of (1) in a mutable scenario by constraining changes to when the hat is mutable.