Skip to content

Commit

Permalink
feat: claim soundness property
Browse files Browse the repository at this point in the history
  • Loading branch information
GalloDaSballo committed Oct 19, 2024
1 parent 886f0f9 commit 29b8b76
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/recon/properties/GovernanceProperties.sol
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,23 @@ abstract contract GovernanceProperties is BeforeAfter {

}

function check_claim_soundness() public {
// Check if initiative is claimable
// If it is assert the check
uint256 initiativeVotesSum;
for(uint256 i; i < deployedInitiatives.length; i++) {
(Governance.InitiativeStatus status,,) = governance.getInitiativeState(deployedInitiatives[i]);

(Governance.InitiativeVoteSnapshot memory initiativeSnapshot, Governance.InitiativeState memory initiativeState,) = governance.getInitiativeSnapshotAndState(deployedInitiatives[i]);

if(status == Governance.InitiativeStatus.CLAIMABLE) {
t(governance.epoch() > 0, "Can never be claimable in epoch 0!"); // Overflow Check, also flags misconfiguration
// Normal check
t(initiativeState.lastEpochClaim < governance.epoch() - 1, "Cannot be CLAIMABLE, should be CLAIMED");
}
}
}


function _getUserAllocation(address theUser, address initiative) internal view returns (uint88 votes, uint88 vetos) {
(votes, vetos, ) = governance.lqtyAllocatedByUserToInitiative(theUser, initiative);
Expand Down

0 comments on commit 29b8b76

Please sign in to comment.