Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor tweak to initiatives initialization #85

Merged
merged 2 commits into from
Nov 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/Governance.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -574,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);

Expand Down