diff --git a/foundry.toml b/foundry.toml index 54fab38..f03e9fa 100644 --- a/foundry.toml +++ b/foundry.toml @@ -38,7 +38,9 @@ forge-std = { version = "1.9.2", url = "https://soldeer-revisions.s3.amazonaws.c anvil-localnet = "http://127.0.0.1:8545" sepolia-testnet = "${SEPOLIA_TEST_RPC_URL}" hoodi-testnet = "${HOODI_TEST_RPC_URL}" +mordor-testnet = "${MORDOR_TEST_RPC_URL}" [etherscan] sepolia-testnet = { key = "${SEPOLIA_TEST_API_KEY}", url = "${SEPOLIA_TEST_ENDPOINT}" } hoodi-testnet = { key = "${HOODI_TEST_API_KEY}", url = "${HOODI_TEST_ENDPOINT}" } +mordor-testnet = { key = "${MORDOR_TEST_API_KEY}", url = "${MORDOR_TEST_ENDPOINT}" } diff --git a/src/governance/GhostGovernor.sol b/src/governance/GhostGovernor.sol index 62c4f5c..dff48c5 100644 --- a/src/governance/GhostGovernor.sol +++ b/src/governance/GhostGovernor.sol @@ -115,19 +115,17 @@ contract GhostGovernor is revert GovernorInsufficientProposerVotes(proposer, proposerVotes, votesThreshold); } - if (proposerVotes <= activeProposedLock) { - revert ProposerNotEnoughVotes(proposerVotes, activeProposedLock); - } - uint256 proposalId = _lastProposalId; if (proposalId != 0) { bytes32 currentProposalState = _encodeStateBitmap(state(proposalId)); - bytes32 terminalStatesBitmap = - _encodeStateBitmap(ProposalState.Canceled) | - _encodeStateBitmap(ProposalState.Expired) | - _encodeStateBitmap(ProposalState.Executed); + bytes32 activePendingMask = + _encodeStateBitmap(ProposalState.Pending) | + _encodeStateBitmap(ProposalState.Active); - if (currentProposalState & terminalStatesBitmap == 0) { + if (currentProposalState & activePendingMask != 0) { + if (proposerVotes <= activeProposedLock) { + revert ProposerNotEnoughVotes(proposerVotes, activeProposedLock); + } ( address[] memory currentTargets, uint256[] memory currentValues, diff --git a/test/governance/GhostGovernor.t.sol b/test/governance/GhostGovernor.t.sol index f2ec44a..0102ff8 100644 --- a/test/governance/GhostGovernor.t.sol +++ b/test/governance/GhostGovernor.t.sol @@ -260,7 +260,7 @@ contract GhostGovernorTest is Test { vm.roll(block.number + 3); (uint256 newProposalId,,,,) = _proposeDummy(carol, 1337); - assertEq(uint8(governor.state(proposalId)), uint8(IGovernor.ProposalState.Canceled)); + assertEq(uint8(governor.state(proposalId)), uint8(IGovernor.ProposalState.Succeeded)); assertEq(uint8(governor.state(newProposalId)), uint8(IGovernor.ProposalState.Pending)); assertEq(ghst.balanceOf(alice), amount);