|
47 | 47 | "types/array_dynamic_3_fail.sol"
|
48 | 48 | ];
|
49 | 49 |
|
| 50 | + z3Timeout = [ |
| 51 | + "operators/compound_assignment_division_1.sol" |
| 52 | + "operators/compound_assignment_division_2.sol" |
| 53 | + "operators/delete_array_index_2d.sol" |
| 54 | + ]; |
| 55 | + |
| 56 | + dynamic = [ |
| 57 | + # OpCalldatacopy |
| 58 | + "loops/for_loop_array_assignment_memory_memory.sol" |
| 59 | + "loops/for_loop_array_assignment_memory_storage.sol" |
| 60 | + "loops/while_loop_array_assignment_memory_memory.sol" |
| 61 | + "loops/while_loop_array_assignment_memory_storage.sol" |
| 62 | + "types/address_call.sol" |
| 63 | + "types/address_delegatecall.sol" |
| 64 | + "types/address_staticcall.sol" |
| 65 | + "types/array_aliasing_storage_2.sol" |
| 66 | + "types/array_aliasing_storage_3.sol" |
| 67 | + "types/array_aliasing_storage_5.sol" |
| 68 | + "types/array_branch_1d.sol" |
| 69 | + "types/array_branches_1d.sol" |
| 70 | + "types/array_dynamic_parameter_1.sol" |
| 71 | + "types/array_dynamic_parameter_1_fail.sol" |
| 72 | + "types/bytes_1.sol" |
| 73 | + "types/bytes_2.sol" |
| 74 | + "types/bytes_2_fail.sol" |
| 75 | + "types/mapping_unsupported_key_type_1.sol" |
| 76 | + "types/function_type_array_as_reference_type.sol" |
| 77 | + ]; |
| 78 | + |
50 | 79 | ignored = [
|
51 | 80 |
|
52 | 81 | # --- constructor arguments ---
|
@@ -115,26 +144,26 @@ let
|
115 | 144 | # OpJump
|
116 | 145 | "complex/slither/external_function.sol"
|
117 | 146 |
|
118 |
| - # OpCalldatacopy |
119 |
| - "loops/for_loop_array_assignment_memory_memory.sol" |
120 |
| - "loops/for_loop_array_assignment_memory_storage.sol" |
121 |
| - "loops/while_loop_array_assignment_memory_memory.sol" |
122 |
| - "loops/while_loop_array_assignment_memory_storage.sol" |
123 |
| - "types/address_call.sol" |
124 |
| - "types/address_delegatecall.sol" |
125 |
| - "types/address_staticcall.sol" |
126 |
| - "types/array_aliasing_storage_2.sol" |
127 |
| - "types/array_aliasing_storage_3.sol" |
128 |
| - "types/array_aliasing_storage_5.sol" |
129 |
| - "types/array_branch_1d.sol" |
130 |
| - "types/array_branches_1d.sol" |
131 |
| - "types/array_dynamic_parameter_1.sol" |
132 |
| - "types/array_dynamic_parameter_1_fail.sol" |
133 |
| - "types/bytes_1.sol" |
134 |
| - "types/bytes_2.sol" |
135 |
| - "types/bytes_2_fail.sol" |
136 |
| - "types/mapping_unsupported_key_type_1.sol" |
137 |
| - "types/function_type_array_as_reference_type.sol" |
| 147 | + # # OpCalldatacopy |
| 148 | + # "loops/for_loop_array_assignment_memory_memory.sol" |
| 149 | + # "loops/for_loop_array_assignment_memory_storage.sol" |
| 150 | + # "loops/while_loop_array_assignment_memory_memory.sol" |
| 151 | + # "loops/while_loop_array_assignment_memory_storage.sol" |
| 152 | + # "types/address_call.sol" |
| 153 | + # "types/address_delegatecall.sol" |
| 154 | + # "types/address_staticcall.sol" |
| 155 | + # "types/array_aliasing_storage_2.sol" |
| 156 | + # "types/array_aliasing_storage_3.sol" |
| 157 | + # "types/array_aliasing_storage_5.sol" |
| 158 | + # "types/array_branch_1d.sol" |
| 159 | + # "types/array_branches_1d.sol" |
| 160 | + # "types/array_dynamic_parameter_1.sol" |
| 161 | + # "types/array_dynamic_parameter_1_fail.sol" |
| 162 | + # "types/bytes_1.sol" |
| 163 | + # "types/bytes_2.sol" |
| 164 | + # "types/bytes_2_fail.sol" |
| 165 | + # "types/mapping_unsupported_key_type_1.sol" |
| 166 | + # "types/function_type_array_as_reference_type.sol" |
138 | 167 |
|
139 | 168 | # OpBlockhash
|
140 | 169 | "special/blockhash.sol"
|
|
223 | 252 | # symbolic` on all contracts within.
|
224 | 253 | # $1 == input file
|
225 | 254 | # $2 == hevm smt backend
|
| 255 | + # $3 == dynamic? |
226 | 256 | checkWithHevm = pkgs.writeShellScript "checkWithHevm" ''
|
227 |
| -
|
228 | 257 | # write json file to store for later debugging
|
229 | 258 | testName=$(${testName} $1)
|
230 | 259 | json=$out/jsonFiles/$testName.json
|
|
236 | 265 |
|
237 | 266 | explore() {
|
238 | 267 | set -x
|
239 |
| - hevm_output=$(${timeout} 90s ${hevm} symbolic --code "$1" --solver "$2" --json-file "$3" $4 2>&1) |
| 268 | + hevm_output=$(${timeout} 90s ${hevm} symbolic --code "$1" --solver "$2" --json-file "$3" $4 $5 2>&1) |
240 | 269 | status=$?
|
241 | 270 | set +x
|
242 | 271 |
|
@@ -273,10 +302,15 @@ let
|
273 | 302 | iterations="--max-iterations 3"
|
274 | 303 | fi
|
275 | 304 |
|
| 305 | + dynamic="" |
| 306 | + if ! [[ -z "$3" ]]; then |
| 307 | + dynamic="--calldata-model DynamicCD" |
| 308 | + fi |
| 309 | +
|
276 | 310 | ${echo}
|
277 | 311 | ${echo} exploring runtime bytecode:
|
278 | 312 | bin_runtime=$(${jq} -r --arg c $contract -c '.contracts[$c]."bin-runtime"' $json)
|
279 |
| - explore "$bin_runtime" "$2" "$json" "$iterations" |
| 313 | + explore "$bin_runtime" "$2" "$json" "$iterations" "$dynamic" |
280 | 314 | done
|
281 | 315 |
|
282 | 316 | exit 0
|
@@ -305,14 +339,35 @@ let
|
305 | 339 | exit 0
|
306 | 340 | fi
|
307 | 341 |
|
| 342 | + z3Timeouts=(${toString z3Timeout}) |
| 343 | + if [[ " ''${z3Timeouts[@]} " =~ " ''${testName} " ]] && [[ $2 = "z3" ]]; then |
| 344 | + ${echo} "skipping test:" ${testName} |
| 345 | + ${echo} "${strings.ignore}" |
| 346 | + exit 0 |
| 347 | + fi |
| 348 | +
|
| 349 | + dynamicFlag="" |
| 350 | + dynamicTests=(${toString dynamic}) |
| 351 | + if [[ " ''${dynamicTests[@]} " =~ " ''${testName} " ]]; then |
| 352 | + # echo $2 |
| 353 | + if [[ $2 = "z3" ]]; then |
| 354 | + dynamicFlag=1 |
| 355 | + else |
| 356 | + ${echo} "skipping test:" ${testName} |
| 357 | + ${echo} "${strings.ignore}" |
| 358 | +
|
| 359 | + exit 0 |
| 360 | + fi |
| 361 | + fi |
| 362 | +
|
308 | 363 | ${grep} -q 'Error trying to invoke SMT solver.' $1
|
309 | 364 | if [ $? == 0 ]; then ${echo} ${strings.smtCheckerFailed} && exit; fi
|
310 | 365 | ${grep} -q 'Assertion checker does not yet implement' $1
|
311 | 366 | if [ $? == 0 ]; then ${echo} ${strings.smtCheckerFailed} && exit; fi
|
312 | 367 | ${grep} -q 'Assertion checker does not yet support' $1
|
313 | 368 | if [ $? == 0 ]; then ${echo} ${strings.smtCheckerFailed} && exit; fi
|
314 | 369 |
|
315 |
| - hevm_output=$(${checkWithHevm} $1 $2 2>&1) |
| 370 | + hevm_output=$(${checkWithHevm} $1 $2 "$dynamicFlag" 2>&1) |
316 | 371 | echo "$hevm_output"
|
317 | 372 |
|
318 | 373 | ${grep} -q '${strings.timeout}' <<< "$hevm_output"
|
|
0 commit comments