-
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
Fix H-01: Allow whitelisted accounts below threshold to propose #89
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.
One small change request.
contracts/CompoundGovernor.sol
Outdated
@@ -135,32 +135,74 @@ contract CompoundGovernor is | |||
return GovernorSequentialProposalIdUpgradeable.hashProposal(_targets, _values, _calldatas, _descriptionHash); | |||
} | |||
|
|||
/// @notice Creates a new proposal. | |||
/// @dev This is an override of the function that skips proposal threshold check for whitelisted 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.
this sounds like it's referring to some other function (in GovernorUpgradeable) that skips the proposal threshold check. but in fact, THIS is the function doing that.
i think i'd recommend expanding the @notice to include details on how the whitelisting works as well, otherwise that'll be undocumented afaik
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.
Updated in: f6bb8a8 and added to the whitelisting related docs above setWhitelistAccountExpiration
.
@@ -74,6 +74,15 @@ contract Propose is CompoundGovernorTest { | |||
vm.assertEq(uint8(governor.state(_proposalId)), uint8(IGovernor.ProposalState.Active)); | |||
} | |||
|
|||
function test_AWhitelistedAccountCanProposeWhileBelowThreshold(address _proposer) public { |
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.
function test_AWhitelistedAccountCanProposeWhileBelowThreshold(address _proposer) public { | |
function test_WhitelistedAccountCanProposeBelowThreshold(address _proposer) public { |
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.
@@ -93,6 +102,21 @@ contract Propose is CompoundGovernorTest { | |||
); | |||
_submitProposal(_proposer, _proposal); | |||
} | |||
|
|||
function test_RevertIf_ProposerIsBelowThreshold(address _proposer) public { |
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.
function test_RevertIf_ProposerIsBelowThreshold(address _proposer) public { | |
function test_RevertIf_NonWhitelistedProposerIsBelowThreshold(address _proposer) public { |
@@ -93,6 +102,21 @@ contract Propose is CompoundGovernorTest { | |||
); | |||
_submitProposal(_proposer, _proposal); | |||
} | |||
|
|||
function test_RevertIf_ProposerIsBelowThreshold(address _proposer) public { |
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.
could also use a... test_RevertIf_ExpiredWhitelistedAccountIsBelowThreshold
just to make sure we're covering the breadth of the feature
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.
added 7a94bff
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
closes #77