-
Notifications
You must be signed in to change notification settings - Fork 0
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
Initial code for Radworks upgraded Governor #2
Initial code for Radworks upgraded Governor #2
Conversation
Current dependencies on/for this PR:
This stack of pull requests is managed by Graphite. |
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.
looks good @jferas! i gave you a bunch of nits, for you to do as you will with. Cheers.
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.
Looks good, I left some comments and questions
src/RadworksGovernor.sol
Outdated
@@ -0,0 +1,218 @@ | |||
// SPDX-License-Identifier: AGPL-3.0-only | |||
pragma solidity ^0.8.18; |
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.
I think this can bumped to ^0.8.20
as that is what we have as the version in the Counters.sol
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.
Done: a62f287
/// @inheritdoc IGovernor | ||
// solhint-disable-next-line func-name-mixedcase | ||
function COUNTING_MODE() public pure override returns (string memory) { | ||
return "support=bravo&quorum=bravo"; |
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.
I think this needs to conform to https://eips.ethereum.org/EIPS/eip-6372. Do we need to override the inherited method.
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.
Need to override COUNTING_MODE here as it is required by Governor who RadworksGovernor inherits from
src/RadworksGovernor.sol
Outdated
contract RadworksGovernor is | ||
Governor, | ||
GovernorVotesComp, | ||
RadworksGovernorTimelockCompound, |
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.
I think we can use the stock GovernorTimelockCompound
. We used a custom Timelock contract for PoolTogether because their GRACE_PERIOD
method was called gracePeriod
. But, for Radicle it seems to be compatible.
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.
Looks like Radicle also calls it gracePeriod
.. https://etherscan.io/address/0x8dA8f82d2BbDd896822de723F55D6EdF416130ba#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.
Thanks! Indeed.. I guess I missed that both were present: c7f59d4
src/RadworksGovernor.sol
Outdated
require( | ||
_proposalVotersWeightCast[proposalId][account] == 0, | ||
"Radworks Governor: vote would exceed weight" | ||
); |
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.
Nit: I think using an error type is more gas efficient
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.
Done: 857551e
} | ||
|
||
/// @inheritdoc Governor | ||
function _quorumReached(uint256 proposalId) internal view virtual override returns (bool) { |
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.
Why does this and the _voteSucceeded
need to be overrided?
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.
I believe it needs to be as RadworksGovernor inherits from Governor
// This RadworksGovernorTimelockCompound has been modified from the OZ GovernorTimelockCompound to | ||
// support a Radworks Timelock which does not conform to Governor Alpha Timelock. If Radworks | ||
// decides to change the Timelock in the future then it must conform to the Radworks Timelock | ||
// interface. |
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.
Is the existing timelock acceptable enough?
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.
Agree: c7f59d4
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.
ah, ok! so radworks timelock is simply the default? this simplifies things 👍
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, it is different, but it doesn't conflict in the same way as the poolTogether timelock did.
Coverage after merging feature/add-governor into 11-02-chore_install_OZ_contracts_library will be
|
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
ba760da
into
11-02-chore_install_OZ_contracts_library
Added Bravo/OZ style governor with needed timelock interface changes