Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions packages/protocol/specs/lockedGold.spec
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ methods {
getPendingWithdrawalsLength(address) returns uint256 envfree
getPendingWithdrawalsIndex(address,uint256) returns uint256 envfree
getunlockingPeriod() returns uint256 envfree
getPendingWithdrawal(address,uint256) returns (uint256,uint256) envfree
incrementNonvotingAccountBalance(address, uint256)
decrementNonvotingAccountBalance(address, uint256)
unlock(uint256)
Expand Down Expand Up @@ -111,10 +112,13 @@ rule noChangeByOther(address a, address b, method f) {
*/
rule withdraw(uint256 index) {
env e;
require (e.msg.sender != currentContract);
uint256 _balance = sinvoke ercBalanceOf(e.msg.sender);
uint256 val = sinvoke getPendingWithdrawalsIndex(e.msg.sender, index);
uint256 val;
uint256 ts;
(val, ts) = sinvoke getPendingWithdrawal(e.msg.sender, index);
require(e.block.timestamp >= ts);
sinvoke withdraw(e, index);
require (e.msg.sender != currentContract);
uint256 balance_ = sinvoke ercBalanceOf(e.msg.sender);
assert(
_balance + val == balance_,
Expand Down