From 46c6f463f46d59bfd9a80c5fdbd8eb7ba3e99deb Mon Sep 17 00:00:00 2001 From: MathisGD Date: Mon, 22 Apr 2024 12:35:24 +0200 Subject: [PATCH] test: halmos nonce can't decrease --- test/forge/HalmosTest.sol | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/forge/HalmosTest.sol b/test/forge/HalmosTest.sol index 9d496239..cb445774 100644 --- a/test/forge/HalmosTest.sol +++ b/test/forge/HalmosTest.sol @@ -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); + } }