Add Governor module for governance-settable parameters (#2904)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
This commit is contained in:
@ -8,27 +8,15 @@ import "../Governor.sol";
|
||||
* @dev Extension of {Governor} for proposal restriction to token holders with a minimum balance.
|
||||
*
|
||||
* _Available since v4.3._
|
||||
* _Deprecated since v4.4._
|
||||
*/
|
||||
abstract contract GovernorProposalThreshold is Governor {
|
||||
/**
|
||||
* @dev See {IGovernor-propose}.
|
||||
*/
|
||||
function propose(
|
||||
address[] memory targets,
|
||||
uint256[] memory values,
|
||||
bytes[] memory calldatas,
|
||||
string memory description
|
||||
) public virtual override returns (uint256) {
|
||||
require(
|
||||
getVotes(msg.sender, block.number - 1) >= proposalThreshold(),
|
||||
"GovernorCompatibilityBravo: proposer votes below proposal threshold"
|
||||
);
|
||||
|
||||
return super.propose(targets, values, calldatas, description);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Part of the Governor Bravo's interface: _"The number of votes required in order for a voter to become a proposer"_.
|
||||
*/
|
||||
function proposalThreshold() public view virtual returns (uint256);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user