Commit Graph

5242 Commits

Author SHA1 Message Date
Saw-mon & Natalie
c6e73707c7 fixed codestyle. 2023-07-05 12:34:39 +02:00
Saw-mon & Natalie
84918fb01e added syntaxt tests and updated the TypeChecker logic. 2023-07-05 12:34:39 +02:00
Saw-mon & Natalie
7de314bd0d fixed typo 2023-07-05 12:34:39 +02:00
Saw-mon & Natalie
89424875de fix coding style 2023-07-05 12:34:39 +02:00
Saw-mon & Natalie
145dfcf6da fixed EIP-712 encoding type. 2023-07-05 12:34:39 +02:00
Anton Bukov
78981fac52 Update libsolidity/codegen/ir/IRGeneratorForStatements.cpp
Co-authored-by: Saw-mon & Natalie <3140080+Saw-mon-and-Natalie@users.noreply.github.com>
2023-07-05 12:34:39 +02:00
Anton Bukov
a8dc240d42 Update libsolidity/codegen/ir/IRGeneratorForStatements.cpp
Co-authored-by: Saw-mon & Natalie <3140080+Saw-mon-and-Natalie@users.noreply.github.com>
2023-07-05 12:34:39 +02:00
Anton Bukov
7ffbfe6781 Fix assert 2023-07-05 12:34:39 +02:00
Anton Bukov
1d40bb4940 Disallow to use typehash() for structs with nested mappings 2023-07-05 12:34:39 +02:00
Anton Bukov
c4e8d3754d Fix compilation error 2023-07-05 12:34:39 +02:00
Anton Bukov
63210e5a68 Update libsolidity/codegen/ir/IRGeneratorForStatements.cpp
Co-authored-by: Hari <webmail.hari@gmail.com>
2023-07-05 12:34:38 +02:00
Anton Bukov
3efe100179 Update libsolidity/codegen/ir/IRGeneratorForStatements.cpp
Co-authored-by: Hari <webmail.hari@gmail.com>
2023-07-05 12:34:38 +02:00
Anton Bukov
f9b9905c95 Update libsolidity/codegen/ExpressionCompiler.cpp
Co-authored-by: Hari <webmail.hari@gmail.com>
2023-07-05 12:34:38 +02:00
Anton Bukov
422676aef2 Update libsolidity/ast/Types.cpp
Co-authored-by: Hari <webmail.hari@gmail.com>
2023-07-05 12:34:38 +02:00
Anton Bukov
e7bb0b38e1 Rename methods encode* to eip712Encode* 2023-07-05 12:34:38 +02:00
Anton Bukov
8c1a9af76a Fix false positive test for type(S).typehash and update error messages 2023-07-05 12:34:38 +02:00
Anton Bukov
e8a311268d Extend type(X) validation to support structs 2023-07-05 12:34:38 +02:00
Anton Bukov
66c54ef128 Fix wrong failure 2023-07-05 12:34:38 +02:00
Anton Bukov
09e85879d7 Some fixes 2023-07-05 12:34:38 +02:00
Anton Bukov
b267b0e8cd Add missing includes 2023-07-05 12:34:38 +02:00
Anton Bukov
9b4da6bdea Improve typehash() computation for nested structs 2023-07-05 12:34:38 +02:00
Anton Bukov
f9a48b94d4 Handle nested structs encoding for EIP-712 2023-07-05 12:34:38 +02:00
Anton Bukov
54b46ce39e Add native support of EIP-712 struct typehash 2023-07-05 12:34:38 +02:00
Martin Blicha
3599c8c6b9 SMTChecker: Fix generation of smtlib scripts
When both CHC and BMC engines are used, the type of state variable
changes when trusted mode for external calls is used. This is because in
CHC engine, trusted mode means we pack more information into the
symbolic state. In BMC this type is always simple.

However, if BMC is run after CHC, in the current code state variables
are reset (and their declaration dumped into SMT-LIB script) before BMC
resets the type of the state variable.

