Commit Graph

1112 Commits

Author SHA1 Message Date
Kamil Śliwak
dfa0a0cdff IR codegen: Handle address() with library type argument and external library calls 2020-11-17 20:36:39 +01:00
chriseth
691f7e6eae Fix merge conflicts. 2020-11-17 19:59:23 +01:00
chriseth
e8a278eefa Merge remote-tracking branch 'origin/develop' into breaking 2020-11-17 18:51:57 +01:00
chriseth
e64fd99fb5 Fix qualified modifier lookup. 2020-11-17 18:33:45 +01:00
chriseth
74ce8d6979 Fix assignment to non-lvalue storage values. 2020-11-17 15:56:34 +01:00
chriseth
fffd0306f5 Fix bug in array to storage copy routine. 2020-11-17 14:56:44 +01:00
chriseth
98cc7a1ea9 Copying structs from storage to storage. 2020-11-17 11:06:25 +01:00
chriseth
d9fb17a85e Copy value array from storage to storage. 2020-11-17 10:51:34 +01:00
chriseth
62893aa1a1 Copy byte arrays from storage to storage. 2020-11-16 19:06:33 +01:00
Kamil Śliwak
ade71d58f8 Assume that enums always take 1-byte in the codegen and type system 2020-11-16 18:58:19 +01:00
chriseth
d744a8fb48 Fail on invalid storage encoding for byte arrays. 2020-11-12 11:12:42 +01:00
chriseth
14ed67ac4b Merge remote-tracking branch 'origin/develop' into breaking 2020-11-11 20:33:40 +01:00
chriseth
44eb63fad0
Merge pull request #10263 from ethereum/fixTryCreateYul
Fix Yul codegen for try with create.
2020-11-11 20:10:54 +01:00
chriseth
571e1e5269
Merge pull request #10266 from ethereum/fixCalldataIndexAccess
Fix calldata index access.
2020-11-11 19:03:19 +01:00
chriseth
8f570a3184 Fix calldata index access. 2020-11-11 18:42:26 +01:00
chriseth
01d7d50750 Fix initializing mapping return variables. 2020-11-11 18:08:42 +01:00
chriseth
59da25056b Fix Yul codegen for try with create. 2020-11-11 17:52:50 +01:00
chriseth
141277dadf Merge remote-tracking branch 'origin/develop' into breaking 2020-11-10 17:28:36 +01:00
chriseth
6cc264ff0a
Merge pull request #10221 from ethereum/refactorArrayConversions
[Sol->Yul] Refactor array conversions
2020-11-10 16:18:11 +01:00
hrkrshnn
2348b721bb Tests after changing type of super to TypeType 2020-11-10 15:38:21 +01:00
hrkrshnn
9eafa1fa1a Change type of super to TypeType 2020-11-10 15:38:21 +01:00
Djordje Mijovic
efba9e45e4 [Sol->Yul] Refactoring array conversions so that they end up in same function. 2020-11-10 15:13:45 +01:00
chriseth
768ac9514b Merge remote-tracking branch 'origin/develop' into breaking 2020-11-09 14:48:48 +01:00
chriseth
04195439b7 Merge remote-tracking branch 'origin/develop' into HEAD 2020-11-09 14:28:05 +01:00
Kamil Śliwak
c970fb46ce YulUtilFunctions::conversionFunction: Add more info to the assertion that fails on invalid conversion 2020-11-09 13:41:03 +01:00
chriseth
b40fb527de Remove access to functions from inline assembly (unused code). 2020-11-05 14:43:29 +01:00
chriseth
1f3239d097 Simplify split parameter. 2020-11-03 14:34:18 +01:00
chriseth
fea3f848f9 Prepare store for external function types. 2020-11-03 14:34:18 +01:00
chriseth
06d0459a72
Merge pull request #10187 from ethereum/validateExternal
[SolYul] Properly validate external functions from calldata.
2020-11-03 14:29:28 +01:00
chriseth
5ffee049fa Merge remote-tracking branch 'origin/develop' into breaking 2020-11-03 14:05:14 +01:00
chriseth
834da7be90 Introduce abicoder pragma. 2020-11-03 13:31:50 +01:00
chriseth
c16b535804 Validate external functions from calldata. 2020-11-03 13:28:08 +01:00
chriseth
22b31054b6
Merge pull request #10174 from ethereum/storeInternalFunctions
Implement internal functions in storage.
2020-11-03 09:56:12 +01:00
chriseth
129b095b09 Implement internal functions in storage. 2020-11-02 23:10:03 +01:00
chriseth
49bd3f2af4 Convert properly during storing. 2020-11-02 21:15:34 +01:00
chriseth
1066af3b98 Copy byte array to storage. 2020-10-29 18:53:15 +01:00
chriseth
14d7ca49c0 Rename function. 2020-10-29 18:53:15 +01:00
chriseth
f215042cf6 Fix style. 2020-10-29 17:35:55 +01:00
chriseth
e93a84ccd4 Merge remote-tracking branch 'origin/develop' into HEAD 2020-10-28 18:19:31 +01:00
chriseth
0c12b2e53a Bit operations for fixed bytes types. 2020-10-28 18:04:54 +01:00
Djordje Mijovic
28f92064b9 [Sol->Yul] Fixing ice when copying struct that contains nested array to storage 2020-10-28 09:28:40 +01:00
chriseth
20f39ab6e9
Merge pull request #10097 from ethereum/develop
Merge develop into breaking.
2020-10-23 10:30:24 +02:00
chriseth
bfd267459c Panic codes. 2020-10-22 19:25:55 +02:00
chriseth
bfc8e26007 Remove low-level log functions. 2020-10-22 17:50:14 +02:00
chriseth
a83ad58109
Merge pull request #10081 from ethereum/maskBytes
Extract mask bytes function.
2020-10-21 10:09:40 +02:00
chriseth
3920f398aa
Update libsolidity/codegen/YulUtilFunctions.h
Co-authored-by: Harikrishnan Mulackal <webmail.hari@gmail.com>
2020-10-21 09:48:22 +02:00
chriseth
53d6721e47 Extract mask bytes function. 2020-10-20 17:36:46 +02:00
Mathias Baumann
a4dc110b38 Fix dependency tracking for abstract contracts for Yul codegen 2020-10-20 16:58:24 +02:00
chriseth
6979952995 Merge remote-tracking branch 'origin/develop' into HEAD 2020-10-19 18:02:50 +02:00
chriseth
527c073bb9 Checked arithmetic by default. 2020-10-19 16:58:37 +02:00
Djordje Mijovic
5f0b8dd716 [Sol->Yul] Changing yul unimplemented test as delete bytes is implemented now. 2020-10-15 22:05:40 +02:00
Djordje Mijovic
4a66723ff9 [Sol->Yul] Implementing resizing of dynamic byte arrays
Co-authored-by: chriseth <chris@ethereum.org>
2020-10-15 22:05:35 +02:00
chriseth
c9ed1b9ae9
Merge pull request #10047 from ethereum/removeMemoryGuards
Disable StackLimitEvader again until we have stronger correctness guarantees.
2020-10-15 18:56:33 +02:00
Daniel Kirchner
0dca223b45 Add another argument to setimmutable and the AssignImmutable opcode, allowing to modify code at any memory offset. 2020-10-15 18:14:41 +02:00
chriseth
00fb152316
Merge pull request #10048 from ethereum/develop
Merge develop into breaking
2020-10-15 17:30:11 +02:00
chriseth
89bdad2096
Merge pull request #10043 from ethereum/emptyArrayCopy
Fix empty array copy bug.
2020-10-15 17:07:54 +02:00
chriseth
38abadf502 Fix empty array copy bug. 2020-10-15 16:48:08 +02:00
Daniel Kirchner
82876fd00e Disable StackLimitEvader again until we have stronger correctness guarantees. 2020-10-15 16:16:41 +02:00
chriseth
e17d6853a9
Merge pull request #9985 from ethereum/optimizeDeleteStructSol2Yul
[Sol->Yul] Optimizing delete struct.
2020-10-15 16:03:06 +02:00
chriseth
979d3062bc
Merge pull request #10033 from ethereum/develop
Merge develop into breaking
2020-10-14 14:12:20 +02:00
Djordje Mijovic
6f7947cfa5 [Sol->Yul] Optimizing delete struct.
Co-authored-by: Daniel Kirchner <daniel@ekpyron.org>
2020-10-14 13:35:15 +02:00
chriseth
25b10b9643
Merge pull request #10028 from ethereum/useArrayLength
Use array length function.
2020-10-14 13:35:09 +02:00
chriseth
92a2cddbfa
Merge pull request #10024 from ethereum/outofBoundsGetter
Use revert for out-of-bounds array index access in getter.
2020-10-14 12:33:41 +02:00
chriseth
a737e51533 Use array length function. 2020-10-14 12:22:34 +02:00
chriseth
56d6855222
Merge pull request #9738 from ethereum/arrayCopyingSol2Yul
[Sol->Yul] Implementing copying of arrays to storage
2020-10-14 12:22:09 +02:00
Djordje Mijovic
850a94bdc9 [Sol->Yul] Implementing arrays copying to storage.
Co-authored-by: chriseth <chris@ethereum.org>
2020-10-13 20:31:08 +02:00
Djordje Mijovic
1272c474ba Fixing ICE when returning Struct from library 2020-10-13 20:00:11 +02:00
chriseth
5dc3a971cb Use revert for out-of-bounds array index access in getter. 2020-10-13 18:57:41 +02:00
Mathias Baumann
006e5f2e1f Allow path syntax for super constructor calls 2020-10-13 14:32:11 +02:00
chriseth
abfa136afb
Merge pull request #10012 from ethereum/extractSelectorFunction
Extract function to compute function selector from signature.
2020-10-12 20:32:05 +02:00
chriseth
4b342a7cad
Merge pull request #9816 from ethereum/exp-base-literals
[Sol->Yul] Optimization for exponentiation when the base is a literal
2020-10-12 19:34:38 +02:00
Harikrishnan Mulackal
418aa01c5b Optimization for exponentiation when the base is a literal 2020-10-12 18:54:58 +02:00
chriseth
cb0d1134b7 Extract function to compute function selector from signature. 2020-10-12 17:57:34 +02:00
Kamil Śliwak
3128e82a9a Look for experimental pragmas in the module containing the definition when generating code for modifiers and inherited functions 2020-10-12 14:29:53 +02:00
Christian Parpart
712d0805eb Fixes internal compiler error with an unused reference to module member. 2020-10-12 11:56:01 +02:00
chriseth
ca86eacfb2 Remove traces of errors due to shifts by negative amounts. 2020-10-08 20:24:53 +02:00
chriseth
2d1bd03a98
Merge pull request #9994 from ethereum/revertOnFailingReadFromCalldata
Revert on failing read from calldata.
2020-10-08 20:11:45 +02:00
chriseth
3970c4e57d
Merge pull request #9892 from ethereum/constantsAtFileLevel
Constants at file-level.
2020-10-08 19:53:33 +02:00
chriseth
8b96d17cb5 Revert on failing read from calldata. 2020-10-08 19:43:16 +02:00
chriseth
f8d5c4db36
Merge pull request #9843 from ethereum/deleteStructSol2Yul
[Sol->Yul] Implementing delete struct
2020-10-08 19:08:40 +02:00
chriseth
b2be8e1c0f Fix module member access. 2020-10-08 18:56:17 +02:00
chriseth
346fe1c6c5 Constants at file-level. 2020-10-08 18:56:17 +02:00
Djordje Mijovic
ad8d840ee7 [Sol->Yul] Implementing conversion of struct to struct pointer.
Co-authored-by: Daniel Kirchner <daniel@ekpyron.org>
2020-10-08 16:37:57 +02:00
Djordje Mijovic
700390a68b [Sol->Yul] Implementing deleting storage structs 2020-10-08 15:27:33 +02:00
Djordje Mijovic
3ede1f1bca Adding support for recursive functions in MultiUseYulFunctionCollector 2020-10-08 15:27:33 +02:00
chriseth
fd6196af16 Copying of arrays from storage to memory. 2020-10-08 15:16:13 +02:00
chriseth
431397eddf
Merge pull request #9943 from ethereum/array-cleanup
Array cleanup
2020-10-07 11:53:06 +02:00
Harikrishnan Mulackal
1bdbc10110 Properly cleanup after copying dynamic-array to storage for packed types 2020-10-06 16:06:02 +02:00
Djordje Mijovic
818afcbec2 [Sol->Yul] Implementing push for nested storage arrays and storage arrays of structs. 2020-10-06 13:06:40 +02:00
Harikrishnan Mulackal
7773bb3bd0 Fix typo: storage 2020-10-02 11:44:10 +02:00
chriseth
e5771efdf8
Merge pull request #9905 from ethereum/deleteArrayPackedSol2Yul
[Sol->Yul] Implementing deleting of storage array of types that are packed in storage
2020-10-01 16:50:57 +02:00
Djordje Mijovic
aa23ebc8e6 [Sol->Yul] Implementing array resizing for packed array types. 2020-10-01 10:25:00 +02:00
Harikrishnan Mulackal
fd02ccc68c Implemented events with indexed function as parameter in Yul 2020-09-30 12:11:39 +02:00
Harikrishnan Mulackal
3970412422 Implemented events with function type as one of its indexed parameters 2020-09-30 12:11:38 +02:00
chriseth
2037b7d6b8
Merge pull request #9820 from ethereum/new-annotation-field-virtual
Add annotation field ``requiresVirtualLookup``
2020-09-29 15:33:54 +02:00
Mathias Baumann
8584c98b6a Add annotation field `requiresVirtualLookup` 2020-09-28 17:36:23 +02:00
chriseth
1e3596ec71 Use invalid opcode on internal errors. 2020-09-24 16:02:35 +02:00
chriseth
e696c4eafd Extract common loop. 2020-09-23 16:14:24 +02:00
chriseth
55e6a92692 Add specialization for small numbers. 2020-09-23 16:14:24 +02:00
Mathias Baumann
dd81d05559 Make annotations `SetOnce or optional` where feasible 2020-09-22 17:38:21 +02:00
Daniel Kirchner
976abf4715 Easy review fixes. 2020-09-17 22:13:27 +02:00
Daniel Kirchner
f4b42d1c72 Add stack limit evader. 2020-09-17 22:13:27 +02:00
chriseth
930646ba2b Report locations of unimplemented features. 2020-09-15 14:41:46 +02:00
chriseth
b1ccf73511 Store current source location in Yul IR generation. 2020-09-15 14:41:46 +02:00
chriseth
eac175c08b
Merge pull request #9053 from ethereum/generatedSources
Export generated sources
2020-09-15 12:08:47 +02:00
chriseth
3b4024c2e1 Store optimized code if optimizer is activated. 2020-09-15 11:22:41 +02:00
chriseth
e7e9b03bd8 Store generated sources in standard-json output. 2020-09-15 11:22:16 +02:00
Alex Beregszaszi
9aa9962f71 Add ContractDefinition::interfaceId() helper 2020-09-14 20:34:52 +01:00
Djordje Mijovic
ec6d21cde2 [Sol->Yul] Fixing storage array index access 2020-09-08 16:02:56 +02:00
chriseth
3a48be546d
Merge pull request #9602 from ethereum/structMemToStorageSol2Yul
[Sol->Yul] Implementing various copying of structs
2020-09-02 13:50:46 +02:00
Djordje Mijovic
1fab5b79fb Refactoring signature for updateStorageValueFunction 2020-09-02 12:28:53 +02:00
Djordje Mijovic
15163b2270 Refactoring readFromStorage util frunctions
Co-authored-by: Daniel Kirchner <daniel@ekpyron.org>
2020-09-02 12:28:53 +02:00
Djordje Mijovic
23f6369a46 Implementing struct copying from calldata to storage 2020-09-02 12:28:53 +02:00
Djordje Mijovic
762e3f3cee [Sol->Yul] Implementing struct copying from calldata to storage 2020-09-02 12:28:53 +02:00
Djordje Mijovic
381784dd89 [Sol->Yul] Implementing struct copying from storage to memory 2020-09-02 12:28:53 +02:00
Djordje Mijovic
b89c863e11 [Sol->Yul] Implementing struct copying from memory to storage 2020-09-02 12:28:53 +02:00
chriseth
8f34ac472f Implement `super`. 2020-09-02 11:00:42 +02:00
Djordje Mijovic
d99b81ef02 [Sol->Yul] Enabling storage pointers to local vars in inline assembly. 2020-08-26 10:25:42 +02:00
chriseth
17edf4f207
Merge pull request #9479 from ethereum/exp
Implement checked exponentiation.
2020-08-18 13:57:25 +02:00
chriseth
c34e349572 Implement checked exponentiation. 2020-08-18 12:42:53 +02:00
chriseth
9324fb4f20 Free functions. 2020-08-18 11:46:59 +02:00
chriseth
833f973f0e Fix assertion for receive function in libraries. 2020-08-17 16:49:13 +02:00
Jason Cobb
888d7037cd
Make FunctionCallAnnotation::kind a SetOnce 2020-08-12 11:57:01 -04:00
Djordje Mijovic
d685bee2ec [Sol->Yul] Implementing struct copying from calldata to memory.
Co-authored-by: Daniel Kirchner <daniel@ekpyron.org>
2020-08-11 16:18:06 +02:00
Djordje Mijovic
96258c7e75 [Sol->Yul] Implementing bytes copying from calldata to memory. 2020-07-27 15:14:26 +02:00
chriseth
2c574af45b Fix conversion bug for exp operation. 2020-07-27 10:44:42 +02:00
chriseth
42063f2158
Merge pull request #9490 from ethereum/renameSlotToSelector
Rename external function slot to selector.
2020-07-27 10:42:47 +02:00
chriseth
1b810d4a0a Remove handling of signed shift amounts. 2020-07-23 16:45:16 +02:00
chriseth
147a80aa24 Rename external function slot to selector. 2020-07-23 14:19:15 +02:00
chriseth
6bb6783d39 Merge remote-tracking branch 'origin/develop' into breaking 2020-07-22 15:26:44 +02:00
Djordje Mijovic
546e9af24d [Sol->Yul] Supporting .runtimeCode 2020-07-21 17:56:37 +02:00
chriseth
9be5ed1220 Merge remote-tracking branch 'origin/develop' into breaking 2020-07-21 11:35:28 +02:00
chriseth
50a54fa8aa Implement inline arrays. 2020-07-20 17:06:32 +02:00
chriseth
50dc17350c Remove leftover of code-generator for `now`. 2020-07-20 15:37:53 +02:00
Sachin Grover
b7adb2aa42 Add SPDX license identifier if not present already in source file
Fixes: #9220
2020-07-17 20:24:12 +05:30
chriseth
f945163909
Merge pull request #9432 from ethereum/develop
Merge develop into breaking.
2020-07-16 17:14:45 +02:00
Mathias Baumann
d3af598c49 CodeGen: Avoid double cleanup when copying to memory 2020-07-16 13:53:48 +02:00
chriseth
8eee3ed3a2
Merge pull request #9388 from ethereum/develop
Merge develop into breaking.
2020-07-13 14:55:21 +02:00
Djordje Mijovic
547590b972 Fixing additional signedness errors after adding -Wsign-conversion flag
Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
2020-07-09 17:22:45 +02:00
chriseth
9ef050af9a
Merge pull request #9373 from ethereum/develop
Merge develop into breaking.
2020-07-09 16:15:43 +02:00
chriseth
0c7e4cf16b
Merge pull request #9340 from ethereum/compileTimeSha
Evaluate keccak256 of string literals at compile-time.
2020-07-08 18:42:38 +02:00
chriseth
0a0f578d7c Evaluate keccak256 of string literals at compile-time. 2020-07-08 16:14:14 +02:00
chriseth
89231bea1e
Merge pull request #9324 from ethereum/noDuplicateInternalRoutine
Remove duplicate creation of internal routine.
2020-07-08 10:30:37 +02:00
chriseth
64b6524bdb Merge remote-tracking branch 'origin/develop' into breaking 2020-07-08 09:37:14 +02:00
chriseth
8e711a8b99 Remove duplicate creation of internal routine. 2020-07-06 19:25:47 +02:00
chriseth
4d2b9cd38f Jump types for yul functions. 2020-07-06 18:12:54 +02:00
chriseth
ab68406006 Merge remote-tracking branch 'origin/develop' into breaking 2020-07-06 15:25:25 +02:00
Mathias Baumann
50373ac1b0 Yul: Implement memory struct allocation 2020-07-02 16:37:20 +02:00
Bhargava Shastry
1a0391bceb Fuzzer: Add a specialized StackTooDeepError Exception that is caught in the fuzzing harness 2020-07-01 11:08:20 +02:00
Harikrishnan Mulackal
d41eaeba56 Added containsNestedMapping() 2020-06-30 16:15:03 +05:30