mirror of https://github.com/logos-co/staking.git
chore: add cerora rules for `stakeSupply` ghost rule
This commit is contained in:
parent
4f2f6d3a75
commit
1f712616be
|
@ -1,6 +1,7 @@
|
||||||
using ERC20A as staked;
|
using ERC20A as staked;
|
||||||
methods {
|
methods {
|
||||||
function staked.balanceOf(address) external returns (uint256) envfree;
|
function staked.balanceOf(address) external returns (uint256) envfree;
|
||||||
|
function stakeSupply() external returns (uint256) envfree;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isMigrationfunction(method f) returns bool {
|
function isMigrationfunction(method f) returns bool {
|
||||||
|
@ -15,6 +16,17 @@ function simplification() {
|
||||||
require currentContract.migration == 0;
|
require currentContract.migration == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ghost mathint sumOfBalances /* sigma account[u].balance forall u */ {
|
||||||
|
init_state axiom sumOfBalances == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
hook Sstore accounts[KEY address addr].balance uint256 newValue (uint256 oldValue) STORAGE {
|
||||||
|
sumOfBalances = sumOfBalances - oldValue + newValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
invariant sumOfBalancesIsStakeSupply()
|
||||||
|
sumOfBalances == to_mathint(stakeSupply());
|
||||||
|
|
||||||
|
|
||||||
rule reachability(method f)
|
rule reachability(method f)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue