You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Changelog.md
+22-5Lines changed: 22 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,32 +4,49 @@ Breaking changes:
4
4
*`error` is now a keyword that can only be used for defining errors.
5
5
6
6
7
-
### 0.8.7 (unreleased)
7
+
### 0.8.8 (unreleased)
8
8
9
9
Language Features:
10
10
11
11
12
+
Compiler Features:
13
+
14
+
15
+
Bugfixes:
16
+
17
+
18
+
19
+
### 0.8.7 (2021-08-11)
20
+
21
+
Language Features:
22
+
* Introduce global ``block.basefee`` for retrieving the base fee of the current block.
23
+
* Yul: Introduce builtin ``basefee()`` for retrieving the base fee of the current block.
24
+
25
+
12
26
Compiler Features:
13
27
* AssemblyStack: Also run opcode-based optimizer when compiling Yul code.
14
-
* Yul EVM Code Transform: Do not reuse stack slots that immediately become unreachable.
15
-
* Yul EVM Code Transform: Also pop unused argument slots for functions without return variables (under the same restrictions as for functions with return variables).
16
-
* Yul Optimizer: Move function arguments and return variables to memory with the experimental Stack Limit Evader (which is not enabled by default).
17
28
* Commandline Interface: option ``--pretty-json`` works also with ``--standard--json``.
29
+
* EVM: Set the default EVM version to "London".
30
+
* SMTChecker: Do not check underflow and overflow by default.
18
31
* SMTChecker: Unproved targets are hidden by default, and the SMTChecker only states how many unproved targets there are. They can be listed using the command line option ``--model-checker-show-unproved`` or the JSON option ``settings.modelChecker.showUnproved``.
32
+
* SMTChecker: new setting to enable/disable encoding of division and modulo with slack variables. The command line option is ``--model-checker-div-mod-slacks`` and the JSON option is ``settings.modelChecker.divModWithSlacks``.
33
+
* Yul EVM Code Transform: Also pop unused argument slots for functions without return variables (under the same restrictions as for functions with return variables).
34
+
* Yul EVM Code Transform: Do not reuse stack slots that immediately become unreachable.
35
+
* Yul Optimizer: Move function arguments and return variables to memory with the experimental Stack Limit Evader (which is not enabled by default).
19
36
20
37
21
38
Bugfixes:
22
39
* Code Generator: Fix crash when passing an empty string literal to ``bytes.concat()``.
23
40
* Code Generator: Fix internal compiler error when calling functions bound to calldata structs and arrays.
24
41
* Code Generator: Fix internal compiler error when passing a 32-byte hex literal or a zero literal to ``bytes.concat()`` by disallowing such literals.
Copy file name to clipboardExpand all lines: docs/cheatsheet.rst
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -84,6 +84,7 @@ Global Variables
84
84
to ``abi.encodeWithSelector(bytes4(keccak256(bytes(signature)), ...)```
85
85
- ``bytes.concat(...) returns (bytes memory)``: :ref:`Concatenates variable number of
86
86
arguments to one byte array<bytes-concat>`
87
+
- ``block.basefee`` (``uint``): current block's base fee (`EIP-3198 <https://eips.ethereum.org/EIPS/eip-3198>`_ and `EIP-1559 <https://eips.ethereum.org/EIPS/eip-1559>`_)
87
88
- ``block.chainid`` (``uint``): current chain id
88
89
- ``block.coinbase`` (``address payable``): current block miner's address
89
90
- ``block.difficulty`` (``uint``): current block difficulty
Eclipse based IDE. Features context sensitive code completion and help, code navigation, syntax coloring, built in compiler, quick fixes and templates.
Utility tool for smart contract systems, offering a number of visual outputs and information about the contracts' structure. Also supports querying the function call graph.
@@ -129,7 +137,7 @@ Solidity Tools
129
137
A tool for mutation generation, with configurable rules and support for Solidity and Vyper.
130
138
131
139
Third-Party Solidity Parsers and Grammars
132
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
140
+
=========================================
133
141
134
142
* `Solidity Parser for JavaScript <https://github.com/solidity-parser/parser>`_
135
143
A Solidity parser for JS built on top of a robust ANTLR4 grammar.
Copy file name to clipboardExpand all lines: docs/smtchecker.rst
+25-4Lines changed: 25 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,9 @@ The other verification targets that the SMTChecker checks at compile time are:
34
34
- Out of bounds index access.
35
35
- Insufficient funds for a transfer.
36
36
37
+
All the targets above are automatically checked by default if all engines are
38
+
enabled, except underflow and overflow for Solidity >=0.8.7.
39
+
37
40
The potential warnings that the SMTChecker reports are:
38
41
39
42
- ``<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
93
96
}
94
97
95
98
The contract above shows an overflow check example.
96
-
The SMTChecker will, by default, check every reachable arithmetic operation
97
-
in the contract for potential underflow and overflow.
99
+
The SMTChecker does not check underflow and overflow by default for Solidity >=0.8.7,
100
+
so we need to use the command line option ``--model-checker-targets "underflow,overflow"``
101
+
or the JSON option ``settings.modelChecker.targets = ["underflow", "overflow"]``.
102
+
See :ref:`this section for targets configuration<smtchecker_targets>`.
98
103
Here, it reports the following:
99
104
100
105
.. code-block:: text
@@ -447,6 +452,8 @@ If the SMTChecker does not manage to solve the contract properties with the defa
447
452
a timeout can be given in milliseconds via the CLI option ``--model-checker-timeout <time>`` or
448
453
the JSON option ``settings.modelChecker.timeout=<time>``, where 0 means no timeout.
449
454
455
+
.. _smtchecker_targets:
456
+
450
457
Verification Targets
451
458
====================
452
459
@@ -471,6 +478,8 @@ The keywords that represent the targets are:
471
478
A common subset of targets might be, for example:
472
479
``--model-checker-targets assert,overflow``.
473
480
481
+
All targets are checked by default, except underflow and overflow for Solidity >=0.8.7.
482
+
474
483
There is no precise heuristic on how and when to split verification targets,
475
484
but it can be useful especially when dealing with large contracts.
476
485
@@ -479,7 +488,7 @@ Unproved Targets
479
488
480
489
If there are any unproved targets, the SMTChecker issues one warning stating
481
490
how many unproved targets there are. If the user wishes to see all the specific
482
-
unproved targets, the CLI option ``--model-checker-show-unproved true`` and
491
+
unproved targets, the CLI option ``--model-checker-show-unproved`` and
483
492
the JSON option ``settings.modelChecker.showUnproved = true`` can be used.
484
493
485
494
Verified Contracts
@@ -509,7 +518,17 @@ which has the following form:
509
518
"source2.sol": ["contract2", "contract3"]
510
519
}
511
520
512
-
.. _smtchecker_engines:
521
+
Division and Modulo With Slack Variables
522
+
========================================
523
+
524
+
Spacer, the default Horn solver used by the SMTChecker, often dislikes division
525
+
and modulo operations inside Horn rules. Because of that, by default the
526
+
Solidity division and modulo operations are encoded using the constraint
527
+
``a = b * d + m`` where ``d = a / b`` and ``m = a % b``.
528
+
However, other solvers, such as Eldarica, prefer the syntactically precise operations.
529
+
The command line flag ``--model-checker-div-mod-no-slacks`` and the JSON option
530
+
``settings.modelChecker.divModNoSlacks`` can be used to toggle the encoding
531
+
depending on the used solver preferences.
513
532
514
533
Natspec Function Abstraction
515
534
============================
@@ -523,6 +542,8 @@ body of the function is not used, and when called, the function will:
523
542
- Return a nondeterministic value, and either keep the state variables unchanged if the abstracted function is view/pure, or also set the state variables to nondeterministic values otherwise. This can be used via the annotation ``/// @custom:smtchecker abstract-function-nondet``.
524
543
- Act as an uninterpreted function. This means that the semantics of the function (given by the body) are ignored, and the only property this function has is that given the same input it guarantees the same output. This is currently under development and will be available via the annotation ``/// @custom:smtchecker abstract-function-uf``.
Copy file name to clipboardExpand all lines: docs/units-and-global-variables.rst
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,6 +72,7 @@ Block and Transaction Properties
72
72
--------------------------------
73
73
74
74
- ``blockhash(uint blockNumber) returns (bytes32)``: hash of the given block when ``blocknumber`` is one of the 256 most recent blocks; otherwise returns zero
75
+
- ``block.basefee`` (``uint``): current block's base fee (`EIP-3198 <https://eips.ethereum.org/EIPS/eip-3198>`_ and `EIP-1559 <https://eips.ethereum.org/EIPS/eip-1559>`_)
75
76
- ``block.chainid`` (``uint``): current chain id
76
77
- ``block.coinbase`` (``address payable``): current block miner's address
77
78
- ``block.difficulty`` (``uint``): current block difficulty
0 commit comments