-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
Add a governor extension that implements a proposal guardian #5303
base: master
Are you sure you want to change the base?
Conversation
|
Looks good other than some comments. Would it make sense to call it something like |
Compound Governance already has a feature like this where the council is called the |
9bc440d
to
d613cc8
Compare
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.
What's the rationale to allow a proposer to cancel a proposal at any time?
I think the contract would be simpler if it just focus on allowing the guardian to cancel at any time and otherwise fallback to their original behavior with super
.
// if there is no proposal guardian | ||
// ... only the proposer can cancel | ||
// ... no restriction on when the proposer can cancel | ||
uint256 proposalId = getProposalId(targets, values, calldatas, descriptionHash); | ||
address proposer = proposalProposer(proposalId); | ||
if (caller != proposer) revert GovernorOnlyProposer(caller); | ||
return _cancel(targets, values, calldatas, descriptionHash); |
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 default behavior in Governor is to only allow the proposer to cancel when the proposal is still pending. I don't think we want to allow proposers to cancel after that.
Also, if we want to keep the default behavior, wouldn't it be better to just?:
// if there is no proposal guardian | |
// ... only the proposer can cancel | |
// ... no restriction on when the proposer can cancel | |
uint256 proposalId = getProposalId(targets, values, calldatas, descriptionHash); | |
address proposer = proposalProposer(proposalId); | |
if (caller != proposer) revert GovernorOnlyProposer(caller); | |
return _cancel(targets, values, calldatas, descriptionHash); | |
return super.cancel(targets, values, calldatas, descriptionHash); |
This would simplify this function imo
The inspiration for this PR is in #5260 which was then replaced by #5301. There is some context missing but will try to give a TLDR.
|
Co-authored-by: Ernesto García <[email protected]>
Co-authored-by: Ernesto García <[email protected]>
Fixes #5301
PR Checklist
npx changeset add
)