Skip to content
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

feat: support whitelisted proposers #116

Draft
wants to merge 61 commits into
base: develop
Choose a base branch
from
Draft

Conversation

coreyar
Copy link
Collaborator

@coreyar coreyar commented Jan 23, 2025

Description

This PR is to support whitelisted proposers that can be set and removed with a timelock. The idea is to allow programmatically creating proposals.

@coreyar coreyar force-pushed the white-list-proposers branch 5 times, most recently from 87a1dda to 753a5a5 Compare January 28, 2025 17:41
@coreyar coreyar force-pushed the white-list-proposers branch 4 times, most recently from 9754981 to d674786 Compare February 17, 2025 22:51

uint latestProposalId = latestProposalIds[msg.sender];
if (
whitelistedProposers[msg.sender] != address(0) &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to check this condition again, as we are already ensuring it in previous condition?

_;
}

modifier onlyGuardianOrAdmin() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we remove it as we are using ACM for authorisation?

* @param proposer The address of the proposer to whitelist
*/
function whitelistProposer(address proposer, ProposalType proposalType) external {
_checkAccessAllowed("whitelistProposer(address,ProposalType)");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_checkAccessAllowed("whitelistProposer(address,ProposalType)");
_checkAccessAllowed("whitelistProposer(address,ProposalType)");
ensureNonzeroAddress(proposer)

@@ -280,35 +364,61 @@ contract GovernorBravoDelegate is GovernorBravoDelegateStorageV2, GovernorBravoE
emit ProposalQueued(proposalId, eta);
}

/**
* @notice Whitelists a proposer
* @param proposer The address of the proposer to whitelist
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

natspec is missing for event and access

require(c >= a, "addition overflow");
return c;
}

function sub256(uint256 a, uint256 b) internal pure returns (uint) {
function sub256(uint256 a, uint256 b) internal pure returns (uint256) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don;t these functionalities to check overflows in 0.8.25 version of solidity.

@coreyar coreyar force-pushed the white-list-proposers branch from d674786 to d8b8274 Compare February 25, 2025 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants