Do not create VCs for underoverflow by default for Sol >=0.8

This commit is contained in:
Leo Alt
2021-08-09 14:12:31 +02:00
parent 6ec711b2f0
commit ee6285d6d7
28 changed files with 341 additions and 329 deletions
+11 -2
View File
@@ -34,6 +34,9 @@ The other verification targets that the SMTChecker checks at compile time are:
- Out of bounds index access.
- Insufficient funds for a transfer.
All the targets above are automatically checked by default if all engines are
enabled, except underflow and overflow for Solidity >=0.8.7.
The potential warnings that the SMTChecker reports are:
- ``<failing property> happens here.``. This means that the SMTChecker proved that a certain property fails. A counterexample may be given, however in complex situations it may also not show a counterexample. This result may also be a false positive in certain cases, when the SMT encoding adds abstractions for Solidity code that is either hard or impossible to express.
@@ -93,8 +96,10 @@ Overflow
}
The contract above shows an overflow check example.
The SMTChecker will, by default, check every reachable arithmetic operation
in the contract for potential underflow and overflow.
The SMTChecker does not check underflow and overflow by default for Solidity >=0.8.7,
so we need to use the command line option ``--model-checker-targets "underflow,overflow"``
or the JSON option ``settings.modelChecker.targets = ["underflow", "overflow"]``.
See :ref:`this section for targets configuration<smtchecker_targets>`.
Here, it reports the following:
.. code-block:: text
@@ -447,6 +452,8 @@ If the SMTChecker does not manage to solve the contract properties with the defa
a timeout can be given in milliseconds via the CLI option ``--model-checker-timeout <time>`` or
the JSON option ``settings.modelChecker.timeout=<time>``, where 0 means no timeout.
.. _smtchecker_targets:
Verification Targets
====================
@@ -471,6 +478,8 @@ The keywords that represent the targets are:
A common subset of targets might be, for example:
``--model-checker-targets assert,overflow``.
All targets are checked by default, except underflow and overflow for Solidity >=0.8.7.
There is no precise heuristic on how and when to split verification targets,
but it can be useful especially when dealing with large contracts.
+2 -1
View File
@@ -415,7 +415,8 @@ Input Description
"solvers": ["cvc4", "smtlib2", "z3"],
// Choose which targets should be checked: constantCondition,
// underflow, overflow, divByZero, balance, assert, popEmptyArray, outOfBounds.
// If the option is not given all targets are checked by default.
// If the option is not given all targets are checked by default,
// except underflow/overflow for Solidity >=0.8.7.
// See the Formal Verification section for the targets description.
"targets": ["underflow", "overflow", "assert"],
// Timeout for each SMT query in milliseconds.