Skip to content

Commit

Permalink
test: formally verify that MPs only decrease when unstaking/leaving
Browse files Browse the repository at this point in the history
  • Loading branch information
0x-r4bbit committed Dec 5, 2024
1 parent be89292 commit c041d5d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions certora/specs/RewardsStreamerMP.spec
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,15 @@ rule stakingGreaterLockupTimeMeansGreaterMPs {
assert lockupTime1 >= lockupTime2 => to_mathint(multiplierPointsAfter1) >= to_mathint(multiplierPointsAfter2);
satisfy to_mathint(multiplierPointsAfter1) > to_mathint(multiplierPointsAfter2);
}


rule MPsOnlyDecreaseWhenUnstaking(method f) filtered { f -> f.selector != sig:upgradeToAndCall(address,bytes).selector } {
env e;
calldataarg args;

uint256 totalMPBefore = totalMP(e);
f(e, args);
uint256 totalMPAfter = totalMP(e);

assert totalMPAfter < totalMPBefore => f.selector == sig:unstake(uint256).selector || f.selector == sig:leave().selector;
}

0 comments on commit c041d5d

Please sign in to comment.