Implement suggestions from audit of 4.9 (#4176)

Co-authored-by: Ernesto García <ernestognw@gmail.com>
This commit is contained in:
Francisco
2023-04-21 12:35:07 +01:00
committed by GitHub
parent 8d633cb7d1
commit 91df66c4a9
15 changed files with 97 additions and 76 deletions

View File

@ -47,19 +47,19 @@ abstract contract GovernorTimelockControl is IGovernorTimelock, Governor {
}
/**
* @dev Overridden version of the {Governor-state} function with added support for the `Queued` status.
* @dev Overridden version of the {Governor-state} function with added support for the `Queued` state.
*/
function state(uint256 proposalId) public view virtual override(IGovernor, Governor) returns (ProposalState) {
ProposalState status = super.state(proposalId);
ProposalState currentState = super.state(proposalId);
if (status != ProposalState.Succeeded) {
return status;
if (currentState != ProposalState.Succeeded) {
return currentState;
}
// core tracks execution, so we just have to check if successful proposal have been queued.
bytes32 queueid = _timelockIds[proposalId];
if (queueid == bytes32(0)) {
return status;
return currentState;
} else if (_timelock.isOperationDone(queueid)) {
return ProposalState.Executed;
} else if (_timelock.isOperationPending(queueid)) {