Skip to content

Commit c0bf36d

Browse files
0x-r4bbit3esmit
authored andcommitted
fix(specs): make sumOfMultiplierPointsIsMultiplierpoints work again
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.
1 parent fc3578e commit c0bf36d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

certora/specs/StakeManager.spec

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ invariant sumOfMultipliersIsMultiplierSupply()
7575
filtered {
7676
m -> !requiresPreviousManager(m) && !requiresNextManager(m)
7777
}
78+
{ preserved with (env e){
79+
requireInvariant accountMPIsZeroIfBalanceIsZero(e.msg.sender);
80+
requireInvariant accountBonusMPIsZeroIfBalanceIsZero(e.msg.sender);
81+
}
82+
}
7883

7984
invariant sumOfEpochRewardsIsPendingRewards()
8085
sumOfEpochRewards == to_mathint(currentContract.pendingReward)

0 commit comments

Comments
 (0)