|
1 | 1 | methods { |
2 | 2 | // |
3 | | - getThreshold() returns (uint256) envfree |
4 | | - disableModule(address,address) |
5 | | - nonce() returns (uint256) envfree |
| 3 | + function getThreshold() external returns (uint256) envfree; |
| 4 | + function disableModule(address,address) external; |
| 5 | + function nonce() external returns (uint256) envfree; |
6 | 6 |
|
7 | 7 | // harnessed |
8 | | - getModule(address) returns (address) envfree |
| 8 | + function getModule(address) external returns (address) envfree; |
| 9 | + |
| 10 | + // optional |
| 11 | + function execTransactionFromModuleReturnData(address,uint256,bytes,SafeHarness.Operation) external returns (bool, bytes memory); |
| 12 | + function execTransactionFromModule(address,uint256,bytes,SafeHarness.Operation) external returns (bool); |
| 13 | + function execTransaction(address,uint256,bytes,SafeHarness.Operation,uint256,uint256,uint256,address,address,bytes) external returns (bool); |
9 | 14 | } |
10 | 15 |
|
11 | 16 | definition noHavoc(method f) returns bool = |
12 | | - f.selector != execTransactionFromModuleReturnData(address,uint256,bytes,uint8).selector |
13 | | - && f.selector != execTransactionFromModule(address,uint256,bytes,uint8).selector |
14 | | - && f.selector != execTransaction(address,uint256,bytes,uint8,uint256,uint256,uint256,address,address,bytes).selector; |
| 17 | + f.selector != sig:execTransactionFromModuleReturnData(address,uint256,bytes,SafeHarness.Operation).selector |
| 18 | + && f.selector != sig:execTransactionFromModule(address,uint256,bytes,SafeHarness.Operation).selector |
| 19 | + && f.selector != sig:execTransaction(address,uint256,bytes,SafeHarness.Operation,uint256,uint256,uint256,address,address,bytes).selector; |
15 | 20 |
|
16 | 21 | definition reachableOnly(method f) returns bool = |
17 | | - f.selector != setup(address[],uint256,address,bytes,address,address,uint256,address).selector |
18 | | - && f.selector != simulateAndRevert(address,bytes).selector; |
| 22 | + f.selector != sig:setup(address[],uint256,address,bytes,address,address,uint256,address).selector |
| 23 | + && f.selector != sig:simulateAndRevert(address,bytes).selector; |
19 | 24 |
|
20 | 25 | /// Nonce must never decrease |
21 | | -rule nonceMonotonicity(method f) { |
| 26 | +rule nonceMonotonicity(method f) filtered { |
| 27 | + f -> noHavoc(f) && reachableOnly(f) |
| 28 | +} { |
22 | 29 | uint256 nonceBefore = nonce(); |
23 | 30 |
|
24 | 31 | calldataarg args; env e; |
25 | 32 | f(e, args); |
26 | 33 |
|
27 | 34 | uint256 nonceAfter = nonce(); |
28 | 35 |
|
29 | | - assert nonceAfter == nonceBefore || nonceAfter == nonceBefore + 1; |
| 36 | + assert nonceAfter == nonceBefore || to_mathint(nonceAfter) == nonceBefore + 1; |
30 | 37 | } |
31 | 38 |
|
32 | 39 |
|
|
0 commit comments