Commit Graph

3725 Commits

Author SHA1 Message Date
Djordje Mijovic
9b8634f2a7 [Sol->Yul] Skipping mapping types when deleting structs and arrays. 2020-12-21 13:19:25 +01:00
chriseth
43baceb1ed Test for recursion with modifiers. 2020-12-21 11:39:59 +01:00
Alex Beregszaszi
7e20a095a8
Merge pull request #10652 from ethereum/smt_constants_inplce
[SMTChecker] Replace constants by their value in-place
2020-12-18 14:22:32 +00:00
chriseth
c4ade1753e
Merge pull request #10445 from ethereum/modifiers
[Sol->Yul] Implement function modifiers.
2020-12-18 14:29:00 +01:00
Leonardo Alt
034d1ab90f [SMTChecker] Replace constants by their value in-place 2020-12-18 14:22:28 +01:00
Alex Beregszaszi
b14a6a10cc Report meaningful error if parsing a version pragma failed 2020-12-18 11:50:37 +00:00
Martin Blicha
7078e8f8f8 [SMTChecker] Fix analysis of overriding modifiers 2020-12-17 17:05:54 +01:00
chriseth
1fa371d426 Tests 2020-12-17 17:00:51 +01:00
chriseth
35908c602b Modifiers for constructors. 2020-12-17 17:00:51 +01:00
chriseth
ccaa81fbe7 Implement function modifiers. 2020-12-17 17:00:51 +01:00
Leonardo Alt
50be39fc21 Add and update tests 2020-12-17 14:42:49 +01:00
Leonardo Alt
f5c96ea6da Fix constant evaluation build 2020-12-16 17:59:00 +01:00
chriseth
3a23df6717 Merge remote-tracking branch 'origin/develop' into breaking 2020-12-16 16:56:45 +01:00
chriseth
7338295fee
Merge pull request #10623 from ethereum/smt_const_expr
[SMTChecker] Apply const eval to arithmetic binary expressions
2020-12-16 15:39:16 +01:00
Kamil Śliwak
34e21c929a Fix a test for unicode direction override failing because of Windows line endings 2020-12-16 15:24:41 +01:00
Leonardo Alt
80e85b772b [SMTChecker] Apply const eval to arithmetic binary expressions 2020-12-16 14:58:00 +01:00
chriseth
8f833f4e8f
Merge pull request #10618 from ethereum/develop
Merge develop into breaking.
2020-12-16 12:34:41 +01:00
chriseth
5c40fb060c Report illegal tokens in the Yul parser. 2020-12-16 12:20:07 +01:00
Leonardo Alt
59428b8f76 Fix SMTChecker tests on breaking 2020-12-15 19:49:57 +01:00
Christian Parpart
381c63ec99 Scanner: Generate error on inbalanced RLO/LRO/PDF override markers. 2020-12-15 18:40:51 +01:00
chriseth
53368eff9b
Merge pull request #10604 from ethereum/strict-address-payable
[BREAKING] Strict address payable
2020-12-15 18:25:31 +01:00
chriseth
3c270ca7f7
Merge pull request #10608 from ethereum/develop
Merge develop into breaking.
2020-12-15 15:24:53 +01:00
hrkrshnn
fdaede9b3e Tests after disallowing some explicit payable conversions 2020-12-15 15:01:40 +01:00
chriseth
4e86390e40
Merge pull request #10590 from ethereum/deposit-test
Include the eth2 deposit contract as an external test
2020-12-15 14:57:38 +01:00
chriseth
ffaf40950a
Merge pull request #10605 from ethereum/develop
Merge develop into breaking.
2020-12-15 14:01:01 +01:00
chriseth
2a54079d41
Merge pull request #10575 from ethereum/calldataArraySlices
Conversion of calldata array slices to memory
2020-12-15 12:21:33 +01:00
Martin Blicha
e2c27b8ea4 [SMTChecker] Fix internal error on constructor of a recursive struct 2020-12-15 09:53:52 +01:00
Djordje Mijovic
64f0120622 Change assertions to align to TypeChecker. 2020-12-15 09:21:50 +01:00
Djordje Mijovic
d479c98920 Adding tests for conversion of calldata slices to memory and storage and fixing syntax tests. 2020-12-15 09:21:47 +01:00
Martin Blicha
71f835b71b [SMTChecker] Fixed internal error when increment/decrement is applied on a result of push(). 2020-12-14 22:52:44 +01:00
Alex Beregszaszi
edbdff8619 Update tests 2020-12-14 19:32:31 +00:00
chriseth
271a17d908
Merge pull request #10496 from ethereum/address-payable
[BREAKING] tx.origin, msg.sender and address(literal) are non-payable addresses
2020-12-14 20:16:52 +01:00
chriseth
9c3690c246 Some more tests for overflow. 2020-12-14 19:12:48 +01:00
hrkrshnn
7438c4dc16 Tests after making all explicit address conversions as non-payable 2020-12-14 18:46:01 +01:00
Martin Blicha
103fa3b7eb [SMTChecker] Fix internal error on abstract modifier 2020-12-14 18:23:25 +01:00
Martin Blicha
27402781c4 [SMTChecker] Fixed crash on push to bytes on lhs of an assignment 2020-12-14 17:40:45 +01:00
hrkrshnn
88c99a7538 Tests/Docs: changing type of msg.sender and tx.origin into address
And also making the type of address(literal) as non-payable address.
2020-12-14 16:55:48 +01:00
Martin Blicha
0be325dc0d [SMTChecker] Fix handling of function calls where the function identifier is nested in a tuple. 2020-12-14 16:19:24 +01:00
chriseth
d257ab7141 Merge remote-tracking branch 'origin/develop' into breaking 2020-12-14 16:05:12 +01:00
Alex Beregszaszi
34cab95446 Do not insert SPDX line if it is already present (in semantic tests) 2020-12-14 14:25:58 +00:00
chriseth
0dd2f1edbe Update counter-examples. 2020-12-14 14:21:35 +01:00
Alex Beregszaszi
3a7a0e4256 Add test cases for the deposit contract 2020-12-14 13:11:57 +00:00
Alex Beregszaszi
b97a12c299 Initial import of syntaxTests/externalContracts/deposit_contract.sol
Imported from https://github.com/axic/eth2-deposit-contract/tree/r2
2020-12-14 12:19:07 +00:00
Alex Beregszaszi
aa042ccb87 Disallow leading zeroes in sized-types
Also avoid using boost::lexical_cast for parseSize.
2020-12-14 11:40:14 +00:00
Alex Beregszaszi
4bffd040e2 Add tests for weirdly sized types
e.g. bytes00001
2020-12-14 11:40:11 +00:00
chriseth
28374447d2
Merge pull request #10582 from ethereum/addr-literal
Fix crash with oversized address literals
2020-12-14 12:14:28 +01:00
chriseth
561280a5cc Merge remote-tracking branch 'origin/develop' into breaking 2020-12-14 11:33:40 +01:00
Alex Beregszaszi
33ff2b16ff Fix crash with oversized address literals 2020-12-11 23:45:23 +00:00
Leonardo
db9aa36d6c
Merge pull request #10567 from blishko/unary-operators-fix
[SMTChecker] Fix CHC analysis of increment/decrement
2020-12-11 18:52:12 +01:00
Leonardo
da9cede0fe
Merge pull request #10348 from ethereum/simplify-compiler
Simplify abstraction of Compiler/CompilerContext/CompilerStack
2020-12-11 17:42:36 +01:00
Martin Blicha
8927015e5a [SMTChecker] Adding unary increment and decrement as under/overflow verification targets for the CHC engine 2020-12-11 17:41:50 +01:00
Leonardo
7972d8eb98
Merge pull request #10578 from ethereum/ast-test
Properly print sources in ASTJSONTest
2020-12-11 17:41:31 +01:00
Alex Beregszaszi
4a7f2ddc6d Properly print sources in ASTJSONTest 2020-12-11 15:28:54 +00:00
Alex Beregszaszi
98d8174d31 Simplify Compiler/CompilerContext by removing extra layers of indirection 2020-12-11 14:43:51 +00:00
chriseth
baaf7c0db8 Implement address(...).code in the IR 2020-12-11 03:00:30 +00:00
Alex Beregszaszi
7b347b9ec2 Introduce address(...).code 2020-12-11 03:00:30 +00:00
Alex Beregszaszi
fa37e69c25 Improved error messages when converting to/from builtin functions 2020-12-10 22:38:15 +00:00
Alex Beregszaszi
ff7e45f417 Add test cases for assigning builtins/bound functions to function types 2020-12-10 22:18:52 +00:00
Đorđe Mijović
9e4f3bad06
Merge pull request #10569 from ethereum/byteArrayStorageStorage
Fix copying byte arrays from storage to storage.
2020-12-10 22:52:50 +01:00
Alex Beregszaszi
bd641a5206 Enable more C++ compiler warnings 2020-12-10 21:03:58 +00:00
chriseth
7764ee8d86 Fix copying byte arrays from storage to storage. 2020-12-10 21:47:37 +01:00
Leonardo Alt
64f81fe82b Fix SMT tests 2020-12-10 18:54:52 +01:00
chriseth
ef3bcbda97
Merge pull request #9549 from ethereum/yul-reserved
[BREAKING] Disallow using reserved identifiers in Yul
2020-12-10 18:49:44 +01:00
Alex Beregszaszi
7cd05bf603 Introduce block.chainid 2020-12-10 17:07:54 +00:00
Alex Beregszaszi
c032ad3379 Update tests 2020-12-10 17:18:15 +01:00
chriseth
d0551b67d7 Merge remote-tracking branch 'origin/develop' into breaking 2020-12-10 17:07:56 +01:00
chriseth
e15136c210
Merge pull request #10558 from ethereum/magictype-tests
Adds more tests for state access (block/tx/msg)
2020-12-10 14:05:37 +01:00
chriseth
4861c9b8d1
Merge pull request #10554 from ethereum/emptyBytesPushSol2Yul
[Sol->Yul] Implementing empty byte array push.
2020-12-10 12:19:07 +01:00
chriseth
482bda6887 Merge remote-tracking branch 'origin/develop' into breaking 2020-12-10 12:15:52 +01:00
Mathias Baumann
37cc795034 Fix segfault for empty @return tags in modifiers 2020-12-10 11:54:40 +01:00
Alex Beregszaszi
f9d6abf69b Add more tests for state access (block, msg, tx, etc.)
Move some of them out of SolidityEndToEndTests. Additionally this ensures the deterministic values of the testing infrastructure.
2020-12-09 20:46:01 +00:00
Leonardo Alt
3c142e0e94 Move CHC counterexamples to primary location 2020-12-09 19:55:18 +01:00
Djordje Mijovic
ab74194ca3 [Sol->Yul] Implementing empty byte array push. 2020-12-09 19:31:35 +01:00
chriseth
3f748bbb94
Merge pull request #10336 from ethereum/enablecoderv2bydefault
[BREAKING] Enable ABI coder v2 by default.
2020-12-09 18:05:07 +01:00
chriseth
1c99537b5a
Merge pull request #10550 from ethereum/chainIdView
[BREAKING] Mark chainid as view.
2020-12-09 17:41:27 +01:00
chriseth
870fd24723
Merge pull request #9888 from ethereum/account-hash
Support address().codehash
2020-12-09 17:40:56 +01:00
Daniel Kirchner
588535566f Mark chainid as view. 2020-12-09 16:55:51 +01:00
Alex Beregszaszi
ad6739d0f6 Support address().codehash 2020-12-09 14:58:27 +00:00
chriseth
251f2a4d93 Fix bug in constant evaluator. 2020-12-09 15:50:53 +01:00
chriseth
dff7dcdc27 Update source location tests. 2020-12-09 15:25:15 +01:00
chriseth
3f5925e1c3 Update gas cost tests. 2020-12-09 15:25:15 +01:00
chriseth
72f1e4ea0b Explicitly set coder to v1 for syntax tests. 2020-12-09 15:25:15 +01:00
chriseth
a5bd22795e Force running abi coder v1 instead of v2. 2020-12-09 15:25:15 +01:00
chriseth
b18c76e34b Merge remote-tracking branch 'origin/develop' into breaking 2020-12-09 15:24:49 +01:00
Leonardo Alt
a961a76263 Do not run SMTChecker when file level functions/constants are present. 2020-12-09 12:18:55 +01:00
Martin Blicha
de34fe8aa3 [SMTChecker] Adding test witnessing that SMTChecker no longer crashes when producing CEX with arrays 2020-12-09 09:13:39 +01:00
chriseth
806453aca9 Merge remote-tracking branch 'origin/develop' into breaking 2020-12-08 21:00:09 +01:00
chriseth
49d1f541a1
Merge pull request #10264 from ethereum/warn-conversion
Enable -Wconversion
2020-12-08 20:37:12 +01:00
chriseth
672abc2276
Merge pull request #10530 from ethereum/changeConstructorOrder
[Sol->Yul] Evaluate base arguments in derived to base order.
2020-12-08 20:32:48 +01:00
chriseth
e97ca0a777 Evaluate base arguments in derived to base order. 2020-12-08 20:27:06 +01:00
Alex Beregszaszi
7e88ba8da0 Enable the -Wconversion warning 2020-12-08 16:45:24 +00:00
chriseth
b045195c1e Merge remote-tracking branch 'origin/develop' into breaking 2020-12-08 17:42:31 +01:00
Martin Blicha
12aa654bad added test 2020-12-08 13:05:16 +01:00
Djordje Mijovic
acb93f3a97 Disallowing usage of msg.data in receive() function. 2020-12-08 11:49:20 +01:00
Alex Beregszaszi
66ee3ec533 Remove the \b, \f, \v escape sequences from the Scanner 2020-12-07 21:10:03 +00:00
Martin Blicha
ff0c794674 [SMTChecker] Fixing conversion from StringLiteral to FixedBytes 2020-12-07 19:30:51 +01:00
Leonardo Alt
b7ac207391 [SMTChecker] Support return in CHC 2020-12-07 18:17:33 +01:00
chriseth
a3c5d37d02 Merge remote-tracking branch 'origin/develop' into breaking 2020-12-07 17:13:48 +01:00
Alex Beregszaszi
a8197788d0 Replace the inconsistent use of u160/Address/h160 with h160 only 2020-12-07 16:44:59 +01:00
chriseth
b86c91d1a3 Make super unavailable in libraries. 2020-12-07 13:59:50 +01:00
chriseth
329b8f2a60 Merge remote-tracking branch 'origin/develop' into breaking 2020-12-07 13:04:14 +01:00
Djordje Mijovic
2839a1b0bf [Sol->Yul] Documenting difference in initialization order in case of inheritance.
Co-authored-by: Leonardo <leo@ethereum.org>

