Skip to content

Commit

Permalink
prevent queueing of proposals from different eras (#1196)
Browse files Browse the repository at this point in the history
Co-authored-by: Akshat Mittal <[email protected]>
  • Loading branch information
tbrent and akshatmittal authored Sep 10, 2024
1 parent 2d5a599 commit 75b0b01
Show file tree
Hide file tree
Showing 10 changed files with 1,430 additions and 7 deletions.
1 change: 1 addition & 0 deletions .solhintignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ contracts/vendor
contracts/plugins/assets/compound/vendor
contracts/plugins/assets/curve/crv
contracts/plugins/assets/curve/cvx
contracts/plugins/governance/vendor
14 changes: 7 additions & 7 deletions contracts/plugins/governance/Governance.sol
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// SPDX-License-Identifier: BlueOak-1.0.0
pragma solidity 0.8.19;

import "@openzeppelin/contracts/governance/Governor.sol";
import "@openzeppelin/contracts/governance/extensions/GovernorCountingSimple.sol";
import "@openzeppelin/contracts/governance/extensions/GovernorSettings.sol";
import "@openzeppelin/contracts/governance/extensions/GovernorTimelockControl.sol";
import "@openzeppelin/contracts/governance/extensions/GovernorVotes.sol";
import "@openzeppelin/contracts/governance/extensions/GovernorVotesQuorumFraction.sol";
import "../../interfaces/IStRSRVotes.sol";
import "./vendor/extensions/GovernorCountingSimple.sol";
import "./vendor/extensions/GovernorSettings.sol";
import "./vendor/extensions/GovernorTimelockControl.sol";
import "./vendor/extensions/GovernorVotes.sol";
import "./vendor/extensions/GovernorVotesQuorumFraction.sol";
import "./vendor/Governor.sol";

uint256 constant ONE_DAY = 86400; // {s}

Expand Down Expand Up @@ -183,7 +183,7 @@ contract Governance is
// === Private ===

function startedInSameEra(uint256 proposalId) private view returns (bool) {
uint256 startTimepoint = proposalSnapshot(proposalId);
uint256 startTimepoint = proposalProposedAt(proposalId);
uint256 pastEra = IStRSRVotes(address(token)).getPastEra(startTimepoint);
uint256 currentEra = IStRSRVotes(address(token)).currentEra();
return currentEra == pastEra;
Expand Down
Loading

0 comments on commit 75b0b01

Please sign in to comment.