The proposed solution is to simply reset the variable type before the
first variable of this type is created.
2023-06-30 15:57:51 +02:00
Pawel Gebal
826fd90dcf Fix error in SMTChecker: Use rich indentifier instead of external identifier to ecnode member access to functions 2023-06-23 15:24:55 +02:00
Kamil Śliwak
3ecf968001
Merge pull request #14328 from ethereum/fix-incomplete-ast-in-standard-json-on-analysis-fail
Fix incomplete AST in standard json on analysis fail
2023-06-19 18:26:33 +02:00
Pawel Gebal
d4be1d9c2f Add --print-smt flag to output SMTChecker SMTLIB code 2023-06-16 14:04:07 +02:00
Kamil Śliwak
712229a5c6 Fix StandardCompiler returning an incomplete AST in Standard JSON in case of an early exit during analysis 2023-06-15 10:50:04 +02:00
Kamil Śliwak
b1a773be2f IRGenerator: Leave IR optimization up to the caller to avoid unnecessarily doing it twice 2023-06-07 19:44:40 +02:00
Kamil Śliwak
25be38905f YulStack: When Yul optimization is not requested, run Yul optimizer with a minimal sequence instead of disabling it 2023-06-07 12:13:38 +02:00
Nikola Matic
47969adf91 Experimental standard library
Change import syntax and cover with tests
2023-06-06 17:16:23 +02:00
Pawel Gebal
f15b826431 Add optional bounds to unroll loops in BMC model checker 2023-06-02 18:32:38 +02:00
Leo
a0933fa80a
Merge pull request #14276 from ethereum/smtchecker-fix-ice
SMTChecker: External function call with struct member is not getter
2023-05-30 13:46:35 +02:00
Leo
ceab4dfee5
Merge pull request #14269 from blishko/smtchecker-fix-analysis-external-calls
[SMTChecker] Remember verification targets from trusted external calls
2023-05-30 13:45:37 +02:00
Martin Blicha
8ca453f82e SMTChecker: External function call with struct member is not getter
if a struct has a member that is a function pointer with `external`
attribute, and such a member is called, it is currently incorrectly
treated as a public getter in SMTEncoder.

The proposed fix is to make SMTEncoder::publicGetter more strict in
deciding whether an expression is a public getter.
The added condition, that the access happens on a state variable, is
exactly what is checked later with an assertion that is currently
failing.
2023-05-26 14:23:45 +02:00
Nikola Matić
477b621f2e
Merge pull request #14274 from ethereum/enable-access-to-foreign-events 2023-05-26 13:49:13 +02:00
Martin Blicha
b0419da654 [SMTChecker] Remember verification targets from trusted external calls
Previously, we did not remember trusted external calls for later phase
when we compute possible verification targets for each function.
This led to false negative in cases where verification target can be
violated, but not by calling a public function directly, but only when
it is called as an external function from other function.

The added test cases witnesses this behaviour. The underflow in
`dec` cannot happen in any other way except what the `dec` is called
from `f`.

The same problem did not occur when the functions are called internally,
because for such cases, we have already been remembering these calls in
the callgraph in the CHC engine.
2023-05-26 13:03:44 +02:00
Nikola Matic
5893e099fe Allow qualified access to events from other contracts 2023-05-26 12:52:52 +02:00
GiokaMarkella
28a1abf89a Yul AST output on the CLI and in Standard JSON 2023-05-26 12:35:31 +02:00
Nikola Matic
7a34d34045 Restrict experimental solidity to constantinople and above 2023-05-17 17:03:43 +02:00
Nikola Matic
8a41f4ac7e Introduce solidity-next pragma
Exclude pragma experimental error from ANTLR tests

Test for first pragma after non-pragma declaration

Resolve import pragmas

Change pragma name from next to solidity

Add Changelog entries

Address review comments
2023-05-15 19:25:13 +02:00
Daniel
9804085934
Merge pull request #14216 from ethereum/fix_bmc_side_effects_in_statement
Fix encoding of side-effects inside if and ternary in BMC
2023-05-15 13:34:22 +02:00
Alexander Arlt
c5673278a7 Remove EWASM backend. 2023-05-11 10:56:55 -05:00
Leo Alt
678461e828 Fix encoding of side-effects inside if and conditional statements in the BMC engine 2023-05-11 16:44:09 +02:00
Daniel
44a30e47ca
Merge pull request #14171 from ethereum/ast-import-via-standard-json
Add support to import AST via Standard JSON.
2023-05-09 22:22:31 +02:00
Alexander Arlt
4837d42361 Add experimental support to import AST via Standard JSON. 2023-05-09 14:07:38 -05:00
Nikola Matic
3bab14747e Fix hidden-overload in Types and remove CMake hack 2023-05-09 19:33:23 +02:00
Nikola Matic
9a87b587d5 Disallow immutable initialization in try catch statements
Trigger github
2023-05-09 14:48:14 +02:00
Rodrigo Q. Saramago
a29f77369a
Move AST annotation of internal function dispatch IDs to ContractDefinition
Co-authored-by: Daniel <daniel@ekpyron.org>
Co-authored-by: Nikola Matić <nikola.matic@ethereum.org>
2023-05-06 20:31:27 +02:00
chriseth
1e63615206 Export all events.
Update tests.

Additional tests

Revert changes to the Natspec
2023-05-03 14:08:27 -03:00