-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(certora): introduce shared.spec to reuse helper functions
We have a couple of helper functions redefined in multiple spec files. This commit introduces a `shared.spec` that provides such functions. The file is then imported in other spec files, so we can make use of the functions there. Closes #87
- Loading branch information
Showing
5 changed files
with
52 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using StakeManager as _stakeManager; | ||
|
||
definition requiresPreviousManager(method f) returns bool = ( | ||
f.selector == sig:_stakeManager.migrationInitialize(uint256,uint256,uint256,uint256,uint256,uint256,uint256).selector || | ||
f.selector == sig:_stakeManager.migrateFrom(address,bool,StakeManager.Account).selector || | ||
f.selector == sig:_stakeManager.increaseTotalMP(uint256).selector | ||
); | ||
|
||
definition requiresNextManager(method f) returns bool = ( | ||
f.selector == sig:_stakeManager.migrateTo(bool).selector || | ||
f.selector == sig:_stakeManager.transferNonPending().selector | ||
); | ||
|
||
function getAccountBalance(address addr) returns uint256 { | ||
uint256 balance; | ||
_, balance, _, _, _, _, _, _ = _stakeManager.accounts(addr); | ||
|
||
return balance; | ||
} | ||
|
||
function getAccountBonusMultiplierPoints(address addr) returns uint256 { | ||
uint256 bonusMP; | ||
_, _, bonusMP, _, _, _, _, _ = _stakeManager.accounts(addr); | ||
|
||
return bonusMP; | ||
} | ||
|
||
function getAccountCurrentMultiplierPoints(address addr) returns uint256 { | ||
uint256 totalMP; | ||
_, _, _, totalMP, _, _, _, _ = _stakeManager.accounts(addr); | ||
|
||
return totalMP; | ||
} | ||
|
||
function getAccountLockUntil(address addr) returns uint256 { | ||
uint256 lockUntil; | ||
_, _, _, _, _, lockUntil, _, _ = _stakeManager.accounts(addr); | ||
|
||
return lockUntil; | ||
} | ||
|
||
|