Daniel
82fdc6fccc
Merge pull request #13932 from lemenkov/redundant_std_move
...
libsolidity: Redundant std::move
2023-02-07 15:29:41 +01:00
Leo Alt
8d91ccf028
[SMTChecker] Add a new trusted mode which assumes that code that is
...
available at compile time is trusted.
2023-02-06 17:02:33 +01:00
Peter Lemenkov
b3f35f703a
libsolidity: Redundant std::move
...
This patch suppresses warnings like this one:
```
/builddir/build/BUILD/solidity-0.8.18/libsolidity/ast/AST.h: In constructor 'solidity::frontend::FunctionDefinition::FunctionDefinition(int64_t, const solidity::frontend::ASTNode::SourceLocation&, solidity::frontend::ASTPointer<std::__cxx11::basic_string<char> >&, const solidity::frontend::ASTNode::SourceLocation&, solidity::frontend::Visibility, solidity::frontend::StateMutability, bool, solidity::langutil::Token, bool, solidity::frontend::ASTPointer<solidity::frontend::OverrideSpecifier>&, solidity::frontend::ASTPointer<solidity::frontend::StructuredDocumentation>&, solidity::frontend::ASTPointer<solidity::frontend::ParameterList>&, std::vector<std::shared_ptr<solidity::frontend::ModifierInvocation> >, solidity::frontend::ASTPointer<solidity::frontend::ParameterList>&, solidity::frontend::ASTPointer<solidity::frontend::Block>&)':
/builddir/build/BUILD/solidity-0.8.18/libsolidity/ast/AST.h:926:69: error: redundant move in initialization [-Werror=redundant-move]
926 | CallableDeclaration(_id, _location, _name, std::move(_nameLocation), _visibility, _parameters, _isVirtual, _overrides, _returnParameters),
| ~~~~~~~~~^~~~~~~~~~~~~~~
/builddir/build/BUILD/solidity-0.8.18/libsolidity/ast/AST.h:926:69: note: remove 'std::move' call
```
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
2023-02-05 12:06:19 +01:00
Jacob Heider
43431eb427
Fixes compilation errors with some clangs
...
resolves https://github.com/ethereum/solidity/issues/13854
2023-02-03 21:37:50 -05:00
Matheus Aguiar
2b70b08d5f
Allow library external functions to be bound with using for
2023-02-02 13:39:19 -03:00
Rodrigo Q. Saramago
feba4de509
Add paris constraints to SMTChecker
...
Co-authored-by: Daniel <daniel@ekpyron.org>
Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
Co-authored-by: Leo <leo@ethereum.org>
2023-01-31 11:03:04 +01:00
Nikola Matic
e7543d487d
Issue warning when using deprecated SELFDESTRUCT
2023-01-25 16:55:11 +01:00
Rodrigo Q. Saramago
ef6ff2f055
Adds support for the EVM version "Paris".
...
Deprecates `block.difficulty` and disallow `difficulty()` in inline assembly for EVM versions >= paris.
The change is due to the renaming introduced by EIP-4399 (see: https://eips.ethereum.org/EIPS/eip-4399 ).
Introduces `block.prevrandao` in Solidity and `prevrandao()` in inline assembly for EVM versions >= paris.
Co-authored-by: Alex Beregszaszi <alex@rtfs.hu>
Co-authored-by: Daniel <daniel@ekpyron.org>
Co-authored-by: matheusaaguiar <95899911+matheusaaguiar@users.noreply.github.com>
Co-authored-by: Nikola Matić <nikola.matic@ethereum.org>
2023-01-23 18:50:36 +00:00
vlad
7fbd36855d
Disallow usage of the indexed attribute for modifier parameters Added tests for edge cases of several keywords
2023-01-20 19:53:02 +01:00
vlad
6a0ea174b8
Disallow several indexed attributes for the same event parameter
2023-01-20 19:53:02 +01:00
Nikola Matic
c2e2adb953
Allow support for older boost and adjust docs
2023-01-18 10:51:14 +01:00
Matheus Aguiar
7779b6f352
Forbid private library functions to be attached outside their declaration scope
2023-01-17 16:27:35 -03:00
Nikola Matic
83c1f62026
Source location for named mapping keys
2023-01-17 12:25:23 +01:00
Nikola Matic
1da82045c4
Use directory_options instead of deprecated symlink_option
...
basename to step
2023-01-12 10:37:01 +01:00
Daniel
f441e1323a
Merge pull request #13384 from zemse/develop
...
Allow named parameters in mapping types
2023-01-09 17:59:29 +01:00
Saw-mon-and-Natalie
e295964f50
fixed some comments in Types.h
2022-12-16 14:58:41 +00:00
Soham Zemse
fa78e0f3d4
feat: allow named parameters in mapping types
...
Co-authored-by: Hari <webmail.hari@gmail.com>
test: add parser and abi test cases
docs: add example on using named parameters for mappings
- Add changelog
feat: update antlr grammar to allow named parameters in mappings
fix: prevent conflicting mapping parameter names
ref: change order of mapping initializers
test: update expectations and fix build
test: add more tests
fix: use common error & code for conflicting params
fix: issue with accessing nested mapping
test: add conflicting params tests for more nested levels
Update libsolidity/analysis/DeclarationTypeChecker.cpp
Co-authored-by: Nikola Matić <nikola.matic@ethereum.org>
fix: error reported with the same code twice
test: add more tests for 3 level nested mapping
Address review comments
2022-12-08 11:56:58 +01:00
wechman
64a4f32bc2
Consistent terminology for attached/bound functions
2022-12-07 19:31:41 +01:00
Leo Alt
77698f8108
Fix internal error when deleting struct member of function type
2022-11-30 12:47:32 +01:00
Leo Alt
608b424afc
Fix internal error when using user defined value types as mapping indices or struct members.
2022-11-29 13:04:01 +01:00
Leo Alt
07870d0318
Fix internal error in assignment chains that also assign to fully qualified state variables (, for example), where the contract expression is a tuble.
2022-11-28 18:45:50 +01:00
Leo Alt
a5dab6181c
Fix internal error when the abstract-nondet SMTChecker natspec annotation is used with a wrong option multiple times for the same function
2022-11-28 16:59:35 +01:00
Leo Alt
9a8dd4242f
Fix SMTChecker bug when a public library function is called internally by an internal library function, which in turn is called internally by a contract.
2022-11-28 13:07:18 +01:00
Vinay
9e7b85ac4b
Improve Error Reporting of SemVer Parser
2022-11-25 13:09:09 -03:00
Daniel
eb2f874eac
Merge pull request #13733 from ethereum/eofSetting
...
Add experimental EOF options for CLI and Standard JSON.
2022-11-23 20:37:24 +01:00
Daniel Kirchner
bf26d3be5a
Add experimental EOF options for CLI and Standard JSON.
...
Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
2022-11-23 19:53:44 +01:00
chriseth
261e819df7
Type: Extract usingForDirectivesForType()
helper
2022-11-23 14:22:49 +01:00
wechman
edb4bfa398
ViewPureChecker: Extract reportFunctionCallMutability() helper from endVisit(FunctionCall)
2022-11-23 13:27:26 +01:00
wechman
27df07c4ce
TypeChecker: Minor simplifications for operators and using for
2022-11-23 13:27:26 +01:00
Leo Alt
24df40de9a
Allow running Eldarica from the command line
2022-11-22 21:16:45 +01:00
wechman
fbe1181517
CFGNode: For function calls store a pointer to a resolved function definition rather than the FunctionCall AST node
2022-11-09 17:51:32 +01:00
Duc Thanh Nguyen
4aac4c7bc4
Add Natspec devdoc inheritance support for events
2022-11-08 15:53:10 +01:00
wechman
df1f5eef72
UsingForDirective: Rename m_functions to m_functionsOrLibrary
2022-11-07 23:58:19 +01:00
Kamil Śliwak
a866aaebf3
Refactor several error messages in TypeChecker to use fmtlib
2022-11-07 17:13:41 +01:00
wechman
6da09e8d9a
Error message tweak: built-in unary/binary operator
2022-11-07 17:13:41 +01:00
wechman
4c9a58eb0f
Don't include location in a message about binding function to a type
2022-11-07 17:13:09 +01:00
wechman
d5428af5bb
Make the message about name not referring to a user-defined type more generic
2022-11-04 08:46:53 +01:00
Kamil Śliwak
12f5612c65
Merge pull request #13405 from ethereum/add_assembly_optimisersettings_translatesettings
...
[libevmasm] Add Assembly::OptimiserSettings::translateSettings.
2022-10-26 15:09:32 +02:00
Alexander Arlt
b7abcb25ae
[libevmasm] Add Assembly::OptimiserSettings::translateSettings.
2022-10-26 14:11:59 +02:00
Christian Parpart
9e7fe985bf
[Language Server]: Add basic document hover support.
2022-10-26 13:53:29 +02:00
chriseth
08af255658
Merge pull request #13578 from ethereum/imported-source-type-refactoring
...
[libsolidity] Refactor Compiler Stack imported source type.
2022-10-20 15:27:36 +02:00
Alexander Arlt
0da1ce3a00
[libsolidity] Refactor Compiler Stack imported source type.
2022-10-20 14:30:40 +02:00
hrkrshnn
6854e2b5d6
fix: bytecodeHash
cannot be set to non-none for appendCBOR=false
...
Testing: see `test/cmdlineTests/metadata_append_standard_json_error`
Closes: https://github.com/ethereum/solidity/issues/13628
2022-10-13 02:07:20 +02:00
Kamil Śliwak
53e0a47a1c
Merge pull request #13265 from ethereum/no-append-metadata
...
Add `--no-append-metadata` in CLI and `metadata.append` in JSON
2022-10-04 17:32:22 +02:00
Alex Beregszaszi
725253551e
Improve FunctionSelector helpers
2022-09-27 17:58:32 +02:00
hrkrshnn
d32661c0af
Added tests for --no-append-metadata
...
- Command line tests
- Documented the standard json
- Changelog
- A Change in SolidityExecutionFramework to prevent flaky gas tests
- A boost test for --no-append-metadata
- Removed an outdated comment
2022-09-26 20:40:34 +02:00
hrkrshnn
f96e802e74
Add --no-append-metadata
in CLI and metadata.append
in JSON
...
Skips appending metadata to the binary
2022-09-26 20:40:34 +02:00
Christian Parpart
d07c596f42
Renaming lspAssert to lspRequire plus adding some documentation to make it more clear what this function is supposed to be used for.
2022-09-26 12:14:56 +02:00
nishant-sachdeva
eafd7218b7
refactored struct message to use std::variant for _typeOrSeverity
2022-09-20 19:20:43 +05:30
nishant-sachdeva
c8011d8719
Cleaning up helpers around errors
2022-09-19 10:51:14 +05:30
Nikola Matic
e37dc8e975
Address review comments
2022-09-13 17:23:31 +02:00
Nikola Matic
feba1bfeff
Rework metadata and cover with tests
2022-09-12 11:13:49 +02:00
Nikola Matic
314a1cc92f
Command line tests and minor touch ups
2022-09-12 11:13:49 +02:00
Nikola Matic
f6f0d6a360
Make hardcoded parts of the optimizer sequence configurable
2022-09-12 10:57:36 +02:00
Damian Wechman
6b99162457
Merge pull request #13406 from ethereum/slot_on_reference_fix
...
Fix `.slot` accessing via mapping reference in assembly
2022-09-05 14:00:18 +02:00
Leo
242096695f
Merge pull request #13428 from ethereum/qualify-move
...
Add std:: qualifier to move() calls
2022-08-30 11:57:54 +02:00
Marenz
f7cc29bec1
Add std:: qualifier to move() calls
2022-08-30 11:12:15 +02:00
tcoyvwac
3d54bfd0c3
ast: condense duplicate code
...
AST.cpp:
* Added findClause() helper function to anonymous namespace.
2022-08-25 14:45:22 +02:00
Christian Parpart
c8074d2c6e
lsp: Limit resolvesToRegularFile()'s recursion depth to 10.
2022-08-24 16:27:08 +02:00
Christian Parpart
3fc7debbef
lsp: Code-review fixups.
2022-08-24 16:27:05 +02:00
Christian Parpart
b22d149e3c
Adds extra check to only consider regular files (e.g. not directories / device files) for inclusion.
2022-08-22 14:53:15 +02:00
Christian Parpart
b6ba43234e
lsp: Always load all solidity files from project for analyzing.
...
Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
2022-08-22 12:49:04 +02:00
wechman
cf3bae0839
Fix "slot" access via mapping reference in assembly
2022-08-17 07:53:52 +02:00
Leonid Pospelov
4682c01920
Update ASTJsonExporter.cpp
2022-08-14 03:07:01 +03:00
Matheus Aguiar
2282ea5e56
Added overflow checks after multiplication operation is executed.
2022-08-12 10:18:05 -03:00
Daniel Kirchner
9a429e2300
Fix ICE on invalid tuple assignments.
2022-08-09 12:41:47 +02:00
Marenz
22c7cd22b9
Fix wrong cleanup when copying from calldata to memory
...
Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
2022-08-08 13:07:16 +02:00
Nikola Matic
40de2b0442
Add full stops to error messages
2022-08-05 09:52:48 +02:00
Duc Thanh Nguyen
a9e03f5e4a
Fix out-of-range compiler crash for nested tuple assignment involving
...
outer unary tuple
2022-08-04 12:45:46 -04:00
Matheus Aguiar
9acf693aa2
Fixed bad cast when abiEncodeCall receives a tuple from a function.
2022-08-03 18:48:38 -03:00
Ishtiaque Zahid
3e70a406af
fixed wrong tab alignment in YulUtilFunctions.h
2022-08-03 12:33:11 +06:00
Duc Thanh Nguyen
5072472917
Fix abi.encodeCall checks
2022-07-25 12:40:54 -04:00
chriseth
f5f77a0833
Merge pull request #13276 from ethereum/resolvingFlags
...
Settings struct for name resolution.
2022-07-14 18:21:24 +02:00
chriseth
e2675002ca
Settings struct for name resolution.
2022-07-14 17:22:17 +02:00
Christian Parpart
5aeb80ec3c
lsp.py: Pass trace option during initialization already.
2022-07-13 16:41:30 +02:00
Christian Parpart
eb5a33273e
lsp: Fixes initialization phase if include-paths
was not set at all, then also no error should be generated.
2022-07-13 16:29:33 +02:00
Christian Parpart
31227e442e
lsp: Adds support for include paths and have {projectUri}/node_modules added by default.
...
- Factor out FileRepository's path resolving into own public function.
- Fixes sourceUnitNameToUri() path resolving in relation to include paths being used.
- Adding an solAssert().
- adds nother test for include-paths (bad include)
- Fixes a case on Windows there an ill-formed URI was generated.
- Dropping unnecessary if-branch when translating from sourceUnitName to URI.
2022-07-12 15:25:33 +02:00
Marenz
16b64f3aee
LSP rename
2022-07-08 11:52:45 +02:00
Mathias L. Baumann
b2ac0dada4
Merge pull request #13210 from timweri/display_human_readable_type_name_in_conversion
...
Display human readable type name in error messages
2022-07-06 17:31:53 +02:00
Duc Thanh Nguyen
e0ba7ef0d3
Rename _short in toString to _withoutDataLocation
2022-07-06 10:49:58 -04:00
Duc Thanh Nguyen
0a14368315
Display human readable type name in conversion error message
2022-07-06 10:49:51 -04:00
Matheus Aguiar
290bd4fd2d
Added a flag to record when a source is reconstructed from JSON so garbage code snippets are not printed after source location.
2022-07-05 11:41:24 -03:00
Mathias L. Baumann
d4e2c2cc89
Merge pull request #13185 from ethereum/functionCall_locations
...
Add location for parameter names in FunctionCall ASTNode
2022-07-04 16:40:45 +02:00
William Entriken
2a957413d0
Update naming of Mainnet
2022-06-30 16:47:11 +02:00
Marenz
3a5218d3d5
Add location for parameter names in FunctionCall ASTNode
2022-06-29 18:37:36 +02:00
Marenz
ee710eadd4
Add location for member in MemberAccess ASTNode
2022-06-29 18:37:09 +02:00
chriseth
b70e064e8f
Merge pull request #13130 from ethereum/check-overflow-after-add-sub-operations
...
Check overflow after add sub operations
2022-06-27 15:33:57 +02:00
Mathias L. Baumann
2397f09b79
Merge pull request #13182 from ethereum/identifierPath_declarations
...
Add all path declarations in IdentifierPath annotation
2022-06-27 12:35:50 +02:00
Matheus Aguiar
4fd5c11af7
Checks for overflow/underflow after add/sub operations.
2022-06-23 14:41:12 -03:00
Mathias L. Baumann
3ed9a38abc
Merge pull request #12966 from a3d4/fix-ice-structtype-nativemembers
...
Fix ICE caused by an immutable struct with mapping
2022-06-23 16:11:28 +02:00
Mathias L. Baumann
03409beb1d
Update libsolidity/analysis/NameAndTypeResolver.h
...
Co-authored-by: Damian Wechman <damian.wechman.it@gmail.com>
2022-06-22 13:25:24 +02:00
Marenz
5d2e134378
Add all path locations to the IdentifierPath ASTNode
2022-06-21 14:19:45 +02:00
Marenz
18784cff81
Add all path declarations in IdentifierPath annotation
2022-06-20 18:08:57 +02:00
chriseth
c3ea86612e
Merge pull request #13161 from ethereum/rename-converter
...
Rename ASTJsonConverter to ASTJsonExporter
2022-06-20 14:49:42 +02:00
Marenz
c88c74ceb8
Rename ASTJsonConverter to ASTJsonExporter
...
given that we have an ASTJsonImporter this name makes more sense.
2022-06-16 18:05:51 +02:00
Daniel Kirchner
4c84b77a4b
Review suggested renaming.
2022-06-16 15:05:21 +02:00
Daniel Kirchner
cdf243a9af
Improved array copy routine for value type arrays from memory or calldata to storage.
2022-06-16 15:05:21 +02:00
Ryan
3b2c6de61c
Propagate purity information for member access to foreign pure variables
2022-06-16 17:11:55 +05:30
Daniel Kirchner
16245f7b9b
Warn about multiple assignments to storage byte pushes and fix warnings about multiple storage to storage copies.
...
Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
2022-06-15 13:53:05 +02:00
Daniel Kirchner
d30b04674e
Add resolveUnaryTuples helper.
2022-06-15 13:15:26 +02:00