Co-authored-by: Daniel Kirchner <daniel@ekpyron.org>
2020-12-04 16:32:56 +01:00
chriseth
4be9b409de Remove unary plus. 2020-12-04 15:14:25 +01:00
chriseth
89919e47d3 New test. 2020-12-04 15:14:25 +01:00
Christian Parpart
c5d172c058 Reimplement constant evaluator. 2020-12-04 15:14:25 +01:00
chriseth
49bde69afa Move computation of constants out of types.cpp 2020-12-04 15:14:25 +01:00
Leonardo Alt
7490ffbe13 Use nonlinear clauses instead of inlining for base constructors 2020-12-04 13:25:56 +01:00
chriseth
75266ea8d4
Merge pull request #10488 from ethereum/fixDocsRevertData
Fix documentation about revert data.
2020-12-03 19:21:44 +01:00
chriseth
61fd76cb27 Fix documentation about revert data. 2020-12-03 18:47:16 +01:00
chriseth
d56a7bb89e
Merge pull request #10489 from ethereum/develop
Merge develop into breaking.
2020-12-03 18:11:12 +01:00
hrkrshnn
9e5d7b9910 Test updates after disallowing Integer -> Contract conversion 2020-12-03 17:53:00 +01:00
Alex Beregszaszi
a9be2e4bb8 update tests 2020-12-03 17:15:45 +01:00
Alex Beregszaszi
6c0a3bd043 Ensure that builtins must be executed 2020-12-03 17:15:44 +01:00
Alex Beregszaszi
43353bb6ca update tests 2020-12-03 17:15:43 +01:00
Alex Beregszaszi
3da2b67b67 simplify parser 2020-12-03 17:14:49 +01:00
hrkrshnn
40244c5469 Tests/Docs after stricter explicit conversion. 2020-12-03 16:51:05 +01:00
Leonardo
088b694f0b
Merge pull request #10207 from ethereum/smt_tests_asserts
[SMTChecker] Add uncovered test and replace uncovered tests by asserts
2020-12-03 08:59:48 +01:00
Martin Blicha
2ee633f404 [SMTChecker] Added support for public getters through this. 2020-12-02 16:06:48 +01:00
chriseth
d50676ecb0
Merge pull request #10451 from ethereum/noTypeSuper
No type super
2020-12-02 15:56:41 +01:00
chriseth
52c49aebe8 Disallow meta type on super. 2020-12-02 15:43:18 +01:00
chriseth
9a5902f9d7 Merge remote-tracking branch 'origin/develop' into breaking 2020-12-02 12:28:02 +01:00
chriseth
c4e97b7624 Update tests. 2020-12-01 16:15:19 +01:00
chriseth
c193ce6c07 Rename SourceReferenceFormatterHuman. 2020-12-01 16:09:46 +01:00
Alex Beregszaszi
1dedba8538 Only use SourceReferenceFormatterHuman 2020-12-01 16:09:46 +01:00
chriseth
edfae1ed05
Merge pull request #10458 from ethereum/fixMergeProblems
Fix tests after merge.
2020-12-01 16:08:51 +01:00
Alex Beregszaszi
d22434ee57 Change ABIEncoderV1 to not pad empty strings 2020-12-01 14:32:18 +00:00
chriseth
da91e590db Fix tests after merge. 2020-12-01 15:30:50 +01:00
chriseth
390640f557
Merge pull request #10384 from ethereum/called_directly_feature
Use annotation.calledDirectly to simplify IR codegen
2020-12-01 15:07:02 +01:00
chriseth
6d1454fce6 Disallow conversion to super. 2020-12-01 14:15:50 +01:00
Mathias Baumann
ea5b63914a Add test to cover (L.f)() case 2020-12-01 12:02:29 +01:00
chriseth
6de7eaba95 Merge remote-tracking branch 'origin/develop' into breaking 2020-12-01 10:50:13 +01:00
chriseth
388fcddd23
Merge pull request #10415 from ethereum/arrayClearingStorageSol2Yul
[Sol->Yul] Fixing copying from storage to storage.
2020-12-01 09:43:47 +01:00
Djordje Mijovic
bd86588459 Adding more tests for array copying from storage to storage. 2020-12-01 08:50:36 +01:00
Djordje Mijovic
28e01202af [Sol->Yul] Fixing coping from storage to storage. 2020-12-01 08:50:33 +01:00
Leonardo Alt
fa561dbd0e Add uncovered test and replace uncovered tests by asserts 2020-11-30 18:46:47 +01:00
Martin Blicha
cd06d68cbe [SMTChecker] Keeping better track of path condition through branches with return statement in the BMC engine. 2020-11-30 11:47:49 +01:00
Alex Beregszaszi
28e65bac46 Add unimplemented assert for modifiers in the IR
Also improved relevant tests for modifiers to be more strict and detect if the modifier body was skipped.
2020-11-27 18:34:17 +00:00
ssi91
e7165f3a9c pass a literal with correct length
mark a test as Yul-based
2020-11-27 04:02:48 +07:00
chriseth
3e5396598b
Merge pull request #10410 from ethereum/ir-fixedbytes-bitnot
Support BitNot on FixedBytes in IR
2020-11-26 14:42:52 +01:00
Alex Beregszaszi
cbae5ca324 Support BitNot on FixedBytes in IR 2020-11-26 13:20:02 +00:00
Djordje Mijovic
565d0cd4eb Support copying of nested calldata arrays to memory. 2020-11-26 12:13:29 +01:00
chriseth
18de8a56c9 Merge remote-tracking branch 'origin/develop' into breaking 2020-11-26 11:48:53 +01:00
Djordje Mijovic
bae32ac402 [Sol->Yul] Implementing member access to arrays in calldata structs. 2020-11-26 11:46:31 +01:00
Đorđe Mijović
5f732cb3ca
Merge pull request #10402 from ethereum/ir-fix-library-call
Properly terminate definitions using define() in IRGenerateForStatements
2020-11-26 10:07:27 +01:00
Alex Beregszaszi
8d9c332593 Properly terminate definitions using define() in IRGenerateForStatements
The lack of termination can result in unparseable output.
2020-11-25 16:41:39 +00:00
Đorđe Mijović
7eb5fc31f8
Merge pull request #10394 from ethereum/viayul-tests
Switch compileViaYul to also where appropriate
2020-11-25 16:46:30 +01:00
Alex Beregszaszi
159f50e189 Turn on semantic tests for the old codegen where possible
These were marked IR-only, but they do pass on the old codegen too.

Also add old codegen version of semantictests/revertStrings/function_entry_checks.
2020-11-25 14:33:39 +00:00
Djordje Mijovic
5077deb285 Fixing pragmas to abicoder v2. 2020-11-25 15:13:57 +01:00
Alex Beregszaszi
c4fd7e4003 Remove/update tests 2020-11-25 11:40:33 +00:00
Alex Beregszaszi
3bce2a2294 Remove the legacy AST JSON output 2020-11-25 11:40:33 +00:00