diff --git a/contracts/model/DualGovernanceModel.sol b/contracts/model/DualGovernanceModel.sol index 812e8e60..56abc5fc 100644 --- a/contracts/model/DualGovernanceModel.sol +++ b/contracts/model/DualGovernanceModel.sol @@ -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." diff --git a/contracts/model/EmergencyProtectedTimelockModel.sol b/contracts/model/EmergencyProtectedTimelockModel.sol index 497d003c..bb6ac72a 100644 --- a/contracts/model/EmergencyProtectedTimelockModel.sol +++ b/contracts/model/EmergencyProtectedTimelockModel.sol @@ -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; + } } } }