Skip to content

Commit 43455db

Browse files
committed
Fix return type
1 parent 2da168a commit 43455db

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

src/modules/ProposalTypesConfigurator.sol

+10-11
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {Hooks} from "src/libraries/Hooks.sol";
88

99
contract ProposalTypesConfigurator is IProposalTypesConfigurator {
1010
using Hooks for IHooks;
11-
/*//////////////////////////////////////////////////////////////
11+
/*//////////////////////////////////////////////////////////////
1212
EVENTS
1313
//////////////////////////////////////////////////////////////*/
1414

@@ -41,7 +41,7 @@ contract ProposalTypesConfigurator is IProposalTypesConfigurator {
4141
_;
4242
}
4343

44-
/*//////////////////////////////////////////////////////////////
44+
/*//////////////////////////////////////////////////////////////
4545
FUNCTIONS
4646
//////////////////////////////////////////////////////////////*/
4747

@@ -51,7 +51,7 @@ contract ProposalTypesConfigurator is IProposalTypesConfigurator {
5151
* @param _proposalTypesInit Array of ProposalType structs to initialize the contract with.
5252
*/
5353
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();
5555
if (_governor == address(0)) revert InvalidGovernor();
5656

5757
governor = AgoraGovernor(_governor);
@@ -85,21 +85,21 @@ contract ProposalTypesConfigurator is IProposalTypesConfigurator {
8585
});
8686
}
8787

88-
/*//////////////////////////////////////////////////////////////
88+
/*//////////////////////////////////////////////////////////////
8989
HOOKS
9090
//////////////////////////////////////////////////////////////*/
9191

92-
9392
/// @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);
9797
}
9898

99-
/*//////////////////////////////////////////////////////////////
99+
/*//////////////////////////////////////////////////////////////
100100
STORAGE
101101
//////////////////////////////////////////////////////////////*/
102-
/**
102+
/**
103103
* @notice Set the parameters for a proposal type. Only callable by the admin or timelock.
104104
* @param proposalTypeId Id of the proposal type
105105
* @param quorum Quorum percentage, scaled by `PERCENT_DIVISOR`
@@ -135,4 +135,3 @@ contract ProposalTypesConfigurator is IProposalTypesConfigurator {
135135
emit ProposalTypeSet(proposalTypeId, quorum, approvalThreshold, name, description);
136136
}
137137
}
138-

0 commit comments

Comments
 (0)