Skip to content

Commit 0040758

Browse files
18.02.26 Release
18.02.26 Release fc7d2c6ac530bbee5bde329a9d3d8d44ecc0a2af
2 parents b03323e + daf6742 commit 0040758

File tree

83 files changed

+3534
-1451
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+3534
-1451
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
contract C {
2+
uint256 fooCalled = 0;
3+
uint256 barCalled = 0;
4+
function foo(address x, address z) public returns (uint) {
5+
if(x == address(0)){
6+
return 0;
7+
}
8+
address(x).call(abi.encodeWithSignature("bar(address,address)"));
9+
fooCalled = fooCalled + 1;
10+
return 1;
11+
}
12+
13+
function bar(address y, address z) public returns (uint) {
14+
if(y == address(0)){
15+
return 0;
16+
}
17+
address(y).call(abi.encodeWithSignature("foo(address,address)"));
18+
barCalled = barCalled + 1;
19+
return 1;
20+
}
21+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
methods {
2+
function currentContract._ external => HAVOC_ALL;
3+
function _.bar(address, address) external => DISPATCHER(true);
4+
}
5+
6+
rule recurse(method f) {
7+
address x;
8+
address y;
9+
env e;
10+
require currentContract.fooCalled == 0 && currentContract.barCalled == 0, "Some initial values";
11+
foo(e, x, y);
12+
satisfy currentContract.fooCalled == 999 && currentContract.barCalled == 42, "there should be a HAVOC_ALL that will allow these values";
13+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"files": [
3+
"C.sol",
4+
],
5+
"verify": "C:C.spec",
6+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"rules": {
3+
"recurse": "SUCCESS"
4+
}
5+
}

lib/GeneralUtils/src/main/kotlin/utils/ExtStdlib.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,6 +1312,8 @@ fun ClosedRange<BigInteger>.stepBy(step: BigInteger) = sequence<BigInteger> {
13121312
}
13131313
}
13141314

1315+
fun UInt.checkedMinus(other: UInt): UInt? = if (this >= other) { this - other } else { null }
1316+
13151317
/**
13161318
Runs the given [block] returns its result wrapped in a [Result]. Any exceptions other than [CancellationException]
13171319
are caught and returned as a failure result. If a [CancellationException] is thrown, it is rethrown, allowing this

lib/Shared/src/main/kotlin/config/Config.kt

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,21 @@ object Config {
969969
val MoveModulePath =
970970
object : ConfigType.StringCmdLine(
971971
null,
972-
Option("movePath", true, "Directory to search for Move modules")
972+
Option(
973+
"movePath",
974+
true,
975+
"Directory to search for Move modules. Ordinarily derived from the spec package path."
976+
)
977+
) {}
978+
979+
val SuiPackageSummaryPath =
980+
object : ConfigType.StringCmdLine(
981+
null,
982+
Option(
983+
"suiPackageSummaryPath",
984+
true,
985+
"Directory with Sui package summary info. Ordinarily derived from the spec package path."
986+
)
973987
) {}
974988

975989
val MovePublicSanityCheck = object : ConfigType.BooleanCmdLine(

lib/Shared/src/main/kotlin/config/DestructiveOptimizationsModeEnum.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package config
1919

2020
import cli.ConversionException
2121
import cli.Converter
22+
import datastructures.stdcollections.*
2223

2324
enum class DestructiveOptimizationsModeEnum {
2425
/** Disable destructive optimizations */
@@ -42,3 +43,12 @@ val DestructiveOptimizationsModeConverter = Converter {
4243
else -> throw ConversionException(it, DestructiveOptimizationsModeEnum::class.java)
4344
}
4445
}
46+
47+
fun DestructiveOptimizationsModeEnum.isTwoStageMode(): Boolean {
48+
return when(this) {
49+
DestructiveOptimizationsModeEnum.TWOSTAGE,
50+
DestructiveOptimizationsModeEnum.TWOSTAGE_CHECKED -> true
51+
DestructiveOptimizationsModeEnum.DISABLE,
52+
DestructiveOptimizationsModeEnum.ENABLE -> false
53+
}
54+
}

lib/Shared/src/main/kotlin/config/ReportTypes.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@ enum class ReportTypes(val loggerCategory: LoggerTypes) : DumpType, CategoryName
190190
REMOVE_UNUSED_WRITES(LoggerTypes.OPTIMIZE),
191191
REMOVE_UNUSED_PARTITIONS(LoggerTypes.OPTIMIZE),
192192
REWRITE_COPY_LOOP(LoggerTypes.OPTIMIZE),
193-
REMOVE_CALL_ANNOTATIONS(LoggerTypes.OPTIMIZE),
194193
PATH_OPTIMIZE0(LoggerTypes.OPTIMIZE),
195194
MATERIALIZE_DISJOINT_HASHES(LoggerTypes.INSTRUMENTATION),
196195
ASSUME_STRICT_MONOTONIC_FP(LoggerTypes.INSTRUMENTATION),
@@ -239,7 +238,7 @@ enum class ReportTypes(val loggerCategory: LoggerTypes) : DumpType, CategoryName
239238
AXIOM_INLINING(LoggerTypes.INSTRUMENTATION),
240239
CANONICALIZE_SCALARSET(LoggerTypes.OPTIMIZE),
241240
GHOST_SUM_INSTRUMENTER(LoggerTypes.INSTRUMENTATION),
242-
SNIPPET_REMOVAL(LoggerTypes.PRUNING),
241+
ANNOTATION_REMOVAL(LoggerTypes.PRUNING),
243242
ENVFREE(LoggerTypes.SPEC),
244243
CANONICALIZATION(LoggerTypes.SPEC),
245244
STORAGE_REWRITER(LoggerTypes.INLINER),

0 commit comments

Comments
 (0)