Skip to content

Commit

Permalink
fix(specs): make sumOfMultiplierPointsIsMultiplierpoints work again
Browse files Browse the repository at this point in the history
This invariant failed as the prover started making wrong assumptions
about the relationship between anyone's account's `totalMP` and its
`balance`, as well as an account's `bonusMP` and its `balance`.

This commit fixes it by adding the necessary invariants to proof the
property.
  • Loading branch information
0x-r4bbit authored and 3esmit committed Oct 13, 2024
1 parent fc3578e commit c0bf36d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions certora/specs/StakeManager.spec
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ invariant sumOfMultipliersIsMultiplierSupply()
filtered {
m -> !requiresPreviousManager(m) && !requiresNextManager(m)
}
{ preserved with (env e){
requireInvariant accountMPIsZeroIfBalanceIsZero(e.msg.sender);
requireInvariant accountBonusMPIsZeroIfBalanceIsZero(e.msg.sender);
}
}

invariant sumOfEpochRewardsIsPendingRewards()
sumOfEpochRewards == to_mathint(currentContract.pendingReward)
Expand Down

0 comments on commit c0bf36d

Please sign in to comment.