Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions test/cmdlineTests/model_checker_targets_all_chc/err
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
Warning: 'transfer' is deprecated and scheduled for removal. Use 'call{value: <amount>}("")' instead.
--> input.sol:10:3:
|
10 | a.transfer(x);
| ^^^^^^^^^^

Warning: CHC: Underflow (resulting value less than 0) happens here.
Counterexample:
arr = []
a = 0x0
x = 0
success = false

Transaction trace:
test.constructor()
Expand All @@ -24,6 +19,7 @@ Counterexample:
arr = []
a = 0x0
x = 1
success = false

Transaction trace:
test.constructor()
Expand All @@ -39,6 +35,7 @@ Counterexample:
arr = []
a = 0x0
x = 0
success = false

Transaction trace:
test.constructor()
Expand All @@ -54,44 +51,48 @@ Counterexample:
arr = []
a = 0x0
x = 0
success = true

Transaction trace:
test.constructor()
State: arr = []
test.f(0x0, 1)
--> input.sol:11:3:
a.call{value: x}("") -- untrusted external call
--> input.sol:12:3:
|
11 | assert(x > 0);
12 | assert(x > 0);
| ^^^^^^^^^^^^^

Warning: CHC: Empty array "pop" happens here.
Counterexample:
arr = []
a = 0x0
x = 0
success = true

Transaction trace:
test.constructor()
State: arr = []
test.f(0x0, 1)
--> input.sol:12:3:
a.call{value: x}("") -- untrusted external call
--> input.sol:13:3:
|
12 | arr.pop();
13 | arr.pop();
| ^^^^^^^^^

Warning: CHC: Out of bounds access happens here.
Counterexample:
arr = []
a = 0x0
x = 0
success = true

Transaction trace:
test.constructor()
State: arr = []
test.f(0x0, 1)
--> input.sol:13:3:
a.call{value: x}("") -- untrusted external call
--> input.sol:14:3:
|
13 | arr[x];
14 | arr[x];
| ^^^^^^

Info: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them.
5 changes: 3 additions & 2 deletions test/cmdlineTests/model_checker_targets_all_chc/input.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ contract test {
--x;
x + type(uint).max;
2 / x;
a.transfer(x);
(bool success, ) = a.call{value: x}("");
require(success);
assert(x > 0);
arr.pop();
arr[x];
}
}
}
12 changes: 4 additions & 8 deletions test/cmdlineTests/model_checker_targets_assert_chc/err
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
Warning: 'transfer' is deprecated and scheduled for removal. Use 'call{value: <amount>}("")' instead.
--> input.sol:10:3:
|
10 | a.transfer(x);
| ^^^^^^^^^^

Warning: CHC: Assertion violation happens here.
Counterexample:
arr = []
a = 0x0
x = 0
success = true

