This repository has been archived by the owner on Nov 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
refactor: remove governor role from configuration and determine it automatically #86
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dd0sxx
reviewed
Dec 21, 2023
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 looks good at first glance. two things:
1: we have to benchmark this against the previous version and against oz governor
2: write a test for the best and worst case, and benchmark the difference between max and min + the average
xmxanuel
reviewed
Dec 21, 2023
0xrajath
reviewed
Dec 21, 2023
0xrajath
reviewed
Dec 21, 2023
0xrajath
reviewed
Dec 21, 2023
0xrajath
reviewed
Dec 21, 2023
0xrajath
reviewed
Dec 21, 2023
0xrajath
reviewed
Dec 21, 2023
Coverage after merging austin/remove-governance-role into main will be
Coverage Report
|
0xrajath
approved these changes
Dec 22, 2023
dd0sxx
approved these changes
Dec 22, 2023
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation:
Rather than requiring Token Governors to specify an immutable governance role at deploy time, this PR enables the use of multiples roles.
Modifications:
For token holder action creation, creators can specify the role they want to create actions with on behalf of token holders when calling
createAction
onLlamaTokenGovernor
.For token holder casting, this PR defines a
_getGovernanceRole
function that is used by bothcastVote
andcastVeto
as well assubmitApproval
andsubmitDisapproval
._getGovernanceRole
provides a deterministic algorithm for determining which role token holders will cast an approval or disapproval with. It does this by first checking if theLlamaTokenGovernor
has a force role for the action's strategy. It iterates through all assigned roles from 1 to the max assigned role.The token governor will cast with the first match if it's policy has a force role. If it doesn't then it will fallback to using the (dis)approvall role defined by the action's strategy.
Result:
Addresses https://github.com/spearbit-audits/review-llama-token-governor/issues/6