The sum of votes is equal to the total votes at most
The contributions are linear (no rounding error) (Need to sum up all contributions individually)
TODO: Can we save a initiative that should be removed? Prob not
Removal of chunks
/// Find some random amount
/// Divide into chunks
/// Ensure chunks above 1 wei
/// Go ahead and remove
/// Ensure that at the end you remove 100%
function test_fuzz_canRemoveExtact() public {
}
Prob best done as invariant
Inductive removal of chunks
If I have X votes and remove Y votes, I always have X - Y votes left
If I withdraw Y and then X - Y I have 0 left
For a unregistered initiative
Registering reverts
Unregistering reverts
Claiming Rewards reverts
AllocateLQTY can only Reduce Votes or Reduce Vetoes
Lifecycle tests
enum InitiativeStatus {
SKIP, /// This epoch will result in no rewards and no unregistering
CLAIMABLE, /// This epoch will result in claiming rewards
CLAIMED, /// The rewards for this epoch have been claimed
UNREGISTERABLE, /// Can be unregistered
DISABLED // It was already Unregistered
}
A newly created Initiative should be SKIP
A initiative that didn't meet the threshold should be SKIP
A initiative that has sufficiently high vetoes in the next epoch should be UNREGISTERABLE
A initiative that has reached sufficient votes in the previous epoch should become CLAIMABLE in this epoch
A CLAIMABLE initiative can remain CLAIMABLE in the epoch, or can become CLAIMED once someone claims the rewards
Initiatives Tracking
allocateLQTY
FSM:Removal of chunks
Prob best done as invariant
Inductive removal of chunks
If I have X votes and remove Y votes, I always have X - Y votes left If I withdraw Y and then X - Y I have 0 left
For a unregistered initiative
Lifecycle tests
A newly created Initiative should be
SKIP
A initiative that didn't meet the threshold should beSKIP
A initiative that has sufficiently high vetoes in the next epoch should beUNREGISTERABLE
A initiative that has reached sufficient votes in the previous epoch should becomeCLAIMABLE
in this epoch ACLAIMABLE
initiative can remainCLAIMABLE
in the epoch, or can becomeCLAIMED
once someone claims the rewardsRegister and award Flow
0 -> 1 -> 1 SKIP -> CLAIMABLE -> CLAIMED
0 -> X SKIP -> SKIP -> UNREGISTERABLE -> [UNREGISTERABLE | DISABLED]
0 -> 1 SKIP -> UNREGISTERABLE -> [UNREGISTERABLE | DISABLED]