added init_state axiom for sum of balances

This commit is contained in:
Michael George
2022-06-02 14:37:40 -04:00
parent b90d195c6c
commit 27fa53bba9

View File

@ -32,7 +32,9 @@ filtered {
/******************************************************************************/ /******************************************************************************/
ghost mapping(uint256 => mathint) sumOfBalances; ghost mapping(uint256 => mathint) sumOfBalances {
init_state axiom forall uint256 token . sumOfBalances[token] == 0;
}
hook Sstore _balances[KEY uint256 token][KEY address user] uint256 newValue (uint256 oldValue) STORAGE { hook Sstore _balances[KEY uint256 token][KEY address user] uint256 newValue (uint256 oldValue) STORAGE {
sumOfBalances[token] = sumOfBalances[token] + newValue - oldValue; sumOfBalances[token] = sumOfBalances[token] + newValue - oldValue;