Skip to content

Commit

Permalink
Fix issues in DualGovernanceModel and EmergencyProtectedTimelockModel
Browse files Browse the repository at this point in the history
  • Loading branch information
qian-hu committed Jul 9, 2024
1 parent 22d1d3b commit fb9de96
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion contracts/model/DualGovernanceModel.sol
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ contract DualGovernanceModel {
"Proposals can only be scheduled in Normal or Veto Cooldown states."
);
if (currentState == State.VetoCooldown) {
(,,, uint256 submissionTime,) = emergencyProtectedTimelock.proposals(proposalId);
(,, uint256 submissionTime,,) = emergencyProtectedTimelock.proposals(proposalId);
require(
submissionTime < lastVetoSignallingTime,
"Proposal submitted after the last time Veto Signalling state was entered."
Expand Down
12 changes: 7 additions & 5 deletions contracts/model/EmergencyProtectedTimelockModel.sol
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,13 @@ contract EmergencyProtectedTimelockModel {
function cancelAllNonExecutedProposals() public {
require(msg.sender == governance, "Caller is not authorized to cancel proposal.");

// Loop through all the proposals stored in the contract.
for (uint256 i = 0; i < nextProposalId; i++) {
// Ensure that only proposals in 'Submitted' or 'Scheduled' status are canceled.
if (proposals[i].status != ProposalStatus.Executed) {
proposals[i].status = ProposalStatus.Canceled;
if (nextProposalId > 0) {
// Loop through all the proposals stored in the contract.
for (uint256 i = 0; i < nextProposalId; i++) {
// Ensure that only proposals in 'Submitted' or 'Scheduled' status are canceled.
if (proposals[i].status != ProposalStatus.Executed) {
proposals[i].status = ProposalStatus.Canceled;
}
}
}
}
Expand Down

0 comments on commit fb9de96

Please sign in to comment.