Skip to content

Commit

Permalink
test: halmos nonce can't decrease
Browse files Browse the repository at this point in the history
  • Loading branch information
MathisGD committed Apr 22, 2024
1 parent 1221cce commit 46c6f46
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/forge/HalmosTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,14 @@ contract HalmosTest is SymTest, Test {

assert(morpho.isIrmEnabled(address(irm)));
}

// Check that the nonce of users cannot decrease.
function check_nonceCannotDecrease(bytes4 selector, address caller, address user) public {
uint256 nonceBefore = morpho.nonce(user);

_callMorpho(selector, caller);

uint256 nonceAfter = morpho.nonce(user);
assert(nonceAfter == nonceBefore);
}
}

0 comments on commit 46c6f46

Please sign in to comment.