Transaction trace:
test.constructor()
State: arr = []
test.f(0x0, 1)
--> input.sol:11:3:
a.call{value: x}("") -- untrusted external call
--> input.sol:12:3:
|
11 | assert(x > 0);
12 | assert(x > 0);
| ^^^^^^^^^^^^^
5 changes: 3 additions & 2 deletions test/cmdlineTests/model_checker_targets_assert_chc/input.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ contract test {
--x;
x + type(uint).max;
2 / x;
a.transfer(x);
(bool success, ) = a.call{value: x}("");
require(success);
assert(x > 0);
arr.pop();
arr[x];
}
}
}
7 changes: 0 additions & 7 deletions test/cmdlineTests/model_checker_targets_balance_chc/err
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, but we're not dropping CHC, so this one needs an actual fix.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ contract test {
--x;
x + type(uint).max;
2 / x;
a.transfer(x);
(bool success, ) = a.call{value: x}("");
require(success);
assert(x > 0);
arr.pop();
arr[x];
Expand Down
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like SMTChecker fails to detect the constant condition here (though it was like this already before this PR).

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ contract test {
--x;
x + type(uint).max;
2 / x;
a.transfer(x);
(bool success, ) = a.call{value: x}("");
require(success);
assert(x > 0);
arr.pop();
arr[x];
Expand Down
27 changes: 13 additions & 14 deletions test/cmdlineTests/model_checker_targets_default_all_engines/err
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
Warning: 'transfer' is deprecated and scheduled for removal. Use 'call{value: <amount>}("")' instead.
--> input.sol:10:3:
|
10 | a.transfer(x);
| ^^^^^^^^^^

Warning: CHC: Division by zero happens here.
Counterexample:
arr = []
a = 0x0
x = 0
success = false

Transaction trace:
test.constructor()
Expand All @@ -24,48 +19,52 @@ Counterexample:
arr = []
a = 0x0
x = 0
success = true

Transaction trace:
test.constructor()
State: arr = []
test.f(0x0, 1)
--> input.sol:11:3:
a.call{value: x}("") -- untrusted external call
--> input.sol:12:3:
|
11 | assert(x > 0);
12 | assert(x > 0);
| ^^^^^^^^^^^^^

Warning: CHC: Empty array "pop" happens here.
Counterexample:
arr = []
a = 0x0
x = 0
success = true

Transaction trace:
test.constructor()
State: arr = []
test.f(0x0, 1)
--> input.sol:12:3:
a.call{value: x}("") -- untrusted external call
--> input.sol:13:3:
|
12 | arr.pop();
13 | arr.pop();
| ^^^^^^^^^

Warning: CHC: Out of bounds access happens here.
Counterexample:
arr = []
a = 0x0
x = 0
success = true

Transaction trace:
test.constructor()
State: arr = []
test.f(0x0, 1)
--> input.sol:13:3:
a.call{value: x}("") -- untrusted external call
--> input.sol:14:3:
|
13 | arr[x];
14 | arr[x];
| ^^^^^^

Info: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them.

Warning: BMC: Condition is always true.
--> input.sol:6:11:
|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ contract test {
--x;
x + type(uint).max;
2 / x;
a.transfer(x);
(bool success, ) = a.call{value: x}("");
require(success);
assert(x > 0);
arr.pop();
arr[x];
}
}
}
27 changes: 13 additions & 14 deletions test/cmdlineTests/model_checker_targets_default_chc/err
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
Warning: 'transfer' is deprecated and scheduled for removal. Use 'call{value: <amount>}("")' instead.
--> input.sol:10:3:
|
10 | a.transfer(x);
| ^^^^^^^^^^

Warning: CHC: Division by zero happens here.
Counterexample:
arr = []
a = 0x0
x = 0
success = false

Transaction trace:
test.constructor()
Expand All @@ -24,44 +19,48 @@ Counterexample:
arr = []
a = 0x0
x = 0
success = true

Transaction trace:
test.constructor()
State: arr = []
test.f(0x0, 1)
--> input.sol:11:3:
a.call{value: x}("") -- untrusted external call
--> input.sol:12:3:
|
11 | assert(x > 0);
12 | assert(x > 0);
| ^^^^^^^^^^^^^

Warning: CHC: Empty array "pop" happens here.
Counterexample:
arr = []
a = 0x0
x = 0
success = true

Transaction trace:
test.constructor()
State: arr = []
test.f(0x0, 1)
--> input.sol:12:3:
a.call{value: x}("") -- untrusted external call
--> input.sol:13:3:
|
12 | arr.pop();
13 | arr.pop();
| ^^^^^^^^^

Warning: CHC: Out of bounds access happens here.
Counterexample:
arr = []
a = 0x0
x = 0
success = true

Transaction trace:
test.constructor()
State: arr = []
test.f(0x0, 1)
--> input.sol:13:3:
a.call{value: x}("") -- untrusted external call
--> input.sol:14:3:
|
13 | arr[x];
14 | arr[x];
| ^^^^^^

Info: CHC: 1 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them.
5 changes: 3 additions & 2 deletions test/cmdlineTests/model_checker_targets_default_chc/input.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ contract test {
--x;
x + type(uint).max;
2 / x;
a.transfer(x);
(bool success, ) = a.call{value: x}("");
require(success);
assert(x > 0);
arr.pop();
arr[x];
}
}
}
7 changes: 1 addition & 6 deletions test/cmdlineTests/model_checker_targets_div_by_zero_chc/err
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
Warning: 'transfer' is deprecated and scheduled for removal. Use 'call{value: <amount>}("")' instead.
--> input.sol:10:3:
|
10 | a.transfer(x);
| ^^^^^^^^^^

Warning: CHC: Division by zero happens here.
Counterexample:
arr = []
a = 0x0
x = 0
success = false

Transaction trace:
test.constructor()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ contract test {
--x;
x + type(uint).max;
2 / x;
a.transfer(x);
(bool success, ) = a.call{value: x}("");
require(success);
assert(x > 0);
arr.pop();
arr[x];
}
}
}
5 changes: 3 additions & 2 deletions test/cmdlineTests/model_checker_targets_error/input.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ contract test {
--x;
x + type(uint).max;
2 / x;
a.transfer(x);
(bool success, ) = a.call{value: x}("");
require(success);
assert(x > 0);
arr.pop();
arr[x];
}
}
}
Loading