From 6447ccc35bf1c5fcc9501b3fbdb086f8716b7e0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Fingen?= Date: Tue, 26 Nov 2024 13:28:15 +0000 Subject: [PATCH 1/2] fix: Remove unnecessary zero initialization from initial initiatives --- src/Governance.sol | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Governance.sol b/src/Governance.sol index fd9bf065..6d0e6749 100644 --- a/src/Governance.sol +++ b/src/Governance.sol @@ -125,8 +125,6 @@ contract Governance is Multicall, UserProxyFactory, ReentrancyGuard, Ownable, IG function registerInitialInitiatives(address[] memory _initiatives) public onlyOwner { for (uint256 i = 0; i < _initiatives.length; i++) { - initiativeStates[_initiatives[i]] = InitiativeState(0, 0, 0, 0, 0); - // Register initial initiatives in the earliest possible epoch, which lets us make them votable immediately // post-deployment if we so choose, by backdating the first epoch at least EPOCH_DURATION in the past. registeredInitiatives[_initiatives[i]] = 1; From 63560506b0f2ecc8d2e9c12dbe3e89a6adf60073 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Fingen?= Date: Tue, 26 Nov 2024 13:28:35 +0000 Subject: [PATCH 2/2] fix: Use cached currentEpoch on registering initiatives --- src/Governance.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Governance.sol b/src/Governance.sol index 6d0e6749..7bfaa1f7 100644 --- a/src/Governance.sol +++ b/src/Governance.sol @@ -572,7 +572,7 @@ contract Governance is Multicall, UserProxyFactory, ReentrancyGuard, Ownable, IG registeredInitiatives[_initiative] = currentEpoch; /// @audit This ensures that the initiatives has UNREGISTRATION_AFTER_EPOCHS even after the first epoch - initiativeStates[_initiative].lastEpochClaim = epoch() - 1; + initiativeStates[_initiative].lastEpochClaim = currentEpoch - 1; emit RegisterInitiative(_initiative, msg.sender, currentEpoch);