fix(StakeManager.spec): make `epochOnlyIncreases` rule pass

This was failing due to `migrationInitialize()` allowing for resetting
or decreasing a `StakeManager`s `currentEpoch`.

In practice, however, this is not possible because a new manager can
only be called from an old manager and the old manager can only migrate
once. So if `migrationInitialize()` is called from an old manager, we
can safely assume it's the first time this is called, meaning the new
manager's `currentEpoch` must be `0` at this point in time.
This commit is contained in:
r4bbit 2024-03-04 11:45:57 +01:00 committed by Ricardo Guilherme Schmidt
parent 2343213e0d
commit e723464245
1 changed files with 3 additions and 1 deletions

View File

@ -119,7 +119,9 @@ rule revertsWhenNoMigration(method f) {
// assert before == staked.balanceOf(user);
// }
rule epochOnlyIncreases {
rule epochOnlyIncreases(method f) filtered {
f -> f.selector != sig:migrationInitialize(uint256,uint256,uint256,uint256).selector;
} {
method f;
env e;
calldataarg args;