@@ -8,7 +8,7 @@ import {Hooks} from "src/libraries/Hooks.sol";
8
8
9
9
contract ProposalTypesConfigurator is IProposalTypesConfigurator {
10
10
using Hooks for IHooks;
11
- /*//////////////////////////////////////////////////////////////
11
+ /*//////////////////////////////////////////////////////////////
12
12
EVENTS
13
13
//////////////////////////////////////////////////////////////*/
14
14
@@ -41,7 +41,7 @@ contract ProposalTypesConfigurator is IProposalTypesConfigurator {
41
41
_;
42
42
}
43
43
44
- /*//////////////////////////////////////////////////////////////
44
+ /*//////////////////////////////////////////////////////////////
45
45
FUNCTIONS
46
46
//////////////////////////////////////////////////////////////*/
47
47
@@ -51,7 +51,7 @@ contract ProposalTypesConfigurator is IProposalTypesConfigurator {
51
51
* @param _proposalTypesInit Array of ProposalType structs to initialize the contract with.
52
52
*/
53
53
function initialize (address payable _governor , ProposalType[] calldata _proposalTypesInit ) public {
54
- if (address (governor) != address (0 )) revert AlreadyInit ();
54
+ if (address (governor) != address (0 )) revert AlreadyInit ();
55
55
if (_governor == address (0 )) revert InvalidGovernor ();
56
56
57
57
governor = AgoraGovernor (_governor);
@@ -85,21 +85,21 @@ contract ProposalTypesConfigurator is IProposalTypesConfigurator {
85
85
});
86
86
}
87
87
88
- /*//////////////////////////////////////////////////////////////
88
+ /*//////////////////////////////////////////////////////////////
89
89
HOOKS
90
90
//////////////////////////////////////////////////////////////*/
91
91
92
-
93
92
/// @notice The hook called before quorum calculation is performed
94
- function beforeQuorumCalculation (address sender , uint256 timepoint ) external override view returns (uint256 ) {
95
- uint256 _beforeQuorum = (governor.token ().getPastTotalSupply (timepoint) * _proposalTypes[0 ].quorum) / governor.quorumDenominator ();
96
- return _beforeQuorum;
93
+ function beforeQuorumCalculation (address sender , uint256 timepoint ) external view returns (bytes4 , uint256 ) {
94
+ uint256 _beforeQuorum =
95
+ (governor.token ().getPastTotalSupply (timepoint) * _proposalTypes[0 ].quorum) / governor.quorumDenominator ();
96
+ return (IHooks.beforeQuorumCalculation.selector , _beforeQuorum);
97
97
}
98
98
99
- /*//////////////////////////////////////////////////////////////
99
+ /*//////////////////////////////////////////////////////////////
100
100
STORAGE
101
101
//////////////////////////////////////////////////////////////*/
102
- /**
102
+ /**
103
103
* @notice Set the parameters for a proposal type. Only callable by the admin or timelock.
104
104
* @param proposalTypeId Id of the proposal type
105
105
* @param quorum Quorum percentage, scaled by `PERCENT_DIVISOR`
@@ -135,4 +135,3 @@ contract ProposalTypesConfigurator is IProposalTypesConfigurator {
135
135
emit ProposalTypeSet (proposalTypeId, quorum, approvalThreshold, name, description);
136
136
}
137
137
}
138
-
0 commit comments