Open GalloDaSballo opened 3 days ago
This finding points towards another edge case
Since calculateVotingThreshold
is calculated spot, at the time of _snapshotVotesForInitiative
then any initiative that wasn't touched for multiple epochs could either be "revived" or made removable based on that one spot valuation
Impact
The condition to
unregister
an initiative is the following:https://github.com/liquity/V2-gov/blob/fc5bff2bd1a650b6dcb68c537b40753d1a59d238/src/Governance.sol#L346-L353
This means that in theory, if we wait enough epochs, we can kick any initiative
However, there's an edge case in this logic
In the case in which we have 0 total votes, and a few epochs pass, the
_snapshotVotesForInitiative
will follow this logic path:Which means that the initiative will have it's 0 votes considered as above the votingThreshold
This causes the test to fail due to the call here:
We would expect the
initData.lastCountedEpoch
to not increase, but it does due to the edge casePOC
Fails with:
More info for POC
For full repro, use: https://github.com/GalloDaSballo/V2-gov/tree/feat-tinfoil
Add the test to
GovernanceAttacks.t