Description
The function ThresholdGovernor.execute executes a successful proposal. Among other things, the function executes the following lines:
if (currentEpoch_ == 0) revert InvalidEpoch();
// Proposals have voteStart=N and voteEnd=N+1, and can be executed
only during epochs N and N+1.
uint16 latestPossibleVoteStart_ = currentEpoch_;
uint16 earliestPossibleVoteStart_ = latestPossibleVoteStart_ > 0 ? latestPossibleVoteStart_ - 1 : 0;The execute function will revert if currentEpoch_ == 0, and then it assigns this value to latestPossibleVoteStart_. Considering this last variable can never be zero, the conditional check in the following line is unnecessary.
Recommendation
Replace the last lined shown above with the following: uint16 earliestPossibleVoteStart_ = latestPossibleVoteStart_ - 1;
Status
Acknowledged