Compare commits

...

1991 Commits

Author SHA1 Message Date
Daniel
72671d6c88
Merge pull request #14581 from ethereum/purge-using-namespace-std-from-test-libsolidity-util
Purge using namespace std from test/libsolidity/util
2023-10-02 17:53:53 +02:00
Daniel
2ba536f278
Merge pull request #14582 from ethereum/fix-check-style-using-namespace-std-exclusion
Fix check_style for using namespace std exclusing in test/*
2023-10-02 15:50:53 +02:00
Nikola Matic
0d0a7fc1f5 Purge using namespace std from previously missed files 2023-10-02 14:37:55 +02:00
Nikola Matic
77912ab35d Fix check_style for using namespace std exclusing in test/* 2023-10-02 14:07:50 +02:00
Nikola Matic
fa394018c3 Purge using namespace std from test/libsolidity/util 2023-10-02 13:25:16 +02:00
Kamil Śliwak
fe1f9c640e
Merge pull request #14565 from ethereum/viaIR-codegen-import-bug-test
Add test for via-ir codegen import bug
2023-09-30 00:04:55 +02:00
r0qs
ab2d3957cb Add bytecode test for multiple sources compiler at same time
Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
2023-09-29 23:17:15 +02:00
Kamil Śliwak
2b7ec23edc
Merge pull request #14562 from ethereum/fix-viaIR-codegen-import-bug
Fix Via-IR bytecode divergence when compiling multiple files that are already included via imports
2023-09-29 23:01:37 +02:00
r0qs
e3b36f736d
Avoid sorting FunctionDefinitions by AST ID during codegen
Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
2023-09-26 14:02:00 +02:00
Daniel
cc7a14a61d
Merge pull request #14518 from ethereum/analysis-framework-refactor
`AnalysisFramework` refactor
2023-09-19 18:52:57 +02:00
Kamil Śliwak
3fb2f1db88 AnalysisFramework: Move common setup to the framework 2023-09-19 15:56:49 +02:00
Kamil Śliwak
d2bfb2f737 AnalysisFramework: Reimplement parseAnalyseAndReturnError() with runFramework() 2023-09-19 15:56:49 +02:00
Kamil Śliwak
b766268ff3 AnalysisFramework: Get rid of parseAndAnalyse() and success()
- There are too many badly named functions doing different things. E.g. SyntaxTest has both this and parseAndAnalyze().
2023-09-19 15:56:49 +02:00
Kamil Śliwak
309a8de530 Refactor AnalysisFramework to share more features between test cases that depend on it 2023-09-19 15:56:49 +02:00
Daniel
dc44f8ad91
Merge pull request #14550 from ethereum/events-at-file-level
File-level events
2023-09-18 14:36:14 +02:00
Daniel
586a7c54eb
Merge pull request #14503 from Saw-mon-and-Natalie/fix-test-typo
fixed `MSTORE` typo in `libevmasm` tests
2023-09-18 14:30:55 +02:00
Kamil Śliwak
b0a986ffff Allow event definitions at file level 2023-09-15 14:47:40 +02:00
Nikola Matić
020b59680e
Merge pull request #14552 from ethereum/bump-cmake-and-boost-to-work-with-vs-2022
Work around differences in `lexically_normal()` on Boost 1.78+ and bump cmake and boost versions
2023-09-14 20:38:53 +02:00
Kamil Śliwak
5a5e0b5bb3
Merge pull request #14551 from zobront/develop
docs: add clarification about post-execution modifier behavior
2023-09-14 20:28:20 +02:00
Zach Obront
6e8b9dff51 docs: add clarification about post execution modifier behavior 2023-09-14 17:58:18 +02:00
Kamil Śliwak
70cf104f19 fixup! Bump cmake to 3.27.4 and boost to 1.83 on Windows to work with Visual Studio 2022 2023-09-14 17:44:08 +02:00
Saw-mon & Natalie
85b1cb9013 fixed MSTORE typo 2023-09-14 16:15:28 +02:00
Kamil Śliwak
0a69758468 FileReader::isPathPrefix(): Work around lexically_normal() no longer preserving UNC slashes on Boost 1.78+ on Windows 2023-09-14 16:12:43 +02:00
Nikola Matic
5d88b74746 install_deps.ps1: Remove downloaded packages and sources after installation 2023-09-14 16:12:43 +02:00
Nikola Matic
73d582d4b3 Bump cmake to 3.27.4 and boost to 1.83 on Windows to work with Visual Studio 2022 2023-09-14 16:12:43 +02:00
Daniel
9bce5f91dc
Merge pull request #14538 from ethereum/experimentalAnalysisBasicInfrastructure
New Analysis basic infrastructure
2023-09-13 13:00:56 +02:00
Kamil Śliwak
64a0f62700
Merge pull request #14506 from ethereum/extracted-natspec-json-tests
Replace Boost-based Natspec test case with one derived from `SyntaxTest`
2023-09-11 19:28:31 +02:00
Kamil Śliwak
b63a94031f Generate expectations for moved Natspec syntax tests 2023-09-11 18:06:42 +02:00
Kamil Śliwak
dc68480f72 Move Natspec syntax tests to natspecJSON 2023-09-11 18:06:42 +02:00
Kamil Śliwak
d083925bed natspecJSON: Generate missing expectations (including errors) 2023-09-11 18:06:42 +02:00
Kamil Śliwak
481c7256cb natspecJSON: Include version and kind fields in expectations where missing 2023-09-11 18:06:42 +02:00
Kamil Śliwak
99bfdf930a SolidityNatspecJSON: Convert Boost-based test cases into natspectJSON/*.sol tests 2023-09-11 18:06:42 +02:00
Kamil Śliwak
ba019e5a01 SolidityNatspecJSON: Manual conversion of two test cases that would not be handled correctly by the script
- dev_multiple_params_mixed_whitespace has whitespace that is not completely preserved
- dev_explicit_inherit_complex is a multi-file test
2023-09-11 18:06:42 +02:00
Kamil Śliwak
1041f071f0 SolidityNatspecJSON: A few tweaks and small fixes before automatic conversion
- Expectation order matching the order of contracts in the source
- Typos in test names
- Redundant prefixes in test names
- Wrong 'king' in some expectations (it's not checked by the test suite)
2023-09-11 18:06:42 +02:00
Kamil Śliwak
91cc72bcd4 NatspecJSONTest based on SyntaxTest 2023-09-11 18:06:42 +02:00
Matheus Aguiar
14aed39261 Introduce experimental analysis basic infrastructure 2023-09-11 12:29:44 -03:00
r0qs
34c86d90be
Merge pull request #14556 from ethereum/homebrew-update
Upgrade homebrew packages
2023-09-11 13:34:56 +02:00
r0qs
1cb04e84d9
Upgrade homebrew packages
Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
2023-09-11 12:49:32 +02:00
Daniel
16ae76cad7
Merge pull request #14533 from ethereum/fix-std-namespace-asan
Fix missing std qualifier for ASAN
2023-09-05 11:04:13 +02:00
Nikola Matic
ae36323edb Fix missing std qualifier for ASAN 2023-09-05 08:49:23 +02:00
Daniel
e43968599e
Merge pull request #14468 from ethereum/push0-rematerializer-default-sequence
Push0 rematerializer default sequence
2023-09-04 19:27:33 +02:00
Nikola Matic
fdc6699159 Rematerialize zero literals with default cleanup sequence
Add unused pruner step to the end of the default cleanup sequence
2023-09-04 15:40:33 +02:00
Daniel
1b8e792eb6
Merge pull request #14530 from ethereum/fix-oz-failing-test
Fix failing OZ test
2023-09-04 13:08:47 +02:00
Nikola Matic
76e0d81354 Fix failing OZ test 2023-09-04 12:23:12 +02:00
Nikola Matić
737c1abbdf
Merge pull request #14525 from molecula451/purge-std
deprecate using namespace std
2023-09-04 11:02:15 +02:00
Paul
b3230b0bdc deprecate using namespace std
test: updat filereader test

deprecate namespace std

deprecate namespace std

deprecate namespace std

deprecate namespace std

deprecate namespace std

deprecate namespace std

deprecate namespace std

deprecate namespace std

deprecated std namespace

deprecated std namespace

deprecated std namespace

deprecated std namespace

deprecated std namespace

deprecated std namespace

deprecated std namespace

deprecated std namespace

deprecated std namespace

depecrate namespace std

deprecated namespace std

check ci

clean line

Co-authored-by: Nikola Matić <nikola.matic@ethereum.org>

purge line

pure line

deprecate std

deprecate std

deprecate std

deprecate std

deprecate std

deprecate

deprecate std

bye namespace
2023-09-04 10:12:07 +02:00
Nikola Matić
df03f1412d
Merge pull request #14522 from junaire/purge-using-namespace-std-in-libyul
Purge using namespace std in libyul
2023-08-29 12:38:50 +02:00
Jun Zhang
eff410eb74 Purge using namespace std in libyul
Signed-off-by: Jun Zhang <jun@junz.org>
2023-08-29 11:51:59 +02:00
Daniel
26912e0ee2
Merge pull request #14515 from junaire/bump-fmtlib-version
Bump fmtlib to 9.1.0
2023-08-28 17:24:20 +02:00
Nikola Matić
88b8368932
Merge pull request #14512 from junaire/yul-opt-kill-namespace-std
Purge using namespace std from libyul/optimiser
2023-08-28 16:01:03 +02:00
Jun Zhang
c2362c3362
Purge using namespace std from libyul/optimiser
Signed-off-by: Jun Zhang <jun@junz.org>
2023-08-28 21:14:56 +08:00
Jun Zhang
2cf23e15d8 Bump fmtlib to 9.1.0
In our downstream project, we have two dependencies: solidity and spdlog.
Both of them depend on fmtlib. Unfortunately, the versions of fmtlib they
use do not match, which leads to compilation failure.

The issue arises because spdlog attempts to use solidity's fmtlib, but the
specific version (v8.0.1) has a bug. Ref: https://github.com/gabime/spdlog/issues/2142

While we could keep this change in our own fork, we believe it would
be worthwhile to contribute it back to the upstream since spdlog is a
very popular logging library.

Signed-off-by: Jun Zhang <jun@junz.org>
2023-08-28 13:58:56 +08:00
Nikola Matić
925bfeb24b
Merge pull request #14513 from junaire/yul-backend-namespace-std
Purge using namespace std from libyul/backends
2023-08-28 07:56:38 +02:00
Jun Zhang
1ebdab43d8 Purge using namespace std from libyul/backends
Signed-off-by: Jun Zhang <jun@junz.org>
2023-08-24 11:12:52 +08:00
Daniel
37e18612c5
Merge pull request #14505 from ethereum/syntax-test-more-extension-points
Make `SyntaxTest` easier to extend with custom expectations
2023-08-23 18:48:37 +02:00
Kamil Śliwak
e847596e39 CommonSyntaxTest: Add support for syntax tests with custom expectations in addition to expected errors 2023-08-23 18:00:01 +02:00
Kamil Śliwak
c965d6332c SyntaxTest: Allow derived test cases to filter out warnings and infos 2023-08-23 18:00:01 +02:00
Kamil Śliwak
73b9077ab0 SyntaxTest: Default-initialize boolean fields without showing the value
- These get re-initialized in constructor anyway. The only purpose if initializing here is our convention to always initialize primitive types at declaration time. We don't want to have to repeat the defaults though.
2023-08-23 18:00:01 +02:00
Kamil Śliwak
b1ead4af94 Order Error::Severity enum from most to least severe
- Also reorder Error::Type to match initial values for some consistency
2023-08-23 18:00:01 +02:00
Kamil Śliwak
c5b81b66cd Define Error::severity() 2023-08-23 18:00:01 +02:00
Daniel
78b1f5acc2
Merge pull request #14511 from ethereum/semantic-tests-via-ir
Semantic tests via IR
2023-08-23 16:42:03 +02:00
Nikola Matić
589adee306
Merge pull request #14514 from junaire/solc-namespace-std
Purge using namespace std from solc
2023-08-23 10:57:05 +02:00
Jun Zhang
86ed964c6a
Purge using namespace std from solc
Signed-off-by: Jun Zhang <jun@junz.org>
2023-08-23 16:12:26 +08:00
Kamil Śliwak
1bb596096b fixup! Change semantic tests to use the proper via IR pipeline, without rerunning on exceptions 2023-08-22 20:43:46 +02:00
Kamil Śliwak
a4d777643d fixup! Change semantic tests to use the proper via IR pipeline, without rerunning on exceptions 2023-08-22 20:19:20 +02:00
Kamil Śliwak
38decf05dd Update gas expectations 2023-08-22 20:00:03 +02:00
Kamil Śliwak
ffd495bd89 Increase gas in call_options_overload test to make it pass on homestead
- After the test framework changes it fails via Yul on Homestead but passes on all other EVM versions and on legacy. The test itself does not seem to be testing these specific numbers so and increasing them resolves the problem.
2023-08-22 20:00:03 +02:00
Daniel Kirchner
b9db435684 Rerun SolidityEndToEndTest.cpp tests on stack errors. 2023-08-22 20:00:03 +02:00
Kamil Śliwak
bc6d10f11d SemanticTest: Add a setting that explicitly states the minimal Yul optimization level that avoids "Stack too deep" 2023-08-22 20:00:00 +02:00
Daniel Kirchner
8e9496eb8b Change semantic tests to use the proper via IR pipeline, without rerunning on exceptions 2023-08-22 19:58:31 +02:00
Kamil Śliwak
60b18a13d2
Merge pull request #14507 from ethereum/circleci-config-commands
Refactor CircleCI config to define proper commands for reused fragments
2023-08-22 17:36:11 +02:00
Kamil Śliwak
af6d7793fb CI: Remove redundant ./ prefixes from script invocation and path arguments 2023-08-22 15:51:13 +02:00
Kamil Śliwak
97f206ea89 CI: Add persist_executables_to_workspace_osx 2023-08-22 15:47:22 +02:00
Kamil Śliwak
ccf2896594 CI: Remove store_artifacts_solc_windows
- For consistency: other things are also hard-coded in the Windows jobs
2023-08-22 15:47:22 +02:00
Kamil Śliwak
e57581e730 CI: Convert multi-step templates into proper commands 2023-08-22 15:47:22 +02:00
Kamil Śliwak
3d9f633bcd CI: Convert artifact templates to commands 2023-08-22 15:47:22 +02:00
Kamil Śliwak
d0dc9e7af0 CI: Convert single-step templates into proper commands 2023-08-22 15:47:22 +02:00
Kamil Śliwak
a442f0608a CI: Remove store_test_results to make naming less confusing 2023-08-22 15:47:22 +02:00
Daniel
06b003b23c
Merge pull request #14504 from Saw-mon-and-Natalie/fix-known-state-typo
fixed a typo in `KnownState.h`
2023-08-22 15:21:34 +02:00
Saw-mon & Natalie
9ae42aab4c fixed a typo in KnownState.h 2023-08-22 14:37:11 +02:00
Kamil Śliwak
c703b5cd8c
Merge pull request #14479 from ethereum/remove-error-recovery
Remove parser error recovery mode
2023-08-22 12:47:06 +02:00
Kamil Śliwak
9adbced98e Remove parser error recovery mode 2023-08-22 12:00:11 +02:00
Daniel
c96db51013
Merge pull request #14309 from ethereum/astPropertyTests
AST Property tests
2023-08-21 19:21:20 +02:00
Daniel
664baa9e6b
Merge pull request #14329 from ethereum/remove-ast-output-in-error-recovery-mode
Remove AST output in error recovery mode
2023-08-21 18:38:57 +02:00
Kamil Śliwak
36429e397c Fix ICE when requesting --combined-json outputs other than AST with --stop-after parsing 2023-08-21 17:50:41 +02:00
Kamil Śliwak
b17757ea17 CompilerStack: Extend inconsistent error sanity check to cover stopAfter: parsing as well 2023-08-21 17:50:41 +02:00
Kamil Śliwak
a15ef59eec Remove the ability to produce an AST in presence of errors in --error-recovery mode
This reverts commit 7fd7cc1e76.
2023-08-21 17:50:41 +02:00
Kamil Śliwak
e8d050a1ce Simplify redundant state check in CompilerStack::analyze() 2023-08-21 17:50:41 +02:00
Matheus Aguiar
969aea6d33 Added new kind of test: check for specific properties of AST 2023-08-21 12:37:40 -03:00
Kamil Śliwak
ee21b03e6c
Merge pull request #14500 from ethereum/fix-isoltest-update-loop-on-short-expectations
Fix infinite isoltest expectation update loop on values not taking full slots
2023-08-21 14:19:20 +02:00
Kamil Śliwak
d2f86ffb16
Merge pull request #14499 from ethereum/purge-using-namespace-std-from-libsolutil
Purge using namespace std from libsolutil
2023-08-18 12:56:01 +02:00
Nikola Matic
ad7932555d Purge using namespace std from libsolutil 2023-08-18 12:10:43 +02:00
Kamil Śliwak
397a5543a4 fixup! BytesUtils: Don't introduce garbage when formatting byte vectors shorter than expected 2023-08-17 20:45:16 +02:00
Kamil Śliwak
0f5aacefa0 BytesUtils: Don't format parameters shorter than 32 bytes as integers 2023-08-17 20:00:54 +02:00
Kamil Śliwak
368ea01bb2 BytesUtils: Don't introduce garbage when formatting byte vectors shorter than expected 2023-08-17 20:00:44 +02:00
Kamil Śliwak
ef5f131862
Merge pull request #14480 from ethereum/refactor-preamble
Unify preamble injection in `AnalysisFramework`
2023-08-17 18:32:51 +02:00
Kamil Śliwak
2baf9d4d82 Put stripPreReleaseWarning() next to withPreamble() 2023-08-17 17:39:27 +02:00
Kamil Śliwak
ec92685bcb Unify preamble handling between AnalysisFramework and SolidityExecutionFramework 2023-08-17 17:39:27 +02:00
Kamil Śliwak
18db62cf41 Unify preamble handling between test cases based on AnalysisFramework 2023-08-17 17:39:27 +02:00
Kamil Śliwak
0c2fce579a Take into account multi-line license comments when adding preamble in test frameworks 2023-08-17 17:39:27 +02:00
Kamil Śliwak
69e5b634ea
Merge pull request #14450 from criadoperez/fix/criadoperez2
Fix typo in a docstring in `libyul/AsmAnalysis.h`
2023-08-16 21:24:11 +02:00
Alejandro Criado-Pérez
9f237d38a6 Corrected text 2023-08-16 20:34:13 +02:00
Nikola Matić
25fc3aa32f
Merge pull request #14493 from ethereum/purge-using-namespace-from-libsolidity-lsp-parsing
Purge using namespace from libsolidity/lsp and parsing
2023-08-16 18:15:28 +02:00
Daniel
8031be1109
Merge pull request #14496 from ethereum/removeDeadMainFunctionStep
Remove obsolete main function yul optimiser step.
2023-08-16 18:14:34 +02:00
Daniel Kirchner
aaba5c408a Remove obsolete main function yul optimiser step. 2023-08-16 17:28:32 +02:00
Nikola Matic
f344dc164e Purge using namespace from libsolidity/lsp and parsing 2023-08-16 17:07:52 +02:00
Nikola Matić
310794089a
Merge pull request #14492 from ethereum/purge-using-namespace-from-libsolidity-interface
Purge using namespace std from libsolidity/interface
2023-08-16 17:05:16 +02:00
Nikola Matic
342ba0324f Purge using namespace std from libsolidity/interface 2023-08-15 15:45:15 +02:00
Daniel
579259d6e1
Merge pull request #14491 from ethereum/purge-using-namespace-from-libsolidity-formal
Purge using namespace from libsolidity/formal
2023-08-15 15:33:55 +02:00
Nikola Matic
d0a5556fd0 Purge using namespace from libsolidity/formal 2023-08-15 14:40:27 +02:00
Daniel
f085572e24
Merge pull request #14490 from ethereum/purge-using-namespace-std-from-libsolidity-codegen
Purge using namespace std from libsolidity/codegen
2023-08-15 14:19:14 +02:00
Nikola Matic
ce423e5ae5 Purge using namespace std from libsolidity/codegen 2023-08-14 21:37:31 +02:00
Daniel
d8cc2c62f3
Merge pull request #14489 from ethereum/purge-using-namespace-from-libsolidity-ast
Purge using namespace std from libsolidity/ast
2023-08-14 15:44:00 +02:00
Nikola Matic
2a2a9d37ee Purge using namespace std from libsolidity/ast 2023-08-14 14:54:58 +02:00
Nikola Matić
b4d4b49dca
Merge pull request #14488 from ethereum/purge-using-namespace-std-from-libsolidity-analysis
Purge using namespace std from libsolidity/analysis
2023-08-14 14:53:32 +02:00
Nikola Matic
de1a017ccb Purge using namespace std from libsolidity/analysis 2023-08-14 11:44:50 +02:00
Kamil Śliwak
c50c9b2c43
Merge pull request #14482 from ethereum/fix-error-ids-in-format-errors
Fix error IDs in `AnalysisFramework::formatErrors()`
2023-08-11 20:37:47 +02:00
Kamil Śliwak
339053f185 AnalysisFramework.formatErrors(): Fix _withErrorIds flag not having any effect 2023-08-11 14:15:56 +02:00
Kamil Śliwak
a59fc39f10 Use printErrorInformation() over printExceptionInformation() where possible 2023-08-11 14:15:56 +02:00
Kamil Śliwak
4020552e1d SourceReferenceFormatter: Remove the ineffective _withErrorIds parameter from formatExceptionInformation() 2023-08-11 14:15:56 +02:00
Kamil Śliwak
8407c8c615 SourceReferenceFormatter: Support full range of options in formatErrorInformation() 2023-08-11 14:15:56 +02:00
Kamil Śliwak
b7d2c8bb0a SourceReferenceFormatter: Line wrapping and unused includes 2023-08-11 14:15:56 +02:00
Kamil Śliwak
3edf91adc8
Merge pull request #14478 from ethereum/set-soltest-cpus-in-circleci-config
Set CPUs for `soltest.sh` based on the number of available cores
2023-08-09 11:58:55 +02:00
Kamil Śliwak
ec240c6422 CI: Set CPUs for soltest.sh based on the number of available cores 2023-08-09 11:12:31 +02:00
Kamil Śliwak
e357b8bc42
Merge pull request #14474 from ethereum/refactor-analysis-framework-error-filtering
Sane error filtering in `AnalysisFramework`
2023-08-07 20:02:45 +02:00
Daniel
0fbc5cc7d3
Merge pull request #14469 from ethereum/push0-rematerializer
Push0 rematerializer
2023-08-07 18:26:08 +02:00
Nikola Matic
96e7b4f46b Rematerialize zero literals 2023-08-07 17:33:16 +02:00
Kamil Śliwak
65587d87c9
Merge pull request #14473 from ethereum/refactor-syntax-test-setup
Refactor syntax test setup
2023-08-07 17:30:58 +02:00
Kamil Śliwak
6d8b1374c5 Use AnalysisFramework's error formatting and filtering features in more test cases 2023-08-07 14:40:34 +02:00
Kamil Śliwak
e42242cd6f AnalysisFramework.formatErrors(): Require providing errors explicitly 2023-08-07 14:40:34 +02:00
Kamil Śliwak
6c1bcb9a81 AnalysisFramework.formatErrors(): Support colored output and error IDs 2023-08-07 14:26:23 +02:00
Kamil Śliwak
6f3a379557 AnalysisFramework: Add filteredErrors() 2023-08-07 14:26:23 +02:00
Kamil Śliwak
e62bc30e9e AnalysisFramework.filterErrors(): Provide default for _includeWarningsAndInfos 2023-08-07 14:26:23 +02:00
Kamil Śliwak
f87bef2431 AnalysisFramework: Make it possible to customize CompilerStack creation 2023-08-07 14:06:16 +02:00
Kamil Śliwak
aecb11eff4 Make better use of virtual functions to customize CommonSyntaxTest in test cases based on it 2023-08-07 14:05:43 +02:00
pgebal
511712570b
Merge pull request #14464 from pgebal/pgebal/fix_require
SMTChecker: Fix inconsistency on constant condition check after a loop is unrolled
2023-08-03 16:12:02 +02:00
Pawel Gebal
6574c10f25 SMTChecker: Visit the condition in for and while loops after loop is unrolled 2023-08-03 13:36:41 +02:00
Paul Wackerow
ead0615ca3
add site_url root path to images [Fixes #14435] (#14462) 2023-08-02 11:41:18 +01:00
Daniel
2c70255617
Merge pull request #14455 from ethereum/fix-yul-id
Yul AST IDs should start from 0 instead of 1.
2023-08-01 17:37:21 +02:00
r0qs
ea7ee3d5fe
Fix yul ast ID to 0 instead of 1. 2023-07-28 17:48:35 +02:00
franzihei
451232985b
re-upload original solidity logo to brand guide (#14451) 2023-07-27 14:04:07 +01:00
pgebal
80d0a979ac
Merge pull request #14448 from pgebal/pgebal/fix_for_loop_iterations
SMTChecker fix: Do not unroll loop after it completes
2023-07-26 17:45:44 +02:00
Pawel Gebal
db5baebff8 SMTChecker fix: Do not unroll loop after it completes 2023-07-26 16:31:03 +02:00
Paul Wackerow
0fa594e501
fix docs layout and link bugs [Fixes #14436] (#14439)
using cdnfonts import instead

fix mobile menu layout

fix mobile content positioning/sizing

fix desktop content widths

prevent header links from wrapping

update desktop positioning

fix backdrop-filter

move to .unified-header::before

feat: independent scrolling for content and menu
2023-07-26 14:17:38 +01:00
Martin Blicha
95beef4072
Merge pull request #14446 from ethereum/smt-cex-tests
SMTChecker tests: Keep counterexamples when updating expectations
2023-07-25 19:52:26 +02:00
Martin Blicha
cdfc19b503 SMTChecker: Bring back counterexample checks in regression tests
Since the default is now to ignore the counterexamples when checking
test output, we bring back counterexample checks in tests where the
counterexample is (mostly) deterministic.
2023-07-25 12:26:21 +02:00
Martin Blicha
2e38798408 SMTChecker: Keep counterexamples on test expectation update 2023-07-24 18:36:18 +02:00
Paul Wackerow
83fe3d4011
update GH edit path to develop branch (#14437) 2023-07-24 15:48:39 +01:00
Paul Wackerow
4fa48a6eb1
patch other-version menu overflow [Fixes #14429] (#14431) 2023-07-24 15:48:18 +01:00
Kamil Śliwak
89407d253d
Merge pull request #14315 from shalaamum/doc-fixes
docs: Fixes for some minor mistakes/typos
2023-07-22 00:11:18 +02:00
shalaamum
b4407d90a5 Small documentation fixes 2023-07-21 23:23:20 +02:00
Kamil Śliwak
548b033af6
Merge pull request #14434 from ethereum/fix-natspec-event-ice
Fix ICE when emitting event from another contract
2023-07-21 23:18:37 +02:00
Nikola Matic
964bdc711c Fix ICE when emitting event from another contract 2023-07-21 21:49:09 +02:00
Kamil Śliwak
957a9e742b
Merge pull request #13873 from ethereum/foundry-prbmath-external-test
Foundry prbmath external test
2023-07-21 21:48:49 +02:00
r0qs
dcbd645798
Delete old prb-math.sh script 2023-07-21 20:25:58 +02:00
r0qs
ab4f5f2983
Initial prototype of prb-math external tests using foundry rewritten in python
Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
2023-07-21 20:25:58 +02:00
r0qs
ecd56e6129
Merge pull request #14441 from ethereum/pylint-notes-config
Add TMP and remove TODO and FIXME from pylint note tags list
2023-07-21 17:58:31 +02:00
r0qs
927eddee84
Add TMP and remove TODO and FIXME from pylint note tags list 2023-07-21 15:55:47 +02:00
Nikola Matić
f466e1ef5e
Merge pull request #14428 from ethereum/update-release-checklist
Update solidity-website links in release checklist
2023-07-20 08:42:53 +02:00
Kamil Śliwak
ceb6587692
Merge pull request #14426 from omahs/typos
Fix minor typos
2023-07-19 18:19:16 +02:00
omahs
5b72c4f494 Fix typos 2023-07-19 17:12:15 +02:00
r0qs
b2ce8898ea Update solidity-website links in release checklist 2023-07-19 16:43:39 +02:00
Nikola Matić
d268c3f5b3
Merge pull request #14423 from ethereum/set-version-to-0.8.22
Set version to 0.8.22
2023-07-19 14:01:50 +02:00
Nikola Matic
c2670e4afb Set version to 0.8.22 2023-07-19 11:03:17 +02:00
Nikola Matić
d9974bed71
Merge pull request #14427 from ethereum/set-release-date-version-0.8.21
Set release date for 0.8.21
2023-07-19 10:56:46 +02:00
Nikola Matić
ce1453b8f8
Merge pull request #14422 from ethereum/sort-changelog-for-0.8.21
Sort Changelog for 0.8.21 release
2023-07-19 10:51:53 +02:00
Nikola Matic
601104ea94
Sort Changelog for 0.8.21 release 2023-07-19 10:00:34 +02:00
Nikola Matic
09628b7502 Set release date for 0.8.21 2023-07-19 09:27:09 +02:00
Nikola Matić
1acebf78ee
Merge pull request #14424 from ethereum/missing-changelog-entries
Add missing changelog entries
2023-07-18 21:43:24 +02:00
Martin Blicha
f622a6c514 Add missing changelog entries 2023-07-18 20:28:52 +02:00
Nikola Matić
9206885bdd
Merge pull request #14421 from ethereum/fix-broken-docs-links
Fix broken links in docs
2023-07-18 19:15:14 +02:00
Nikola Matić
2a46e2fedc
Merge pull request #14366 from ethereum/selectorSideEffects
Always generate code for .selector member access.
2023-07-18 19:14:30 +02:00
Nikola Matic
aba7d1769c Fix broken links in docs 2023-07-18 18:25:48 +02:00
r0qs
86602852be Add buglist entry
Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
2023-07-18 18:15:32 +02:00
Daniel Kirchner
5c7214cbe3 Always generate code for .selector member access. 2023-07-18 18:15:32 +02:00
Nikola Matić
64427412c4
Merge pull request #14347 from ethereum/fixTypeCheckingAbiDecode
Disallow the use of `TypeType` in complex expressions
2023-07-18 18:14:45 +02:00
Nikola Matić
23fb9bc3a6
Merge pull request #14367 from ethereum/functionTypeMobileType
Restrict mobile types of function types.
2023-07-18 17:55:02 +02:00
Nikola Matic
82cb5338a9 Relax delegatecall type restriction plus test 2023-07-18 17:07:13 +02:00
Daniel Kirchner
110e2a656d Restrict mobile types of function types.
Move ternary tests to semanticTests
2023-07-18 14:13:36 +02:00
Matheus Aguiar
4fd5bbf50b Restrict mobileType of TypeType 2023-07-18 12:58:11 +02:00
Kamil Śliwak
2c82873a2c
Merge pull request #14371 from ethereum/overrideMagicType_mobileType
Disallow the use of `MagicType` in complex expressions
2023-07-18 12:57:39 +02:00
Matheus Aguiar
f3fc19080a Override mobileType of MagicType to null 2023-07-18 10:56:02 +02:00
Kamil Śliwak
4c4410e0c5
Merge pull request #14365 from ethereum/declarationFunctionTypeConversions
Disallow conversions between declaration function types.
2023-07-17 19:21:29 +02:00
Daniel Kirchner
0ab0842c29 Disallow conversions between declaration function types. 2023-07-17 18:33:07 +02:00
Kamil Śliwak
755110aed4
Merge pull request #14407 from ethereum/fix-inliner-argument-order-bug
Fix ``FullInliner`` not preserving evaluation order of call arguments
2023-07-17 18:32:50 +02:00
Kamil Śliwak
735326d50d Properly document FullInliner's prerequisites 2023-07-17 16:40:43 +02:00
Kamil Śliwak
ba3f9dd2a2 FullInliner: Do not include calls whose arguments may have side-effects 2023-07-17 16:40:43 +02:00
Kamil Śliwak
5e1e0e7752 FullInliner: Fix order of arguments of inlined functions 2023-07-17 16:40:43 +02:00
Kamil Śliwak
a07f6c443a Tests for Yul argument evaluation order after optimization 2023-07-17 16:40:43 +02:00
Kamil Śliwak
edceb4d2d1 Allow testing FullInliner without ExpressionSplitter 2023-07-17 16:40:43 +02:00
Kamil Śliwak
96bb39d1b4
Merge pull request #14304 from ethereum/relax-restrictions-on-immutable-initialization-outside-functions-and-modifiers
Relax restrictions on immutable initialization (outside of functions and modifiers)
2023-07-17 16:38:57 +02:00
Paul Wackerow
11be2f4881
Squashed commit of the following: (#14401)
commit 6f38009a31b2ff5d6f53de7b74469f495fe04092
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Mon Jul 10 15:36:03 2023 -0700

    remove default sphinx footer

commit 0d842749566f40fa8c2dd434fa67bcc5e9df3aa0
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Mon Jul 10 15:21:26 2023 -0700

    linting

commit c8484ac7c1f54067b0d3c4aa4aa81de7d36df71d
Merge: 8339800d0 b583e9e64
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Mon Jul 10 14:15:03 2023 -0700

    Merge branch 'develop' into docs-rebrand

commit 8339800d0fdd197f589337e1198867d4198a3850
Merge: 633c673c5 88d5e06d4
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Mon Jul 10 14:11:58 2023 -0700

    Merge branch 'rebrand' into docs-rebrand

commit 88d5e06d4ce79696b9451991b33834ecc55bf66d
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Mon Jul 10 14:11:52 2023 -0700

    remove dev code

commit 633c673c5e227009917d888e1f0991f33aa75f44
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Mon Jul 10 14:02:25 2023 -0700

    update home url poitner to production domain

commit b3689cb7c230e1fb3a97400e5412ec14c34fc586
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Mon Jul 10 13:59:34 2023 -0700

    fix external link arrow to match core site

commit b7a28a5dfe7517a88870afe67783e9e300b85af4
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Mon Jul 10 13:59:19 2023 -0700

    swap in cdnfonts for overpass fonts

commit e979ad5c9f69c9c7ee369a0700a64ea6d9061c2b
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Mon Jul 10 08:30:48 2023 -0700

    fix external link arrow spacing/underline

commit b90077863cfff5d8776f5dc74f82f061e0162d37
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Thu Jul 6 16:26:28 2023 -0700

    update foot note

commit ed9ddfd327cd0e382286abf0c8896c7c879512b2
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Thu Jul 6 13:12:14 2023 -0700

    update nav link hover color

commit 077d3a0c9333c96cbabc3ce2bccf00afac19a312
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Tue Jul 4 20:27:05 2023 -0700

    bug fixed for header/nav-link styling

commit 2584dd2e419255ec93430446bd049ff90155987e
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Tue Jul 4 12:15:09 2023 -0700

    fix link shift bug

commit 885d2bc52ca3ed9e4727d7f0eaed0e312fedaaaa
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Tue Jul 4 12:13:03 2023 -0700

    update nav link hover styling

commit d06c81592ad88ad2e81701cec9e85b6a3cee86ee
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Mon Jul 3 18:25:37 2023 -0700

    extract event listener functions

commit 414e444ee67fe937d1295b14ac8591a710bfbdff
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Mon Jul 3 18:22:08 2023 -0700

    a11y: skip to content link

commit 6c628ea73995dad9b9a6fb502bb216d88f0e9602
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Sun Jul 2 21:57:24 2023 -0700

    fine-tuning more styling

commit 71b617abaf27c34fcecaf6e30795687abf9885f7
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Sun Jul 2 21:37:02 2023 -0700

    fix primary link color

commit d90627418c605bff4398a9e24ae0c5c685f73992
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Sun Jul 2 21:21:30 2023 -0700

    fix mobile versions expansion

commit f0f0fbbcb74ea35efa6e4cf87ab1d855f1ae2bd2
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Sun Jul 2 21:21:16 2023 -0700

    update code styling

commit 727c7ee9b69427eddd73012a89e6ee9ae1ccec8d
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Sun Jul 2 21:20:38 2023 -0700

    remix link styling

commit 4059c00e3d704002ef34f85fd86495f2a4ac9e57
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Sun Jul 2 21:19:49 2023 -0700

    fix whitespace styling

commit 631e2910a53484b97770cad1b3439d412a0ab6d0
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Sun Jul 2 20:33:54 2023 -0700

    fix search input styling

commit 5e06b22a7200b0774bd135c666b4e3437d342350
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Sun Jul 2 19:37:19 2023 -0700

    css adjustments

commit 637d5122038fd6075cd53d57537d728b730acbcf
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Sun Jul 2 19:15:05 2023 -0700

    selector adjustments, linting

commit 781dc7c3009dc406b36cd2bdcb2d02c3c34fafa6
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Sun Jul 2 18:26:09 2023 -0700

    top version/search layout adjustments

commit 7341e17003700133659e5f64ee2d1369ac50e434
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Sun Jul 2 18:18:21 2023 -0700

    update version div styling

commit 3a4b3feb581b1799e48d395b73aca05760dc5658
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Sat Jul 1 21:18:12 2023 -0700

    restyle external link arrow for forum link

commit e6cef6312ca73c125c01b78573f21c75fcbbfc87
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Sat Jul 1 20:50:31 2023 -0700

    add woff2 fonts, use absolute font urls

commit 3bc401b1dbe971501826011a692c38ee9ce4b992
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Sat Jul 1 15:15:26 2023 -0700

    fix nav button alignment

commit b7d607b7090e1ac6ded55ac6e534549609226236
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Fri Jun 30 19:02:24 2023 -0700

    rename pcm param to color

commit d67e23539f720250bb298c11fd2b1b6d7dbb0815
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Fri Jun 30 17:34:56 2023 -0700

    center align footer buttons, fix bug on pre text

commit 34a665038dc27e2b8874b3e16ffc581c33f31bc5
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Thu Jun 29 16:40:26 2023 -0700

    preload fonts

commit 5b987c31455ffe02135e357ea560bbad8a9c6745
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Thu Jun 29 15:31:41 2023 -0700

    antialiased font smoothing

commit 9585fb5bb73f67e37a4f9f1da83e7b133f0b4446
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Thu Jun 29 13:44:51 2023 -0700

    search results styling

commit 224ed028b181b3944d2f2e33f4122b15f38f7608
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Thu Jun 29 13:29:09 2023 -0700

    restore search functionality

commit ec5782a01cd0f1c1808b353560c39911c9fdc645
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Wed Jun 28 21:55:11 2023 -0700

    more mobile menu and styling fixes

commit c033f05e2ab839309e7d3864ae66c465d801e806
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Wed Jun 28 13:14:22 2023 -0700

    patch location cleaner

commit 6cae3b5ad67e38f6decfa18eeacce973783a2fc1
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Tue Jun 27 17:49:28 2023 -0700

    patch location cleaner

commit e86e6a11189ed57f122382c901fe7a0f49518e83
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Tue Jun 27 17:40:11 2023 -0700

    color mode continuity

commit c3ba4ee6c614fa637a34eacbae60c5e88cd018c5
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Tue Jun 27 15:32:11 2023 -0700

    refactor layout

commit ac3bae8f34ccbd08f68cb784b3ec00bad70a9281
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Mon Jun 26 14:35:00 2023 -0700

    color and styling updates

commit 42e301818d3d11152c5ce630c8085db1c1664a13
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Mon Jun 26 13:23:03 2023 -0700

    highlight active nav link

commit fb72573c01494486ab9b0942c3f67c372af0d5e6
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Mon Jun 26 12:34:25 2023 -0700

    patch mobile menu bottom scroll stop

commit 2dcef754301d35143ea24ca197906c974e128a25
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Mon Jun 26 12:32:38 2023 -0700

    adjust header icon sizes

commit dc75b636b7f442dfe7aaa80ad82470be0f3d4f19
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Sun Jun 25 21:41:18 2023 -0700

    fix header icon sizes

commit de70f1a56eba85c89c1f01f37770b1d6bd91d5db
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Sun Jun 25 19:58:18 2023 -0700

    mobile meun debugging

commit 1fe20565a838c2f2212cd95045cd309b076c8b2b
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Sat Jun 24 13:21:23 2023 -0700

    icon color mode improvements

commit fcb134a4209371277693e919fb06eaeb53e36cb6
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Sat Jun 24 11:51:24 2023 -0700

    initialize with menu closed

commit defa7c78e981037409ec9d2b9ab871910023f5b0
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Sat Jun 24 11:37:47 2023 -0700

    color toggle and mobile menu

commit 695d719612be0ed9cac0f246f0eaf91f3fdb2e75
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Fri Jun 23 16:39:32 2023 -0700

    forum url as external link

commit ad182602095909d84331339993b31f2a37bf1cd7
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Fri Jun 23 16:28:14 2023 -0700

    patch contributing path

commit fbfeaa7a12a1b9bc86b766a0e490b85d2ded8849
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Fri Jun 23 16:20:57 2023 -0700

    update contribute path

commit f7dbf1f2e0a3e31d164d6cc67c952f89c3f8f49e
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Fri Jun 23 16:05:22 2023 -0700

    dev: point to vercel build for new solidity site

commit c344c1df86e78ad6ab9bc066ac75659180d068cf
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Fri Jun 23 14:30:40 2023 -0700

    update stylesheets, constants, logos

commit c15135378c8568ed93bf685552940cdbe1c07b70
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Fri Jun 23 10:25:05 2023 -0700

    bg color cleanup

commit c049df77d9d55adc796bc2f8cd7c186d833aca69
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Thu Jun 22 19:02:49 2023 -0700

    clean up initialize and toggle scripts

    deprecate dark.css in lieu of a dark more html attribute indicator and css selectors for this attribute. Avoids needing to enable/disable dark stylesheet

commit 881c9cce66e18d30b50c467a22d98836698f5b58
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Thu Jun 22 18:59:24 2023 -0700

    import type faces

commit e9b26157aabf4374754cf14d9a4a980c92bd139c
Author: Paul Wackerow <54227730+wackerow@users.noreply.github.com>
Date:   Thu Jun 22 15:39:00 2023 -0700

    implement initial styling adjustments
2023-07-14 19:31:06 +01:00
Kamil Śliwak
e70e595ce7
Merge pull request #14355 from ethereum/via-ir-bytecode-comparison
Via IR bytecode comparison
2023-07-14 17:26:13 +02:00
Kamil Śliwak
dad2bf6472 Relax restrictions on immutable initialization 2023-07-14 15:29:32 +02:00
Kamil Śliwak
490b90d0ab Implement ImmutableItem::setToZero() to make delete work with immutables 2023-07-14 15:29:32 +02:00
Kamil Śliwak
0afe025f19 Minor tweaks to immutable tests for better diffs 2023-07-14 15:29:32 +02:00
Kamil Śliwak
bccfcd40a0 prepare_report: Add YulException to the list of ICEs for which we ignore Standard JSON outputs even when present 2023-07-14 15:28:11 +02:00
Kamil Śliwak
23955ba428 CI: Workaround for some test cases crashing the compiler via IR during bytecode comparison due to a regex-related bug 2023-07-14 15:28:11 +02:00
Kamil Śliwak
ae3b7625c9 CI: Include via IR presets in the bytecode comparison 2023-07-14 15:28:11 +02:00
Kamil Śliwak
ea724071b1 prepare_report: Add viaIR presets 2023-07-14 15:28:11 +02:00
Nikola Matić
703fa6c8b5
Merge pull request #14411 from ethereum/fix-openzeppelin-missing-test
Remove missing test from OZ script
2023-07-14 14:08:55 +02:00
Nikola Matic
1628678de2 Remove missing test from OZ script 2023-07-14 13:22:06 +02:00
Nikola Matić
ebc2bc9e23
Merge pull request #14382 from minaminao/fix-docs
docs: fix unintentionally commented out warning block
2023-07-13 12:28:33 +02:00
Kamil Śliwak
3fc2eadbdb
Merge pull request #14374 from ethereum/fix-non-deterministic-ir-function-generation-order
Fix undefined order of functions when generating code for index expressions
2023-07-13 12:20:01 +02:00
Kamil Śliwak
5b70830a64 IRGeneratorForStatements: Small refactor in endVisit(IndexAccess) for readability 2023-07-13 11:07:40 +02:00
Kamil Śliwak
16220db759 IRGeneratorForStatements: Fix undefined order of functions when generating code for index expressions 2023-07-13 11:06:11 +02:00
Nikola Matić
69c034b1c0
Merge pull request #14410 from ethereum/purge-using-namespace-std-in-libsmtutil-libsolc
Purge using namespace std in libsmtutil and libsolc
2023-07-12 15:33:18 +02:00
Nikola Matic
62723b7534 Purge using namespace std in libsmtutil and libsolc 2023-07-12 14:09:19 +02:00
Nikola Matić
1ac883b84d
Merge pull request #14409 from ethereum/purge-using-namespace-from-liblangutil
Purge using namespace std from liblangutil
2023-07-12 12:10:27 +02:00
Nikola Matic
e81f2bdbd6 Purge using namespace std from liblangutil 2023-07-12 11:24:21 +02:00
Nikola Matić
8390a24e30
Merge pull request #14408 from ethereum/check-style-for-using-namespace-std-v2
Check style coverage for using namespace std
2023-07-12 11:21:37 +02:00
matheusaaguiar
b29d8a429c
Merge pull request #14391 from alpinevm/patch-2
Update compiler standard input docs to include shanghai in the available evm version options
2023-07-11 17:50:45 -03:00
Nikola Matic
c1ca2bf9d2 Check style coverage for using namespace std 2023-07-11 20:28:21 +02:00
Kamil Śliwak
b583e9e64d
Merge pull request #14398 from ethereum/fix-welcome-contributors
Remove token requirement from external contributor greeter
2023-07-10 18:19:02 +02:00
r0qs
919408901d
Remove token requirement from external contributor greeter 2023-07-10 16:26:18 +02:00
Cliff Syner
09c30566eb
Formatting docs/using-the-compiler.rst
Co-authored-by: Nuno Santos <nunofilipesantos@gmail.com>
2023-07-10 09:20:10 -05:00
minaminao
ce0fbae00b fix docs
Co-authored-by: r0qs <rodrigo.saramago@protonmail.com>
2023-07-10 21:22:10 +09:00
Daniel
b84af3f420
Merge pull request #14394 from ethereum/purge-using-namespace-std
Purge using namespace std in libevmasm
2023-07-10 13:59:11 +02:00
Nikola Matic
a9c8b4b4d1 Purge using namespace std 2023-07-10 13:12:46 +02:00
Kamil Śliwak
27faacb72c
Merge pull request #14390 from criadoperez/fix/criadoperez
Fixed typo in protoToAbiv2.h
2023-07-10 12:35:18 +02:00
Cliff Syner
58a4296989
Update using-the-compiler.rst
Reflect all available evm options in compiler standard input docs
2023-07-10 00:33:05 -05:00
Alejandro Criado-Pérez
29358806f4
updated protoToAbiv2.h 2023-07-09 01:45:54 +02:00
Bhargava Shastry
5d7533b540
Merge pull request #14227 from ethereum/update-codegen-fuzzer
Stack optimizer fuzzer: Detect stack-too-deep during optimization
2023-07-03 14:52:27 +02:00
Leo
2f451a186b
Merge pull request #14377 from ethereum/fix-smtlib
SMTChecker: Fix generation of smtlib scripts
2023-06-30 16:58:26 +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
Daniel
30cd1a0fb4
Merge pull request #14370 from ethereum/smt-cleanup
Remove ReasoningBasedSimplifier from libyul
2023-06-28 16:31:13 +02:00
Martin Blicha
29041c8101 Remove ReasoningBasedSimplifier from libyul
Due to a design decision to move away from a bundled SMT solver,
ReasoningBasedSimplifier in its current form cannot be use any longer.
This is a necessary step to allow a unified way to call solvers using
only SMTLIB interface.

Since this optimization pass has always been marked as highly
experimental and never turned on by default, it should be OK to remove
it.
2023-06-28 14:38:36 +02:00
r0qs
c819243374
Merge pull request #14368 from ethereum/gh-built-in-triage-automation
Remove triage workflow in favor of github built-in automation
2023-06-28 12:37:49 +02:00
Kamil Śliwak
3bb492a28d
Merge pull request #14351 from ethereum/ci-deduplicate-base-env-with-anchors
Deduplicate environment variables in CI
2023-06-27 14:43:24 +02:00
Kamil Śliwak
8b64195d4b CI: Make jobs extend base environments instead of redefining them
- Also remove variables that are now redundant.
- Note that this adds new variables for jobs that previously did not have them. This should not affect behavior because we were simply omitting those variables where they were not necessary.
2023-06-27 14:00:28 +02:00
Kamil Śliwak
793adc8106 CI: Define base environments in terms of environments of dicts they depend on 2023-06-27 13:56:36 +02:00
Kamil Śliwak
d12a981ba8 CI: Define aliases for all the base environment dicts 2023-06-27 13:56:36 +02:00
Leo
2cf03e3f0b
Merge pull request #14344 from pgebal/pgebal/fix-ice-internal-type
Fix error in SMTChecker: Use rich indentifier instead of external identifier to encode member access to functions
2023-06-27 12:31:25 +02:00
Bhargava Shastry
87d0c84960 Stack optimizer fuzzer: Detect stack-too-deep during optimization
Co-authored-by: r0qs <deepmarolaest@gmail.com>
2023-06-27 10:32:23 +02:00
r0qs
a4777937ed
Remove triage workflow in favor of github built-in automation 2023-06-26 22:53:29 +02:00
Daniel
34d2383f28
Merge pull request #14281 from alexjorgef/patch-1
Change installation documentation for Arch Linux
2023-06-26 19:42:11 +02:00
Alexandre Ferreira
b70477d795
Change installation documentation for Arch Linux
Correct inline code with double backquotes


Add more information

Add external links to packages;
Add a note to inform that packages don't have official support.
2023-06-26 17:58:03 +01:00
Daniel
1067232bbc
Merge pull request #14354 from ethereum/parallelize-bytecode-compare-presets
Parallelize optimized and unoptimized bytecode reports in CI
2023-06-26 12:57:52 +02:00
Kamil Śliwak
92816eb6c5 CI: Generate optimized and unoptimized bytecode reports in parallel 2023-06-26 10:53:29 +02:00
Kamil Śliwak
dabecb600f
Merge pull request #14353 from ethereum/unify-and-simplify-bytecode-report-generation-in-ci
Unify and simplify bytecode report generation in CI
2023-06-26 10:50:48 +02:00
Kamil Śliwak
45c2ffcd55 CI: Merge prepare_bytecode_report and storebytecode.sh script into a new script and use it for all platforms in CI 2023-06-23 19:49:54 +02:00
Kamil Śliwak
69ffcfc242 CI: Move bytecode report comparison logic to a script 2023-06-23 19:49:54 +02:00
Kamil Śliwak
ea1327707b CI: Don't use requires_nothing for jobs that explicitly state what they require 2023-06-23 19:49:54 +02:00
Kamil Śliwak
aca4c86a23
Merge pull request #14350 from ethereum/bytecode-report-presets
Bytecode report presets
2023-06-23 19:49:07 +02:00
Kamil Śliwak
10670d6286 prepare_report: Replace hard-coded optimize setting with selectable presets 2023-06-23 19:00:30 +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
f9a3c094a6
Merge pull request #14330 from ethereum/parallelize-bytecode-compare
Generate CLI and Standard JSON bytecode reports in parallel
2023-06-23 11:06:51 +02:00
Kamil Śliwak
3b80aa2ea4 Run Standard JSON and CLI bytecode report generation in parallel 2023-06-23 09:17:53 +02:00
Kamil Śliwak
e8c4d0e324 More consistent file naming for bytecode compare artifacts
- This will make it easier to have a single variable specifying the interface.
2023-06-23 09:17:53 +02:00
Kamil Śliwak
b26090c288
Merge pull request #14339 from ethereum/parallelize-cli-tests
Parallelize CLI tests
2023-06-21 17:46:45 +02:00
Nikola Matić
08897b88c9
Merge pull request #14342 from ethereum/peg-oz-to-specific-commit
Disable failing OZ tests
2023-06-21 16:11:23 +02:00
Nikola Matic
edd99b07fe Disable failing OZ tests 2023-06-21 14:50:05 +02:00
Kamil Śliwak
fac7ca943b Parallelize CLI tests 2023-06-20 14:01:18 +02:00
Kamil Śliwak
dc7cda18f0
Merge pull request #14338 from ethereum/cmdline-tests-exclude-option
Add `--exclude` option to `cmdlineTests.sh`
2023-06-20 13:49:53 +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
Leo
6b2939da31
Merge pull request #14307 from pgebal/pgebal/print_smt_to_output_smtchecker_smtlib_code
Add --print-smt flag to output the SMTChecker SMTLIB code
2023-06-19 16:58:52 +02:00
Kamil Śliwak
399457d74b cmdlineTests.sh: Add --exclude option 2023-06-19 16:43:30 +02:00
Kamil Śliwak
4752b31e6c cmdlineTests.sh: Rewrite test selection to use find 2023-06-19 16:43:30 +02:00
Kamil Śliwak
381b610fe5
Merge pull request #14336 from ethereum/remove-bytecode-compare-deploy-key
Remove unused Travis deploy key for bytecode compare
2023-06-19 15:09:58 +02:00
Kamil Śliwak
32e8297048 Remove unused bytecodecompare/deploy_key.enc 2023-06-19 14:20:35 +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
f50820fcae Tests checking outputs produced in presence of errors 2023-06-15 10:49:19 +02:00
Daniel
374a6fd50e
Merge pull request #14311 from ethereum/StackToMemoryDeterminism
Deterministically choose memory slots for variables during stack-to-memory.
2023-06-14 17:31:32 +02:00
Daniel
ca8db58edd
Merge pull request #14322 from ethereum/stackLayoutsForUnassignedReturnVariables
Account for unassigned return variables in stack layout generation.
2023-06-14 17:30:57 +02:00
Kamil Śliwak
c2e97369d9
Merge pull request #14327 from ethereum/cmdline-tests-sanitize-metadata-in-standard-json-output
Sanitize metadata in Standard JSON output in command-line tests
2023-06-14 17:01:00 +02:00
Kamil Śliwak
e45e6cc31d CLI tests for metadata output 2023-06-14 16:04:33 +02:00
Kamil Śliwak
e6b1f5ccee cmdlineTest.sh: Remove compiler version from metadata in Standard JSON output as well 2023-06-14 16:04:33 +02:00
Kamil Śliwak
4e113820c9
Merge pull request #14321 from ethereum/fix-bash-syntax-error-on-expectation-update-in-cli-tests
Fix Bash syntax error that shows up in CLI test output when updating expectations
2023-06-14 16:03:40 +02:00
Kamil Śliwak
25f329e4a1
Merge pull request #14323 from ethereum/stop-after-parsing-disallow-outputs-that-require-analysis
Disallow `--stop-after parsing` with CLI outputs that require analysis
2023-06-14 16:02:37 +02:00
Kamil Śliwak
e87333f20f More CLI tests for --stop-after parsing 2023-06-14 14:22:38 +02:00
Kamil Śliwak
f8a1af8bd5 CommandLineParser: Fix some outputs not being properly disallowed with --stop-after parsing 2023-06-14 14:22:38 +02:00
Kamil Śliwak
0713adde04 Fix bad indentation in handleCombinedJSON() 2023-06-14 14:22:38 +02:00
Kamil Śliwak
f4217bdc2c Fix Bash syntax error that shows up in CLI tests when updating expectations 2023-06-14 14:22:10 +02:00
Daniel Kirchner
aa01223398 Account for unassigned return variables in stack layout generation. 2023-06-14 11:43:46 +02:00
Nikola Matić
e44b8b9097
Merge pull request #14324 from ethereum/zeppelin-via-ir-workaround
Workaround open-zeppelin expectRevertCustomError bug
2023-06-14 10:58:01 +02:00
r0qs
28573dc71b
Workaround open-zeppelin expectRevertCustomError bug 2023-06-14 09:49:38 +02:00
Daniel
53c305ea80
Merge pull request #14310 from ethereum/moreRobustSemanticsTests
Do not let low-level semantic test calls depend on a well-defined contract ABI.
2023-06-12 17:32:21 +02:00
Daniel Kirchner
b7abd9bba4
Deterministically choose memory slots for variables independently of names that may depend on AST IDs. 2023-06-12 17:28:01 +02:00
Daniel
6c4e40bcef
Merge pull request #14317 from ethereum/bump-node-cimg
Bump circleci cimg/node version
2023-06-12 16:26:12 +02:00
r0qs
54c0ca99c3
Bump circleci cimg/node version 2023-06-12 15:15:03 +02:00
Daniel
d32aef3fea
Merge pull request #14313 from junaire/fix-wrong-cmake-variable
Fix incorrect CMAKE_SOURCE_DIR usage
2023-06-12 14:46:24 +02:00
Kamil Śliwak
2f484431da
Merge pull request #14243 from ethereum/do-not-optimize-yul-twice
Remove redundant Yul optimization from `IRGenerator`
2023-06-12 12:26:55 +02:00
Jun Zhang
8c5ecd1c01
Fix incorrectly CMAKE_BINARY_DIR usage
Similiar to CMAKE_SOURCE_DIR. Using CMAKE_BINARY_DIR will put the
generated header (stdlib.h) in build/include/solidity/libstdlib but it
should start with build/third-party/solidity or the library can't find
the header.

Signed-off-by: Jun Zhang <jun@junz.org>
2023-06-10 00:35:24 +08:00
Jun Zhang
74a38fc3d8
Fix incorrect CMAKE_SOURCE_DIR usage
When using solidity as a third-party library (include it into our
project using FetchContent), we encountered a strange compilation error.
For some reason, cmake considers the root directory of the project as
the root directory of the dependency (solidity). This is because
solidity is incorrectly using CMAKE_SOURCE_DIR variable, which should be
PROJECT_SOURCE_DIR (The former one refers to the top-level source
directory that contains a CMakeLists.txt, while the latter refers to the
source directory of the most recent project() command)

I've created a repo for demonstration (https://github.com/junaire/test-solidity-fetch-content)

Signed-off-by: Jun Zhang <jun@junz.org>
2023-06-08 19:17:34 +08: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
facc38097d
Merge pull request #14149 from ethereum/enable-minimal-yul-optimizations-by-default
Minimal Yul optimizations by default
2023-06-07 18:26:00 +02:00
Kamil Śliwak
3aaa207162 Enable unoptimized presets in those external tests where they now pass 2023-06-07 16:45:45 +02:00
Daniel Kirchner
0ea06e1c71 Do not let low-level semantic test calls depend on a well-defined contract ABI. 2023-06-07 13:40:14 +02:00
Kamil Śliwak
5e32a728fe Update test expectations 2023-06-07 12:13:39 +02:00
Kamil Śliwak
51cd87c94d YulStack: Don't enable stack optimizations in unoptimized mode when msize is present 2023-06-07 12:13:39 +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
Kamil Śliwak
dff774d82f Overload MSizeFinder::containsMSize() for Yul objects 2023-06-07 12:12:00 +02:00
Kamil Śliwak
8e35e8dd8e Command-line tests checking behavior of msize without optimizer 2023-06-07 12:12:00 +02:00
Kamil Śliwak
7ab730d410 Update tests that would become ineffective with minimal optimizations applied 2023-06-07 12:12:00 +02:00
Kamil Śliwak
811b8e565b
Merge pull request #14288 from ethereum/cli-and-standard-json-equivalence-tests
CLI and Standard JSON equivalence tests
2023-06-07 12:10:38 +02:00
Kamil Śliwak
64ef9d581b Command-line test for equivalence of optimizer options on the CLI and in Standard JSON 2023-06-07 10:29:45 +02:00
Kamil Śliwak
e6716e3208 Helpers for removing decorations form solc output 2023-06-07 10:29:45 +02:00
Kamil Śliwak
25c78be73e Give error_message in msg_on_error an initial value to make it compatible with set -u 2023-06-07 10:29:45 +02:00
Kamil Śliwak
c7372f3f22
Merge pull request #14268 from ethereum/resurrect-yul-optimizer-cli-options
Resurrect Yul optimizer CLI options
2023-06-07 10:28:16 +02:00
Daniel
09038ce4cb
Merge pull request #14249 from ethereum/experimental-stdlib
Experimental standard library
2023-06-06 18:08:34 +02:00
Nikola Matic
47969adf91 Experimental standard library
Change import syntax and cover with tests
2023-06-06 17:16:23 +02:00
Kamil Śliwak
2769bb52f6 Make --optimize-yul work again 2023-06-06 09:54:07 +02:00
Kamil Śliwak
42a068b449 CommandLineParser: Store the state of EVM assembly and Yul optimizer explicitly
- Does not change the meaning of CLI options, just the way we map them to internal variables.
2023-06-06 09:54:07 +02:00
pgebal
f1d2eda795 Merge pull request #14116 from pgebal/pgebal/add_option_to_add_bounds_to_unroll_loops_in_bmc
Add optional bounds to unroll loops in BMC model checker
2023-06-05 12:01:08 +02:00
Pawel Gebal
f15b826431 Add optional bounds to unroll loops in BMC model checker 2023-06-02 18:32:38 +02:00
Kamil Śliwak
dcecf00e30
Merge pull request #14292 from ethereum/command-line-test-docs
Document the command-line tests
2023-06-02 18:28:22 +02:00
Kamil Śliwak
f5a531fd71
Merge pull request #14289 from ethereum/script-based-cmdline-tests
Move hard-coded tests out of `cmdlineTests.sh`
2023-06-02 17:30:25 +02:00
Kamil Śliwak
0e48e1251d Document the command-line tests 2023-06-02 16:11:04 +02:00
Kamil Śliwak
f397b9a083 cmdlineTests: Add prefixes for temporary files/dirs 2023-06-02 16:10:40 +02:00
Kamil Śliwak
5c5f8e8dad cmdlineTests: Remove superfluous set and temporary dirs 2023-06-02 16:10:40 +02:00
Kamil Śliwak
00c2f511d3 cmdlineTests: Remove superfluous output from script-based tests and adjust the rest 2023-06-02 16:10:40 +02:00
Kamil Śliwak
c1df8ed563 cmdlineTests: Remove unnecessary subshells
- Whitespace-only change, separated out to make it easy to diff.
2023-06-02 16:10:40 +02:00
Kamil Śliwak
6b061ba696 cmdlineTests: Extract script-based test out of cmdlineTests.sh
- Just extraction, with as few changes to the code as possible.
2023-06-02 16:10:40 +02:00
Kamil Śliwak
dd10334754 cmdlineTests: Support tests that contain a script to run as an alternative to input.* files 2023-06-02 16:09:11 +02:00
Kamil Śliwak
72a384f4fe cmdlineTests: Ensure that leading symbols in names affect the sort order 2023-06-02 16:09:11 +02:00
Kamil Śliwak
4773b0b1e4
Merge pull request #14291 from ethereum/drop-gp2
Disable gp2 tests
2023-06-02 14:08:42 +02:00
Kamil Śliwak
5306838920
Merge pull request #14290 from ethereum/oz-fix
Remove unnecessary line from OZ external test script
2023-06-02 13:02:48 +02:00
r0qs
a518310af9
Disable gp2 tests 2023-06-02 12:50:28 +02:00
r0qs
824e59dec2
Remove unnecessary line from OZ external test script 2023-06-02 12:09:53 +02:00
Kamil Śliwak
14d2ae2dfa
Merge pull request #14282 from ethereum/fixOpenZeppelinExtTest
Remove sed commands targeting deleted files in openzeppelin external test
2023-05-31 12:17:56 +02:00
Matheus Aguiar
d657e77f1e Remove problematic sed commands in openzeppelin external test 2023-05-31 02:11:33 -03:00
Nuno Santos
3eedc635c4
Misspelling and terms inconsistencies (#14280)
* Installing solidity tweeks

* A few more misspells

* More inconsistencies fixed

* Removed contractions according to our guide.
2023-05-30 20:49:25 +01: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
Nikola Matić
4449f07df4
Merge pull request #14262 from davidBar-On/issue-14259-help-text-about-standard-input-usage
Fix help text about standard input usage
2023-05-29 15:53:58 +02:00
David Bar-On
cf106c44fe Fix issue 14259 - help text about standard input usage 2023-05-29 13:30:39 +02:00
Kamil Śliwak
38468d03f4
Merge pull request #14272 from ethereum/fixInlinerDocs
Fix mistake about default value for inliner setting in docs
2023-05-26 17:02:38 +02:00
Matheus Aguiar
2260c23ce1 Fix mistake about default value for inliner setting 2023-05-26 10:25:26 -03: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
Kamil Śliwak
37506b1a90
Merge pull request #14177 from GiokaMarkella/develop
Add support for Yul ASTs output
2023-05-26 13:25:54 +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
Kamil Śliwak
bb16f61e1c
Merge pull request #14263 from ethereum/gh-auth-token-foundry-cmd
Prefer authenticated request to github api when the token is available
2023-05-26 12:30:11 +02:00
r0qs
f09838a03d
Prefer authenticated request to github api when the token is available
Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
2023-05-26 10:56:24 +02:00
Kamil Śliwak
8c7404f639
Merge pull request #14264 from ethereum/remove-leftover-ewasm-bits-in-docs
Remove a few leftover mentions of Ewasm from optimizer docs
2023-05-25 12:25:14 +02:00
Kamil Śliwak
1cc656c550 docs: Remove a few leftover mentions of Ewasm 2023-05-25 11:38:16 +02:00
Kamil Śliwak
a089aefc05
Merge pull request #14266 from ethereum/disallow-optimize-yul-and-no-optimize-yul-at-the-same-time
Disallow `--optimize-yul` and `--no-optimize-yul` at the same time
2023-05-25 11:37:38 +02:00
Nikola Matić
6db4f182a5
Merge pull request #14226 from kuzdogan/docs-add-immutable-ref
Mention `immutableReferences` in immutables docs
2023-05-24 20:02:12 +02:00
Kamil Śliwak
a11b1c83f0 Disallow using both --optimize-yul and --no-optimize-yul at the same time 2023-05-24 15:54:40 +02:00
Kamil Śliwak
b24e4fcbfa Command-line tests for --optimize-yul and --no-optimize-yul used together 2023-05-24 15:53:29 +02:00
Kamil Śliwak
4a1dbdaedb
Merge pull request #14261 from ethereum/clean-up-via-ir-equivalence-test
Clean up via-IR equivalence command-line test
2023-05-24 12:16:26 +02:00
Kamil Śliwak
8c5304368d test_via_ir_equivalence(): Simplify by merging the asm loops
- And fix indentation
2023-05-23 15:30:07 +02:00
Kamil Śliwak
bcdb41f743 test_via_ir_equivalence(): Remove unnecessary filter for asm_output_two_stage
- This bit will never actually appear in the output file.
2023-05-23 15:28:18 +02:00
Kamil Śliwak
17aacfdb6a test_via_ir_equivalence(): Fix quoting and locals 2023-05-23 15:25:48 +02:00
Kamil Śliwak
0ce5e4c94d test_via_ir_equivalence(): Use assertions for precondition checks 2023-05-23 15:23:44 +02:00
Nuno Santos
02a07fdf46
Changed references to money 2023-05-22 12:54:43 +01:00
johnnygee19
a2a00850ca
Fix small typo on "Units and Globally Available Variables" page (#14252)
* Fix typo

* Update docs/units-and-global-variables.rst

---------

Co-authored-by: Nuno Santos <nunofilipesantos@gmail.com>
2023-05-22 12:31:21 +01:00
r0qs
4af4e5c78f
Merge pull request #14248 from ethereum/bump-docker-images
Bump  buildpack-deps images
2023-05-22 11:54:02 +02:00
r0qs
6ea033b7e3
Merge pull request #14228 from ethereum/add-sudo-base-imgs
Add sudo to buildpack-deps images
2023-05-22 11:53:35 +02:00
r0qs
9eaa5cebdb
Merge pull request #14247 from ethereum/replace-envsubst
Replace `envsubst` by `sed` in `matrix_notification` script
2023-05-18 19:45:04 +02:00
r0qs
ab70c9cccb
Update build_emscripten.sh 2023-05-18 19:41:02 +02:00
r0qs
45bd6827d2
Use sed instead of envsubst 2023-05-18 18:27:17 +02:00
r0qs
9f1f2a2a06
Bump docker images 2023-05-18 17:41:35 +02:00
Kamil Śliwak
574d454be7
Merge pull request #14242 from ethereum/ci-gh-limit-fix
Fix intermittent error in `install_foundry` command
2023-05-17 19:26:37 +02:00
Nikola Matić
4c77bf57df
Merge pull request #14239 from ethereum/restrict-experimental-mode-to-constantinople
Restrict experimental solidity to constantinople and above
2023-05-17 19:06:36 +02:00
Nikola Matic
e7f5303a39 Make ASTJSONTest an EVMVersionRestrictedTestCase 2023-05-17 18:10:16 +02:00
Nikola Matic
7a34d34045 Restrict experimental solidity to constantinople and above 2023-05-17 17:03:43 +02:00
r0qs
7460c997b7
Add comment to colony test 2023-05-17 16:37:47 +02:00
r0qs
ff2e4736fa
Add Github authorization token to foundry installation 2023-05-17 14:52:47 +02:00
Daniel
33e7fc1cba
Merge pull request #14234 from ethereum/drop-colony-nightly
Drop ColonyNetwork external test run on nightly builds
2023-05-17 13:25:39 +02:00
r0qs
d49ed7d66b
Drop ColonyNetwork external test run on nightly builds 2023-05-17 11:41:15 +02:00
Daniel
aa9e25021d
Merge pull request #14232 from ethereum/workaround-hardhat-waffle
Workaround gp2 and prb-math external tests
2023-05-16 18:36:33 +02:00
r0qs
af74ab69c9
Workaround gp2 and prb-math external tests 2023-05-16 16:13:51 +02:00
Daniel
1250ee778d
Merge pull request #14168 from ethereum/pragma-solidity-next
Introduce `pragma experimental solidity`
2023-05-15 20:18:22 +02:00
r0qs
5640353603
Add sudo to base images 2023-05-15 19:37:53 +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
Kaan Uzdoğan
c8117ef75e
Be more explicit about immutableReferences
Co-authored-by: r0qs <rodrigo.saramago@protonmail.com>
2023-05-15 17:21:03 +02:00
Kaan Uzdoğan
5fcba53223 Fix trailing whitespace, add punctuation 2023-05-15 16:39:31 +02:00
Kaan Uzdoğan
a334ab3525 Add in immutables docs 2023-05-15 16:32:12 +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
Daniel
ccd80f9904
Merge pull request #13998 from ethereum/remove-ewasm-backend
Remove EWASM backend.
2023-05-15 13:04:27 +02:00
Nikola Matić
3f2cde9bd6
Merge pull request #14215 from ethereum/gitignore_orig_files
Add `*.orig` to `.gitignore`.
2023-05-12 13:31:21 +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
Alexander Arlt
33bb833949 Add *.orig to .gitignore. 2023-05-11 09:14:16 -05:00
Daniel
0a0c389541
Merge pull request #14213 from ethereum/postReleaseAdjustments
Minor post-release adjustments.
2023-05-11 13:08:11 +02:00
Daniel Kirchner
c3a8b9cebb Minor post-release adjustments. 2023-05-11 11:28:00 +02:00
Daniel
f07c8b1f51
Merge pull request #14210 from ethereum/add-readthedocs-config
Add readthedocs configuration
2023-05-10 18:57:07 +02:00
Daniel
de722d99bc
Merge pull request #14209 from ethereum/set-version-to-0.8.21
Set version to 0.8.21.
2023-05-10 18:48:25 +02:00
r0qs
edc5512b75
Add readthedocs configuration 2023-05-10 18:04:47 +02:00
Daniel Kirchner
4b67dea8e2 Set version to 0.8.21. 2023-05-10 17:55:52 +02:00
Daniel Kirchner
a1b79de642 Update bugs by version entry for 0.8.20. 2023-05-10 12:21:29 +02:00
Daniel Kirchner
3c77d33db8 Set release date for 0.8.20. 2023-05-10 12:20:56 +02:00
Daniel
0f2bd3e8bd
Merge pull request #14204 from ethereum/sortChangelog0_8_20
Sort changelog for 0.8.20.
2023-05-10 12:18:09 +02:00
Daniel Kirchner
b730bde54d Sort and adjust changelog for 0.8.20. 2023-05-10 12:15:00 +02:00
Daniel
8366bd439b
Merge pull request #14205 from ethereum/fixAntlr4
Fix antlr grammar.
2023-05-10 12:11:21 +02:00
Daniel Kirchner
606fbd8fcc Fix antlr grammar. 2023-05-10 12:00:45 +02:00
Daniel
328f9c8f99
Merge pull request #14203 from ethereum/gitterLinkFix
Fix gitter link.
2023-05-10 11:39:16 +02:00
Daniel Kirchner
d5c3d34bf4 Fix gitter link. 2023-05-10 11:38:24 +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
Daniel
a02a7206d8
Merge pull request #14201 from ethereum/fix-hidden-overload-warning-in-types
Fix hidden-overload in Types and remove CMake hacks
2023-05-09 20:47:26 +02:00
Nikola Matic
3bec4c09be Disable dangling-reference warning 2023-05-09 19:54:00 +02:00
Nikola Matic
3bab14747e Fix hidden-overload in Types and remove CMake hack 2023-05-09 19:33:23 +02:00
Daniel
d370f53b7e
Merge pull request #14180 from ethereum/fix_override_error
Add missing overridden virtual methods in SMT Sort structs
2023-05-09 19:23:06 +02:00
Daniel
0d0bcf628d
Merge pull request #14199 from ethereum/evmoneDockerUpdate
Bump evmone version in docker images to 0.10.0.
2023-05-09 19:20:40 +02:00
Daniel
4c4eadd893
Merge pull request #14200 from ethereum/updateEvmone
Bump docker images and evmone version.
2023-05-09 19:20:22 +02:00
Daniel Kirchner
75a0c486a8 Adjust gas expectations due to new creation costs. 2023-05-09 18:22:44 +02:00
Matheus Aguiar
c1720e62aa Implement missing overrides and relax smtAsserts 2023-05-09 13:20:56 -03:00
Daniel Kirchner
53626fc092 Bump docker images and evmone version. 2023-05-09 17:59:00 +02:00
Daniel Kirchner
77af0b41df Bump evmone version in docker images to 0.10.0. 2023-05-09 16:27:45 +02:00
Nikola Matić
347c966f08
Merge pull request #14198 from ethereum/disallow-immutable-initialization-in-try-catch
Disallow immutable initialization in try catch statements
2023-05-09 15:37:14 +02:00
Nikola Matic
9a87b587d5 Disallow immutable initialization in try catch statements
Trigger github
2023-05-09 14:48:14 +02:00
Daniel
2da0a861ce
Merge pull request #14195 from ethereum/fix-push0-docs
docs: mention that `push0` also decreases the runtime costs
2023-05-08 18:57:11 +02:00
hrkrshnn
cbd6495fb1 docs: mention that push0 also decreases the runtime costs
Fixes https://github.com/ethereum/solidity/pull/14107#discussion_r1163830306
2023-05-08 18:53:10 +02:00
Daniel
f32f35f8f1
Merge pull request #14140 from ethereum/foundry-ci-setup
Foundry ci setup
2023-05-08 18:18:04 +02:00
Daniel
4ccda14798
Merge pull request #14164 from BraxWong/BraxBranch
Switch to Gen2 macOS resources on CircleCI
2023-05-08 17:47:29 +02:00
Daniel
94d3747034
Merge pull request #14158 from ethereum/shanghai
Make Shanghai the default EVM version.
2023-05-08 17:29:11 +02:00
Rodrigo Q. Saramago
ccc2b8e2db
Make python and foundry installation steps a command 2023-05-08 17:26:08 +02:00
Daniel Kirchner
44da8507b1 Change default EVM version to Shanghai.
Co-authored-by: Rodrigo Q. Saramago <rodrigoqsaramago@gmail.com>
2023-05-08 16:34:23 +02:00
Rodrigo Q. Saramago
759732d310
Remove python unlink 2023-05-08 15:19:59 +02:00
BraxWong
41adba0eff
Switch to Gen2 macOS resources on CircleCI 2023-05-08 15:19:59 +02:00
Daniel
34b13c1f89
Merge pull request #14154 from Vectorized/optimize-multiplicity-map
Optimize multiplicity map
2023-05-08 14:54:05 +02:00
Vectorized
050927b026 Optimize multiplicity map 2023-05-08 14:01:47 +02:00
Daniel
7c323a1faa
Merge pull request #14176 from ethereum/internal-function-id-annotation-fix
Move AST annotation of internal function dispatch IDs to ContractDefinition
2023-05-08 13:31:31 +02:00
r0qs
29751849b5
Merge pull request #14191 from ethereum/migration-external-test-ci
Migrate to new external tests script
2023-05-06 20:33:53 +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
Rodrigo Q. Saramago
d80fd1b572
Migrate to new external tests script 2023-05-06 16:19:34 +02:00
Nikola Matić
41742c5410
Merge pull request #14188 from ethereum/fuzz-ir-pipeline
Make use of IR codegen pipeline and selectively report stack too deep…
2023-05-06 13:04:13 +02:00
Nikola Matić
102f18b2b0
Merge pull request #14190 from ethereum/fix-gp2
Fix gp2 external test script
2023-05-05 22:18:26 +02:00
Rodrigo Q. Saramago
766db7daa4
Update gp2 external test script 2023-05-05 17:09:58 +02:00
Nuno Santos
a00a2117c5
Removed English (UK) and changed to International English. (#14189)
Removed English (UK) and changed to International English like previously discussed.
2023-05-05 12:02:17 +01:00
Bhargava Shastry
889f0721a2 Make use of IR codegen pipeline and selectively report stack too deep errors for the new pipeline. 2023-05-05 11:39:56 +02:00
Nuno Santos
0f40bcc06d
Changed order of menu and spelling (#14185)
- Changed menu order to obey what we had written on the page.
- Fixed some spelling.
2023-05-04 18:35:02 +01:00
Daniel
bed4732e95
Merge pull request #14183 from ethereum/temporaryGcc13Fix
Temporary workaround for GCC 13 compiler warnings.
2023-05-04 17:20:49 +02:00
Daniel Kirchner
f2ddc997f0 Temporary workaround for GCC 13 compiler warnings. 2023-05-04 16:30:19 +02:00
Daniel
385c48df73
Merge pull request #14137 from ethereum/fix-matrix-notification-windows
Make bash the default shell on windows
2023-05-03 21:34:19 +02:00
Daniel
dde579b434
Merge pull request #10996 from ethereum/exportAllEvents
Export all events
2023-05-03 21:32:31 +02:00
chriseth
1e63615206 Export all events.
Update tests.

Additional tests

Revert changes to the Natspec
2023-05-03 14:08:27 -03:00
Nikola Matić
1af6ca772d
Merge pull request #14160 from kuzdogan/patch-4
[docs]: Fix metadata JSON "version" field being a string
2023-05-02 22:46:03 +02:00
Nuno Santos
49cf49184a
Update security-considerations.rst (#14079)
* Update security-considerations.rst

Spell checking mostly

* Update docs/security-considerations.rst

* Update docs/security-considerations.rst

* fixup! Update docs/security-considerations.rst

* Update docs/security-considerations.rst

* Update docs/security-considerations.rst

* Update docs/security-considerations.rst

* Update docs/security-considerations.rst

* Update docs/security-considerations.rst

* Update docs/security-considerations.rst

* Update docs/security-considerations.rst

* Update docs/security-considerations.rst

* Update docs/security-considerations.rst

* Update docs/security-considerations.rst

* Update docs/security-considerations.rst

* Update docs/security-considerations.rst

* Update docs/security-considerations.rst

* Update docs/security-considerations.rst

* Update docs/security-considerations.rst

* Update docs/security-considerations.rst

* Update docs/security-considerations.rst

* Update docs/security-considerations.rst

* Update security-considerations.rst

* Update security-considerations.rst

* Update docs/security-considerations.rst

Co-authored-by: r0qs <deepmarolaest@gmail.com>

---------

Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
Co-authored-by: r0qs <deepmarolaest@gmail.com>
2023-05-02 17:05:23 +01:00
Kamil Śliwak
0cb279494a
Merge pull request #14170 from ethereum/external-tests-refactor
Fix throw of ExternalTestNotFound in external_tests.py
2023-04-28 19:40:05 +02:00
Rodrigo Q. Saramago
75960e6db8
Fix throw of ExternalTestNotFound in external_tests.py 2023-04-28 18:28:07 +02:00
Kamil Śliwak
8be32f2267
Merge pull request #14064 from ethereum/external-tests-refactor
External tests script refactor
2023-04-28 17:25:32 +02:00
Rodrigo Q. Saramago
28a959295b
Move common.sh from test/externalTests to scripts/externalTests 2023-04-28 16:32:01 +02:00
Rodrigo Q. Saramago
778d6f4b26
Migrate externalTests.sh to python
Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
2023-04-28 16:31:49 +02:00
minaminao
7c870c95c5
docs: change the remix button from icon to text (#14122)
* docs: change remix button to text button

* docs(fix): trim trailing whitespaces

* fix: remove unnecessary spaces

Co-authored-by: Kamil Śliwak <cameel2@gmail.com>

* fix: remove unnecessary !important in link

* refactor: remove !important in custom.css

* fix: `.. code-block:: Solidity` -> `.. code-block:: solidity`

* fix: broken layout of remix button in list items

* refactor: make selectors more strict

---------

Co-authored-by: Kamil Śliwak <cameel2@gmail.com>
2023-04-27 11:02:04 +01:00
r0qs
6edec899c8
Merge pull request #14161 from ethereum/enable-triage-issues-new-board
Enable triage issues action
2023-04-27 11:27:37 +02:00
Rodrigo Q. Saramago
da7754c6db
Enable triage issues action 2023-04-26 18:17:58 +02:00
Kaan Uzdoğan
816f6ec175
Fix metadata JSON "version" field being a string
Should be a number
2023-04-26 17:38:13 +02:00
Daniel
302d46c1e6
Merge pull request #14156 from kuzdogan/patch-3
Fix Remix links by adding `#` before URL params
2023-04-26 12:42:47 +02:00
Kaan Uzdoğan
3bcdc7bd9a
Fix Remix links by adding # before URL params 2023-04-26 10:37:37 +02:00
Kamil Śliwak
14c25c386d
Merge pull request #13962 from ethereum/triage-issues-new-board
Update triage automation to use new project board and github projectV2 API
2023-04-25 18:15:01 +02:00
Rodrigo Q. Saramago
a6c809fd19 Update triage automation to use new project board and github projectV2 API 2023-04-25 17:22:40 +02:00
Daniel
53a02fc130
Merge pull request #14155 from ethereum/isoltest-stack-shuffling
Migrate yulStackShuffling tests to isoltest
2023-04-25 16:49:13 +02:00
Rodrigo Q. Saramago
28c7fdae09
Migrate yulStackShuffling tests to isoltest 2023-04-25 15:53:01 +02:00
Rodrigo Q. Saramago
ba722b66cb
Make bash the default shell on windows 2023-04-25 15:51:51 +02:00
Leo
4a8d6618f5
Merge pull request #13974 from blishko/chc-path-condition
[SMTChecker] Use path condition in CHC engine
2023-04-24 16:24:53 +02:00
Kamil Śliwak
b95b96db4e
Merge pull request #14152 from ethereum/fix-matrix-bot
Add default value for CIRCLE_TAG
2023-04-24 11:39:51 +02:00
Daniel
cd5ae26e34
Merge pull request #14143 from ethereum/remove-type-categoryname
Remove the inaccurate `Type::categoryName()`
2023-04-23 22:05:35 +02:00
Daniel
d0043d6753
Merge pull request #14151 from ethereum/evmc-update
Upgrade to evmc 10.1.0
2023-04-23 21:47:29 +02:00
Alex Beregszaszi
ee92491aae Upgrade to evmc 10.1.0 2023-04-23 15:51:06 +02:00
Rodrigo Q. Saramago
1fb9a414c9
Add default value for CIRCLE_TAG 2023-04-23 14:23:46 +02:00
Kamil Śliwak
b75bddbd11
Merge pull request #14145 from ethereum/small-refactors-extracted-from-asm-import
Trivial refactors extracted from the JSON assembly import PR
2023-04-21 19:53:31 +02:00
Martin Blicha
12bca24774 [SMTChecker] Use path condition when creating CHC targets
Without path condition, verification targets created inside ternary
operator ignore the condition of the operator inside the branches.
This led to false positives.

Further updates:

- Function calls should consider the conditions under which they are
called, otherwise the analysis may report false positives.
The fix proposed here is to add the current path condition to the edge
that propagates error from a function call.

- Increment error index after function call

This is necessary for the analysis of the ternary operator to work
correctly. No information should leak from a function call inside a
ternary operator in the first branch to the second branch, including
whether or not an error would have occured in the first branch.

However, for the execution that continues after the function call,
we still need to ensure that under the current path condition
the error has not occurred in that function call.

It would be better to isolate the analysis of the branches to separate
clauses, but I do not see an easy way for that now. In this way, even
though the function call in first branch is included in the clause of
the second branch, no information leaks.

- Additonal test for ternary operator

This tests the behaviour of SMTChecker on ternary operator with function
calls inside both branches. Specifically, it tests that SMTChecker
successfully detects a violation of a verification target in the second
branch when the same target is present also in the first branch, but
there it cannot be triggered because of the operator's condition.
2023-04-21 18:56:34 +02:00
Alexander Arlt
24d43dd1e6
Merge pull request #14115 from ethereum/clang-format-remove-prohibited-property
[.clang-format ] Update prohibited property 'AlignEscapedNewlinesLeft'.
2023-04-21 11:45:19 -05:00
Kamil Śliwak
c694a004be
Merge pull request #13982 from ethereum/cleanup-base-images
Cleanup base images and CI config
2023-04-21 18:09:30 +02:00
Alexander Arlt
35a78f77bc Add solRequire() 2023-04-20 20:01:45 +02:00
Kamil Śliwak
f5b2044ed1 Remove unused CompilerStack::m_sourceJsons 2023-04-20 20:01:45 +02:00
Alexander Arlt
611e02c038 Rename assemble() to assembleYul() in CompilerStack and CommandLineInterface 2023-04-20 20:01:45 +02:00
Kamil Śliwak
ded9ef17e8 Misc small refactors: Use ranges::views::keys and fmt::format() 2023-04-20 20:01:45 +02:00
Alexander Arlt
2f78e9549a Misc small refactors: Superfluous std::, trailing commas in lists, whitespace, missing breaks, import order 2023-04-20 19:53:48 +02:00
Kamil Śliwak
a297a68726
Merge pull request #14090 from ethereum/fix-matrix-bot
Fix text formatting of CI matrix notifications
2023-04-20 14:49:40 +02:00
Kamil Śliwak
34da6c8811 Remove the inaccurate Type::categoryName() and change the error message for invalid calls to one independent of the category 2023-04-20 13:50:22 +02:00
Rodrigo Q. Saramago
61beb321b6
Bump ubuntu 2004 and 2204 images 2023-04-19 15:49:09 +02:00
Rodrigo Q. Saramago
58555db423
Fix text formatting of CI matrix notifications
Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
2023-04-19 01:09:08 +02:00
Rodrigo Q. Saramago
f53c0375de
Fix ci parameters style 2023-04-19 00:57:00 +02:00
Rodrigo Q. Saramago
a968f1a18c
Fix default image 2023-04-19 00:53:28 +02:00
Rodrigo Q. Saramago
589688b236
Add image parameter to external tests 2023-04-19 00:26:04 +02:00
Rodrigo Q. Saramago
e95cfa84bc
Add space between jobs definitions 2023-04-19 00:18:15 +02:00
Rodrigo Q. Saramago
3b2bb4ba50
Rename t_ems_ext to t_ext since the job also supports native builds 2023-04-19 00:18:15 +02:00
Rodrigo Q. Saramago
ce27eecb93
Add requires_nothing 2023-04-19 00:18:15 +02:00
Rodrigo Q. Saramago
67078afe4b
Add on_develop filter 2023-04-19 00:18:15 +02:00
Rodrigo Q. Saramago
a9949f1cd1
Rename workflow_osx -> requires_osx 2023-04-19 00:18:15 +02:00
Rodrigo Q. Saramago
6cde589a03
Rename workflow_win -> requires_win 2023-04-19 00:18:15 +02:00
Rodrigo Q. Saramago
e464a49b0b
Rename workflow_archlinux -> requires_b_archlinux 2023-04-19 00:18:14 +02:00
Rodrigo Q. Saramago
8ea890de53
Minor fix 2023-04-19 00:18:14 +02:00
Rodrigo Q. Saramago
4cf3661c3e
Rename workflow_emscripten -> requires_emscripten 2023-04-19 00:18:14 +02:00
Rodrigo Q. Saramago
a13c3f0d07
Rename workflow_ubuntu2204 -> requires_b_ubu 2023-04-19 00:18:14 +02:00
Rodrigo Q. Saramago
d8937d8a76
Rename workflow_ubuntu2004_static -> requires_b_ubu_static 2023-04-19 00:18:14 +02:00
Rodrigo Q. Saramago
b99684d3f2
Rename workflow_trigger_on_releases -> on_version_tags 2023-04-19 00:18:14 +02:00
Rodrigo Q. Saramago
9b7eb4683b
Rename workflow_trigger_on_tags -> on_all_tags_and_branches 2023-04-19 00:18:14 +02:00
Rodrigo Q. Saramago
524db30f12
Update ubuntu ossfuzz references 2023-04-19 00:18:11 +02:00
Rodrigo Q. Saramago
f78591c356
Reorganize base images alphabetically and add small and xlarge image for ubuntu2004 2023-04-19 00:12:04 +02:00
Rodrigo Q. Saramago
1e00672fbc
Rename ubuntu ossfuzz dockerfile 2023-04-19 00:12:04 +02:00
Rodrigo Q. Saramago
927946c4f5
Move ubuntu 22.04 dependencies to docker image 2023-04-19 00:12:04 +02:00
Rodrigo Q. Saramago
f4ab85da3e
Remove HERA from base image 2023-04-19 00:12:04 +02:00
Rodrigo Q. Saramago
1fbc17ba05
Remove unused artifacts step 2023-04-19 00:12:04 +02:00
Rodrigo Q. Saramago
2810119891
Remove unused workflow_ubuntu1604_clang 2023-04-19 00:12:04 +02:00
Daniel
a77d4e281f
Merge pull request #14139 from ethereum/make-plus-binary-only
Make plus binary only (second attempt)
2023-04-18 21:20:31 +02:00
Daniel
29baf3b2ba
Merge pull request #14135 from ethereum/fix_null_deref_using_for
Fix null dereference in using for directive when operator name is empty
2023-04-18 20:31:55 +02:00
Matheus Aguiar
64f57ac3c7 Fix null dereference in using for directive when operator name is empty 2023-04-18 14:23:58 -03:00
Kamil Śliwak
b85a95f52d Refactor TokenTraits::isUnaryOp() not to treat + as a unary operator 2023-04-18 16:49:31 +02:00
Kamil Śliwak
8a14680851 Disallow unary plus at the parsing stage 2023-04-18 16:47:00 +02:00
Kamil Śliwak
ee1b50d345
Merge pull request #14123 from ethereum/docs-and-index-tweaks-for-literals
Literal-related documentation and index tweaks
2023-04-18 16:31:14 +02:00
Nikola Matić
8194acb3b7
Merge pull request #14119 from veniger/natspec-struct
Adds NatSpec to AST for struct definitions.
2023-04-18 16:05:20 +02:00
Daniel
3f04f00bdc
Merge pull request #14138 from ethereum/evmHostCalldataFix
Fix calldata handling during creation in EVMHost.
2023-04-18 13:47:07 +02:00
Marko Veniger
07def48f45 Adds NatSpec to AST for struct definitions. 2023-04-18 13:10:21 +02:00
Daniel Kirchner
421738b50d Fix calldata handling during creation in EVMHost. 2023-04-18 12:53:50 +02:00
Daniel
02e936ad82
Merge pull request #14128 from mdehoog/golang-generation
Fix incompatibilities with Golang parser generation
2023-04-17 20:26:41 +02:00
Daniel
c6aab84a0c
Merge pull request #14127 from ethereum/eip-3860
Add warning for EIP-3860 enforced initcode limits
2023-04-17 17:42:55 +02:00
Daniel
9befe1d456
Merge pull request #14133 from ethereum/codeTransformPush0
Emit PUSH0 as junk in evm code transform, if available.
2023-04-17 17:24:54 +02:00
Daniel Kirchner
3458da9df3 Emit PUSH0 as junk in evm code transform, if available. 2023-04-17 16:26:07 +02:00
Nuno Santos
5a776c722f
Update Side Menu (#14081)
* Update index.rst

### Plan

#### Bundle 1

Security cons.
List of known bugs
Solidity Breaking Changes (should be 1 link only)

#### Bundle 2

Natspec
SMTC
YUL
Import path

#### Bundle 3

Style Guide
Common Patterns
Resources
Contributing
Languages influences
Keyword Index

* Line breaks fix

* Whitespaces

* Update docs/index.rst

Co-authored-by: Nikola Matić <nikola.matic@ethereum.org>

* Update docs/index.rst

* Update docs/index.rst

---------

Co-authored-by: Nikola Matić <nikola.matic@ethereum.org>
2023-04-17 14:27:06 +01:00
Nuno Santos
719cce02b4
Removed duplicated link (#14131)
Submitting the Security advisory will only show for repo admins, normal users will still have the option to check our security policy.
2023-04-17 14:06:51 +01:00
Daniel
6d847e4e57
Merge pull request #14126 from ethereum/warm-coinbase
EVMHost: Support warm coinbase
2023-04-17 14:55:59 +02:00
Daniel
1a8be13c05
Merge pull request #14125 from ethereum/blake2
EVMHost: Add "support" for Blake2f
2023-04-17 14:45:58 +02:00
Kamil Śliwak
618211f82b
Merge pull request #14084 from ojasaklechayt/patch-3
Cheatsheet: Segregated codes based on type
2023-04-17 13:40:43 +02:00
Ojas Aklecha
345d0bcf13 Cheatsheet segregated based on type 2023-04-17 12:51:27 +02:00
Michael de Hoog
07ac3874b6
Fix incompatibilities with Golang parser generation 2023-04-16 13:51:05 -05:00
Alex Beregszaszi
71bea997aa Add and update tests 2023-04-15 13:47:11 +02:00
Alex Beregszaszi
3edcfce478 Add warning for EIP-3860 enforced initcode limits 2023-04-15 13:43:05 +02:00
Alex Beregszaszi
4264b5ae07 EVMHost: Support warm coinbase 2023-04-15 13:19:08 +02:00
Alex Beregszaszi
d478c7d81a EVMHost: Add "support" for Blake2f 2023-04-15 13:17:02 +02:00
Kamil Śliwak
cab88290c2 docs: Consistent index entries for literals, denominations, free functions 2023-04-14 16:57:20 +02:00
Kamil Śliwak
bc18af91bb docs: Fix index entry for receive 2023-04-14 16:36:26 +02:00
Kamil Śliwak
8f63bb646c docs: Hexadecimal string literals behave like string literals only in some aspects 2023-04-14 16:36:26 +02:00
minaminao
e1a9446f87
fix(docs): fix missing backticks, remove latexpdfja, fix the missing help message of latexpdf, and remove unnecessary whitespace (#14101)
* Fix missing backticks

* Remove whitespace in the header of the optimizer step

* Remove whitespace in directives

* Remove `make latexpdfja`

* Add the help message of latexpdf in make.bat

* Fix missing backticks

* Update docs/internals/optimizer.rst

---------

Co-authored-by: Nuno Santos <nunofilipesantos@gmail.com>
2023-04-14 12:24:50 +01:00
Nuno Santos
5d42bb5e38
Removed Issues duplications from GitHub (#14120) 2023-04-13 18:51:04 +01:00
Nuno Santos
f0c0df2d8c
Team meetings change (#14113)
Team decision to have only public Wednesday meetings.
2023-04-12 18:01:08 +01:00
Alexander Arlt
d08de34bd3 [.clang-format ] Update prohibited property 'AlignEscapedNewlinesLeft'.
- 'AlignEscapedNewlines' set to 'Left' is now the correct property.
2023-04-12 11:44:23 -05:00
Leo
416e6f6604
Merge pull request #14074 from ethereum/update_z3_docker
update z3 in docker files
2023-04-12 17:59:08 +02:00
Kamil Śliwak
593e207094
Merge pull request #14104 from ethereum/extract-parse-literal
Refactor literal parsing before adding suffixes
2023-04-12 14:52:04 +02:00
Daniel
6bc6ae94a6
Merge pull request #14050 from ethereum/contract-ast-internal-function-ids
Annotate internal function IDs
2023-04-12 14:11:39 +02:00
Kamil Śliwak
c1fffa892d Parser: Extract literal parsing into a separate function 2023-04-12 12:30:05 +02:00
Kamil Śliwak
46457cfc25
Merge pull request #14103 from ethereum/extra-tests
A few extra tests for operators, denominations and virtual functions
2023-04-12 11:32:26 +02:00
Daniel
82bde40717
Merge pull request #14107 from ethereum/push0
Introduce `Shanghai` version and `push0` support
2023-04-12 10:10:03 +02:00
hrkrshnn
b30f89bcce docs: On supporting shanghai EVM version and changelog 2023-04-12 00:10:24 +02:00
hrkrshnn
41ce3feb0a test: some tests for push0
1. `push0_disallowed.yul`: checks if `push0()` is a valid builtin in strict Yul
2. `push0_disallowed.sol`: checks if `push0()` is a valid builtin in inline assembly
3. `push0.sol`: simple semantic test that returns 0
4. `evmone_support.sol`: tests if push0 works properly in evmone
5. Updated some bytecode too large tests to use `shanghai` as version
6. Updated various tests where `push1 0` was hardcoded in different forms / expectations on bytecode
size (`Assembler.cpp`, `GasCosts.cpp`, `SolidityCompiler.cpp`, `SolidityExpressionCompiler.cpp`)
2023-04-12 00:10:24 +02:00
hrkrshnn
802f895062 feat: introduce EVM Version Shanghai
Note: Paris is still the default
2023-04-12 00:10:24 +02:00
hrkrshnn
0bfcdaf794 feat: change generation of bytecode for pushes with zero-value 2023-04-12 00:10:24 +02:00
Daniel
8b4c1d3373
Merge pull request #14102 from minaminao/fix-dark-mode-in-grammar
Fix dark mode in grammar
2023-04-11 13:07:45 +02:00
hrkrshnn
8757e0aa11 feat: add support for push0 in libevmasm
See https://eips.ethereum.org/EIPS/eip-3855

Note: `push0` costs 2 gas, i.e., `Tier::Base` unlike other pushes.
2023-04-09 18:01:52 +02:00
Kamil Śliwak
66fcd542bc Tests for denominations in array sizes 2023-04-07 14:54:09 +02:00
Kamil Śliwak
fc7cd54849 Tests for changing virtual function mutability when overriding 2023-04-07 14:49:55 +02:00
Kamil Śliwak
5687f6e934 Tests for literal denominations with non-integer literals 2023-04-07 14:48:13 +02:00
Kamil Śliwak
8dd6f77692 Extra test for operator cleanup 2023-04-07 14:47:34 +02:00
minaminao
16d758b7f9 Fix dark mode in grammar 2023-04-07 13:16:21 +09:00
Kamil Śliwak
e29a68d374
Merge pull request #14098 from ethereum/workaround-oz-ext-test-2
Skip `TransparentUpgradeableProxy` openzeppelin external tests due to partial viaIR support in Hardhat
2023-04-06 15:53:33 +02:00
Kamil Śliwak
a902c09cb7
Merge pull request #14086 from ethereum/gnosis-ext-workaround
Skip via-ir with yul optimizer for Gnosis external tests
2023-04-06 15:52:15 +02:00
Rodrigo Q. Saramago
f404eb0349
More openzeppelin workarounds 2023-04-06 13:23:36 +02:00
Nikola Matić
9e0a0af78c
Merge pull request #14062 from ethereum/fix-split-sources-script
[scripts/splitSources.py] Add newline to files.
2023-04-05 22:37:20 +02:00
Rodrigo Q. Saramago
33b07c5dc6
Skip via-ir with yul optimizer for Gnosis external tests 2023-04-05 21:27:31 +02:00
Kamil Śliwak
d7ecee4f0a
Merge pull request #14095 from ethereum/sort-changelog
Sort changelog
2023-04-05 20:23:29 +02:00
Kamil Śliwak
878862a924
Merge pull request #14096 from minaminao/fix-not-displaying-svg-image
fix(docs): not displaying svg images in PDF
2023-04-05 19:40:01 +02:00
minaminao
26c769fe8e fix: not displaying svg image 2023-04-06 01:35:09 +09:00
Nikola Matic
3d5bb3e87b Sort changelog 2023-04-05 17:42:06 +02:00
Kamil Śliwak
9020efec58
Merge pull request #14087 from ethereum/better-error-for-invalid-call
Better error message when trying to call things that are not functions
2023-04-05 17:38:10 +02:00
Nikola Matić
2ea2a63102
Merge pull request #13626 from ethereum/natspec-enum
Adds natspec to AST for enum definition.
2023-04-05 15:48:55 +02:00
Christian Parpart
be8752b5d3 Adds natspec to AST for enum definition. 2023-04-05 14:58:32 +02:00
Leo Alt
8e5f8c8595 reenable arch smt tests 2023-04-05 14:56:03 +02:00
Leo Alt
e6f099db92 bring ubuntu2004 back 2023-04-05 14:56:03 +02:00
Leo Alt
f72e61ccbe update z3 in docker files 2023-04-05 14:56:03 +02:00
Kamil Śliwak
a019f400d0 Better error message when trying to call things that are not functions 2023-04-04 17:30:37 +02:00
Kamil Śliwak
293690e5a4 Add util::capitalized() and Type::categoryName() 2023-04-04 17:30:37 +02:00
Kamil Śliwak
7b634152bd
Merge pull request #14071 from minaminao/docs-fix-yul
docs: correct small errors in yul.rst
2023-04-04 15:28:15 +02:00
Kamil Śliwak
a1fbf6b097
Merge pull request #14020 from krvaibhaw/develop
Update Solidity scripts to remove unencrypted git protocol
2023-04-04 15:05:39 +02:00
Kamil Śliwak
9d5b34b230
Merge pull request #14008 from ethereum/uniform-gh-label-naming-convention
Uniform naming convention for github labels
2023-04-04 14:34:45 +02:00
Nuno Santos
d9965a3d14
Update issue templates (#13970)
* Update issue templates

Added labels to all the templates as well as descriptions.

Next step:
- Mandatory fields.

* Update .github/ISSUE_TEMPLATE/bug_report.md

Co-authored-by: matheusaaguiar <95899911+matheusaaguiar@users.noreply.github.com>

* Update .github/ISSUE_TEMPLATE/documentation_issue.md

Co-authored-by: matheusaaguiar <95899911+matheusaaguiar@users.noreply.github.com>

---------

Co-authored-by: matheusaaguiar <95899911+matheusaaguiar@users.noreply.github.com>
2023-04-04 14:03:10 +02:00
Nuno Santos
0037693c8d
Update ReleaseChecklist.md post release steps (#14007)
* Update ReleaseChecklist.md

* Update ReleaseChecklist.md

* Update ReleaseChecklist.md

* Update ReleaseChecklist.md

* Update ReleaseChecklist.md

Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>

* Update ReleaseChecklist.md

Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>

* Update ReleaseChecklist.md

Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>

* Update ReleaseChecklist.md

Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>

---------

Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
2023-04-03 17:55:17 +01:00
Kamil Śliwak
5e88d590c4
Merge pull request #14077 from minaminao/consolidate-terms-and-fix-typos
Fix a couple of small errors in docs: broken/missing backticks, broken code blocks, bad capitalization
2023-04-03 17:00:36 +02:00
Kamil Śliwak
79d975a77d
Merge pull request #14078 from ethereum/fix_missing_keyword_unicode
Fix missing keyword `unicode` in grammar
2023-04-03 12:53:20 +02:00
Nikola Matić
f2dc3d38a7
Merge pull request #14052 from kuzdogan/develop
Update Metadata Documentation
2023-03-31 15:35:56 +02:00
Kaan Uzdoğan
1a23b7a60a Update metadata docs
Squashed into single commit

Squashed commits:
Sort metadata JSON, add errors to devdoc & userdoc

Sorts the example metadata in the alphabetical order,
as this is the way output by the compiler.

Add playground.sourcify.dev link

Update metadata documentation content

Fix trailing whitespaces

Add new line after code-block

Fix unexpected indentation

Fix unexpected unindent

Fix unexpected unindent - 2

Suggestions from code review: wording, punctuation

Co-authored-by: Nikola Matić <nikola.matic@ethereum.org>
Fix missing trailing commas

Co-authored-by: Nikola Matić <nikola.matic@ethereum.org>
Order yul settings, fix trailing commas

Explicitly state appended to the runtime bytecode

Break down metadata content into two points

Remove trailing whitespace
2023-03-31 15:27:57 +03:00
Leo
bca3fb8ffd
Merge pull request #14076 from ethereum/update_z3_tests
Update z3 tests
2023-03-29 10:35:39 +02:00
Matheus Aguiar
4aa310034c Added missing keyword unicode to Lexer 2023-03-28 13:51:43 -03:00
Leo Alt
ce9a7ee954 update smtchecker tests 2023-03-28 18:23:54 +02:00
minaminao
c0f92da860 Replace solidity with Solidity 2023-03-28 23:02:29 +09:00
minaminao
c2a2fce8e7 Replace Send with `send` 2023-03-28 23:01:06 +09:00
minaminao
25a41e3ac6 Replace Javascript with JavaScript 2023-03-28 22:59:48 +09:00
minaminao
cd8636105d Replace python with Python 2023-03-28 22:59:05 +09:00
minaminao
ccb64e9fa4 Fix the style of bullet points 2023-03-28 22:57:39 +09:00
minaminao
dce1e7b378 Fix "Yul Code" 2023-03-28 22:56:24 +09:00
minaminao
f12e368d67 Fix the missing dot 2023-03-28 22:55:09 +09:00
minaminao
c5ae22db86 Wrap numbers in backquotes 2023-03-28 22:53:57 +09:00
minaminao
58f3aa8c28 Fix the code block not rendered 2023-03-28 22:52:09 +09:00
minaminao
1468f5ac41 Fix the missing backquote 2023-03-28 22:50:35 +09:00
Leo Alt
3e1e43f569 use new z3 2023-03-28 14:37:01 +02:00
Nuno Santos
7974a3cf7c
Consolidated term to reentrancy 2023-03-28 12:28:31 +01:00
minaminao
7375fc24c0 Omit the mention of topics 2023-03-27 18:26:15 +09:00
minaminao
6f0941a510 Correct small errors in yul.rst 2023-03-25 15:13:51 +09:00
Kamil Śliwak
5dbfa9409b
Merge pull request #14066 from ethereum/update_grammar
Update grammar `functionDefinition` parser rule and rename `NumberUnit` lexer rule
2023-03-24 21:19:42 +01:00
Matheus Aguiar
0158de60be Refactored NumberUnit and FunctionDefinition. Added OctalNumber. Fixed number followed by identifier with no whitespace. 2023-03-24 16:19:33 -03:00
Alexander Arlt
3fb1628358 [scripts/splitSources.py] Add newline to files. 2023-03-21 13:56:50 -05:00
Nikola Matić
2ca349c69a
Merge pull request #14061 from mmqxyz/patch-2
Fix small typos in abi-spec.rst
2023-03-21 08:51:41 +01:00
Rodrigo Q. Saramago
a0e62bbd3d
Annotate function ID of functions that may be called via the internal dispatch.
Co-authored-by: Daniel <daniel@ekpyron.org>
2023-03-20 20:14:41 +01:00
mmqxyz
0dd40d2ad2
Fix small typos in abi-spec.rst 2023-03-20 20:12:56 +01:00
Daniel
e7ec40b1af
Merge pull request #13752 from ethereum/reimplement_unused_assign
Reimplement unused eliminators
2023-03-20 16:51:17 +01:00
Kamil Śliwak
afe1242c2f
Merge pull request #14051 from ethereum/stale-action-operation-per-run-bump
Double number of operations per run for stale action bot
2023-03-20 16:25:43 +01:00
chriseth
fac5666dc9 Re-implement unused assign / unused store eliminator. 2023-03-20 13:49:37 +01:00
Daniel
960889f532
Merge pull request #14057 from MuKnIO/notty
Keep test/lsp.py working when not on a tty
2023-03-20 11:32:30 +01:00
Francois-Rene Rideau
acaa019785 Keep test/lsp.py working when not on a tty 2023-03-19 16:09:42 -04:00
Vaibhaw
6b73afae44
Removing unencrypted git protocol 2023-03-16 11:42:42 +01:00
Leo
9a207ad27c
Merge pull request #14028 from ethereum/smt_group_unsupported
[SMTChecker] Group unsupported warnings
2023-03-16 11:15:52 +01:00
Leo Alt
6c58f31b4a add cli tests 2023-03-15 17:52:58 +01:00
Leo Alt
aacbe72079 group unsupported warnings 2023-03-15 17:06:06 +01:00
Rodrigo Q. Saramago
8c53b656e9
Double number of operations per run for stale action bot 2023-03-15 15:36:04 +01:00
Daniel
0aa85153e5
Merge pull request #14042 from uji/unicode-string-grammer
docs/grammer: Fix the writing of unicodeStringLiteral rules.
2023-03-13 13:54:11 +01:00
uji
8b07e23975 docs/grammer: Fix the writing of unicodeStringLiteral rules.
UnicodeStringLiteral rules can be written with a common prefix.
(like HexString ef6ff2f055/docs/grammar/SolidityLexer.g4 (L213))
2023-03-11 17:29:45 +09:00
Kamil Śliwak
d58c699478
Merge pull request #14034 from ethereum/migration-gitter-to-matrix
Migrate from gitter to matrix api
2023-03-10 21:28:53 +01:00
Leo
812e26640c
Merge pull request #13957 from ethereum/smt_report_safe
[SMTChecker] Report safe properties in BMC and CHC
2023-03-09 15:56:06 +01:00
Leo Alt
21c0f78650 Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
Rodrigo Q. Saramago
529ffffbe1
Migrate from gitter to matrix api 2023-03-08 08:54:50 +01:00
Kamil Śliwak
d30ec3548f
Merge pull request #14032 from ethereum/fix-member-call-on-null-for-unary-operators
Fix `member call on null pointer` when type-checking built-in unary operators
2023-03-07 23:42:47 +01:00
Kamil Śliwak
5327f4b4e3
Merge pull request #14031 from ethereum/update-oz-external-tests
Update openzeppelin external tests with basic hardhat via-ir support
2023-03-07 23:42:03 +01:00
Rodrigo Q. Saramago
f974dbc205
Update openzeppelin skipped tests that depends on hardhat via-ir full support 2023-03-07 18:50:48 +01:00
Kamil Śliwak
aeff485079
Merge pull request #14030 from ethereum/fix-ubsan-asan-sanitizer-mixup-in-ci
Fix `b_ubu_ubsan_clang` running the address sanitizer instead of the undefined behavior sanitizer
2023-03-07 11:17:05 +01:00
Kamil Śliwak
94ebcc9742
Merge pull request #14029 from ethereum/clang-std-forward
Use `std::` prefix with `std::forward()` as well to satisfy Clang
2023-03-06 19:28:40 +01:00
Kamil Śliwak
c95108169d Fix member call on null pointer when type-checking built-in unary operators 2023-03-06 19:20:18 +01:00
Kamil Śliwak
ca55115ca5 fix b_ubu_ubsan_clang running the address sanitizer instead of the undefined behavior sanitizer 2023-03-06 19:01:14 +01:00
Kamil Śliwak
817a57b365 Use std:: prefix with std::forward() as well to satisfy Clang 2023-03-06 18:20:49 +01:00
Daniel
9ace80c7ff
Merge pull request #14010 from lemenkov/initialize_before_use
Initialize vars before use
2023-03-06 17:11:26 +01:00
Kamil Śliwak
f341cfbfb6
Merge pull request #13785 from ethereum/fix-strictasm-assembly-opt
Strict assembly fuzzer: Change optimization setting from full to minimal
2023-03-06 11:25:11 +01:00
Bhargava Shastry
1ac3abfbb7 Strict assembly fuzzer: Change optimization setting from full to minimal. 2023-02-24 22:42:07 +01:00
Peter Lemenkov
93c8120a24 Initialize vars before use
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
2023-02-24 12:06:01 +01:00
Kamil Śliwak
0904bb3a3c Update github actions to match renamed labels (lower case, no dashes) 2023-02-23 16:51:56 +01:00
Kamil Śliwak
983407762c
Merge pull request #14002 from ethereum/NunoFilipeSantos-patch-1
Update smtchecker docs to reflect the only 2 Reported Inferred Inductive Invariants
2023-02-23 16:15:45 +01:00
Kamil Śliwak
43e2e3b28b
Merge pull request #13992 from ethereum/triage-any-issue
Run triage action on all new issues independent of the presence of labels
2023-02-23 16:12:54 +01:00
Nuno Santos
b8e74ffc57
Update smtchecker.rst
Fixes #13988
2023-02-23 12:09:12 +00:00
Daniel
58c1cc6bde
Merge pull request #14000 from ethereum/ppaScriptFix
Revert debian compatibility for ubuntu focal support.
2023-02-22 22:41:44 +01:00
Daniel Kirchner
17bb4d8b03 Revert debian compatibility for ubuntu focal support. 2023-02-22 20:46:22 +01:00
Nikola Matić
8540fc8780
Merge pull request #13999 from ethereum/set-version-to-0.8.20
Set version to 0.8.20
2023-02-22 20:33:43 +01:00
Nikola Matic
b6df64e4fd Set version to 0.8.20 2023-02-22 19:41:03 +01:00
Daniel
7dd6d40481
Merge pull request #13996 from ethereum/set-release-date-for-0.8.19
Set release date for 0.8.19
2023-02-22 14:25:21 +01:00
Nikola Matic
21823613bc Set release date for 0.8.19 2023-02-22 13:33:25 +01:00
Daniel
1d8e0abd0a
Merge pull request #13995 from ethereum/revert-13994-set-version-to-0.8.20
Revert "Set version to 0.8.20"
2023-02-22 13:29:02 +01:00
Nikola Matić
5f0f91974a
Revert "Set version to 0.8.20" 2023-02-22 13:27:50 +01:00
Nikola Matić
ab74a268ae
Merge pull request #13994 from ethereum/set-version-to-0.8.20
Set version to 0.8.20
2023-02-22 13:04:15 +01:00
Daniel
d4a08bda93
Merge pull request #13993 from ethereum/sort-changelog-for-0.8.19
Sort Changelog for 0.8.19
2023-02-22 12:38:25 +01:00
Nikola Matic
02b02f507d Set version to 0.8.20 2023-02-22 12:17:21 +01:00
Nikola Matic
486be8f10d Sort Changelog for 0.8.19 2023-02-22 12:13:46 +01:00
Nikola Matic
94ab0e3c53 Sort Changelog for 0.8.19 2023-02-22 12:00:45 +01:00
Daniel
103bf7a71f
Merge pull request #13790 from ethereum/user-defined-operators-for-udvt
User-defined operators for UDVTs
2023-02-22 11:58:48 +01:00
Nikola Matić
82817bfc3a
Merge pull request #13963 from fulldecent/feature-leading-underscore
Add recommendation for leading underscore
2023-02-22 08:23:27 +01:00
William Entriken
6216842458 Add recommendation for leading underscore, see #11764
Update docs/style-guide.rst

Co-authored-by: Nuno Santos <nunofilipesantos@gmail.com>

Update docs/style-guide.rst

Update docs/style-guide.rst

Co-authored-by: Nikola Matić <nikola.matic@ethereum.org>

Update docs/style-guide.rst

Co-authored-by: Nikola Matić <nikola.matic@ethereum.org>

Update docs/style-guide.rst

Update docs/style-guide.rst

Co-authored-by: Nikola Matić <nikola.matic@ethereum.org>

Update docs/style-guide.rst

Update docs/style-guide.rst

Co-authored-by: Nikola Matić <nikola.matic@ethereum.org>

Update docs/style-guide.rst

Co-authored-by: Nikola Matić <nikola.matic@ethereum.org>

Update docs/style-guide.rst

Co-authored-by: Nikola Matić <nikola.matic@ethereum.org>

Update docs/style-guide.rst

Co-authored-by: Nikola Matić <nikola.matic@ethereum.org>

Update docs/style-guide.rst

Co-authored-by: Nikola Matić <nikola.matic@ethereum.org>

Update docs/style-guide.rst

Co-authored-by: Nikola Matić <nikola.matic@ethereum.org>
2023-02-22 07:31:51 +01:00
wechman
aba5ac5e2a User-defined operators: Tests 2023-02-22 00:40:03 +01:00
Kamil Śliwak
5b5e853ea0 Warn about missing user-defined operator support in SMTChecker 2023-02-22 00:39:25 +01:00
wechman
2e8d50eca2 User-defined operators: Documentation 2023-02-22 00:39:25 +01:00
wechman
1a83fa7ebc User-defined operators: Code generation 2023-02-22 00:39:25 +01:00
wechman
5b03c13f90 User-defined operators: Analysis 2023-02-22 00:39:25 +01:00
wechman
9445483d60 User-defined operators: Parsing and grammar 2023-02-22 00:06:17 +01:00
wechman
9a36438441 User-defined operators: AST 2023-02-22 00:06:17 +01:00
Kamil Śliwak
fa0d3a44a7 Tests for using enums and fixed-point types as user-defined types 2023-02-21 23:42:22 +01:00
Rodrigo Q. Saramago
9efc422b48
Run triage action on all new issues 2023-02-21 22:04:41 +01:00
Kamil Śliwak
38b5ae578b Fix typo in test name: singed -> signed 2023-02-21 21:30:03 +01:00
Daniel
6c9fc53874
Merge pull request #13991 from ethereum/fix-broken-links-for-0.8.19
Fix broken links for 0.8.19
2023-02-21 16:28:21 +01:00
Nikola Matic
2c306ed32c Fix broken links for 0.8.19 2023-02-21 14:46:41 +01:00
Nikola Matić
ff61192eda
Merge pull request #13980 from Drblessing/develop
Update documentation block time discussion
2023-02-21 14:07:37 +01:00
drblessing
37e507972c Update block time documentation 2023-02-21 13:18:51 +01:00
Nikola Matić
c2036081db
Merge pull request #13804 from ethereum/duplicatedSubAssembly
Do not duplicate subassemblies.
2023-02-21 07:07:07 +01:00
Daniel
d3d9d09f5e
Merge pull request #13990 from minaminao/remove-unnecesary-text-in-yul-rst
docs: remove unnecessary text in yul.rst
2023-02-20 22:37:16 +01:00
Daniel Kirchner
4064116df4 Do not duplicate subassemblies.
Add LinkerObject check and more tests
2023-02-20 22:20:45 +01:00
minaminao
411431444e fix: remove unnecessary text in yul.rst 2023-02-21 05:37:10 +09:00
Kamil Śliwak
18b42dccd6
Merge pull request #13973 from ethereum/static-build-2004
Restore static ubuntu 20.04 release builds
2023-02-20 15:30:03 +01:00
Rodrigo Q. Saramago
930c8c0753
Restore static ubuntu 20.04 release builds 2023-02-20 14:27:30 +01:00
Kamil Śliwak
13c0d93f81
Merge pull request #13888 from Zachinquarantine/remove-verifytestcases
Remove obsolete endToEndExtraction script
2023-02-20 13:55:06 +01:00
Zachinquarantine
45a3d8228d Removed folder scripts/endToEndExtraction/ 2023-02-17 16:10:22 -03:00
Kamil Śliwak
973eda17b4
Merge pull request #13977 from ethereum/revert-openzeppelin-time-workaround
Remove openzeppelin workaround
2023-02-17 14:13:17 +01:00
Kamil Śliwak
23eb9c59bb
Merge pull request #13964 from ethereum/more_aggressive_runtime_code_exclusion
More aggressive runtime code exclusion.
2023-02-16 13:49:34 +01:00
Rodrigo Q. Saramago
228c355424
Remove openzeppelin workaround 2023-02-16 13:10:21 +01:00
chriseth
01b10e2515 Gas updates. 2023-02-15 21:33:06 +01:00
chriseth
07750ea23a More aggressive runtime code exclusion. 2023-02-15 21:33:06 +01:00
Kamil Śliwak
e147654f92
Merge pull request #13971 from ethereum/improve-error-reporting-for-wrong-constructor-arguments
Improve error messages for wrong constructor arguments
2023-02-15 20:39:59 +01:00
Kamil Śliwak
8e652c3aff
Merge pull request #13976 from ethereum/openzeppelin-governor-clock-bug
Skipping flaky openzeppelin tests
2023-02-15 20:30:20 +01:00
Rodrigo Q. Saramago
ceaa7b53da
Skipping flaky openzeppelin tests 2023-02-15 18:54:15 +01:00
Kamil Śliwak
1a981af548 Only suggest removing parentheses from a construction call if they're empty 2023-02-15 14:27:03 +01:00
Kamil Śliwak
73183d3df9 Fix missing base constructor arguments being treated as an unimplemented function 2023-02-15 14:27:03 +01:00
Kamil Śliwak
bc3cbfa18d Add more tests tests for calls to base constructor with missing or wrong arguments 2023-02-15 14:17:55 +01:00
Kamil Śliwak
16bc4c6b5f Fix test for replacing base constructor 2023-02-15 14:17:55 +01:00
Kamil Śliwak
1b0f7af707
Merge pull request #13926 from ethereum/release-checklist-tweaks-and-clarifications
Release checklist tweaks and clarifications
2023-02-14 22:10:51 +01:00
Kamil Śliwak
0aefd15576 ReleaseChecklist: Add more detail to the PPA steps 2023-02-14 14:43:32 +01:00
Kamil Śliwak
0384506e55 ReleaseChecklist: Pre-flight checks and drafts to be prepared before the release 2023-02-14 14:43:32 +01:00
Kamil Śliwak
89c4ee6942 Add a script for generating a list of contributors to paste in release notes 2023-02-14 14:39:55 +01:00
Kamil Śliwak
8b7879c7da ReleaseChecklist: static-z3.sh is actually called static_z3.sh 2023-02-14 14:39:55 +01:00
Kamil Śliwak
7585cd9507 ReleaseChecklist: List packages needed to update the PPA as prerequisites 2023-02-14 14:39:55 +01:00
Daniel
7cd589eee4
Merge pull request #13961 from ethereum/fix-external-test-gp2
gp2 external test workaround
2023-02-13 21:36:36 +01:00
chriseth
91b14174d8
Merge pull request #13702 from ethereum/new_knowledge_engine
Re-implement KnowledgeBase using groups of constantly-spaced variables.
2023-02-13 20:05:47 +01:00
r0qs
e50d56517b
Merge pull request #13947 from ethereum/update-stale-issues
Update stale issues action
2023-02-11 20:26:22 +01:00
Rodrigo Q. Saramago
a5166f0a19
gp2 external test workaround 2023-02-11 17:16:03 +01:00
Rodrigo Q. Saramago
627bbe2ea3
Update stale issues policies 2023-02-11 11:24:14 +01:00
chriseth
29e4becd73 Introduce helpers for VariableOffset. 2023-02-09 16:44:36 +01:00
Leo
59f9ab4dee
Merge pull request #13939 from pgebal/fix_handling_bitwise_operators_when_parsing_z3_call_result
Fixes handling bitwise operators for z3 model checker
2023-02-09 12:16:28 +01:00
chriseth
3ac6edec5b Apply suggestions from code review 2023-02-09 10:47:12 +01:00
chriseth
695b250557 Update gas costs. 2023-02-09 10:47:12 +01:00
chriseth
eec258c2d2 Bugfix. 2023-02-09 10:47:12 +01:00
chriseth
6bbef64034 Optimize in case this is SSA. 2023-02-09 10:47:12 +01:00
chriseth
96e2a6d3fe Keep one instance of KnowledgeBase for UnusedStoreEliminator. 2023-02-09 10:47:12 +01:00
chriseth
47aa1c65ae Re-implement KnowledgeBase using groups of constantly-spaced variables. 2023-02-09 10:47:11 +01:00
Daniel
d33f2734b6
Merge pull request #13952 from ethereum/fix-abstract-nondet
fix abstract nondet exception
2023-02-08 19:39:19 +01:00
Daniel
7b35f44622
Merge pull request #13953 from lemenkov/gcc_12_strings_recognition
Type recognition workaround for some GCC compilers
2023-02-08 19:36:02 +01:00
Pawel Gebal
a38549dc19 Fixes handling bitwise operators for z3 model checker 2023-02-08 18:37:17 +01:00
Peter Lemenkov
603f9f7208 Type recognition workaround for some GCC compilers
Looks like somewhat old GCC compilers, namely 12.2.1, cannot recognize a
string literal sometimes. Let's help it to avoid error logs like this
one:

```
[ 75%] Building CXX object libsolidity/CMakeFiles/solidity.dir/codegen/ir/IRGeneratorForStatements.cpp.o
cd /builddir/build/BUILD/solidity-0.8.18/redhat-linux-build/libsolidity && /usr/bin/g++ -DBOOST_ATOMIC_DYN_LINK -DBOOST_ATOMIC_NO_LIB -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_FILESYSTEM_NO_LIB -DBOOST_SYSTEM_DYN_LINK -DBOOST_SYSTEM_NO_LIB -DFMT_HEADER_ONLY=1 -DHAVE_CVC4 -DHAVE_Z3 -I/builddir/build/BUILD/solidity-0.8.18/redhat-linux-build/include -I/builddir/build/BUILD/solidity-0.8.18 -isystem /usr/include/z3 -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fuse-ld=gold -O3 -DNDEBUG -fstack-protector-strong -Wimplicit-fallthrough -fmacro-prefix-map=/builddir/build/BUILD/solidity-0.8.18=/solidity -Wpessimizing-move -Wredundant-move -Wall -Wextra -Werror -pedantic -Wmissing-declarations -Wno-unknown-pragmas -Wsign-conversion -Wconversion -Wextra-semi -Wduplicated-cond -Wlogical-op -fdiagnostics-color -std=c++17 -MD -MT libsolidity/CMakeFiles/solidity.dir/codegen/ir/IRGeneratorForStatements.cpp.o -MF CMakeFiles/solidity.dir/codegen/ir/IRGeneratorForStatements.cpp.o.d -o CMakeFiles/solidity.dir/codegen/ir/IRGeneratorForStatements.cpp.o -c /builddir/build/BUILD/solidity-0.8.18/libsolidity/codegen/ir/IRGeneratorForStatements.cpp
In file included from /usr/include/c++/12/string:40,
                 from /builddir/build/BUILD/solidity-0.8.18/libsolidity/ast/ASTForward.h:27,
                 from /builddir/build/BUILD/solidity-0.8.18/libsolidity/ast/AST.h:26,
                 from /builddir/build/BUILD/solidity-0.8.18/libsolidity/ast/ASTVisitor.h:26,
                 from /builddir/build/BUILD/solidity-0.8.18/libsolidity/codegen/ir/IRGeneratorForStatements.h:24,
                 from /builddir/build/BUILD/solidity-0.8.18/libsolidity/codegen/ir/IRGeneratorForStatements.cpp:22:
In function 'std::char_traits<char>::copy(char*, char const*, unsigned long)',
    inlined from 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_copy(char*, char const*, unsigned long)' at /usr/include/c++/12/bits/basic_string.h:423:21,
    inlined from 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace(unsigned long, unsigned long, char const*, unsigned long)' at /usr/include/c++/12/bits/basic_string.tcc:532:22,
    inlined from 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::assign(char const*)' at /usr/include/c++/12/bits/basic_string.h:1647:19,
    inlined from 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator=(char const*)' at /usr/include/c++/12/bits/basic_string.h:815:28,
    inlined from '(anonymous namespace)::CopyTranslate::translateReference(solidity::yul::Identifier const&)' at /builddir/build/BUILD/solidity-0.8.18/libsolidity/codegen/ir/IRGeneratorForStatements.cpp:182:13:
/usr/include/c++/12/bits/char_traits.h:431:56: error: 'memcpy' accessing 9223372036854775810 or more bytes at offsets -4611686018427387902 and [-4611686018427387903, 4611686018427387904] may overlap up to 9223372036854775813 bytes at offset -3 [-Werror=restrict]
  431 |         return static_cast<char_type*>(__builtin_memcpy(__s1, __s2, __n));
      |                                        ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
gmake[2]: *** [libsolidity/CMakeFiles/solidity.dir/build.make:695: libsolidity/CMakeFiles/solidity.dir/codegen/ir/IRGeneratorForStatements.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[2]: Leaving directory '/builddir/build/BUILD/solidity-0.8.18/redhat-linux-build'
gmake[1]: *** [CMakeFiles/Makefile2:414: libsolidity/CMakeFiles/solidity.dir/all] Error 2
gmake[1]: Leaving directory '/builddir/build/BUILD/solidity-0.8.18/redhat-linux-build'
gmake: *** [Makefile:139: all] Error 2
```

Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
2023-02-08 17:51:56 +01:00
Leo Alt
db9c11a2a5 fix abstract nondet exception 2023-02-08 16:59:37 +01:00
Daniel
665bf29a84
Merge pull request #12958 from ethereum/yul-fuzzer-bound-memory-accesses
Yul grammar generator: Bound memory accesses.
2023-02-07 15:47:20 +01:00
Daniel
048aabd3ca
Merge pull request #13934 from esaulpaugh/develop
specify "receive" as having no "name"
2023-02-07 15:40:52 +01:00
Daniel
82fdc6fccc
Merge pull request #13932 from lemenkov/redundant_std_move
libsolidity: Redundant std::move
2023-02-07 15:29:41 +01:00
matheusaaguiar
88e44ed5e2
Merge pull request #13941 from ethereum/cleanup-gnosis-test
Cleanup of duplicated line leftover from previous fix
2023-02-06 18:58:25 -03:00
Matheus Aguiar
a5c5e4602a Cleanup of duplicated line leftover from previous fix 2023-02-06 18:10:31 -03:00
Nikola Matić
e48d495fb7
Merge pull request #13940 from ethereum/fix-workaround-gnosis-test
Replace quote marks with quotation marks in workaround of gnosis.sh external test
2023-02-06 21:48:38 +01:00
Leo
7176925a87
Merge pull request #11559 from ethereum/smt_trusted
[SMTChecker] Trusted mode for external calls
2023-02-06 21:39:13 +01:00
Matheus Aguiar
98c011328a Replace quote marks with quotation marks 2023-02-06 16:53:23 -03:00
Nuno Santos
411841cbb5
Tweak wording in value type docs (#13935)
* Update value-types.rst

- User-defined were written inconsistently (with/without hyphen)
- Rewording some sentences for user clarity.

* Update docs/types/value-types.rst

Co-authored-by: chriseth <chris@ethereum.org>

---------

Co-authored-by: chriseth <chris@ethereum.org>
2023-02-06 17:19:48 +00: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
Evan Saulpaugh
821da895ea
specify "receive" as having no "name" 2023-02-05 16:13:23 -06: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
Kamil Śliwak
f2bf23a067
Merge pull request #13929 from jhheider/explicit-copy-init
Fixes minor compilation errors with some clangs
2023-02-05 01:48:08 +01:00
Kamil Śliwak
acc01dadfc
Merge pull request #13919 from lemenkov/explicit_include
libsolutil: Add missing include
2023-02-05 01:46:36 +01:00
Peter Lemenkov
6a6bf303b5 libsolutil: Add missing include
This one is more obscure. It helps suppressing the following error while
compiling:

```
/builddir/build/BUILD/solidity-0.8.18/liblangutil/EVMVersion.h:33:6: error: elaborated-type-specifier for a scoped enum must not use the 'class' keyword [-Werror]
   33 | enum class Instruction: uint8_t;
      | ~~~~ ^~~~~
      |      -----
/builddir/build/BUILD/solidity-0.8.18/liblangutil/EVMVersion.h:33:23: error: found ':' in nested-name-specifier, expected '::'
   33 | enum class Instruction: uint8_t;
      |                       ^
      |                       ::
/builddir/build/BUILD/solidity-0.8.18/liblangutil/EVMVersion.h:33:12: error: 'Instruction' has not been declared
   33 | enum class Instruction: uint8_t;
      |            ^~~~~~~~~~~
/builddir/build/BUILD/solidity-0.8.18/liblangutil/EVMVersion.h:101:24: error: 'solidity::evmasm::Instruction' has not been declared
  101 |         bool hasOpcode(evmasm::Instruction _opcode) const;
      |                        ^~~~~~
/builddir/build/BUILD/solidity-0.8.18/liblangutil/EVMVersion.cpp:29:6: error: no declaration matches 'bool solidity::langutil::EVMVersion::hasOpcode(solidity::evmasm::Instruction) const'
   29 | bool EVMVersion::hasOpcode(Instruction _opcode) const
      |      ^~~~~~~~~~
/builddir/build/BUILD/solidity-0.8.18/liblangutil/EVMVersion.h:101:14: note: candidate is: 'bool solidity::langutil::EVMVersion::hasOpcode(int) const'
  101 |         bool hasOpcode(evmasm::Instruction _opcode) const;
      |              ^~~~~~~~~
/builddir/build/BUILD/solidity-0.8.18/liblangutil/EVMVersion.h:43:7: note: 'class solidity::langutil::EVMVersion' defined here
   43 | class EVMVersion:
      |       ^~~~~~~~~~
cc1plus: all warnings being treated as errors
```

Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
2023-02-04 16:22:18 +01:00
Peter Lemenkov
8f1668ffb8 libsolutil: Add missing include
This helps suppressing the following message during compilation:

```
/builddir/build/BUILD/solidity-0.8.18/libsolutil/Common.h:55:27: error: 'uint8_t' was not declared in this scope
   55 | using bytes = std::vector<uint8_t>;
      |                           ^~~~~~~
/builddir/build/BUILD/solidity-0.8.18/libsolutil/Common.h:49:1: note: 'uint8_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
   48 | #include <functional>
  +++ |+#include <cstdint>
   49 | #include <string>
```

Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
2023-02-04 16:22:18 +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
Kamil Śliwak
77640a57c9
Merge pull request #13781 from janisozaur/patch-2
Update debian/compat to version 13
2023-02-03 22:28:20 +01:00
Kamil Śliwak
558c39dad6
Merge pull request #13855 from ethereum/allow_external_library_functions_attached
Allow library external functions to be attached with using for
2023-02-03 21:10:46 +01:00
Michał Janiszewski
6f285ad197 Update debian/compat to version 13
Compat version 13 is currently the recommended one.

An important change introduced in 10 was change of default to target parallel builds

5d1bb29841/debhelper.pod (compatibility-levels)
2023-02-03 20:56:25 +01:00
r0qs
dbf35f1c14
Merge pull request #13910 from ethereum/asan-cli-fix
Avoid printing suppressions statistics for t_ubu_asan_cli tests
2023-02-03 10:15:25 +01:00
Matheus Aguiar
2b70b08d5f Allow library external functions to be bound with using for 2023-02-02 13:39:19 -03:00
Bhargava Shastry
5c6e12b2c0 Update existing and add new test cases. 2023-02-02 11:40:39 +01:00
Rodrigo Q. Saramago
7ddb5e0c66
Change relative to absolute path for LSAN_OPTIONS 2023-02-02 09:49:59 +01:00
Rodrigo Q. Saramago
bc00063b2e
Do not print suppressions statistics for cli tests 2023-02-02 09:49:58 +01:00
Bhargava Shastry
f8880cad82 Yul grammar generator: Bound memory accesses. 2023-02-02 08:10:53 +01:00
Kamil Śliwak
ddbef8f650
Merge pull request #13918 from ethereum/set-version-to-0.8.19
Set version to 0.8.19
2023-02-01 21:15:15 +01:00
Kamil Śliwak
78608e8d17
Merge pull request #13916 from NicoAcosta/mapping-style
Fix mapping style in docs
2023-02-01 20:56:29 +01:00
Rodrigo Q. Saramago
e735ff1a95
Set version to 0.8.19 2023-02-01 20:24:50 +01:00
Nicolás Acosta
da7dfeb0c5 style(reference-types): fix mapping style 2023-02-01 15:54:32 -03:00
Nicolás Acosta
b403085fa1 style(layout_in_storage): fix mapping style 2023-02-01 15:54:08 -03:00
Nicolás Acosta
9b0556caa4 style(modular): fix mapping style 2023-02-01 15:53:33 -03:00
Nicolás Acosta
5b149adfcd style(visibility-and-getters): fix mapping style 2023-02-01 15:53:04 -03:00
Nicolás Acosta
72a17ceb71 style(function-modifiers): fix mapping style 2023-02-01 15:52:34 -03:00
Nicolás Acosta
1edfd73b37 style(security-considerations): fix mapping style 2023-02-01 15:51:56 -03:00
Nicolás Acosta
7b8478a81b style(intro-sc): fix mapping style 2023-02-01 15:51:26 -03:00
Nicolás Acosta
4ff310cc62 style(common-patterns): fix mapping style 2023-02-01 15:50:48 -03:00
Nicolás Acosta
e89efe89a6 style(mapping-types): fix mapping style 2023-02-01 15:49:34 -03:00
Kamil Śliwak
87f61d960c
Merge pull request #13913 from ethereum/changelog-v0.8.18
Sort changelog for 0.8.18 alphabetically
2023-02-01 15:36:41 +01:00
Rodrigo Q. Saramago
66007f5001
Add release date and bugs by version entry for 0.8.18 2023-02-01 14:45:13 +01:00
Rodrigo Q. Saramago
a186e60782
Sort changelog for 0.8.18 alphabetically 2023-02-01 14:45:13 +01:00
Kamil Śliwak
836e1ee1ca
Merge pull request #13914 from ethereum/pylint-2.16-fix
Fix pylint 2.16 warnings
2023-02-01 14:43:46 +01:00
Rodrigo Q. Saramago
828f95ad9e Fix pylint 2.16 warnings 2023-02-01 10:39:00 -03:00
Kamil Śliwak
37953a7eb0
Merge pull request #13911 from ethereum/fix-broken-docs-links-and-redirects
Fix broken docs links and redirects
2023-02-01 14:13:31 +01:00
Kamil Śliwak
8447baec4d docs; Link to published versions of translated docs for languages that already have them 2023-02-01 12:27:56 +01:00
Kamil Śliwak
57b01db57b docs: Replace broken link to Oxford Dictionary British spelling page with an archive.org copy 2023-02-01 12:27:23 +01:00
Kamil Śliwak
986bc361b1 docs: Replace some links with redirects found by linkcheck 2023-02-01 12:26:44 +01:00
Kamil Śliwak
20138f35df
Merge pull request #13909 from codeTIT4N/develop
Replace references to `sha3` in the docs with `keccak`
2023-02-01 11:54:06 +01:00
franzihei
6cad055d97
[DOCS] Update copyright year and description (#13894)
Co-authored-by: Nuno Santos <nuno.santos@ethereum.org>
Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
2023-02-01 11:47:08 +01:00
Kamil Śliwak
dec1adc03b
Merge pull request #13883 from ethereum/default-evmversion-paris
Set default EVM version to Paris
2023-02-01 11:45:13 +01:00
Lokesh Kumar
4f84112650
updated abi-spec.rst 2023-02-01 03:12:03 +05:30
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
Kamil Śliwak
fa4892e622
Merge pull request #13905 from shimmeris/patch-2
`optimizer.rst`: Remove redundant word in `UnusedStoreEliminator` description
2023-01-31 10:29:05 +01:00
Mio
a68501cebd
fix redundant typo 2023-01-31 13:23:47 +08:00
Rodrigo Q. Saramago
d9d9ab30a2 Update default evm version to paris 2023-01-30 17:57:08 +01:00
Daniel
939b916f4a
Merge pull request #13903 from ethereum/asan-cvc4-cln-memory-leak
Suppress libcln in nightly asan jobs
2023-01-30 14:32:40 +01:00
Rodrigo Q. Saramago
21f95c4536
Suppress libcln from asan tests 2023-01-30 13:22:58 +01:00
Bhargava Shastry
cfc62a4e07
Merge pull request #13902 from ethereum/paris-proto
Yul proto converter: Output prevrandao for evm versions >= paris
2023-01-30 11:49:48 +01:00
Bhargava Shastry
564cf85725 Yul proto converter: Output prevrandao for evm versions >= paris 2023-01-30 09:19:33 +01:00
r0qs
206e7cf5db
Disable stale action debug mode (#13756) 2023-01-26 13:40:38 +00:00
Nikola Matić
019d13d3b6
Merge pull request #13884 from ethereum/deprecation-warning-for-selfdestruct
Issue warning when using deprecated SELFDESTRUCT
2023-01-26 14:33:26 +01:00
Nikola Matic
83a937423f Update docs to reflect deprecation warning 2023-01-26 13:42:26 +01:00
Nikola Matic
e7543d487d Issue warning when using deprecated SELFDESTRUCT 2023-01-25 16:55:11 +01:00
Daniel
fd9ac9abed
Merge pull request #13759 from ethereum/prevrandao
Add `block.prevrandao` as alias for `block.difficulty`
2023-01-25 16:37:17 +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
Kamil Śliwak
d70d79af4a
Merge pull request #13816 from quantum13/disallow_several_indexed_for_event_parameter
Disallow several `indexed` attributes for the same event parameter
2023-01-20 21:14:39 +01:00
vlad
484ee8a621 Additional tests for edge cases for mutability, visibility, location, experimental, global, indexed and anonymous 2023-01-20 20:05:36 +01: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
Daniel
c195782f96
Merge pull request #13778 from Andy53/removes-solidity-upgrade
Removes solidity upgrade
2023-01-18 13:20:54 +01:00
Kamil Śliwak
34b975da62
Merge pull request #13881 from ethereum/gnosis-remove-workarounds-for-latest-dependencies
Remove more workarounds from gnosis ext test
2023-01-18 12:47:45 +01:00
Nikola Matić
57a686656a
Merge pull request #13880 from ethereum/allow-older-boost-support
Allow support for older boost and adjust docs
2023-01-18 11:59:12 +01:00
Nikola Matic
c2e2adb953 Allow support for older boost and adjust docs 2023-01-18 10:51:14 +01:00
Rodrigo Q. Saramago
a9757e963e
Remove more workarounds 2023-01-18 09:25:31 +00:00
Nikola Matić
db0ecd2413
Merge pull request #13878 from ethereum/gnosis-remove-workarounds-for-latest-dependencies
Remove workarounds for latest dependencies from gnosis ext test
2023-01-18 09:42:39 +01:00
Kamil Śliwak
6df65ca1a1 gnosis ext test: Remove workarounds that used to be necessary to make the test work with latest versions of its dependencies 2023-01-18 08:54:01 +01:00
Kamil Śliwak
96ddc54fa2
Merge pull request #13860 from ethereum/forbid_private_library_functions_attached
Forbid private library functions be attached with using for outside their declaration scope
2023-01-17 22:11:29 +01:00
Matheus Aguiar
7779b6f352 Forbid private library functions to be attached outside their declaration scope 2023-01-17 16:27:35 -03:00
andy53
df2ea19535 Remove solidity-upgrade
update config.yaml

Update using-the-compiler.rst

removed bug reports section

added changelog entry

removed trailing whitespace

removed trailing whitespace
2023-01-17 07:59:43 -07:00
Kamil Śliwak
229fcc9fce
Merge pull request #13876 from Big-Aaron/develop
Update ir-breaking-changes.rst
2023-01-17 14:20:07 +01:00
Daniel
0d19b94286
Merge pull request #13877 from ethereum/add-key-name-source-location-for-mappings
Source locations for named mapping keys and values
2023-01-17 13:31:32 +01:00
Nikola Matic
83c1f62026 Source location for named mapping keys 2023-01-17 12:25:23 +01:00
Big-Aaron
83774c28bf
Update ir-breaking-changes.rst
Fix errors in the doc
2023-01-17 11:30:30 +08:00
Daniel
7b2f8a2e31
Merge pull request #13875 from ethereum/fix-ext-test-gnosis
Change filename in gnosis external test script
2023-01-16 19:01:20 +01:00
Matheus Aguiar
82806c4236 Change filename in sed command 2023-01-16 12:54:02 -03:00
Nikola Matić
609f15229b
Merge pull request #13857 from ethereum/add-snark-verifier-benchmark
Add snark verifier benchmark test
2023-01-12 13:03:10 +01:00
Nikola Matić
7c62f35a61
Merge pull request #13863 from ethereum/bump-ubuntu-images
Update ubuntu images from `2004` to `2204`
2023-01-12 12:34:54 +01:00
Nikola Matic
0ca97ba8b8 Add snark verifier benchmark test 2023-01-12 11:59:33 +01:00
Rodrigo Q. Saramago
b1f728efcd
Remove hera build 2023-01-12 11:47:14 +01:00
Rodrigo Q. Saramago
b07ccd56e1
Add CLN library 2023-01-12 11:47:14 +01:00
Rodrigo Q. Saramago
43032433fd
Rename buildpack-deps ci scripts 2023-01-12 11:47:14 +01:00
Rodrigo Q. Saramago
0178024903
Reset label version for new image 2023-01-12 11:47:14 +01:00
Rodrigo Q. Saramago
904afd8963
Rename ubuntu dockerfiles 2023-01-12 11:47:14 +01:00
Rodrigo Q. Saramago
a01936d5fc
Bumping ubuntu images to use boost 1_74_0 2023-01-12 11:47:14 +01:00
Nikola Matić
a68af64004
Merge pull request #13866 from ethereum/update-docker-images-ci
Update CI config to use 2204 docker images
2023-01-12 11:45:45 +01:00
Nikola Matic
f2e053e0c8 disable cxx20 job 2023-01-12 10:42:47 +01:00
Rodrigo Q. Saramago
7063fabf1f Update CI ubuntu version to 2204
Minor fix

replace deprecated is_pod
2023-01-12 10:37:29 +01:00
Nikola Matic
1da82045c4 Use directory_options instead of deprecated symlink_option
basename to step
2023-01-12 10:37:01 +01:00
Rodrigo Q. Saramago
d4f9383185
Drop ewasm from tests 2023-01-12 09:08:39 +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
Daniel
2e2210222c
Merge pull request #13849 from ethereum/ossfuzzGitterComment
Disable t_ubu_ossfuzz gitter notifications.
2023-01-05 18:31:35 +01:00
Daniel Kirchner
03eb17a50f Disable t_ubu_ossfuzz gitter notifications. 2023-01-05 17:43:31 +01:00
Nikola Matić
090a9d0937
Merge pull request #13850 from ethereum/zeppelin-ci-sandbox
Silence version check and up node heap limit for Zeppelin tests
2023-01-05 11:42:42 -05:00
Nikola Matic
5ecf3075fb Silence version check grep and up the node heap limit 2023-01-05 16:55:16 +01:00
Daniel
e6b579fa40
Merge pull request #13841 from ethereum/unpin-v4-core-and-neutralize-packages
Unpin v4-core dependency and neutralize packaged contracts
2023-01-05 13:02:08 +01:00
Daniel
85ccae2276
Merge pull request #13842 from ethereum/update-sphinx-a4doc
Update sphinx-a4doc version
2023-01-05 13:01:31 +01:00
Nikola Matic
17d57da082 Unpin v4-core dependency and neutralize packages 2023-01-04 12:02:13 +01:00
Rodrigo Q. Saramago
0694f639e4
Update sphinx-a4doc version 2023-01-04 11:46:59 +01:00
Daniel
2ec6a04b36
Merge pull request #13833 from quantum13/fix_sphinx_version_to_5
fix sphinx version to 5.* since 6.0 is not supported by code
2023-01-04 11:34:11 +01:00
vlad
f48cd743d9 fix sphinx version to 5.* since 6.0 is not supported by code 2022-12-30 00:46:32 +04:00
Nikola Matić
f1d427242f
Merge pull request #13830 from pgrimaud/develop
docs: fix typos
2022-12-27 09:51:05 -05:00
Pierre Grimaud
b314e1b37d
docs: fix typos 2022-12-25 22:39:50 +01:00
Kamil Śliwak
71ce291cb9
Merge pull request #13659 from Andy53/Report-when-no-contracts-to-compile
Report when no contracts to compile
2022-12-21 16:05:28 +01:00
Daniel
32f94d45b5
Merge pull request #13821 from ethereum/workaround-sphinx-a4doc
Fix sphinx-a4doc version to 1.3.0
2022-12-20 17:36:07 +01:00
Rodrigo Q. Saramago
7242d9c2cf
Fix sphinx-a4doc version to 1.3.0 2022-12-20 13:21:27 +01:00
andy53
3bc535e1a1 Report when no contracts to compile
updates
2022-12-19 13:47:03 +01:00
Kamil Śliwak
73fcf69188
Merge pull request #13814 from Saw-mon-and-Natalie/typo/types-comments
Fixed some comments in `Types.h`
2022-12-17 02:53:56 +01:00
Kamil Śliwak
b053359b9b
Merge pull request #13782 from kanej/docs/update-resources-with-more-extensions
docs(resources.rst): update editor extensions
2022-12-16 17:58:44 +01:00
Nikola Matić
43cc4d0904
Merge pull request #13810 from ethereum/external-tests-maintenance
External tests maintenance
2022-12-16 10:21:42 -05:00
Saw-mon-and-Natalie
e295964f50
fixed some comments in Types.h 2022-12-16 14:58:41 +00:00
Nikola Matic
4d627e6fc4 fixup! External tests maintenance 2022-12-16 14:49:01 +01:00
Nikola Matić
fcfc96567c
Merge pull request #13792 from ethereum/z3_version_docs
update docs on the required z3 version
2022-12-16 07:58:55 -05:00
Leo Alt
d5c6fd881b update docs on the required z3 version 2022-12-16 13:05:40 +01:00
Nikola Matic
d1a158368a External tests maintenance 2022-12-16 11:34:00 +01:00
Nikola Matić
c1040815b1
Merge pull request #13808 from ethereum/unpeg-fixed-dependency-from-elementfi 2022-12-15 12:33:33 -05:00
Nikola Matic
cca1b460c9 Unpeg fixed dependency from elementfi external test 2022-12-15 16:45:44 +01:00
Kamil Śliwak
e06f3b2c46
Merge pull request #13806 from ethereum/fix-pooltogether-failing-test
Pin v4-core dependecy to fix failing exteral pooltogether test
2022-12-15 14:40:52 +01:00
Nikola Matic
ab78f69bf5 Pin v4-core dependecy to fix failing exteral pooltogether test 2022-12-15 12:53:57 +01:00
Kamil Śliwak
37e935f025
Merge pull request #13803 from kuzdogan/docs-favicon
[docs]: Add Solidity favicon
2022-12-14 23:37:47 +01:00
Kaan Uzdogan
a98bb41bd3 Add Solidity favicon to docs 2022-12-14 18:15:50 +01:00
Kamil Śliwak
e769c79813
Merge pull request #13741 from ethereum/consistent-bound-function-terminology
Consistent terminology for attached/bound functions
2022-12-14 14:53:47 +01:00
John Kane
f5858a118d
docs(resources.rst): update editor extensions
Update the editor extensions section of the resources page:

1. Remove the Atom section - as Atom is being deprecated on
   2022-12-15. See https://github.blog/2022-06-08-sunsetting-atom/.
2. Update the vim syntax plugins - remove the tomlion extension as
   no longer maintained, add the thesis and TovarishFin forks of
   the tomlion vim syntax highlighter as these are both maintained.
3. add/rename vscode extensions - add truffle and remix extensions,
   rename the two Solidity extensions to include the authors for
   disambiguation.
4. Clarify the Visual Studio Code title by including `VS Code` in
   brackets, as many people only know it as `VS Code`.
5. Use Sublime Text's full name.

Co-authored-by: franzihei <41991517+franzihei@users.noreply.github.com>
Co-authored-by: Nuno Santos <nunofilipesantos@gmail.com>
2022-12-12 10:02:54 +00:00
Kamil Śliwak
a9fe05e8c0
Merge pull request #13793 from ethereum/increase-asancli-codecov-ci-resoure
Increase CI resource_class of t_ubu_asan_cli and t_ubu_codecov tests
2022-12-09 21:15:48 +01:00
Rodrigo Q. Saramago
1f1b5910dc
Change base image of t_ubu_asan_cli and t_ubu_codecov to image with
higher resource_class
2022-12-09 13:38:25 +01:00
Kamil Śliwak
b49dac7a8e
Merge pull request #13784 from minebuu/patch-2
Fixed typo in abi.encodeWithSignature description
2022-12-08 14:01:47 +01: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
Kamil Śliwak
abbf2cb6d6 using-for-rst: Make it clearer where snippets are just examples 2022-12-07 19:31:44 +01:00
wechman
c2e6452b90 using-for.rst: Clarify which library functions can be used with using for 2022-12-07 19:31:44 +01:00
Kamil Śliwak
71506bd3b3 Consistent terminology for attached/bound functions (file rename) 2022-12-07 19:31:44 +01:00
wechman
64a4f32bc2 Consistent terminology for attached/bound functions 2022-12-07 19:31:41 +01:00
Nikola Matić
1c8745c54a
Merge pull request #12274 from ethereum/reuseKeccak
Re-use knowledge about keccak calls.
2022-12-07 08:59:25 -05:00
chriseth
79c52b3c9e Re-use knowledge about keccak calls.
Re-use knowledge about keccak calls.

Update gas cost.

More tests.

Fix bug.

Update libyul/optimiser/DataFlowAnalyzer.cpp

Remove util prefixes

fix test

More test cases.

Add Changelog entry
2022-12-07 14:16:13 +01:00
Minebuu
41b3f0521b
Fixed typo in abi.encodeWithSignature description
In the description of abi.encodeWithSignature, a right parenthesis is missing in the function argument of abi.encodeWithSelector.
2022-12-07 14:18:04 +09:00
Nikola Matić
591df04211
Merge pull request #13760 from ethereum/addoptimizorclub
Add optimizor club benchmark.
2022-12-02 13:27:42 -05:00
chriseth
0cf7236729 Add optimizor club benchmark. 2022-12-02 18:40:49 +01:00
Kamil Śliwak
867a68d798
Merge pull request #13770 from ethereum/docs-yul-updates
[DOCS] Remove mentions of Yul being experimental from docs
2022-12-02 18:28:06 +01:00
franzihei
a9bd337fac
Update yul.rst 2022-12-02 17:17:33 +01:00
chriseth
5e74e95b67 Update test/benchmarks/run.sh
Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
2022-12-02 14:08:41 +01:00
chriseth
a0f8cc922f Add optimizor club benchmark. 2022-12-02 14:08:41 +01:00
Daniel
056c4593e3
Merge pull request #13771 from ethereum/enable-stale-action-draft-pr
Remove exempt of draft PRs in stale action
2022-12-01 19:31:36 +01:00
Rodrigo Q. Saramago
523aad175e
Remove exempt of draft PRs in stale action 2022-12-01 18:23:03 +01:00
Daniel
a9f8a77817
Merge pull request #13709 from ChrisXXXXXXX/patch-2
Separate node for every `if` and `case` body in the Yul CFG
2022-12-01 17:04:41 +01:00
ChrisXXXXXXX
feade14fd6 Update ControlFlowSideEffectsCollector.cpp
There are errors in the function void ControlFlowBuilder::operator()(If const& _if) and function void ControlFlowBuilder::operator()(Switch const& _switch) when calculating CFG.
1. In the function void ControlFlowBuilder::operator()(If const& _if), the if.condion block is not the same block as the if.then block. The original code is calculated as one same block.
2. The switch.expression block are not the same block as all the cases block in cases, the original code is calculated as one same block.
This can cause some potential problems during the optimization phase.
2022-12-01 16:06:02 +01:00
Daniel
851cc09742
Merge pull request #13516 from ethereum/fix-yul-interpreter-memory-access
Fix memory expansion semantics in the yul interpreter.
2022-12-01 15:42:41 +01:00
Kamil Śliwak
c6ee18a507
Merge pull request #13744 from ethereum/review-checklist-update-for-external-prs
Update the review checklist to address common external PR problems
2022-11-30 18:20:41 +01:00
Nikola Matić
68686b5e26
Merge pull request #13768 from ethereum/prb-math-fix
Quick fix of prb-math external tests
2022-11-30 11:17:17 -05:00
Rodrigo Q. Saramago
0fb04432fa
Quick fix of prb-math 2022-11-30 16:24:44 +01:00
Leo
ca204c8b05
Merge pull request #13762 from ethereum/smt_fix_delete
Fix internal error when deleting struct member of function type
2022-11-30 13:52:12 +01:00
Leo Alt
77698f8108 Fix internal error when deleting struct member of function type 2022-11-30 12:47:32 +01:00
Kamil Śliwak
40b24850d2
Merge pull request #13766 from ethereum/fix-spurious-unreachable-warning-in-semvermatcher
Fix spurious unreachable warning in `SemVerMatcher`
2022-11-30 00:41:17 +01:00
Sabnock
dbc1bc1515
Array member clarification (#13763)
* clarify array members

Co-authored-by: Kamil Śliwak <cameel2@gmail.com>
2022-11-30 00:39:57 +01:00
Kamil Śliwak
fdf4ec581f Update the review checklist to address common external PR problems 2022-11-29 23:41:16 +01:00
Kamil Śliwak
d0fb8c2e87 Fix another instance of the spurious unreachable warning, this time in SemVerMatcher 2022-11-29 23:26:22 +01:00
Kamil Śliwak
d2dd84ad4b
Merge pull request #13758 from ethereum/close-stale-issues
Prefer old issues/prs and only issues already labeled as stale
2022-11-29 17:32:08 +01:00
Rodrigo Q. Saramago
35f4456be2
Ensure that stale label is not removed from processed ancient issues 2022-11-29 14:38:33 +01:00
Rodrigo Q. Saramago
e31488ff7c
Prefer old issues/prs and only issues already labeled as stale
Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
2022-11-29 14:19:56 +01:00
Leo
7cb76ee515
Merge pull request #13761 from ethereum/smt_fix_user
Fix internal error when using user defined value types in map/struct
2022-11-29 13:52:53 +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
cc8baf7ea8
Merge pull request #13754 from ethereum/smt_fix_assignment
Fix internal error in assignment chains
2022-11-29 11:58:36 +01:00
Kamil Śliwak
7070a1721f
Merge pull request #13755 from ethereum/smt_fix_nondet
Make isoltest not check SMTChecker counterexamples by default
2022-11-28 22:45:07 +01:00
Leo
d5b8f74fa0
Merge pull request #13757 from ethereum/fix_emscripten_hash
Fix emscripten docker hash
2022-11-28 21:57:35 +01:00
Leo Alt
15b062e466 Fix emscripten docker hash 2022-11-28 21:06:51 +01:00
Leo Alt
be8b05e6bf Make isoltest not check SMTChecker counterexamples by default. 2022-11-28 20:55:15 +01:00
Kamil Śliwak
3f17e0e1ca
Merge pull request #13753 from ethereum/close-stale-rename
Rename close stale action
2022-11-28 19:39:50 +01:00
Kamil Śliwak
1373aef249
Merge pull request #13745 from ethereum/close-stale-issues
Close stale issues
2022-11-28 19:39:44 +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
Rodrigo Q. Saramago
0407ef744a
Rename stale action 2022-11-28 17:59:45 +01:00
Rodrigo Q. Saramago
eb550d839e
Modify stale pr action to also close old stale issues
Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
2022-11-28 17:58:27 +01:00
Leo
764569be16
Merge pull request #13751 from ethereum/smt_fix_natspec
Fix internal error in multiple wrong options for SMTChecker natspec
2022-11-28 17:51:41 +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
4baeddc62b
Merge pull request #13749 from ethereum/smt_fix_library
Fix SMTChecker bug when a public library function is called internally
2022-11-28 13:56:30 +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
Kamil Śliwak
40f0329baa
Merge pull request #13743 from GeorgePlotnikov/develop
Add updated solc-bin update call to ReleaseChecklist.md
2022-11-25 20:29:33 +01:00
George Plotnikov
0a4c7f3b0f ReleaseChecklist.md: Update update call in solc-bin section 2022-11-25 19:42:33 +01:00
Kamil Śliwak
4e3175d093
Merge pull request #12797 from vinayman/10627_ErrorReportingScannerIssues
Improve Error Reporting of SemVer Parser
2022-11-25 19:39:16 +01:00
Vinay
9e7b85ac4b Improve Error Reporting of SemVer Parser 2022-11-25 13:09:09 -03:00
Kamil Śliwak
10f81425a3
Merge pull request #13581 from r0qs/ci-to-nightly
Let the nightlies call themselves 'nightly', the return.
2022-11-25 15:27:27 +01:00
chriseth
826ada0b96
Merge pull request #13705 from ethereum/onlyCountVariables
Only count variables if only variables are needed.
2022-11-25 14:20:07 +01:00
Nikola Matić
bf1a2c7cee
Merge pull request #13734 from ethereum/add_perf_benchmarks
Add performance benchmarks.
2022-11-25 07:44:02 -05:00
Rodrigo Q. Saramago
cf5d0d3f8b
Let the nightlies call themselves 'nightly', the return.
Co-authored-by: Kamil Śliwak <cameel2@gmail.com>
2022-11-25 11:53:57 +01:00
chriseth
e9cc770d80 Add performance benchmarks. 2022-11-25 10:29:29 +01:00
Kamil Śliwak
91589e0214
Merge pull request #13742 from ethereum/external-pr-greeter
Don't run the external contributor greeter action when PRs are reopened
2022-11-24 23:43:39 +01:00
Rodrigo Q. Saramago
b4add1df68
Avoid run the action when PRs are reopened 2022-11-24 20:38:11 +01:00
Alexander Arlt
fe68200f30
[tests] Refactor scripts/ASTImportTest.sh. (#13576)
* [tests] Refactor scripts/ASTImportTest.sh.

Co-authored-by: Nuno Santos <nuno.santos@ethereum.org>
Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
2022-11-24 16:16:16 +01:00
Leo
0f3e7af30f
Merge pull request #13738 from ethereum/z3_4_11_2_docker
update docker images with z3 4.11.2
2022-11-24 15:47:01 +01:00
Leo Alt
e51d2ca5e9 update docker images with z3 4.11.2 2022-11-24 14:46:49 +01:00
Leo
a00e6c6089
Merge pull request #13740 from ethereum/z3_4_11_2_tests
update SMTChecker tests with Z3 4.11.2
2022-11-24 14:25:56 +01:00
Leo Alt
d660f0cab0 adjust nondeterministic tests 2022-11-24 13:08:06 +01:00
Leo Alt
504b70b6af update smt tests 2022-11-24 13:08:06 +01:00
Leo Alt
c3a7adad27 update cli tests 2022-11-24 13:08:06 +01:00
Leo Alt
87d277ec05 avoid unused error codes 2022-11-24 13:08:06 +01:00
Leo Alt
be0149dd47 new z3 version in cmakelist 2022-11-24 13:08:06 +01:00
Leo Alt
f3d7dfba82 use new docker images 2022-11-24 13:08:06 +01: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
33f27098e9
Merge pull request #13739 from ethereum/code-reshuffling-before-operators
Code reshuffling before custom operators
2022-11-23 15:09:32 +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
Kamil Śliwak
39a8ec12bd
Merge pull request #13736 from kuzdogan/patch-2
Add "appendCBOR" to example JSON in metadata docs
2022-11-23 13:08:15 +01:00
Kaan Uzdoğan
fa944a0673
Add "appendCBOR" to example JSON in metadata docs 2022-11-23 09:53:58 +01:00
Leo
1dd05e2978
Merge pull request #12969 from ethereum/smt_eld
[SMTChecker] Add Eldarica as a Horn solver
2022-11-22 23:00:13 +01:00
Leo Alt
24df40de9a Allow running Eldarica from the command line 2022-11-22 21:16:45 +01:00
Nikola Matić
be8ecb17d8
Merge pull request #13703 from ethereum/performance_metrics
Code to output performance metrics for optimizer steps.
2022-11-22 13:36:16 -05:00
chriseth
5950ec306b Code to output performance metrics for optimizer steps. 2022-11-22 18:44:01 +01:00
Daniel
3109ce2dbc
Merge pull request #12132 from ethereum/userDefinedSideEffectsCodeTransform
Use side-effects of user defined functions in evm code transform.
2022-11-22 14:26:57 +01:00
Kamil Śliwak
5211d3da0d
Merge pull request #13698 from ethereum/evm-paris
Add basic support for the EVM version Paris
2022-11-21 19:08:01 +01:00
Nikola Matić
50935dbcc5
Merge pull request #13679 from fulldecent/feature-order-of-errors
[Documentation] Set error placement in contract, match example to specified order
2022-11-21 10:39:06 -05:00
William Entriken
8f705fc327 [Documentation] set error placement in contract, match example to prescription
Add example

fix order
2022-11-21 15:52:41 +01:00
Alex Beregszaszi
c353eb0af5 Document difficulty vs. prevrandao 2022-11-21 14:56:46 +01:00
Alex Beregszaszi
eb8af2caec Add basic support for the EVM version Paris
This mostly means testing with evmone, but instruction renaming of difficulty->prevrandao is omitted.
2022-11-21 14:56:46 +01:00
Bhargava Shastry
2c27405cbb Fix zero size memory expansion semantics in the yul interpreter. 2022-11-21 11:53:42 +01:00
Daniel
0b4b1045cf
Merge pull request #13712 from Qlio/patch-2
Bug fix on Yul Object example code.
2022-11-17 11:16:35 +01:00
Bulgantamir Gankhuyag
76fcd0d537
Bug fix on Yul Object example code.
Related issue: #13711
2022-11-17 14:17:10 +08:00
Nuno Santos
75a74cd43f
Merge pull request #13277 from Ruko97/formatNumberReadable_styleChange_upstream
Improved output of formatNumberReadable
2022-11-16 16:20:30 +00:00
Daniel Kirchner
1b6063ede4 Disable zeppelin test failing due to hardhat heuristics. 2022-11-14 21:26:36 +01:00
chriseth
5ba8c109f4 Use side-effects of user defined functions in evm code transform. 2022-11-14 21:26:36 +01:00
chriseth
4100a59cca
Merge pull request #13708 from ethereum/refactor_join_knowledge
Refactor join knowledge.
2022-11-14 17:40:06 +01:00
Ishtiaque Zahid
3abf2724a1 changed output of formatNumberReadable so that it shows powers of two and one-less-than powers of two in a more compact format 2022-11-14 17:37:38 +01:00
chriseth
62ab78bf70 Refactor join knowledge. 2022-11-14 11:56:32 +01:00
chriseth
f1febf69d0 Only count variables if only variables are needed. 2022-11-14 10:24:28 +01:00
Alex Beregszaszi
310a58dd31
Merge pull request #13695 from ethereum/evmc-refund
test: Support tracking gas refunds
2022-11-10 23:08:38 +01:00
chriseth
50747d6ab8
Merge pull request #13704 from ethereum/optimize_and_shl_functions
added changelog entry for optimizer
2022-11-10 22:42:19 +01:00
Alex Beregszaszi
54b4598390 Move some tests from viaYul to appropriate groups 2022-11-10 22:21:15 +01:00
Alex Beregszaszi
0f65e17b7b Update tests 2022-11-10 22:21:15 +01:00
Alex Beregszaszi
5a35c50d16 test: Support tracking gas refunds 2022-11-10 22:00:38 +01:00
nishant-sachdeva
149303d02d added changelog entry for optimizer 2022-11-11 02:26:47 +05:30
chriseth
77a9f8ac43
Merge pull request #13529 from ethereum/optimize_and_shl_functions
optimize and_shl distribution operation
2022-11-10 21:38:29 +01:00
nishant-sachdeva
efbd3666a7 added optimization. shl comes out from being distributed over and 2022-11-11 01:16:14 +05:30
matheusaaguiar
c72645327e
Merge pull request #13613 from Andy53/patch-1
Clarification to the documentation on converting payable to non payable functions.
2022-11-10 16:28:36 -03:00
andy53
1e5c229a37 update value-types.rst 2022-11-10 15:42:31 -03:00
chriseth
1bd35b1be1
Merge pull request #13682 from ethereum/improve_cse
Use hash of candidates for CSE.
2022-11-10 16:48:57 +01:00
chriseth
4b0348a9a5
Merge pull request #13693 from ethereum/resolved-function-call-in-cfg
Resolved `FunctionDefinition` instead of `FunctionCall` in CFG
2022-11-10 14:04:37 +01:00
Nikola Matić
4e5a5259f5
Merge pull request #13650 from Andy53/document-optimized-cleanup-process
update using-the-compiler.rst with details of optimizer cleanup sequence
2022-11-10 03:35:26 -05:00
andy53
4e035c41b6 update using-the-compiler.rst with details of optimizer cleanup sequence
Removed duplicate lines and clarified the wording.

Removed trailing whitespace.

Update docs/using-the-compiler.rst

Co-authored-by: matheusaaguiar <95899911+matheusaaguiar@users.noreply.github.com>

Clarified behaviors.

Updated text to meet suggestions.
2022-11-10 08:45:48 +01:00
Nikola Matić
2fb7205dd3
Merge pull request #13532 from ethereum/evmc-update
Upgrade to evmc10 + evmone9
2022-11-10 02:10:29 -05:00
Nikola Matić
1aea745304
Merge pull request #13537 from ethereum/evmc-buildpack
Upgrade to evmone 0.9.1 and hera 0.6.0 in buildpack
2022-11-10 02:10:15 -05:00
Alex Beregszaszi
47ed36e0db Upgrade CI and download instructions to evmone 0.9.1 and hera 0.6.0 2022-11-09 21:27:40 +01:00
Alex Beregszaszi
b49008af9e Support EVMC_PARIS with randao from merge block 2022-11-09 21:27:40 +01:00
Alex Beregszaszi
5df92a374b Update EVMHost to match EVMC10 changes 2022-11-09 21:27:40 +01:00
matheusaaguiar
73e7b844dc
Merge pull request #13381 from ethereum/cleanupDocs
Clarify variable cleanup in docs.
2022-11-09 17:14:44 -03:00
Daniel Kirchner
27dba5c2d4 Clarify cleanup in docs.
Co-authored-by: matheusaaguiar <95899911+matheusaaguiar@users.noreply.github.com>
2022-11-09 16:27:24 -03: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
chriseth
40342264c2 Use hash of candidates for CSE. 2022-11-09 16:57:46 +01:00
Daniel
2f33105d11
Merge pull request #13697 from ethereum/coc-contact-update
[COC] Update contact section in Code of Conduct
2022-11-09 15:44:46 +01:00
franzihei
7cc4c659cf Update CODE_OF_CONDUCT.md
Update CODE_OF_CONDUCT.md
2022-11-09 14:55:59 +01:00
Alex Beregszaszi
458857d0d6 Upgrade to evmc 10.0.0 2022-11-09 11:45:40 +01:00
Daniel
5c139b60b8
Merge pull request #13694 from ethereum/evmhost_set_storage
test: Improve precision of SSTORE cost in EVMHost
2022-11-09 11:41:23 +01:00
Hari
bbb9eb37c5
Merge pull request #13696 from VVander/patch-2
Replace "miners" with "block builders"
2022-11-09 10:24:45 +01:00
Paweł Bylica
4830194383
test: Update test expectations 2022-11-09 10:15:17 +01:00
Paweł Bylica
199f36585a
test: Improve precision of SSTORE cost in EVMHost
Add "original" field to storage_value to precise track "dirty" state of
a storage slot as defined in EIP-2200. In case a current storage value
is restored to original (after multiple modifications in a single
transaction), the storage slot is not considered "dirty" any more.
Previously, we only had a bool dirty flag to model this and a storage
slot was always considered "dirty" after first modification.
2022-11-09 10:15:14 +01:00
Mike Leach
211d1e733f
Remove "miners" with "block builders" 2022-11-08 21:03:00 -06:00
Daniel
9db2da0385
Merge pull request #13687 from ethereum/hashNumberLiterals
Hash number literals according to their value instead of their string representation.
2022-11-08 21:21:23 +01:00
chriseth
cffacac9de Hash number literals according to their value instead of their string representation. 2022-11-08 20:34:10 +01:00
Daniel
19fc395662
Merge pull request #13688 from ethereum/cacheNumberLiteralConversion
Cache literal to number conversion.
2022-11-08 20:28:35 +01:00
Daniel
9a60c06335
Merge pull request #11087 from ethereum/precompile-prices
EVMHost: charge gas for precompiles
2022-11-08 19:56:42 +01:00
Alex Beregszaszi
ab7307203b
Merge pull request #13691 from ethereum/evmhost_storage_dirty
test: Properly clear storage dirty flag
2022-11-08 19:33:42 +01:00
chriseth
0bf68e7f58
Merge pull request #13692 from ethereum/indent_changelog
Indent changelog.
2022-11-08 18:36:33 +01:00
Paweł Bylica
c4b6f5f00b
test: Properly clear storage dirty flag
Clear storage dirty flag between transactions in EVMHost. The EIP-2200
dirty flag should be persisted only in a single transaction.
2022-11-08 18:13:17 +01:00
chriseth
c3899bd549 Indent changelog. 2022-11-08 17:48:36 +01:00
franzihei
d472c94ff6
Merge pull request #13686 from ethereum/readme-update-maintainer
[README] Update maintainers
2022-11-08 17:28:25 +01:00
Kamil Śliwak
3db7cb7060
Merge pull request #13631 from Dev-Doggo/patch-2
Clarify that a contract without `receive` can still receive Ether through payable function calls
2022-11-08 17:04:19 +01:00
Kamil Śliwak
0d0d51cabf
Merge pull request #13391 from timweri/event-natspec-inherit
Add Natspec devdoc inheritance support for events
2022-11-08 16:40:27 +01:00
franzihei
350454d8a4 Update README maintainers
Update README.md

Update README.md

Co-Authored-By: Kamil Śliwak <kamil.sliwak@codepoets.it>
2022-11-08 16:30:00 +01:00
Doggo
b787c32233 Update receive function documentation
The receive function documentation is slightly inaccurate currently, as a contract can still receive Ether through payable functions even if no receive or payable fallback function is present.
2022-11-08 15:59:09 +01:00
Duc Thanh Nguyen
4aac4c7bc4 Add Natspec devdoc inheritance support for events 2022-11-08 15:53:10 +01:00
chriseth
c42d577fc0 Cache literal to number conversion. 2022-11-08 12:29:00 +01:00
Daniel
ce18dddd20
Merge pull request #13685 from ethereum/graph-naming-corrections
Graph naming corrections
2022-11-08 00:49:01 +01:00
wechman
df1f5eef72 UsingForDirective: Rename m_functions to m_functionsOrLibrary 2022-11-07 23:58:19 +01:00
wechman
52bfb8bd2d Minor test naming/style corrections 2022-11-07 23:16:02 +01:00
Kamil Śliwak
b66cea175b
Merge pull request #13660 from ethereum/operator-releated-error-message-tweaks
Operator-releated error message tweaks
2022-11-07 22:23:38 +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
Alex Beregszaszi
b74b55198d Update tests 2022-11-04 10:48:30 +01:00
Alex Beregszaszi
c50f190c02 Upgrade to evmone 0.9.1 and hera 0.6.0 in buildpack 2022-11-04 10:27:45 +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
wechman
c297183467 Test that built-ins cannot be bound to structs 2022-11-04 08:46:53 +01:00
Alex Beregszaszi
18a5aee38c EVMHost: Introduce gas metering for precompiles 2022-11-03 22:18:34 +01:00
r0qs
2cc6610e40
Merge pull request #13677 from ethereum/welcome-external-contributors
Properly distinguish team members and external contributors
2022-11-03 14:56:38 -03:00
Rodrigo Q. Saramago
c0c1ab766f
Properly query team members 2022-11-03 09:53:39 -03:00
Nikola Matić
88b5ed1894
Merge pull request #13675 from ethereum/fix-gp2-hardhat-tenderly-tests
Peg hardhat-tenderly to fix GP2 external tests
2022-11-03 05:58:54 -05:00
Nikola Matić
e9c1eaa651
Merge pull request #13676 from SebastianSupreme/patch-2
Fix grammar mistake
2022-11-03 04:39:24 -05:00
Nikola Matic
d5d573dfbe Peg hardhat-tenderly to fix GP2 external tests
Empty
2022-11-03 09:07:58 +01:00
Sebastian Supreme
6d4f541ae6
Fix grammar mistake
Enforced grammatical consistency for the last bullet point.
2022-11-02 21:00:12 +01:00
Kamil Śliwak
46a7ebd5b6
Merge pull request #13068 from ethereum/circleci-review-fixes
CI config tweaks after CircleCI review
2022-11-02 17:30:09 +01:00
Nikola Matić
b2fa5da350
Merge pull request #13674 from fvictorio/add-hardhat-vscode-extension
Add Hardhat+Solidity VSCode extension
2022-11-02 07:26:30 -05:00
Franco Victorio
788e45b66f
Add Hardhat+Solidity VSCode extension 2022-11-02 12:23:33 +01:00
Daniel
0c168b154c
Merge pull request #13579 from ethereum/refactor-json
[libsolutil] Add new JSON helper functions.
2022-11-02 10:25:04 +01:00
Daniel
7ac4c70c9b
Merge pull request #13569 from ethereum/document-call-to-zero-init-function-type
Document legacy and IR behavior for call to zero initialized variable of function type
2022-11-01 15:42:12 +01:00
Daniel
f262c1addf
Merge pull request #13419 from rafales/patch-docs-ecrecover
Update misleading information about OpenZeppelin's ECDSA library
2022-11-01 14:24:31 +01:00
Daniel
05217fa8be
Merge pull request #13633 from ethereum/solc-return-codes
[solc] Exit code 2 for exceptions.
2022-11-01 14:18:41 +01:00
Daniel
bbaf8a4eb4
Merge pull request #13283 from ethereum/yulDebugger
Yul Debugger
2022-11-01 14:04:56 +01:00
Nikola Matić
add6a6b1de
Merge pull request #13666 from SavPhill/patch-1
[Documentation] Change text to be hyperlink
2022-11-01 07:53:04 -05:00
Phill
564d541853 [Documentation] Change URL to be hyperlink
The documentation link incorrectly displays in the text along with the angled brackets. I believe this is incorrect, and should be a standard markdown hyperlink. The error also disrupts the spacing of the line.  My small PR fixes both.

Apply suggestions from code review

Co-authored-by: Nikola Matić <nikola.matic@ethereum.org>

Update docs/contributing.rst

Co-authored-by: Nikola Matić <nikola.matic@ethereum.org>
2022-11-01 13:04:47 +01:00
Alexander Arlt
5b9096a381 [solc] Exit code 2 for exceptions. 2022-11-01 12:56:05 +01:00
Daniel Kirchner
74be278242 De-macro helpers. 2022-11-01 12:49:22 +01:00
Daniel
684f7e85d5
Merge pull request #13668 from ethereum/docs-translation-link-updates
[DOCS] Translations: Updated links and adding new language repos
2022-11-01 10:22:44 +01:00
Daniel
7569233c8a
Merge pull request #13669 from ligi/patch-2
Remove the mention of RadSpec
2022-11-01 10:17:56 +01:00
franzihei
91e9eadcf1 [DOCS] Translations: Updated links and new languages
Update index.rst
2022-11-01 08:35:20 +01:00
ligi
d84050d157
Remove the mention of RadSpec 2022-10-31 16:34:01 +01:00
Kamil Śliwak
ff14e40869
Merge pull request #13655 from ethereum/raise_resource_class_for_cmdline_tests
raised resource class of `t_ubu_ubsan_clang_cli` to medium
2022-10-28 12:54:23 +02:00
nishant-sachdeva
8d4a354c69 raised resource class of cli tests to medium 2022-10-28 11:51:33 +05:30
Kamil Śliwak
0816b15e75
Merge pull request #13657 from rskbansal/develop
update README.md
2022-10-27 14:26:10 +02:00
Rhythm Bansal
776952f940
using 'Read the Docs' should be apt 2022-10-27 17:09:37 +05:30
Rhythm Bansal
6f63fb681c
added credits for 'Read the Docs' 2022-10-27 16:54:00 +05:30
Rhythm Bansal
5294ead64f
removed 'Read the Docs' as it's no longer used 2022-10-27 16:41:57 +05:30
Kamil Śliwak
6cef697246 chk_antlr_grammar: bump openJDK to version 17 2022-10-26 18:22:56 +02:00
Nikola Matic
339bf38584 Silence warning about improper quoting in .circleci/soltest.sh 2022-10-26 18:22:56 +02:00
Kamil Śliwak
c675266393 Switch to bash.exe in b_bytecode_win to be able to control locale 2022-10-26 18:22:56 +02:00
Kamil Śliwak
fe118abb53 CI: Switch from deprecated circleci/buildpack-deps image to cimg/base 2022-10-26 18:22:03 +02:00
Kamil Śliwak
10905ac51d CI: Update external tests to run with latest node version supported by each 2022-10-26 18:22:03 +02:00
Kamil Śliwak
273edd2c86 CI: Switch from deprecated circleci/node images to cimg/node 2022-10-26 18:22:03 +02:00
Kamil Śliwak
489fa38b5b CI: Remove b_win_release job 2022-10-26 18:22:03 +02:00
Kamil Śliwak
c3d9f001c7 Rename b_ubu_release to b_ubu_force_release 2022-10-26 18:22:03 +02:00
Alexander Arlt
c23093e0f0 [libsolutil] Add new JSON helper functions. 2022-10-26 09:33:03 -05: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
Christian Parpart
4915c8eb8e
Merge pull request #13609 from ethereum/lsp-hover-provider
Adds basic `textDocument/hover`
2022-10-26 14:38:35 +02:00
Kamil Śliwak
05c457181e
Merge pull request #13227 from ethereum/functions_taking_calldata_args_should_be_assignable_to_function_pointer_of_same_type
functions taking calldata args should be assignable to function pointers of same type
2022-10-26 14:35:24 +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
Kamil Śliwak
1d85eb5ccf
Merge pull request #13586 from GeorgePlotnikov/use-pretty-json-for-cmlinetests-output
Use `--pretty-json` for `cmdlineTests.sh` output by default
2022-10-26 13:14:59 +02:00
George Plotnikov
b0a729aab8 adding a point about expectations to checklist 2022-10-26 15:14:05 +05:00
George Plotnikov
6374b4fe23 regenerating tests expectation 2022-10-26 15:13:47 +05:00
George Plotnikov
376b923a79 adding support for no-pretty-print 2022-10-26 15:13:11 +05:00
nishant-sachdeva
8c0740748e functions taking calldata args should be assignable to function pointers of same type 2022-10-26 13:29:02 +05:30
Kamil Śliwak
799ef0ab1a
Merge pull request #13649 from Andy53/output-emit-logs-correctly
fix emit statments being printed on the same line
2022-10-25 21:31:27 +02:00
andy53
54965fb0ae fix emit statments being printed on the same line
Update test/libsolidity/semanticTests/emit_three_identical_events.sol

Co-authored-by: Kamil Śliwak <cameel2@gmail.com>

Update test/libsolidity/semanticTests/emit_two_identical_events.sol

Co-authored-by: Nikola Matić <nikola.matic@ethereum.org>
2022-10-25 19:22:07 +02:00
Kamil Śliwak
84cdcec2cf
Merge pull request #13648 from ethereum/gh-triage-actions
Disable dry-run for triage action
2022-10-24 17:46:54 +02:00
Kamil Śliwak
b04b17cbe0
Merge pull request #13647 from ethereum/gh-stale-actions
Enable stale PR action (disable debug mode)
2022-10-24 17:46:27 +02:00
Rodrigo Q. Saramago
c47d3cd00f
Disable dry-run 2022-10-24 11:56:56 -03:00
Rodrigo Q. Saramago
2af6ca0eca
Disable debug mode and exempt roadmap and epic labels 2022-10-24 11:55:34 -03:00
Kamil Śliwak
8e90cf024f
Merge pull request #13309 from yusufbenliii/patch-1
Fix misspelling in bug name in `bugs.json` (`NestedCallataArrayAbiReencodingSizeValidation`)
2022-10-24 15:15:23 +02:00
Yusuf Benli
0bad372aee Fix buglist typo: NestedCallataArrayAbiReencodingSizeValidation -> NestedCalldataArrayAbiReencodingSizeValidation
Misspelling fix
2022-10-24 14:21:42 +02:00
Kamil Śliwak
2a03603340
Merge pull request #13639 from ethereum/welcome-external-contributors
Action to welcome external contributors
2022-10-24 13:09:19 +02:00
Kamil Śliwak
fb3d0a874e
Merge pull request #13643 from ethereum/ext-gp2-bug-fix
Fix gp2 ext test failing to build, not being able to resolve the the keyv dependency
2022-10-24 13:06:21 +02:00
Rodrigo Q. Saramago
813a37592d
Add action to welcome external contributors with the contributing guidelines
Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
Co-authored-by: Nuno Santos <nunofilipesantos@gmail.com>
2022-10-23 18:27:53 -03:00
Rodrigo Q. Saramago
bc7567244a
Remove ens fork 2022-10-23 17:58:13 -03:00
Rodrigo Q. Saramago
be0f633966
Update gp2 fork 2022-10-21 16:59:50 -03:00
Kamil Śliwak
8830be9817
Merge pull request #13577 from ethereum/valid-input-modes-refactoring
[solc] Refactor valid input modes.
2022-10-21 21:32:41 +02:00
Kamil Śliwak
b4c85c6d37
Merge pull request #13594 from ethereum/evmc-selfdestruct
EVMHost: implement selfdestruct better
2022-10-21 21:07:22 +02:00
Kamil Śliwak
5c5045ee26
Merge pull request #13644 from ethereum/builtin-tests
test: Move hashing algorithm tests to semanticTests
2022-10-21 20:17:47 +02:00
Alex Beregszaszi
4f07be6348 test: Move hashing algorithm tests to semanticTests 2022-10-21 15:59:47 +02:00
Kamil Śliwak
9800e19df6
Merge pull request #13527 from ethereum/git-safe-directory-workaround
Add git `safe.directory` workaround in emscripten build script
2022-10-21 15:47:42 +02:00
Nikola Matić
b205fe8494
Merge pull request #13501 from ethereum/document-unused-store-eliminator
Document UnusedStoreEliminator
2022-10-21 07:06:20 -05:00
Kamil Śliwak
db86a730fe
Merge pull request #13642 from ethereum/euler-ci-resource
Increase euler external tests container size
2022-10-21 13:22:04 +02:00
Nikola Matic
9e505bd128 Document UnusedStoreEliminator
Update comment in header file

Address review comments
2022-10-21 13:19:56 +02:00
Rodrigo Q. Saramago
11e13f5a41
Replace npm by yarn 2022-10-20 20:32:36 -03:00
Rodrigo Q. Saramago
9dbc3e0b82
Add git safe.directory workaround in emscripten build script
Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
2022-10-20 19:43:18 -03:00
Kamil Śliwak
720db45d88
Merge pull request #13622 from ethereum/fix-failing-build
Silence integer precision loss warning for protobuf fuzzers.
2022-10-21 00:13:55 +02:00
Rodrigo Q. Saramago
50670262c1
Increase euler external tests resource class 2022-10-20 18:53:07 -03:00
Kamil Śliwak
db54e0492a
Merge pull request #13640 from ethereum/gh-stale-actions
Update to actions/stale to v6
2022-10-20 21:50:37 +02:00
Rodrigo Q. Saramago
b0b8bf657b
Update to v6 and minor fixes 2022-10-20 15:09:03 -03:00
Nikola Matić
af257408e4
Merge pull request #13638 from Bojidar00/move-files
refactor: Move error generating tests to /invalid
2022-10-20 09:23:47 -05:00
Alex Beregszaszi
24946ec318 EVMHost: implement selfdestruct better 2022-10-20 15:35:41 +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
Hari
b052052839
Merge pull request #13636 from ethereum/rename-no-cbor-metadata-tests
Rename command-line tests for the `--no-cbor-metadata`/`appendCBOR` option
2022-10-20 14:43:42 +02:00
chriseth
673b48138a
Merge pull request #13587 from ethereum/forward-declare-enum
[Trivial] Forward declare Instruction enum in EVMVersion
2022-10-20 14:40:22 +02:00
Alexander Arlt
0da1ce3a00 [libsolidity] Refactor Compiler Stack imported source type. 2022-10-20 14:30:40 +02:00
Bojidar00
af9a1d8a18 refactor: Move error generating tests to /invalid 2022-10-20 14:04:12 +03:00
Kamil Śliwak
ed3d3959aa Rename command line tests for the --no-cbor-metadata/appendCBOR option 2022-10-19 21:28:45 +02:00
Kamil Śliwak
4679ae0275
Merge pull request #13629 from ethereum/metadata-standard-json-bugfix
fix: `bytecodeHash` cannot be set to non-none for `appendCBOR=false`
2022-10-19 21:21:41 +02:00
Alexander Arlt
cd440fc5f9 [solc] Refactor valid input modes. 2022-10-18 15:15:30 -05:00
Daniel
2cb618a5c3
Merge pull request #13593 from ethereum/test-selfdestruct
Add test for selfdestruct
2022-10-17 17:43:08 +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
Bhargava Shastry
898fbe9335 Silence integer precision loss warning for protobuf fuzzers. 2022-10-12 12:10:43 +02:00
Christian Parpart
238ac4fd92
Merge pull request #13621 from omahs/patch-2
Fix: minor typo
2022-10-10 10:08:33 +02:00
omahs
28a5448f21
Fix: minor typo
Fix: minor typo
2022-10-10 08:33:44 +02:00
r0qs
2ab0c055c9
Merge pull request #13528 from ethereum/gh-triage-actions
Move new issues to triage
2022-10-09 08:17:34 +02:00
Rodrigo Q. Saramago
43e8f7e381
Move new issues to Triage column in the repository project board
Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
2022-10-07 13:39:26 +02:00
Rafal Stozek
a4ed92b546 Update misleading information about OpenZeppelin's ECDSA library 2022-10-07 12:23:18 +02:00
Nikola Matić
16c4c7565a
Merge pull request #13546 from KatyaPrusakova/move-nonstruct-test
test copy_from_calldata.sol folder location update
2022-10-06 19:02:50 +02:00
Prusakova Katya
2d4aa990fb test copy_from_calldata.sol folder location update
Rename copy_from_calldata
2022-10-06 18:14:15 +02:00
Kamil Śliwak
9eac10a8ff
Merge pull request #13612 from ethereum/clarifyGithubIssuesForumPosts
Clarify github issues vs forum posts in docs.
2022-10-05 22:41:14 +02:00
Daniel Kirchner
f39abf29b4 Clarify github issues vs forum posts in docs.
Co-authored-by: Nuno Santos <nunofilipesantos@gmail.com>
2022-10-05 18:42:03 +02:00
Daniel Kirchner
6662053dc8
Merge pull request #13611 from ethereum/fix-ppa-ubuntu-kinetic
Disable FETCHCONTENT_FULLY_DISCONNECTED on ppa release
2022-10-05 13:23:45 +02:00
Rodrigo Q. Saramago
6c167374f7
Disable FETCHCONTENT_FULLY_DISCONNECTED on ppa release 2022-10-05 10:13:55 +02:00
Kamil Śliwak
70b0fb6366
Merge pull request #13560 from rajgaur98/develop
Updated Whiskers for checking invalid tags
2022-10-04 17:33:05 +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
Kamil Śliwak
23118d62e6
Merge pull request #13573 from ethereum/undef-macros
Drop deprecated UndefMacros file
2022-10-04 17:31:42 +02:00
Kamil Śliwak
efc11a8332
Merge pull request #13572 from ethereum/docs-clarify-relative-path-normalization
[Docs] Clarify relative path normalization rules
2022-10-04 17:31:15 +02:00
Kamil Śliwak
5ca2ca35eb
Merge pull request #13553 from ethereum/review-checklist
Review checklist
2022-10-04 17:30:43 +02:00
Alex Beregszaszi
96168a1438 Add test for selfdestruct
Also drop less useful EndToEndTest
2022-10-01 11:45:46 +02:00
Marenz
9e674ba047 Forward declare Instruction enum in EVMVersion 2022-09-29 13:41:58 +02:00
franzihei
2ba8fc1db5
Merge pull request #13568 from ethereum/franzihei-patch-1
[Docs] Contributing: Update meeting link to meet.soliditylang.org
2022-09-29 11:51:29 +02:00
Rajkumar gaur
bfd83c966a Updated Whiskers for checking invalid tags
For Example, raise an error if it contains invalid tags like
<?ba<!b</b
2022-09-29 07:36:29 +05:30
Kamil Śliwak
1c77d30cea
Merge pull request #13580 from R-Y-M-R/fix-docs-phrasing
Fix: improve docs typos & phrasing
2022-09-29 00:10:58 +02:00
Kamil Śliwak
b3b9b88dee Add review checklist 2022-09-28 23:47:19 +02:00
Kamil Śliwak
1df95ed552 path-resolution.rst: Rewrite relative import normalizatin rules to make them more precise 2022-09-28 23:29:10 +02:00
Kamil Śliwak
ac5d575e9c path-resolution.rst: Typo, segument -> segment 2022-09-28 23:23:33 +02:00
Riley
269a0463e4
Update spelling and phrasing. 2022-09-28 06:38:05 -04:00
Riley
71308ce5ee
Improve phrasing. 2022-09-28 06:32:42 -04:00
Alex Beregszaszi
2201526a90
Merge pull request #13533 from ethereum/evmhost-create
EVMHost: Calculate address for CREATE properly
2022-09-28 02:14:18 +02:00
Alex Beregszaszi
f5c85662ca Drop deprecated UndefMacros file 2022-09-27 23:35:32 +02:00
Alex Beregszaszi
0357cedb5c Update tests and include new for create/create2 calculation 2022-09-27 22:31:46 +02:00
Alex Beregszaszi
9aa304d43a EVMHost: Calculate address for CREATE properly 2022-09-27 22:31:45 +02:00
Alex Beregszaszi
5f8b48793c
Merge pull request #13571 from ethereum/explicit-fixedhash
Drop implicit alignment argument from FixedHash (and improve FunctionSelector helpers)
2022-09-27 22:30:34 +02:00
Alex Beregszaszi
2a41295d03 Drop implicit alignment argument from FixedHash 2022-09-27 17:58:32 +02:00
Alex Beregszaszi
725253551e Improve FunctionSelector helpers 2022-09-27 17:58:32 +02:00
Alex Beregszaszi
d1b8991c03
Merge pull request #13565 from ethereum/evmc-cleanup
EVMHost: a few more simplifications
2022-09-27 17:56:05 +02:00
Alex Beregszaszi
cb5c559392
Merge pull request #13567 from ethereum/ranges-filter
Replace use of boost::adapters::filtered with ranges::views::filter
2022-09-27 17:34:19 +02:00
franzihei
46531ac32b
Update contributing.rst 2022-09-27 15:09:16 +02:00
Bhargava Shastry
bd57de6d68 Document legacy and IR behavior for call to zero initialized variable of function type. 2022-09-27 14:09:09 +02:00
franzihei
1480bf1293
Update meeting link to meet.soliditylang.org 2022-09-27 12:37:45 +02:00
Alex Beregszaszi
0f484ec93b Replace use of boost::algorithm::all_of with ranges::all_of 2022-09-27 03:33:13 +02:00
Alex Beregszaszi
8230022e18 Remove unused include of boost/variant 2022-09-27 03:27:37 +02:00
Alex Beregszaszi
565423c934 Replace use of boost::adapters::filtered with ranges::views::filter 2022-09-27 03:14:17 +02:00
Alex Beregszaszi
311b2054af
Merge pull request #13556 from GeorgePlotnikov/fix-cvc4-bitvector-ctor-ambigious-call
Update ambiguous CVC4::BitVector ctor call
2022-09-27 00:00:29 +02:00
George Plotnikov
44a2dd864f Update CVC4::BitVector ctor call 2022-09-26 23:03:42 +02:00
Alex Beregszaszi
50182d7ee0 EVMHost: replace precompileALTBN128PairingProduct with mapping 2022-09-26 21:39:18 +02:00
Alex Beregszaszi
f40d1d654d EVMHost: Add size%192 check to bn128pairing
And also refactor resultWithFailure
2022-09-26 21:06:33 +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
Alex Beregszaszi
8b7010872c
Merge pull request #13562 from ethereum/evmc-cleanup
EVMHost: Simplify some code and document functions
2022-09-26 18:42:14 +02:00
Alex Beregszaszi
c967a621eb EVMHost: Reduce code duplication in precompiles 2022-09-26 15:38:55 +02:00
Christian Parpart
70aa3aed04
Merge pull request #13540 from ethereum/lsp-require
renames lspAssert() to lspRequire + documentation
2022-09-26 15:06:23 +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
Alex Beregszaszi
a260000a16 EVMHost: Make it clear which MockedHost helpers are used
And also remove unused helpers.
2022-09-26 02:05:40 +02:00
Alex Beregszaszi
e3c7369413 EVMHost: Simplify some code and dcoument functions 2022-09-26 01:59:52 +02:00
Kamil Śliwak
3ddf5db755
Merge pull request #13548 from gnattishness/060-opcode-breaking-changes
Add v0.6.0 change notes for inline assembly opcode syntax changes.
2022-09-23 17:32:33 +02:00
Nishant Sachdeva
44e8ada691
Merge pull request #13549 from miles170/develop
Fix stripping in CLI tests does not produce correct JSON formatting
2022-09-23 17:12:23 +05:30
Nikola Matić
b12b845739
Merge pull request #13554 from ethereum/code-style-rule-for-std-qualifier
Add code style rule for std:: qualifier
2022-09-23 11:21:59 +02:00
Nikola Matic
c2a9e36c5c Add code style rule for std:: qualifier 2022-09-23 09:44:45 +02:00
r0qs
d0103b5776
Merge pull request #13522 from ethereum/gh-stale-actions
Workflow to label and comment stale pull requests
2022-09-22 16:00:19 +02:00
Rodrigo Q. Saramago
e2767363db
Add workflow to label, comment and close stale pull requests
Co-authored-by: Kamil Śliwak <cameel2@gmail.com>
Co-authored-by: Daniel Kirchner <daniel@ekpyron.org>
2022-09-22 14:51:39 +02:00
Miles Liu
dad1a56321
Pretty print expected json output of command line tests 2022-09-22 18:49:55 +08:00
Miles Liu
4e929ee145
Fix stripping in CLI tests does not produce correct JSON formatting 2022-09-21 21:25:09 +08:00
Nathaniel Jensen
f0f46a12af
Add v0.6.0 change notes for inline assembly opcode syntax changes. 2022-09-21 17:50:29 +10:00
Nishant Sachdeva
37597f9e88
Merge pull request #13162 from ethereum/cleanup_helpers_around_errors
cleaning up helpers around errors
2022-09-20 20:49:45 +05:30
nishant-sachdeva
eafd7218b7 refactored struct message to use std::variant for _typeOrSeverity 2022-09-20 19:20:43 +05:30
Nikola Matić
db571add54
Merge pull request #13542 from ethereum/pin-v3-periphery-in-euler-tests
Fix Euler tests by pinning v3-periphery
2022-09-20 14:58:07 +02:00
Nikola Matic
1f244cc1b3 Fix Euler tests by pinning v3-periphery 2022-09-20 14:12:57 +02:00
nishant-sachdeva
c8011d8719 Cleaning up helpers around errors 2022-09-19 10:51:14 +05:30
Daniel Kirchner
1fbee8259a
Merge pull request #13464 from ethereum/copying_reference_types
Add tests for copying reference types between data locations
2022-09-15 15:44:38 +02:00
Daniel Kirchner
5f63b3ca21
Merge pull request #13519 from ethereum/boost-tests-for-non-delimited-optimizer-sequence
Boost tests for non-delimited optimizer sequence
2022-09-14 13:10:03 +02:00
Marenz
692a99f891 yulRun: Add recursion protection 2022-09-14 11:40:23 +02:00
Marenz
d10d967008 yulRun: Fix unexpected return value for call* instructions and add tests 2022-09-14 11:40:08 +02:00
Marenz
b8699e7687 YulRunner: Add support for interactive inspection of the state 2022-09-14 11:40:02 +02:00
Marenz
4b69b5fdc1 YulRunner: Add support for external calls to the same contract 2022-09-14 11:40:02 +02:00
Marenz
53b67334c5 YulRunner: Add support for memoryguard() and literal parameters 2022-09-14 11:40:02 +02:00
Daniel Kirchner
1730e43bf7
Merge pull request #13514 from ethereum/yul-interpreter-create2
Fix create2 memory access in yul interpreter.
2022-09-14 11:19:11 +02:00
Daniel Kirchner
f05cbb9112
Merge pull request #13524 from ethereum/remove-std-qualifier-from-metadata-tests
Remove std qualifier from string in Metadata tests
2022-09-14 10:49:45 +02:00
Nikola Matic
12ea1158bf Remove std qualifier from string in Metadata tests 2022-09-14 09:12:03 +02:00
Nikola Matic
4a52be8fe7 Boost tests for non-delimited optimizer sequence 2022-09-13 19:39:15 +02:00
Nikola Matić
ea78c8fd31
Merge pull request #13376 from ethereum/make-hardcoded-parts-of-optimizer-sequence-configurable 2022-09-13 18:15:58 +02:00
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
ddf0d784ac Changelog and docs 2022-09-12 11:13:47 +02:00
Nikola Matic
f6f0d6a360 Make hardcoded parts of the optimizer sequence configurable 2022-09-12 10:57:36 +02:00
Bhargava Shastry
69d9869d21 Fix create2 memory access in yul interpreter. 2022-09-12 09:53:31 +02:00
Kamil Śliwak
f808855329
Merge pull request #13498 from eltociear/patch-2
Update ReleaseChecklist.md
2022-09-09 21:35:36 +02:00
Daniel Kirchner
34be07b37a
Merge pull request #13500 from supermassive/patch-2
Fix dynamic array spec
2022-09-09 17:07:46 +02:00
Anton Paymyshev
faffe3e0a4
Update docs/abi-spec.rst
Co-authored-by: Daniel Kirchner <daniel@ekpyron.org>
2022-09-09 18:38:49 +07:00
Anton Paymyshev
ddea589ffc
fix per review 2022-09-09 18:31:24 +07:00
Daniel Kirchner
3677c7a3ba
Merge pull request #13510 from ethereum/release-checklist-look-for-missing-changelog-entries
Release checklist: recommend checking if all PRs have changelog entries
2022-09-09 12:21:50 +02:00
wechman
0eae9e70ff Tests for copying structs between data locations 2022-09-09 09:58:41 +02:00
wechman
dfe8fce369 Tests for copying nested array of structs between data locations 2022-09-09 09:42:40 +02:00
wechman
c4d97120bd Add test for copying elements of nested storage array 2022-09-09 09:42:40 +02:00
Daniel Kirchner
99428838e5
Merge pull request #13509 from ethereum/Marenz-patch-1
Update PPA instructions for Z3 in checklist
2022-09-08 21:30:31 +02:00
Mathias L. Baumann
46b9df92b1 Update PPA instructions for Z3 in checklist 2022-09-08 20:39:37 +02:00
Kamil Śliwak
918307a542 ReleaseChecklist: Make sure the changelog is complete 2022-09-08 20:37:48 +02:00
Daniel Kirchner
a12a96cf7a
Merge pull request #13505 from ethereum/set-version-to-0.8.18
Set version to 0.8.18
2022-09-08 20:23:37 +02:00
Kamil Śliwak
3b524455c6 Set version to 0.8.18 2022-09-08 17:59:54 +02:00
Daniel Kirchner
8df45f5f86
Merge pull request #13502 from ethereum/finalize-release-0.8.17
Finalize release 0.8.17
2022-09-08 16:35:41 +02:00
Kamil Śliwak
722e9d8693 Set release date for 0.8.17 and update the bug list 2022-09-08 15:32:40 +02:00
Kamil Śliwak
514842e2a4 Sort changelog for 0.8.17 alphabetically 2022-09-08 15:32:40 +02:00
Kamil Śliwak
1649f24767 Add missing changelog entries for a few PRs that will go into 0.8.17 2022-09-08 15:32:40 +02:00
Daniel Kirchner
130892cdaa
Merge pull request #13503 from ethereum/release-link-check
Fix SMT checker paper link
2022-09-08 15:32:25 +02:00
Nikola Matic
f90b25449d Fix SMT checker paper link 2022-09-08 15:22:47 +02:00
Daniel Kirchner
727591b984
Merge pull request #13479 from ethereum/unusedStoreStorageBug
Fix of unused store remover storage bug.
2022-09-08 14:04:04 +02:00
Anton Paymyshev
a39bce010e
Fix dynamic array spec 2022-09-08 17:50:44 +07:00
Daniel Kirchner
d6eb255df4 Changelog entry and bug list entry.
Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
2022-09-08 12:05:49 +02:00
Daniel Kirchner
a33da17300 Bugfix and tests.
Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
2022-09-08 11:54:14 +02:00
Ikko Ashimine
f562021918
Update ReleaseChecklist.md
github -> GitHub
Github -> GitHub
2022-09-08 11:34:11 +09:00
Daniel Kirchner
d5e2925326 broken yul optimizer test 2022-09-07 16:49:58 +02:00
wechman
0262621b9f fixup! Add test for copying reference types between data locations 2022-09-07 10:45:53 +02:00
wechman
c5d8c5ad05 Add test for copying reference types between data locations 2022-09-07 10:45:53 +02:00
Kamil Śliwak
548a4b4ac6
Merge pull request #13474 from ethereum/add-note-about-peephole-optimizer
Add note about peephole optimizer in docs
2022-09-06 22:59:09 +02:00
Matheus Aguiar
efe558a989 Added note about PeepholeOptimizer in docs. 2022-09-06 17:15:21 -03:00
Daniel Kirchner
7351f6d084
Merge pull request #13491 from ethereum/pin-hardhat-version-in-bleeps-tests
Pin hardhat version in bleeps tests
2022-09-06 19:59:49 +02:00
Nikola Matic
71d1209996 Pin hardhat version in bleeps tests 2022-09-06 17:55:23 +02:00
Nikola Matić
b4b5f7b355
Merge pull request #13489 from ethereum/pin-hardhat-version-in-yield-liquidator-tests
Pin hardhat version in yield-liquidator tests
2022-09-06 12:49:51 +02:00
Nikola Matić
f7e22fc00d
Merge pull request #13487 from ethereum/add-message-to-gp2-pin
Add comment to pinned GP2 hardhat version
2022-09-06 12:49:35 +02:00
Nikola Matic
8c4bbf1f4e Pin hardhat version in yield-liquidator tests 2022-09-06 11:06:31 +02:00
Nikola Matic
deab2bf37e Add comment to pinned GP2 hardhat version 2022-09-06 08:10:55 +02:00
Nikola Matić
e0b2162bf9
Merge pull request #13485 from ethereum/pin-hardhat-in-gp2-ext-tests
Pin hardhat version in GP2 external tests
2022-09-05 21:55:24 +02:00
Nikola Matic
53059936cc Pin hardhat version in GP2 external tests 2022-09-05 20:52:46 +02:00
Daniel Kirchner
7911666ab3
Merge pull request #13463 from emmaodia/develop
Grammar fix
2022-09-05 20:47:30 +02:00
emmaodia
0d98436de6 Grammar fix 2022-09-05 20:34:10 +02:00
Daniel Kirchner
62e4ce3387
Merge pull request #13363 from ethereum/release-checklist-update-and-tweaks
Release checklist update and tweaks after 0.8.16
2022-09-05 19:00:38 +02:00
Kamil Śliwak
ccc331743c ReleaseChecklist: Markdown formatting for all links 2022-09-05 18:19:51 +02:00
Kamil Śliwak
98ad27d42c ReleaseChecklist: Update PPA instructions 2022-09-05 18:13:09 +02:00
Kamil Śliwak
be67e76165 ReleaseChecklist: Update the list of requirements 2022-09-05 18:13:09 +02:00
Kamil Śliwak
f5c91ec842 ReleaseChecklist: Don't sort contributor list by number of commits and use long options 2022-09-05 18:13:09 +02:00
Kamil Śliwak
d9f169eb4b ReleaseChecklist: Consistently use double backticks everywhere, fix indents and mismatched parentheses 2022-09-05 18:13:09 +02:00
Kamil Śliwak
33883059ed ReleaseChecklist: Add "still in progress" warning and make the release page a single point 2022-09-05 18:13:08 +02:00
Kamil Śliwak
3f437da2a4 ReleaseChecklist: Emphasize separate changelog and version commits 2022-09-05 18:13:08 +02:00
Kamil Śliwak
b9d06b48a2 ReleaseChecklist: More detailed steps related to blog posts 2022-09-05 18:13:08 +02:00
Kamil Śliwak
dd2f718b99 ReleaseChecklist: Regenerating the bug list does not require running the whole tests.sh 2022-09-05 18:13:08 +02:00
Kamil Śliwak
71a9fb25ed ReleaseChecklist: Documentation now gets built automatically from tags 2022-09-05 18:13:08 +02:00
Mathias L. Baumann
f2168c16b4
Merge pull request #13467 from ethereum/check-for-unqualified-move
Add a check for unqualified move
2022-09-05 16:49:52 +02:00
Nikola Matic
1f6a299062 Add a check for unqualified move 2022-09-05 16:05:14 +02:00
Daniel Kirchner
99f15ff04e
Merge pull request #13481 from ethereum/fix-artifacts-check-in-hardhat-external-tests
Fix compiler version check in hardhat artifacts json
2022-09-05 16:03:22 +02:00
Nikola Matic
e5769d784e Fix compiler version check in hardhat artifacts json 2022-09-05 15:00:53 +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
Daniel Kirchner
5192965229
Merge pull request #13460 from Pospelove/patch-1
Set CMake policy `CMP0115` to `NEW`: "Source file extensions must be explicit"
2022-09-01 13:07:01 +02:00
matheusaaguiar
220aecefd0
Merge pull request #13465 from xternet/patch-1
README.md: added comma
2022-09-01 07:02:37 -03:00
xternet
66994b68d7
README.md: added comma 2022-08-31 15:01:46 +02:00
Leonid Pospelov
6d331a8c8a
Improve comment on CMP0115
Co-authored-by: Kamil Śliwak <cameel2@gmail.com>
2022-08-31 12:12:15 +03:00
Leonid Pospelov
6e1f0e73b6
Set CMP0115 to new in EthPolicy 2022-08-31 01:50:30 +03:00
matheusaaguiar
ecdc808e67
Merge pull request #13387 from taylorferran/improve-voting-example
Add detail about limitation in voting contract example
2022-08-30 10:41:41 -03:00
Mathias L. Baumann
b2afe9f9dc
Merge pull request #13457 from ethereum/checks
Explained Checks-Effects-Interactions
2022-08-30 15:20:53 +02:00
Leo
b028671fec
Merge pull request #13438 from ethereum/z3_4_11_0
Update z3 to 4.11.0 in the docker files
2022-08-30 14:57:11 +02:00
Luke Hutchison
b676944c3f Update security-considerations.rst
Explained Checks-Effects-Interactions and added info on Checks-Effects-Events-Interactions
2022-08-30 14:35:31 +02:00
Taylor Ferran
79adec08f2 Add detail about limitation in voting contract example 2022-08-30 14:34:05 +02:00
Leo Alt
cbcd8a724b Update z3 to 4.11.0 2022-08-30 12:52:22 +02:00
Leo
e048ba4d75
Merge pull request #13439 from ethereum/z3_4_8_11_smt_tests
Update SMT tests with z3 4.11.0
2022-08-30 12:51:13 +02:00
Leo
3658d8abc4
Merge pull request #13292 from The-Arbiter/Function_modifiers_placeholder
Placeholder elaboration in function-modifiers.rst
2022-08-30 12:50:49 +02:00
NoFaceDev
e96453d585 Added details on placeholders in function-modifiers
Author:    NoFaceDev <NoFaceDev@protonmail.com>
Date:      Sat Jul 23 18:22:06 2022 +0400
2022-08-30 12:00:37 +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
Leo
4f6524063d
Merge pull request #13454 from ethereum/github-labels-and-issue-changes
Update issue selector, and remove auto labeling
2022-08-30 11:53:42 +02:00
Leo Alt
22e4e2cdc9 disable SMT tests for the clang job 2022-08-30 11:51:59 +02:00
Leo Alt
16c0838f75 Update docker images and tests 2022-08-30 11:51:59 +02:00
Mathias L. Baumann
fa5ea38ab3
Merge pull request #13409 from tcoyvwac/fix/refactor/reduce-code-duplication-ast
Reduce duplication in AST helpers for finding try/catch clauses
2022-08-30 11:37:49 +02:00
Marenz
f7cc29bec1 Add std:: qualifier to move() calls 2022-08-30 11:12:15 +02:00
Leo
19e3c7339e
Merge pull request #13455 from emmaodia/patch-2
Grammer fix
2022-08-30 11:08:42 +02:00
Leo
ec36a5aaab
Merge pull request #13452 from minaminao/fix-typo-optimizer
Fix typo
2022-08-30 10:54:05 +02:00
Emmanuel Oaikhenan
776f74dc30
Grammer fix 2022-08-30 09:23:15 +01:00
Nikola Matic
a08d39ce84 Update issue selector, and remove auto labeling 2022-08-30 10:05:49 +02:00
minaminao
99400a6121 Fix typo 2022-08-30 09:35:12 +09:00
Mathias L. Baumann
7fdd494da7
Merge pull request #13450 from ethereum/add_yul_exception_to_compiler_errors
added yul exception to compiler error types
2022-08-30 00:27:25 +02:00
nishant-sachdeva
216d38cefe added yul exception to compiler error types 2022-08-29 22:52:31 +05:30
Mathias L. Baumann
8ea483d532
Merge pull request #13449 from ethereum/fix-undefined-order-of-evaluation
[Tiny] Fix undefined order of evaluation
2022-08-29 17:35:36 +02:00
Leo
94fd40f696
Merge pull request #13443 from frangio/fix-13416
Clarify effect of memory unsafe assembly
2022-08-29 17:25:23 +02:00
Francisco Giordano
81c4604b8a Clarify effect of memory unsafe assembly 2022-08-29 11:39:57 -03:00
Mathias L. Baumann
2ddb26ad96
Merge pull request #13429 from sotatek-dev/fix/13421
Fix warning about DOWNLOAD_EXTRACT_TIMESTAMP on CMake 3.24
2022-08-29 15:52:56 +02:00
Marenz
f508494f52 Fix undefined order of evaluation 2022-08-29 15:33:25 +02:00
Mathias L. Baumann
5a3ae1a583
Merge pull request #13422 from ethereum/cleanup-z3-script
Cleanup static z3 script to work similar to release_ppa
2022-08-29 14:51:39 +02:00
Leo
f0d1ddaee4
Merge pull request #13447 from MeetRajput00/develop
fixed grammar typo in readme.md
2022-08-29 14:28:40 +02:00
Leo
e49c2ef1ec
Merge pull request #13440 from ethereum/meeting_time_standardized
Meetings on Mondays and Wednesdays now happen at the same time
2022-08-29 13:52:50 +02:00
MeetRajput00
eb644b1d8e fixed grammar typo in readme.md 2022-08-29 16:48:14 +05:30
nishant-sachdeva
a2a80401ed Meetings on Mondays and Wednesdays should happen at the same time 2022-08-29 16:33:18 +05:30
Leo
409f3b44aa
Merge pull request #13444 from ethereum/fix_pylint
Fix pylint warning
2022-08-29 12:44:32 +02:00
Leo Alt
e99e93ff5b Fix pylint warning 2022-08-29 11:50:29 +02:00
Nikola Matić
7bfec3ba70
Merge pull request #13430 from ethereum/fix-gnosis-test-inconsistent-dependency
Fix inconsistent nested dependency in safe-contracts
2022-08-26 17:12:50 +02:00
Nikola Matic
71c3c26b29 Fix inconsistent nested dependency in safe-contracts 2022-08-26 09:40:03 +02:00
Kamil Śliwak
f802eafc67
Merge pull request #13436 from ethereum/newemscripthashes
Update docker images for emscripten.
2022-08-25 20:57:10 +02:00
Leo
0bec0e8ec4
Merge pull request #13397 from kuzdogan/patch-1
Update Metadata docs
2022-08-25 17:25:41 +02:00
Marenz
484c9d3ff0 Update docker images for emscripten. 2022-08-25 17:09:46 +02:00
Mathias L. Baumann
c4d9cdf643
Merge pull request #13424 from ethereum/update-emscripten-dockerfile
Update emscripten Dockerfile to 3.1.19
2022-08-25 16:08:03 +02:00
kuzdogan
5849fc3bf1 Update contract metadata docs 2022-08-25 15:25:39 +02:00
Marenz
c5e9b6e666 static_z3.sh: Update releases to include only maintained ones 2022-08-25 15:18:55 +02:00
Marenz
0475ec81f0 Cleanup static z3 script to work similar to release_ppa 2022-08-25 15:18:55 +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
Marenz
35870549db Dockerfile.emscripten: Use `&& instead of ;` everywhere 2022-08-25 13:08:13 +02:00
Duc Thanh Nguyen
318dedf439 Update emscripten Dockerfile to 3.1.19 2022-08-25 13:08:13 +02:00
Thanh Tran
1cd6f2a486 Fix warning about DOWNLOAD_EXTRACT_TIMESTAMP on CMake 3.24 2022-08-25 14:23:47 +07:00
Kamil Śliwak
22a0c46eae
Merge pull request #12923 from super1ha1/circle-ci-merge_similar_jobs
[Circle CI] Parameterize b_bytecode_ubu and b_bytecode_osx build job
2022-08-24 22:01:02 +02:00
khue
66f48282cc change to common config of 1 job to reuse between osx and ubuntu 2022-08-24 20:29:51 +02:00
Christian Parpart
44fcf351ba
Merge pull request #13150 from ethereum/lsp-analyze-all-in-project
LSP analyze all files in project
2022-08-24 18:02:24 +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
d0854cb485 Applying CI-reported fixes. 2022-08-22 12:49:06 +02:00
Christian Parpart
d31e4dcc0a lsp: Finishing last missing test wrt complex nested project directory structure and specifying custom includes, while using some (one) of them. 2022-08-22 12:49:06 +02:00
Christian Parpart
122fbc6ff7 Adds include-paths-nested test case. 2022-08-22 12:49:06 +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
Christian Parpart
0e2ab05000 libsolutil: Adding findFilesRecursively() helper to find files recursively. 2022-08-22 12:48:35 +02:00
Mathias L. Baumann
a3de6cd60e
Merge pull request #12762 from ethereum/emptyReturnRevert
Optimize ``return(x,0) -> pop(x) return(0,0)`` (and also for ``revert``).
2022-08-22 12:42:48 +02:00
Alexander Arlt
f01a09f843
Merge pull request #13400 from ethereum/buildpack-deps-fix2
[buildpack] Switch to unsplash/comment-on-pr@v1.3.0.
2022-08-19 12:22:08 +02:00
Mathias L. Baumann
3497e2b2ec
Merge pull request #13413 from ethereum/fix-spelling-ci
Use long option for spellchecker in CI
2022-08-18 17:48:55 +02:00
Marenz
542ce5ad95 Use long option for spellchecker in CI 2022-08-18 15:28:12 +02:00
Alexander Arlt
4addf1e0ad [buildpack] Switch to unsplash/comment-on-pr@v1.3.0. 2022-08-18 15:27:44 +02:00
Mathias L. Baumann
a229d7219b
Merge pull request #13411 from ethereum/fix-spelling-ci
Fix spelling mistakes and CI spellcheck job
2022-08-18 15:26:59 +02:00
Marenz
1b5332c2b9 Fix spelling mistakes and CI spellcheck job 2022-08-18 14:38:19 +02:00
Mathias L. Baumann
86ab18c9af
Merge pull request #13287 from ethereum/bettercmdlineHelp
Document in ``solc --help`` usage of ``--metadata`` better.
2022-08-18 13:00:33 +02:00
wechman
cf3bae0839 Fix "slot" access via mapping reference in assembly 2022-08-17 07:53:52 +02:00
Nikola Matić
bb41ddd7ab
Merge pull request #13404 from ethereum/peg-hardhat-ethers-version
Peg hardhat-ethers version
2022-08-16 19:43:06 +02:00
Alexander Arlt
a4358b166c
Merge pull request #13398 from ethereum/cmdline-test-verbosity-fix
test/cmdlineTests.sh: fix verbosity.
2022-08-16 18:57:10 +02:00
Nikola Matic
6b6cfa1795 Peg hardhat-ethers version 2022-08-16 17:52:27 +02:00
Kamil Śliwak
f20ca0c0b2
Merge pull request #13401 from ethereum/docs-more-highlighting
Enable highlighting for more code blocks in the docs
2022-08-16 12:17:53 +02:00
Kamil Śliwak
0400b435b8 Enable highlighting for more code blocks in the docs 2022-08-16 10:05:14 +02:00
Leo
a0ee14f7c2
Merge pull request #13399 from minaminao/remove-callcode-in-heading
Remove unnecessary "Callcode" in the heading
2022-08-15 19:55:52 +02:00
minami
1706db2776 Fix underline 2022-08-16 01:15:29 +09:00
minami
b08454e49d Remove callcode in heading 2022-08-16 01:12:43 +09:00
Alexander Arlt
ee2c4cddcd test/cmdlineTests.sh: fix verbosity. 2022-08-15 17:37:08 +02:00
Daniel Kirchner
1b081d0c46
Merge pull request #13388 from Pospelove/fix-12027
Fix iter_swap build issue
2022-08-15 17:32:16 +02:00
Daniel Kirchner
a9c21863d4 Update tests. 2022-08-15 16:24:10 +02:00
Leo
c0e678033c
Merge pull request #12855 from aathan/patch-12
Rephrase named vs unnamed parameters in function definitions (in control-structures.rst).
2022-08-15 15:53:49 +02:00
Daniel Kirchner
733b0f63f6 Disable failing chainlink tests. 2022-08-15 15:42:51 +02:00
Daniel Kirchner
e996fe6247 Yul Optimizer: Simplify start offset of zero-length operations. 2022-08-15 15:42:51 +02:00
Leo
fbef27233c
Merge pull request #13394 from ethereum/buildpack-deps-fix
[buildpack] Switch to unsplash/comment-on-pr@v1.3.1.
2022-08-15 15:11:13 +02:00
Alexander Arlt
730950fb63 [buildpack] Switch from aarlt/comment-on-pr@v1.2.0 to unsplash/comment-on-pr@v1.3.1. 2022-08-15 13:53:36 +02:00
Marenz
5da46581bd Document in `solc --help usage of --metadata` better. 2022-08-15 12:57:40 +02:00
Daniel Kirchner
31bd4f6b80
Merge pull request #13389 from Pospelove/patch-1
Fix "signed/unsigned mismatch" warnings (MSVC)
2022-08-15 11:05:28 +02:00
Leonid Pospelov
32aa000378
Update FullInliner.cpp 2022-08-14 03:14:15 +03:00
Leonid Pospelov
4682c01920
Update ASTJsonExporter.cpp 2022-08-14 03:07:01 +03:00
Leo
a78a2bcf34
Merge pull request #13374 from 0xpranay/patch-2
Update the default free memory pointer in Yul.rst
2022-08-13 15:55:15 +02:00
Leo
1b8d7aae10
Merge pull request #13346 from minaminao/docs-abi-encoder-v2-default
Update description of input parameter type and return type limitations
2022-08-13 15:34:38 +02:00
Leo
b17559184a
Merge pull request #13256 from YuviTz1/develop
Added build flag to disable pedantic builds
2022-08-13 15:32:04 +02:00
Pranay
60d513c484
Updated yul.rst with feedback.
Updated yul.rst with explanation of 0x60 pointer choice.
2022-08-13 18:39:46 +05:30
Leo
5cf3973bb5
Merge pull request #12852 from aathan/patch-9
Update reference-types.rst
2022-08-13 15:09:33 +02:00
Leo
9dd2e0ec3f
Merge pull request #12954 from aathan/clarify-address-literals-eip-55
Link to address literals from address value types
2022-08-13 15:06:34 +02:00
minami
ec4ccf8183 Improve docs of possible function inputs and outputs 2022-08-13 14:48:20 +02:00
Leo
898ad25aab Review suggestions 2022-08-13 14:25:09 +02:00
aathan
18ce69ebbd Update reference-types.rst 2022-08-13 14:25:09 +02:00
Leo
681581d7f0
Merge pull request #12844 from aathan/patch-6
Update operators.rst
2022-08-13 14:25:07 +02:00
aathan
ffbb6f159e Update value-types.rst 2022-08-13 14:22:42 +02:00
Leo
cdf48de315
Merge pull request #12837 from aathan/patch-2
Rephrase comment about arrays of arrays in code example.
2022-08-13 14:13:13 +02:00
aathan
0561bd6b00 Update control-structures.rst 2022-08-13 13:51:55 +02:00
aathan
9d5fb1bf8b Update operators.rst 2022-08-13 13:36:57 +02:00
aathan
f1a5bc7ed9 Update reference-types.rst
Clarify comment using language similar to that in the Array section of the documentation. Previously it said simply "Because of that..." but what the word "that" was about, was not evident.
2022-08-13 13:29:22 +02:00
matheusaaguiar
e27cb025c2
Merge pull request #13177 from ethereum/check-overflow-after-mul-operation
Check overflow after multiplication operation.
2022-08-12 12:01:56 -03:00
Matheus Aguiar
2282ea5e56 Added overflow checks after multiplication operation is executed. 2022-08-12 10:18:05 -03:00
Bhargava Shastry
c48be40ab8
Merge pull request #13380 from ethereum/multiple-indirections
Permit multiple indirections in coding calldata to and from memory/calldata
2022-08-12 12:20:28 +02:00
Daniel Kirchner
51e22595e6
Merge pull request #13370 from ethereum/ppa_release_fixes
Little enhancements to the ppa release script
2022-08-12 11:58:13 +02:00
Daniel Kirchner
b9967c64e5
Merge pull request #13289 from ethereum/calldata_tests
Calldata validation tests
2022-08-12 11:29:06 +02:00
Bhargava Shastry
e3ed29d3b3 Permit multiple indirections in coding calldata to and from memory/calldata. 2022-08-12 09:33:06 +02:00
Marenz
0fab970eb9 Remove old distributions in release_ppa script 2022-08-11 18:36:07 +02:00
Marenz
351efae5f8 Little enhancements to the ppa release script 2022-08-11 18:36:07 +02:00
Kamil Śliwak
b7847c9f07 installing-solidity.rst: Mention the PEDANTIC flag 2022-08-11 15:43:34 +02:00
Yuvraj Singh
9290ccb908 Added build flag to disable pedantic builds 2022-08-11 15:10:53 +02:00
wechman
99ac7e09bb fixup! Calldata validation tests 2022-08-11 07:55:10 +02:00
wechman
60e7e4a24c fixup! Calldata validation tests 2022-08-11 07:39:02 +02:00
wechman
123a410795 fixup! Calldata validation tests 2022-08-11 07:38:54 +02:00
wechman
d066dd2bc0 Calldata validation tests 2022-08-11 07:38:28 +02:00
Kamil Śliwak
3c0a7355d0
Merge pull request #13262 from xromrom/fixLinkToInternalFunctionCallsInDocs
[Docs] Fixed link to internal-function-calls
2022-08-10 19:07:08 +02:00
Daniel Kirchner
3a5b43eea3
Merge pull request #13286 from LCamel/contract_metadata_doc
Modify the metadata / hash document.
2022-08-10 18:19:10 +02:00
Daniel Kirchner
c4b0cb77ad
Merge pull request #13300 from krakxn/patch-1
Docs — Minor grammar fixes in `abi-spec.rst`
2022-08-10 18:17:49 +02:00
Daniel Kirchner
676e2fe79a
Merge pull request #13379 from ethereum/makeGasDiffScriptExecutable
Make gas diff stats script executable.
2022-08-10 18:03:50 +02:00
Daniel Kirchner
213f951dbb Make gas diff stats script executable. 2022-08-10 16:50:42 +02:00
Roman Figurin
bbf6ecf69d [Docs] Updated a part about abicoder v2 and multi-dimensional array for external-function-calls 2022-08-10 16:09:33 +02:00
Roman Figurin
664b7bfbda [Docs] Fixed link to internal-function-calls 2022-08-10 16:09:14 +02:00
Kamil Śliwak
80f77dc1ad
Merge pull request #13360 from ethereum/update-bugs-by-version-no-error-on-update
`update_bugs_by_version.py`: don't fail when the list gets updated
2022-08-10 15:51:41 +02:00
Pranay
6439955e83
Update the default free memory pointer in Yul.rst
The solidity docs and [Inline assembly memory management](https://docs.soliditylang.org/en/v0.8.15/assembly.html#memory-management) suggest the actual allocate-able memory starts from `0x80`. The above yul example defaults the free memory pointer to `0x60` in initialisation cases.
2022-08-10 13:54:02 +05:30
Daniel Kirchner
6b60524cfe
Merge pull request #13367 from ethereum/invalidTupleAssignment
Fix ICE on invalid tuple assignments.
2022-08-09 15:59:29 +02:00
Daniel Kirchner
9a429e2300 Fix ICE on invalid tuple assignments. 2022-08-09 12:41:47 +02:00
Nikola Matić
bb1a8df97e
Merge pull request #13355 from ethereum/tidy-up-gitignore
Tidy up and update .gitignore
2022-08-09 10:00:43 +02:00
Kamil Śliwak
6a42da8d35
Merge pull request #13361 from ethereum/addBuglistLink
Add blog post link to bug list.
2022-08-08 18:35:15 +02:00
Daniel Kirchner
c2d4e03c55 Add blog post link to bug list. 2022-08-08 17:40:32 +02:00
Kamil Śliwak
8874627dda update_bugs_by_version: Don't fail when the list gets updated 2022-08-08 17:29:47 +02:00
Kamil Śliwak
c1cbffc814 update_bugs_by_version: Use pathlib 2022-08-08 17:10:04 +02:00
Daniel Kirchner
abe869ad7c
Merge pull request #13359 from ethereum/set-version-to-0.8.17
Set version to 0.8.17
2022-08-08 16:47:17 +02:00
Kamil Śliwak
cc11c6f3d5 Set version to 0.8.17 2022-08-08 15:24:48 +02:00
Kamil Śliwak
07a7930e73
Merge pull request #13358 from ethereum/set-release-date-0.8.16
Set release date for 0.8.16 and update the bug list
2022-08-08 14:59:34 +02:00
Nikola Matic
d7531b716f Tidy up and update .gitignore 2022-08-08 14:45:31 +02:00
Kamil Śliwak
caba38db5c Set release date for 0.8.16 and update the bug list 2022-08-08 14:12:42 +02:00
Daniel Kirchner
f390b01dd1
Merge pull request #13357 from ethereum/sort-changelog-0.8.16
Sort changelog for 0.8.16
2022-08-08 14:02:29 +02:00
Kamil Śliwak
fb51bd69a3 Changelog cleanup for 0.8.16 2022-08-08 13:57:19 +02:00
Kamil Śliwak
0835e41626 Sort changelog for 0.8.16 alphabetically 2022-08-08 13:56:22 +02:00
Daniel Kirchner
4e67ef2384
Merge pull request #13282 from ethereum/fix-array-encode-bug
Fix wrong cleanup when copying from calldata to memory.
2022-08-08 13:49:13 +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
Kamil Śliwak
5b0f4a724a
Merge pull request #13354 from ethereum/fuzz-calldata-to-calldata-coding
Place calldata to calldata coder sanity checks.
2022-08-08 12:40:38 +02:00
Bhargava Shastry
53947404e4 Place calldata to calldata coder sanity checks.
Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
2022-08-08 11:04:51 +02:00
Kamil Śliwak
49a2db99e6
Merge pull request #13345 from minaminao/docs-this-no-longer-works-in-free-function
Update description of `this` in free functions
2022-08-05 23:47:09 +02:00
minami
796fb2cfad Fix description of this in free functions 2022-08-05 23:05:10 +02:00
Nikola Matić
2c5a8c0e25
Merge pull request #13342 from ethereum/full-stop-for-error-messages
Add full stops to error messages
2022-08-05 11:43:44 +02:00
Nikola Matic
40de2b0442 Add full stops to error messages 2022-08-05 09:52:48 +02:00
matheusaaguiar
19ad8b115e
Merge pull request #13279 from timweri/nested-tuple-oor-fix 2022-08-04 15:29:50 -03: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
Daniel Kirchner
14488e3f0e
Merge pull request #13347 from ethereum/fix-zeppelin-tests
Disable failing zeppelin tests
2022-08-04 18:16:36 +02:00
Nikola Matic
1543d23601 Disable failing zeppelin tests 2022-08-04 17:22:42 +02:00
Kamil Śliwak
c9f772eba8
Merge pull request #13299 from ethereum/fix-bad-cast-tuple-returned-from-function-abi-encodeCall
Fix bad_cast when abi.encodeCall() receives a tuple expression
2022-08-04 16:00:47 +02:00
Matheus Aguiar
9acf693aa2 Fixed bad cast when abiEncodeCall receives a tuple from a function. 2022-08-03 18:48:38 -03:00
LCamel
14f63cc7e8
Update docs/metadata.rst
Co-authored-by: Daniel Kirchner <daniel@ekpyron.org>
2022-08-03 22:12:11 +08:00
Daniel Kirchner
82e5a110ea
Merge pull request #13341 from Ruko97/fix-tab-alignment
fixed wrong tab alignment in YulUtilFunctions.h
2022-08-03 11:24:22 +02:00
Ishtiaque Zahid
3e70a406af fixed wrong tab alignment in YulUtilFunctions.h 2022-08-03 12:33:11 +06:00
AN ❦
4d4a030a01 Minor grammar fixes 2022-08-03 02:02:16 +05:30
chriseth
d5a78b18b3
Merge pull request #13313 from QGarchery/develop
fix: global state object in yul formal specification
2022-07-28 15:30:44 +02:00
Quentin Garchery
b3fd11a66f
fix: global state object in yul formal specification 2022-07-28 11:12:14 +02:00
matheusaaguiar
72f1907298
Merge pull request #13131 from rodrigobaraglia/develop
replace boost::range::for_each with range::views:zip + loop in file ContractABIUtils.cpp
2022-07-27 13:58:46 -03:00
rodrigobaraglia
95bc553ffc replace boost/range/for_each with standard for loop over rangev3/view/zip in ContractABIUtils::overwriteParameters 2022-07-27 12:54:42 -03:00
Mathias L. Baumann
63f8a93ca8
Merge pull request #13304 from ethereum/tmp-fix-zep
Disable zeppelin tests that detect wrong revert reason
2022-07-27 17:29:49 +02:00
Marenz
a1f6a3da9b Disable faulty zeppelin tests that detect a wrong revert reason 2022-07-27 15:57:50 +02:00
chriseth
ce5da7dbdc
Merge pull request #13307 from ethereum/changelog-cleanup
Changelog cleanup
2022-07-26 18:54:47 +02:00
Kamil Śliwak
849d6f6230
Merge pull request #13306 from ethereum/no-smt-on-arch
Disable SMT tests on Arch Linux
2022-07-26 18:25:29 +02:00
Kamil Śliwak
48835b3a73 Changelog: Add missing entry for the 0.8.13 PR that caps the returndata copied for static returns 2022-07-26 18:19:17 +02:00
Kamil Śliwak
f917249111 Changelog: Remove the superfluous entry about error reporter 2022-07-26 18:05:16 +02:00
Kamil Śliwak
8b05868895 Changelog: Sort 0.8.15 entries 2022-07-26 18:04:50 +02:00
Kamil Śliwak
13dc5c2981 Changelog: Use Language Server instead of LSP when referring to the compiler component 2022-07-26 18:04:06 +02:00
Kamil Śliwak
cd741b4162 CI: Disable SMT tests on Arch Linux 2022-07-26 17:38:55 +02:00
Luoh Ren-Shan (LCamel)
de857c27f3 Modify the metadata document. 2022-07-26 15:53:52 +08:00
chriseth
9f34322f39
Merge pull request #13280 from timweri/fix-abi-encodecall-special-func-in-free-func
Fix NULL dereference in abi.encodeCall check
2022-07-25 21:22:25 +02:00
chriseth
dd9a57b1fb
Merge pull request #13295 from minaminao/fix-dark-mode-bug
Fix dark mode bug
2022-07-25 21:03:03 +02:00
chriseth
ce6d86b8e1
Merge pull request #13298 from krakxn/contributing.rst-grammar-fix
Minor grammar fixes in `contributing.rst`
2022-07-25 21:01:40 +02:00
AN ❦
991174074e Minor grammar fixes 2022-07-25 21:01:00 +02:00
Duc Thanh Nguyen
5072472917 Fix abi.encodeCall checks 2022-07-25 12:40:54 -04:00
chriseth
6c4cfd8b03
Merge pull request #13293 from krakxn/develop
Grammatical fixes in `assembly.rst`
2022-07-25 17:31:10 +02:00
minami
98833b267f Fix dark mode bug 2022-07-25 04:26:45 +09:00
AN
b828da248f
Grammatical fixes 2022-07-23 21:21:28 +05:30
Kamil Śliwak
800088e38b
Merge pull request #13128 from CJ42/docs/assembly-memory-safe
docs: specify memory-safe is available since 0.8.13 for inline assembly
2022-07-14 21:58:45 +02:00
CJ42
ac5c26bbe9 docs: specifiy memory-safe in inline assembly is available since 0.8.13 2022-07-14 21:14:53 +02: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
454603e170
Merge pull request #13273 from ethereum/lsp-ci-trace
lsp.py: Pass trace option during initialization already.
2022-07-13 20:13:31 +02:00
chriseth
8cb12877bb
Merge pull request #13261 from ethereum/onlyAnalyzeMemoryIfNeeded
Only analyze memory in DataFlowAnalyzer if it is needed in the optimizer step.
2022-07-13 17:59:59 +02:00
chriseth
d30fef0ff2
Merge pull request #13272 from maxisch/patch-1
Modular Contracts typo fix
2022-07-13 17:59:25 +02:00
Christian Parpart
ed039abb97
Merge pull request #13274 from ethereum/lsp-fix-include-path
lsp: Fixes initialization phase if `include-paths` was not set at all then also no error should be generated.
2022-07-13 17:13:58 +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
f686294374
Merge pull request #12994 from ethereum/lsp-include-path
LSP to resolve custom include paths (e.g. Hardhat)
2022-07-13 14:41:41 +02:00
maxisch
5567e30196
Modular Contracts typo fix 2022-07-13 09:02:29 -03:00
Christian Parpart
d89008da0a lsp: Adding test for custom include paths. 2022-07-13 13:57:04 +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
Christian Parpart
d003400cb0
Merge pull request #13263 from ethereum/fix/lsp-checker-to-not-bail-on-missing-response
lsp: Fixes lsp.py to not bail out when no response is expected.
2022-07-12 15:16:26 +02:00
Christian Parpart
5918955615 lsp: Fixes lsp.py to not bail out when no response is expected.
This is required for another PR to support sending notifications as part of the I/O being documented as comments.
2022-07-12 14:35:14 +02:00
chriseth
c12d151834 Only analyze memory in DataFlowAnalyzer if it is needed in the optimizer step. 2022-07-11 15:51:25 +02:00
Mathias L. Baumann
e7c5f04464
Merge pull request #12681 from devtooligan/tweak/update-max-line-length
tweak: update maximum line length
2022-07-11 12:57:53 +02:00
Richie
db2b066d40
tweak: update maximum line length 2022-07-08 11:41:51 -07:00
Mathias L. Baumann
8d6b20f763
Merge pull request #13103 from ethereum/lsp-rename
Lsp rename feature
2022-07-08 15:01:37 +02:00
Damian Wechman
5d90dd1982
Merge pull request #13255 from vdusart/patch-1
[Docs] Fix operator docs to use an actually convertible type when describing how common type is chosen
2022-07-08 13:55:49 +02:00
Marenz
16b64f3aee LSP rename 2022-07-08 11:52:45 +02:00
vdusart
f012a77980
Fix mistake 2022-07-07 13:48:20 +02:00
vdusart
eb6b1291b7
Fix type error
Fix type error according to #13144
2022-07-07 13:41:33 +02:00
matheusaaguiar
b6f11b3392
Merge pull request #13244 from ethereum/remove-code-snippets-from-error-import-ast-mode
Removed wrong code snippets from error messages when in import-ast mode.
2022-07-06 16:25:43 -03:00
Matheus Aguiar
a73bf9136c Remove "garbage" code snippet from error message when in import-ast mode. 2022-07-06 13:43:29 -03: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
Mathias L. Baumann
b02f64818b
Merge pull request #13096 from victorknox/develop
Moved Keywords section from 'Cheatsheet' to 'Units and Globally Available Variables'
2022-07-06 15:30:36 +02:00
Mathias L. Baumann
45f5616b12
Merge pull request #12679 from devtooligan/tweak/expand-collide-definition
tweak: expand definition of suggested collision naming convention
2022-07-06 15:04:40 +02:00
Kamil Śliwak
4c85cb880e
Merge pull request #13238 from ethereum/improve-stack-too-deep-message
Improved stack too deep message when compiled without --optimize
2022-07-06 12:43:36 +02:00
Kamil Śliwak
3bc68139fd
Merge pull request #13250 from timweri/update_rangev3_to_0.12.0
Update rangev3 to 0.12.0
2022-07-06 12:38:55 +02:00
Duc Thanh Nguyen
2215b6d44b Update rangev3 to 0.12.0 2022-07-05 15:55:12 -04:00
Mathias L. Baumann
c8aed8c150
Merge pull request #13205 from ethereum/fix-stack-overflow-importing-large-AST-json-file
Fix segmentation fault when  importing large AST from json file
2022-07-05 18:56:38 +02: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
Kamil Śliwak
a53f15f45f
Merge pull request #13240 from derekg/test-fix
Fix C++ compilation errors on 32-bit Raspbian due to `unsigned` -> `int` conversion
2022-07-04 22:08:06 +02: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
Derek Gottfrid
3f62ab069c fix test w/ signed issues 2022-07-03 16:33:22 -04:00
hrkrshnn
0b2a670a94 Improved stack too deep message when compiled without --optimize 2022-07-03 14:03:00 +02:00
matheusaaguiar
5de5120497
Merge pull request #13105 from CJ42/docs/address-conversion
docs: add notice about `address` conversion prior to 0.8.0
2022-07-01 10:26:38 -03:00
CJ42
e4d3425ad9 docs: add uint160 type in address conversion section
docs: add notice for uint conversion before 0.8.0

docs: edit sentence structure + remove 'result in `address payable`'

docs: add keyword 'explicitly' to be more specific for `address payable`

docs: edit notice uint to address conversion change since 0.8.0

Co-authored-by: Kamil Śliwak <cameel2@gmail.com>
2022-07-01 09:43:24 -03:00
Mathias L. Baumann
48669b4bec
Merge pull request #13219 from ethereum/whiskers
Add whiskers test for weird case
2022-06-30 17:45:54 +02:00
Mathias L. Baumann
4e721273ed
Merge pull request #13220 from fulldecent/patch-26
Update naming of Mainnet
2022-06-30 17:41:29 +02:00
Alex Beregszaszi
cae1571aa7 Add whiskers test for weird case 2022-06-30 17:00:23 +02:00
William Entriken
2a957413d0 Update naming of Mainnet 2022-06-30 16:47:11 +02:00
Mathias L. Baumann
05496064fe
Merge pull request #13189 from ethereum/fix-externalTests-script
Enabled external tests to use relative paths to solc binary.
2022-06-29 19:46:00 +02:00
Mathias L. Baumann
b988d3ed37
Merge pull request #13184 from ethereum/memberAccess_locations
Add location for member in MemberAccess ASTNode
2022-06-29 19:25:57 +02:00
Matheus Aguiar
5b8a9509fc Enable each external script to work with solc binary relative path. 2022-06-29 13:55:21 -03:00
Mathias L. Baumann
2e334c30ae
Merge pull request #13229 from ethereum/temp-fix-ext
Fix external test ens
2022-06-29 18:54:26 +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
Marenz
4d8a14b653 Fix external test ens
By using the last known working commit.
Only a temporary measure.
2022-06-29 17:54:35 +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
Mathias L. Baumann
9d72842635
Merge pull request #13163 from Ruko97/formatNumberReadable_signed_int
formatNumberReadable now prints signed integers as well
2022-06-27 12:31:32 +02:00
Hari
046423f272
Merge pull request #13191 from aiman/doc-decimal-literal-trailing-dots
docs: Disallow decimal literals with trailing dots
2022-06-27 11:08:02 +02:00
victorknox
7445a4803f Moved Keywords section from 'Cheatsheet' to 'Units and Globally Available Variables' 2022-06-24 10:23:31 +05:30
Ishtiaque Zahid
61febbd249 formatNumberReadable now prints signed integers as well 2022-06-24 07:15:15 +06: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
70ca05fd73
Merge pull request #13183 from ethereum/identifierPath_locations
Add all path locations to the IdentifierPath ASTNode
2022-06-23 14:39:41 +02:00
Aiman Baharna
392b1872b3 docs: Disallow decimal literals with trailing dots
Currently the documentation suggests that a decimal literal can omit the
fractional part [1]:

> Decimal fractional literals are formed by a `.` with at least one
> number on one side. Examples include `1.`, `.1` and `1.3`.

However, commit ac68710 (May 30, 2018) disallowed trailing dots that are
not followed by a number [2].

Using decimal literals of the form `1.` will actually result in a
`ParserError` and so the docs should no longer recommend this form.

[1] https://docs.soliditylang.org/en/v0.8.15/types.html#rational-and-integer-literals
[2] ac68710789
2022-06-22 17:19:12 +01:00
Mathias L. Baumann
a2a88afd98
Merge pull request #13167 from ywon0925/ICE-isoltest
Fix validation error causing ICE with isoltest --test
2022-06-22 17:29:34 +02:00
ywon0925
0ee38c5d54 Rename boostTest.cpp to soltest.cpp, changed CMakeLists.txt accordingly 2022-06-22 21:14:42 +09:00
ywon0925
b78960c604 Add a Catch to handle exception 2022-06-22 21:14:42 +09: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
Damian Wechman
02fdcb3623
Merge pull request #12976 from dflupu/mulmod-opti
Add simplification rules for `mod(mul(X, Y), A)` & `mod(add(X, Y), A)`
2022-06-22 10:10:14 +02:00
Daniel Lupu
8498fdf1d4 Add changelog entries 2022-06-22 09:26:31 +02:00
Daniel Lupu
b99f85ec65 Only apply rules for yul optimizer 2022-06-22 09:26:09 +02:00
Daniel Kirchner
d1e382f2a8 Python Z3 proofs of the rules. 2022-06-22 09:26:09 +02:00
Daniel Lupu
8c5f5c7db0 add rules for mod(mul(X, Y), A) & mod(add(X, Y), A) 2022-06-22 09:26:09 +02:00
Mathias L. Baumann
75300c32a8
Merge pull request #13170 from RohitKS7/develop
fix: Typo
2022-06-21 17:28:56 +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
Rohit Kumar Suman
9bc015071c
fix: Typo
Line 84!
By => With
to the them => to them
2022-06-19 11:56:03 +05:30
Daniel Kirchner
be470c16fe
Merge pull request #13166 from ethereum/libraryNameIsoltestSemanticTestExpectations
Fix for library name updates in isoltest semantics tests.
2022-06-17 17:20:08 +02:00
Daniel Kirchner
14ef22c112 Hot fix for library name updates in isoltest semantics tests. 2022-06-17 16:02:05 +02:00
Daniel Kirchner
bed4d986f9
Merge pull request #13118 from ethereum/improvedCopyValueArrayToStorageFunction
Improved copy value-type-array to storage function
2022-06-17 15:13:55 +02:00
Daniel Kirchner
dc0a9bd8ec
Merge pull request #13164 from IMEF-FEMI/patch-1
updated int assembly.rst (Sample program bug fix)
2022-06-17 12:33:28 +02:00
Femi Bolaji
d417fe135f
updated int assembly.rst (Sample program bug fix)
fixed for loop bug in VectorSum.sumPureAsm function at line 42
# updated { data := add(dataElementLocation, 0x20) } to ----->  { dataElementLocation := add(dataElementLocation, 0x20) }
 in order to update dataElementLocation after every iteration. (Hence ending the loop)
2022-06-17 10:48:48 +01: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
384bb8b8f7 More gas adjustments. 2022-06-16 15:24:22 +02:00
Daniel Kirchner
9c3a0f11f9 Review suggested test adjustments. 2022-06-16 15:05:21 +02:00
Daniel Kirchner
4c84b77a4b Review suggested renaming. 2022-06-16 15:05:21 +02:00
Daniel Kirchner
c3781f7a1c Gas cost updates. 2022-06-16 15:05:21 +02:00
Daniel Kirchner
1a9e66f4b0 Tests 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
Nishant Sachdeva
b80f4baae2
Merge pull request #12928 from StrongerXi/expand-purity-check-for-foreign-constants
Propagate purity information for member access to foreign pure variables
2022-06-16 17:53:49 +05:30
Nishant Sachdeva
c7fd1190d1
Merge pull request #12166 from Midhun07/fix_invalid_options_mode_combinations
Disallowed --metadata-literal, --model-checker-show-unproved, --model-checker-div-mod-no-slacks outside of compiler mode
2022-06-16 17:53:19 +05:30
Ryan
3b2c6de61c Propagate purity information for member access to foreign pure variables 2022-06-16 17:11:55 +05:30
Midhun07
697821b96b Disallowed --metadata-literal, --model-checker-show-unproved, --model-checker-div-mod-no-slacks ----metadata-hash=swarm outside of compiler mode 2022-06-16 17:09:33 +05:30
Daniel Kirchner
f904bb0615
Merge pull request #13154 from ethereum/fixReleasePPAScript
Fix release regex and add Ubuntu Kinetic to PPA scripts
2022-06-15 23:54:38 +02:00
Daniel Kirchner
080d2f7868 Fix release ppa script. 2022-06-15 22:48:06 +02:00
Kamil Śliwak
7e0665752f
Merge pull request #13155 from ethereum/fix-naming-in-binary-collector-job
Fix naming for the release binary collector job
2022-06-15 21:17:47 +02:00
Daniel Kirchner
1fa354560b
Merge pull request #13156 from ethereum/setver0816
Set version to 0.8.16.
2022-06-15 19:17:11 +02:00
Daniel Kirchner
60004acfe9 Set version to 0.8.16. 2022-06-15 18:32:15 +02:00
Kamil Śliwak
51e0ae514c ReleaseChecklist: Use the correct name for c_release_binaries 2022-06-15 18:16:06 +02:00
Kamil Śliwak
1e8faa8e83 CI: Fix binary naming for solc-bin 2022-06-15 18:16:06 +02:00
Daniel Kirchner
e14f27147b
Merge pull request #13151 from ethereum/setreleasedatefor0815
Set release date for 0.8.15.
2022-06-15 15:56:19 +02:00
Daniel Kirchner
14d0776c94 Set release date for 0.8.15. 2022-06-15 15:08:24 +02:00
Daniel Kirchner
506e9c4536
Merge pull request #13152 from ethereum/fixWarningInDocs
Add warning comment to dangling references docs.
2022-06-15 15:07:52 +02:00
Daniel Kirchner
3f112280f8 Add warning comment to dangling references docs. 2022-06-15 14:52:37 +02:00
Daniel Kirchner
416c3dc1a4
Merge pull request #13139 from ethereum/lvalueBytesPushWarning
Warn about multiple assignments to storage byte pushes.
2022-06-15 14:39:46 +02:00
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
7f07497f2a
Merge pull request #13023 from SamuelOsewa/patch-1
Changes to error message for Unicode character in non-unicode string literal
2022-06-15 13:31:40 +02:00
Daniel Kirchner
71c838abb3
Merge pull request #13141 from ethereum/danglingReferencesDocs
Add documentation section about dangling references.
2022-06-15 13:23:09 +02:00
Daniel Kirchner
d30b04674e Add resolveUnaryTuples helper. 2022-06-15 13:15:26 +02:00
Daniel Kirchner
1cb8e17d94 Add documentation section about dangling references.
Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
2022-06-15 12:51:24 +02:00
Samuel Osewa
c21265f9f8 Changed error message for for Unicode character in non-unicode string literal
Co-authored-by: Kamil Śliwak <cameel2@gmail.com>
2022-06-15 16:12:24 +05:30
Daniel Kirchner
9542e46ea4
Merge pull request #13145 from ethereum/fixCompilationError
Fix GCC compilation errors due to Boost 1.79 update
2022-06-15 11:57:16 +02:00
Daniel Kirchner
53c4facf4e Fix compilation error. 2022-06-15 11:14:50 +02:00
Daniel Kirchner
b45bc3918f
Merge pull request #13045 from ethereum/bytesArrayToStorageBug
Bytes array to storage bug
2022-06-15 10:21:01 +02:00
Daniel Kirchner
27822dbca7 Remove entry in IR breaking changes. 2022-06-14 18:27:52 +02:00
Daniel Kirchner
187f0f070d Some review suggestions. 2022-06-14 18:27:52 +02:00
Daniel Kirchner
91ff02b988 Changelog and buglist entries. 2022-06-14 18:26:16 +02:00
Daniel Kirchner
5989f45e9e Test updates. 2022-06-14 18:26:16 +02:00
Daniel Kirchner
7a84e9c875 Bugfix. 2022-06-14 18:26:16 +02:00
Daniel Kirchner
a27b063c10 Test for buggy behaviour. 2022-06-14 18:26:16 +02:00
Kamil Śliwak
dccc06cc29
Merge pull request #13135 from ethereum/foreign-event-access-revert-and-selector-cleanup
Revert access to foreign events and clean up event/error selector tests/docs
2022-06-14 18:14:30 +02:00
Kamil Śliwak
b76c048ce9
Merge pull request #13138 from ethereum/cheatsheet-shared-operator-list
Operator precedence table shared between Cheatsheet and Operators
2022-06-14 18:07:37 +02:00
Daniel Kirchner
f2eada1ee2
Merge pull request #13140 from ethereum/fix-ext-test-zeppelin
Changed sed command in `zeppelin.sh` to match renamed test file in openzeppelin project.
2022-06-14 16:18:03 +02:00
Matheus Aguiar
d0d71714a1 Changed sed command in zeppelin.sh to match renamed test file. 2022-06-14 10:32:57 -03:00
Kamil Śliwak
1ab84bb361 Put the table with operator precedence in a separate file, included in both Operators and Cheatsheet 2022-06-14 14:41:41 +02:00
Kamil Śliwak
f323cb2ef5 Improve index entries for selectors, events and selfdestruct 2022-06-14 12:05:49 +02:00
Kamil Śliwak
7785f46efd Document the .selector member for errors 2022-06-14 12:05:49 +02:00
Kamil Śliwak
5375dfff9d Refactor error/event selector tests
- Remove redundant semantic tests for error selector
- Consolidate semanticTests/error/ and semanticTests/errors/ dirs
- Make "selector syntax test" for errors and event an actual test for syntax rather than a copy of the same semantic test
2022-06-14 12:04:19 +02:00
Kamil Śliwak
acbdcc3711 Revert the change that made events accessible in other contacts via qualified access 2022-06-14 12:04:14 +02:00
Daniel Kirchner
c8a6bd6b7e
Merge pull request #13134 from Saw-mon-and-Natalie/sw0nt-fix-typo
removed a duplicate word from a comment.
2022-06-14 11:55:12 +02:00
Saw-mon-and-Natalie
a265d9968a
removed a duplicate word from a comment. 2022-06-13 17:38:43 -07:00
Daniel Kirchner
82e5339d23
Merge pull request #13129 from ethereum/inlineAssemblyBugSeverity
Change severity of inline assembly bug to medium.
2022-06-13 18:02:45 +02:00
Daniel Kirchner
3015afc504 Change severity of inline assembly bug to medium. 2022-06-13 17:18:13 +02:00
Daniel Kirchner
efcbc79b1c
Merge pull request #13100 from ethereum/fixUnusedStoreInlineAssembly
Fix unused store inline assembly
2022-06-10 22:56:44 +02:00
Daniel Kirchner
aa7e4e02bb A few more tests. 2022-06-10 20:12:09 +02:00
Daniel Kirchner
94dd6d0671 Bug list entry draft.
Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
2022-06-10 20:05:14 +02:00
chriseth
51ef6a62da Fix removal of memory stores in inline assembly blocks. 2022-06-10 17:32:28 +02:00
chriseth
14cdb76e4b Add failing test 2022-06-10 17:32:28 +02:00
Kamil Śliwak
80f6a13d65
Merge pull request #13075 from ethereum/add-more-info-to-failed-semantic-tests
Print settings options such evmVersion and optimize in isoltest/soltest failed test logs.
2022-06-09 17:05:01 +02:00
Matheus Aguiar
f15e53ce4d Added printSelectedOptions and toString as method of CommonOptions and used the former to print settings in failed semanticTests. 2022-06-09 11:19:46 -03:00
Daniel Kirchner
01a794dd31
Merge pull request #13117 from ethereum/fixEmptyLinesInDocs
Remove all-whitespace lines from docs.
2022-06-09 15:41:47 +02:00
Mathias L. Baumann
cf1b9a5241
Merge pull request #13109 from sourabhxyz/develop
Fix commandline tests not detecting a snippet with a broken free function definition
2022-06-09 15:31:54 +02:00
Daniel Kirchner
4576333245 Remove all-whitespace lines from docs. 2022-06-09 15:00:03 +02:00
Kamil Śliwak
ef2aa59f63
Merge pull request #13115 from denis-t-dev/patch-1
Fix comment position in the voting example
2022-06-09 14:53:47 +02:00
Denis T
811fa193af
Fix comment position in the voting example 2022-06-09 15:09:02 +03:00
Kamil Śliwak
9b220a2007
Merge pull request #12575 from ethereum/gnosis-gp-v2-ext-test
External test for Gnosis Protocol v2
2022-06-08 21:42:30 +02:00
Kamil Śliwak
e777ec9013
Merge pull request #12580 from ethereum/chainlink-ext-test
External test for Chainlink
2022-06-08 21:42:05 +02:00
Kamil Śliwak
8e67b28e0f Make the checks that detect if a docs snippet should compile a bit more robust against comments 2022-06-08 21:32:30 +02:00
sourabh.xyz
8405d167c1 using-for.rst: Fix free function visibility.
Example is incorrect in the sense that "Free functions" cannot have visibility specified.
2022-06-08 21:32:30 +02:00
Kamil Śliwak
0b80a56294 External test for Gnosis Protocol v2 2022-06-08 20:23:39 +02:00
Kamil Śliwak
5c76d8ee77 External test for Chainlink 2022-06-08 20:21:58 +02:00
Daniel Kirchner
bbfef2dd6b
Merge pull request #13005 from StrongerXi/fix-typechecker-for-custom-error
Display human readable type name in conversion error message
2022-06-08 16:14:19 +02:00
Ryan
4b7ed2d47a Display human readable type name in conversion error message 2022-06-08 18:23:51 +05:30
Daniel Kirchner
f2c930588c
Merge pull request #13079 from uji/sort-grammer-rules
Sort grammar rules of SolidityLexer.g4
2022-06-08 12:55:59 +02:00
Christian Parpart
8c87f58fa5
Merge pull request #13102 from ethereum/cpp-unreachable
Better way to annotate unreachability in C++
2022-06-07 17:22:52 +02:00
Christian Parpart
4ae43884d0 Apply a better way to annotate unreachability to the C++ compiler. 2022-06-07 16:41:04 +02:00
Christian Parpart
927da20ce4 Adds solidity::util::unreachable() helper function. 2022-06-07 16:40:55 +02:00
Christian Parpart
87f5865fb0
Merge pull request #13093 from ethereum/lsp.py-fixes
lsp.py: Add missing check for non-interactive
2022-06-07 16:13:22 +02:00
Marenz
9c4ea1dc68 lsp.py: Add missing check for non-interactive 2022-06-07 15:30:14 +02:00
Kamil Śliwak
95f22db175
Merge pull request #13097 from ethereum/skipping-ext-benchmark-diff
Skipping benchmark diff when previous run failed
2022-06-07 14:46:01 +02:00
Kamil Śliwak
2cea70c04f Skip external test benchmark diff instead of failing when previous run of the job did not succeed 2022-06-07 13:24:55 +02:00
Damian Wechman
64979c1119
Merge pull request #13081 from ethereum/cse-optimization-changelog
Update changelog with information about changes to CommonSubexpressionEliminator
2022-06-07 13:18:38 +02:00
wechman
f40c9cdf1d Update changelog with information about changes to CommonSubexpressionEliminator 2022-06-07 11:53:43 +02:00
a3d4
423f3d3088 Fix ICE caused by an immutable struct 2022-06-07 10:29:45 +02:00
Kamil Śliwak
3948391ca8
Merge pull request #13092 from ethereum/disable_zepplin_tests_broken_via_ir_due_to_hardhat_heuristics
Disabling more OpenZeppelin tests that expect reverts with specific error
2022-06-06 20:32:09 +02:00
nishant-sachdeva
61306a6f9d disabling more zeppline tests that expect reverts with specific errors and they're broken via IR due to Hardhat heuristics.
Updated zeppelin.sh

Added cautionary comment for two sed commands that depend on the order of occurrence of the patterns in the files.
L122, and L123 both are referencing the 3rd occurrence of the patterns from their respective files.
This could result in an error in the future when the code is further modified.
2022-06-06 19:15:40 +05:30
Kamil Śliwak
035f6abb1b
Merge pull request #13094 from yurivict/fix-missing-include
Fix missing STL include in tools/solidityUpgrade/SourceUpgrade.cpp
2022-06-02 20:23:17 +02:00
Yuri Victorovich
54ac1e8240 Fix missing STL include in tools/solidityUpgrade/SourceUpgrade.cpp 2022-06-02 09:43:18 -07:00
Kamil Śliwak
1f8b8c98d2
Merge pull request #13087 from ethereum/gcc-12-control-reaches-end-of-function-warning-workaround
Workaround for the spurious `control reaches end of non-void function` warning in GCC 12.1
2022-06-02 14:59:01 +02:00
Kamil Śliwak
3f84837e0b
Merge pull request #13088 from ethereum/fix-new-pylint-warnings-after-upgrade
Fix new warnings from pylint 2.14 and adjust pylint config
2022-06-01 21:15:56 +02:00
Kamil Śliwak
e19e6ad806 Remove empty assertion messages in a fews places 2022-06-01 20:37:48 +02:00
Kamil Śliwak
539e139555 Add explicit throws after some assertions to work around a spurious warning in GCC 12.1 2022-06-01 20:37:48 +02:00
Kamil Śliwak
f5e421ff91 pylintrc: Remove bad-whitespace form the list of disabled warnings
- pylint complains that it's not a valid value and removing it does not make any new warnings appear
2022-06-01 20:32:25 +02:00
Kamil Śliwak
6605dd084a gas_diff_stats.py: Replace a list with a generator as suggested by pylint 2022-06-01 20:32:25 +02:00
Kamil Śliwak
f4f4cfe294 CI: Print pylint version before running checks 2022-06-01 20:32:25 +02:00
chriseth
a90bafd44d
Merge pull request #13083 from ethereum/lsp.py-fixes
lsp.py: Fix various problems with subdirectory edge cases
2022-06-01 13:16:43 +02:00
Kamil Śliwak
baf56aff40
Merge pull request #13076 from PrajwalBorkar/develop
Updated broken link for Yul optimizations
2022-05-31 16:25:14 +02:00
Marenz
6c9754a784 lsp.py: Fix various problems with subdirectory edge cases
* fix properly path parsing with nested subdirectories
* fix regex to be able to handle `file://..`
* fix not checking all expected diagnostics
* Some extra comments and renames
2022-05-31 16:17:35 +02:00
Prajwal Borkar
6061219641 Fix link to the optimizer step sequence in optimizer.rst 2022-05-31 15:41:22 +02:00
Kamil Śliwak
96398ee3ee
Merge pull request #13084 from ethereum/revert-workaround-euler-test
Revert workaround introduced in euler tests because it is no longer needed
2022-05-31 15:26:34 +02:00
Matheus Aguiar
3904a0d5ce Revert workaround introduced in euler tests because it is no longer needed.
This reverts commit 98efb46031.
2022-05-31 09:00:00 -03:00
uji
5f6f353953 Sort grammer rules of SolidityLexer.g4 2022-05-30 00:15:48 +09:00
Kamil Śliwak
095cc64728
Merge pull request #13072 from ethereum/make-soltest-print-errors-to-stderr
Added option to allow soltest in CI print errors to stderr in addition to the XML report.
2022-05-28 00:24:46 +02:00
Matheus Aguiar
90514d8893 Added option to allow soltest in CI print errors to stderr in addition to the XML report. 2022-05-27 18:32:21 -03:00
Kamil Śliwak
fdc3c8eede
Merge pull request #13048 from shadyy41/moving-operator-precedence
Move operator precedence from cheatsheet to operators
2022-05-25 23:50:57 +02:00
shady41
ecb7c0b008 Moved operator precedence from the cheatsheet to the operator docs 2022-05-25 23:07:51 +02:00
Kamil Śliwak
1543cfc904
Merge pull request #13067 from ethereum/disable-zeppelin-test-cases-failing-after-relaxing-inlining
Disable more zeppelin test cases in which Hardhat's heuristics break after relaxing inlining.
2022-05-25 23:04:05 +02:00
Matheus Aguiar
be12f90775 Disable zeppelin test cases in which Hardhat's heuristics break after relaxing inilining.
Also disabled one test because of hardhat issue 2115 (revert due to overflow misdetected).
2022-05-25 16:24:18 -03:00
Kamil Śliwak
ea2754c157
Merge pull request #13063 from ethereum/gnosis-euler-ext-test-workarounds
External test workarounds for Gnosis and Euler external test failures
2022-05-25 21:18:11 +02:00
Kamil Śliwak
c8612078c4 Remove the ethers.js 5.6.2 workaround from all ext tests except for gnosis and uniswap 2022-05-25 16:20:49 +02:00
Kamil Śliwak
6937799587 gnosis: Pin typescript dependency at <= 4.7.0 2022-05-25 15:52:21 +02:00
Kamil Śliwak
dcf23edf92
Merge pull request #13061 from DustinAlandzes/patch-1
expect -> except in docs/contributing.rst
2022-05-25 14:53:55 +02:00
Dustin Alandzes
10c991c3ff
expect -> except in docs/contributing.rst 2022-05-24 23:14:21 -05:00
chriseth
2159153162
Merge pull request #13052 from ethereum/cechan
Copy editing changelog.
2022-05-23 16:50:28 +02:00
chriseth
52ea572ec1 Copy editing changelog. 2022-05-23 15:43:03 +02:00
chriseth
a8dc762850
Merge pull request #12818 from ethereum/benchmark-downloader
Benchmark downloader (script + CI job)
2022-05-23 15:41:13 +02:00
chriseth
45030f0740
Merge pull request #12731 from ethereum/removeInliningConstraint
Remove inlining constraint for large functions when targetting the new code transform.
2022-05-23 15:18:37 +02:00
chriseth
df7bfd10d6
Merge pull request #12937 from ethereum/disable-ext-test-cases-broken-after-relaxing-inlining
Disable external test cases in which Hardhat's heuristics break after relaxing inlining constraints
2022-05-23 15:17:20 +02:00
Kamil Śliwak
45dffe598c c_ext_benchmarks: Generate and store benchmark diffs 2022-05-23 14:18:29 +02:00
Kamil Śliwak
9618cb947d download_benchmarks: Script for downloading benchmark results from CircleCI 2022-05-23 14:18:29 +02:00
chriseth
77038aa40e Update test expectations. 2022-05-23 13:37:50 +02:00
Daniel Kirchner
7168c27f0d Relax inliner heuristics. 2022-05-23 13:37:50 +02:00
Kamil Śliwak
f08d349791 Separate some inlining tests into pre- and post-homestead 2022-05-23 13:37:50 +02:00
Kamil Śliwak
49d5c0a292 Disable external test cases where Hardhat's heuristics break after relaxing inlining 2022-05-23 13:37:36 +02:00
chriseth
f0e43921f7
Merge pull request #12921 from ethereum/add_event_and_error_selector_fields_on_the_line_of_function_selector_field
Adding event and error selector fields
2022-05-23 11:34:13 +02:00
chriseth
2bbc9a1445
Merge pull request #13040 from ethereum/returndatacopyOptimizer
Do not remove potentially reverting returndatacopy cases.
2022-05-23 11:32:26 +02:00
chriseth
be85d287b4
Merge pull request #13047 from ethereum/fix-external-test-euler-failing
Workaround for euler ext test failing due to changed chainid behavior
2022-05-23 11:27:10 +02:00
Matheus Aguiar
98efb46031 Patches issue https://github.com/euler-xyz/euler-contracts/issues/119.
After issue is resolved, this should be reverted/changed.
2022-05-23 11:26:50 +02:00
chriseth
f4b16592b6
Merge pull request #13049 from josepot/nit/use-canonical-representation
nit: ABI docs use canonical representation
2022-05-23 11:25:05 +02:00
Daniel Kirchner
9fa907aac2 Do not remove potentially reverting returndatacopy cases. 2022-05-23 11:01:03 +02:00
chriseth
30335c13ff
Merge pull request #13001 from matheusaaguiar/develop
Don't add an empty data slot to ABI-encoded empty strings from storage
2022-05-23 10:56:30 +02:00
nishant-sachdeva
d4c06d2b4e Adding event and error selector fields on the lines of the function selector fields 2022-05-23 10:49:16 +02:00
Josep M Sobrepere
5575bb9d99
nit: ABI docs use canonical representation 2022-05-21 23:29:25 +02:00
Kamil Śliwak
02567fd3b4
Merge pull request #13010 from ethereum/reenable-ext-test-presets-failing-due-to-stack-too-deep
Re-enable the optimized IR preset in all external tests
2022-05-20 20:56:02 +02:00
Kamil Śliwak
2cb29dbd35
Merge pull request #13024 from SamuelOsewa/patch-2
Remove notes section from Cheatsheet
2022-05-20 16:22:52 +02:00
Kamil Śliwak
3f4d9cb035 Disable more external tests failing due to Hardhat heuristics 2022-05-20 15:59:57 +02:00
Samuel Osewa
2dee5dcfae Removed notes section 2022-05-20 15:41:35 +02:00
Kamil Śliwak
6eb09000e0
Merge pull request #12938 from ethereum/update-external-repos-script
Script for keeping main branches of external test repos in sync with upstream
2022-05-20 15:38:05 +02:00
Kamil Śliwak
54c5b3de68 Re-enable the optimized IR preset in all external tests 2022-05-20 14:50:57 +02:00
Daniel Kirchner
953bc9fed2
Merge pull request #12983 from ethereum/hint-via-ir
Recommend `via-ir` whenever a stack too deep error is encountered.
2022-05-20 12:26:25 +02:00
Daniel Kirchner
f617d27f2b
Merge pull request #13019 from ethereum/enforceViaYulNoSmtTests
Remove enforce-via-yul CI run and instead always force via yul in regular test runs.
2022-05-20 10:42:28 +02:00
Daniel Kirchner
a2f768d29a Remove empty settings. 2022-05-19 20:23:28 +02:00
Daniel Kirchner
58d21f1e9d Remove // compileViaYul: also 2022-05-19 20:23:28 +02:00
Daniel Kirchner
788dc6b4c8 Remove canEnableViaYul logic and default to compiling also via yul. 2022-05-19 20:23:28 +02:00
Daniel Kirchner
e93ad30e43 Remove obsolete enforce-via-yul logic and CI run. 2022-05-19 20:23:28 +02:00
Kamil Śliwak
0cb9590298
Merge pull request #12929 from ethereum/circleci-release-binaries-via-workspace
[CI] Automate preparation of release binaries for publishing (via workspace)
2022-05-19 18:17:53 +02:00
Nishant Sachdeva
25fa0d49b6
Merge pull request #13022 from ethereum/ice_in_abi_encodecall_when_internal_function_passed_in_arg_of_different_type
Add tests for `abi.encodeCall()` ICE on internal function passed in arg of different type
2022-05-19 19:20:00 +05:30
nishant-sachdeva
7ff4cab0b9 issue has already been fixed. Adding test cases for confirmation 2022-05-19 15:36:59 +05:30
Damian Wechman
55df07f745
Merge pull request #12831 from ethereum/cse-optimization
CSE optimization
2022-05-19 11:00:41 +02:00
Matheus Aguiar
33ea6a679d Fixed bug that added a superfluous empty slot for data when encoding an empty string coming from storage.
Added tests covering empty string, uninitialized string, emptry string literal, byte arrays and explicit call to `abi.encode`.
2022-05-18 14:50:26 -03:00
Christian Parpart
de7daaa2af
Merge pull request #12993 from ethereum/lsp-semantic-tokens-full
LSP: Implement semantic token requests
2022-05-18 15:37:21 +02:00
Marenz
0234e2aa6b lsp.py: Fix broken console reading 2022-05-18 14:54:19 +02:00
Marenz
ca3af4b2a2 LSP: Implement semantic tokens 2022-05-18 14:54:16 +02:00
chriseth
f629f9eff0
Merge pull request #13036 from ethereum/setver0815
Set version to 0.8.15.
2022-05-18 12:13:38 +02:00
chriseth
79554b9a40 Set version to 0.8.15. 2022-05-17 18:03:53 +02:00
chriseth
80d49f3702
Merge pull request #13034 from ethereum/setreleasedatefro0814
Set release date.
2022-05-17 13:55:13 +02:00
chriseth
0bd0bf4c7d Set release date. 2022-05-17 13:50:26 +02:00
chriseth
c5cc55339e
Merge pull request #12850 from ethereum/dataLocationInInheritance
Properly check data location in inheritance.
2022-05-17 13:48:55 +02:00
chriseth
f427247993 Bug list entry. 2022-05-17 13:04:06 +02:00
chriseth
259edd4c98 Changelog. 2022-05-17 13:04:05 +02:00
Kamil Śliwak
1164d1b4dd Switch ENS external test to master branch 2022-05-17 13:02:12 +02:00
Kamil Śliwak
27e5afa23d Patch external tests for the override data alignment issue until our patches are accepted upstream 2022-05-17 13:02:12 +02:00
chriseth
dfa0bcf760 More strict override check for data locations. 2022-05-17 13:02:12 +02:00
chriseth
bef348aa6a
Merge pull request #13027 from ethereum/ethersproject-contracts-update-workaround
Workaround for problems caused by forcing ethers@5.6.1 in external tests
2022-05-17 12:59:50 +02:00
chriseth
c67e8a247d
Merge pull request #13031 from ethereum/sortChangelog
Sort changelog.
2022-05-17 11:05:28 +02:00
Kamil Śliwak
adf3eaac9b gnosis: Update upstream repo URL 2022-05-17 10:57:21 +02:00
Kamil Śliwak
c57bc47060 gnosis: Disable newly added tests broken due to Hardhat heuristics 2022-05-17 10:57:21 +02:00
chriseth
f021017bc0 Sort changelog. 2022-05-17 10:38:26 +02:00
Kamil Śliwak
91177d74ee perpetual-pools: Remove the ethers@5.6.1 workaround 2022-05-16 20:52:53 +02:00
Kamil Śliwak
e9f1bd00cc gnosis: Workaround for problems caused by forcing ethers@5.6.1 in external tests 2022-05-16 20:52:30 +02:00
Daniel Kirchner
a3bd01d9fc
Merge pull request #13020 from ethereum/gnosis-ext-test-get-storage-at-hardhat-bug-workaround
Workaround for `getStorageAt()` bug in Hardhat 2.9.5 for gnosis external test
2022-05-13 19:47:40 +02:00
Kamil Śliwak
3bfb79df0c gnosis: Workaround for getStorageAt() bug in Hardhat 2.9.5 2022-05-13 19:05:21 +02:00
Daniel Kirchner
12ee9aed50
Merge pull request #13013 from ethereum/revert-disallow-returndatacopy-in-pure-functions
Revert "Disallow RETURNDATASIZE and RETURNDATACOPY in inline assembly blocks in pure functions"
2022-05-13 18:52:37 +02:00
Daniel Kirchner
67270854ee
Merge pull request #13014 from ethereum/updateZ3_4_8_17
Update Z3 deps ppa script and docker images.
2022-05-13 18:29:01 +02:00
Daniel Kirchner
af5662ffad
Merge pull request #13018 from 0xalpharush/patch-1
document that pop does not return last element
2022-05-13 17:57:35 +02:00
Daniel Kirchner
49badcd91a Update docker images for new z3 version. 2022-05-13 17:46:42 +02:00
Daniel Kirchner
edd769a6dc Update Z3 deps ppa script. 2022-05-13 17:46:42 +02:00
Daniel Kirchner
e1972da29a
Merge pull request #13016 from ethereum/z3_17
Update tests and hashes for z3 4.8.17
2022-05-13 17:46:03 +02:00
alpharush
93755fcb70
document that pop does not return last element
It's already documented for push and this would clarify my incorrect assumption (that pop returns a value as in other languages) that caused confusion with https://github.com/ethereum/solidity/issues/13017
2022-05-13 09:45:55 -05:00
Leo Alt
6a126f6ccb Update tests and hashes for z3 4.8.17 2022-05-13 15:25:10 +02:00
Matheus Aguiar
35661479b6 Revert "Disallow RETURNDATASIZE and RETURNDATACOPY in inline assembly blocks in pure functions"
This reverts commit f567eb1fb2.

Correcting Bugfixes section of Changelog.
2022-05-13 08:35:21 -03:00
Kamil Śliwak
dbcffb79a5 CI: Post a notification to gitter when binaries are ready 2022-05-12 21:41:44 +02:00
Kamil Śliwak
0153822d2e CI: Add c_release_binaries job that gathers release binaries from individual jobs 2022-05-12 21:41:44 +02:00
Daniel Kirchner
aafda389ea
Merge pull request #12907 from ethereum/calldataReencodeValidationBug
Calldatasize-check during ABI encoding from calldata values with nested dynamic arrays.
2022-05-12 17:56:44 +02:00
Leo
2aba061bde
Merge pull request #12967 from ethereum/update_z3_docker
Update docker z3 version 4.8.16
2022-05-12 15:23:03 +02:00
Leo
96bf85b35b
Merge pull request #13012 from ethereum/z3-use-rebuilt-buildpack-images
Switch to newly built buildpack-deps images with Z3 4.8.16 in CI
2022-05-12 15:16:12 +02:00
Leo
80a055103e
Merge pull request #13009 from ethereum/smt_support_z3_16
Support new z3 AST node
2022-05-12 14:28:38 +02:00
Kamil Śliwak
c0cc8ff7e7 Switch to newly built buildpack-deps images in CI 2022-05-12 14:26:07 +02:00
Leo Alt
2fe143f7d0 add changelog entry and docs note 2022-05-12 13:43:28 +02:00
Daniel Kirchner
d357d56b16 Increase CircleCI node size for soltest_all runs. 2022-05-12 13:41:56 +02:00
Daniel Kirchner
352a3c5f4b Bug list entry, changelog entry and tests. 2022-05-12 13:08:30 +02:00
Leo Alt
60b405aaa9 Support new z3 AST node 2022-05-12 10:50:30 +02:00
Leo
0c0ff4fce6
Merge pull request #13000 from ethereum/smt_fix_recursive
[SMTChecker] Fix check that solver is available
2022-05-11 21:52:52 +02:00
Leo Alt
4c00815c53 Changelog entry 2022-05-11 20:02:31 +02:00
Leo Alt
cbaba6f913 update tests 2022-05-11 20:02:31 +02:00
Leo Alt
93f9638a1b Add error id to script 2022-05-11 20:02:31 +02:00
Leo Alt
75d08ea924 Check early if solvers are available. 2022-05-11 20:02:31 +02:00
Daniel Kirchner
d3a837b340 Bugfix. 2022-05-11 18:17:47 +02:00
Daniel Kirchner
d92ed3fd29 Test case for the buggy behaviour. 2022-05-11 18:17:47 +02:00
Daniel Kirchner
1d7b4704bb
Merge pull request #13006 from ethereum/initializationOrderFix
Fix asorted compilation issues with GCC 12.
2022-05-11 17:19:45 +02:00
Daniel Kirchner
cf311e5780 Disable maybe-unitialized warning for boost headers using a pragma. 2022-05-11 16:21:53 +02:00
Daniel Kirchner
cbf9a4f1ed Add bogus return to switch. 2022-05-11 13:58:06 +02:00
Daniel Kirchner
ece547204a Reorder member variables of unique error reporter to ensure proper initialization order. 2022-05-11 13:40:02 +02:00
Kamil Śliwak
c64fb7a258 docker_upgrade.sh: Workaround for git refusing to work with a repo in attached volume 2022-05-10 18:24:21 +02:00
Leo Alt
571d94b051 Update docker z3 version 2022-05-10 18:24:21 +02:00
Leo
9f6d3deaea
Merge pull request #12999 from ethereum/disable-non-deterministic-counterexamples-in-some-smt-tests
Disable non-deterministic counterexamples in some SMT tests
2022-05-10 14:32:40 +02:00
Kamil Śliwak
0e0d1972f9 Disable non-deterministic counterexamples in some SMT tests
- The counterexamples sometimes do appear and the tests fail.
2022-05-10 12:48:01 +02:00
Christian Parpart
463e417508
Merge pull request #12960 from ethereum/lsp-make-import-error-fatal
lsp.py enhancements
2022-05-09 16:37:34 +02:00
Marenz
893122eb89 lsp.py: Support subdirectories 2022-05-09 14:54:55 +02:00
Kamil Śliwak
6d14f5059e fixup! Script for keeping main branches of external repos in sync with upstream 2022-05-09 14:50:30 +02:00
Kamil Śliwak
be7da89cf5 Script for keeping main branches of external repos in sync with upstream 2022-05-09 14:35:35 +02:00
Marenz
02dfeb5427 lsp.py: Trigger fatal error when importing outside of test dir 2022-05-09 14:22:23 +02:00
Christian Parpart
59e054bb9b
Merge pull request #12468 from ethereum/allowAllLSP
Always allow full filesystem access to LSP.
2022-05-09 14:20:59 +02:00
Christian Parpart
e8d07772d9 lsp.py: Port to support running on Windows & adapt to changes due to prior merged PR.
- lsp.py: Fixes invalid-syntax by Python interpreter on Windows CI (older Python version).
- lsp.py: Savely strip CRLF from right side of the string, ignoring accidental multiple occurrences of \r (such as \r\r\n).
- lsp.py: Fixes reading single character from stdin (wrt. Windows platform).
- lsp.py: Adds header line reading to I/O tracing (useful for debugging).
- lsp.py: When running the tests on Windows, don't care test file content's newlines but simply expect LFs (instead of CRLF for example).
- Apply pylint notes.
- Fixing use of @functools.lru_cache for older python versions (CircleCI Windows)
2022-05-09 11:37:11 +02:00
Christian Parpart
c2f245b40a Fixes to lsp.py with respect to Windows drive-letter paths in URI. 2022-05-09 11:37:11 +02:00
Christian Parpart
f308f1a1f8 Always allow full filesystem access to LSP. 2022-05-09 11:37:11 +02:00
Christian Parpart
49d27eaa5d [Circle CI] Adds LSP tests to Windows CI. 2022-05-09 11:37:11 +02:00
chriseth
44157aa69a
Merge pull request #12985 from sey/improve-wording-on-voting-example
Improve wording on voting example
2022-05-09 09:35:49 +02:00
Florian Sey
c7d57031b5 Improve wording on voting example
From a beginner perspective, it is the first time in the documentation
that the term wallets is used. Other terms such as accounts or addresses
are explained in the Introduction to smart contracts.
2022-05-06 01:01:37 +02:00
hrkrshnn
5ae17c8e65 Recommend via-ir whenever a stack too deep error is encountered. 2022-05-05 19:22:03 +02:00
Mathias L. Baumann
1dba6aafe4
Merge pull request #12981 from ethereum/update-static-z3
Update version & distributions for static z3 script
2022-05-05 16:20:56 +02:00
Marenz
1ccdb92cdb Update version & distributions for static z3 script 2022-05-05 15:27:18 +02:00
Leo
2c49ae7a9d
Merge pull request #12984 from ethereum/fix_smt
fix smt flaky test
2022-05-05 14:26:27 +02:00
Leo Alt
201c6c6819 fix smt flaky test 2022-05-05 11:38:16 +02:00
Leo
84c64edfee
Merge pull request #12974 from ethereum/smt_tests_z3_16
update smt tests z3 4.8.16
2022-05-04 21:24:15 +02:00
Leo Alt
cba3d18f66 adjust for osx nondeterminism 2022-05-04 19:04:54 +02:00
Leo Alt
4fd7de36f1 update smt tests z3 4.8.16 2022-05-03 14:23:27 +02:00
chriseth
3e3e73e380
Merge pull request #12956 from nobutoba/fix-ballot-contract
Add a require statement to the Ballot contract
2022-05-02 15:40:46 +02:00
chriseth
f0d851afe3
Merge pull request #12950 from a3d4/refix-msvc-debug-stack-crash
Refix MSVC Debug crash
2022-05-02 15:18:05 +02:00
chriseth
df29ea72f0
Merge pull request #12836 from ethereum/fixUsingGlobal
Fix using global with libraries.
2022-05-02 12:41:34 +02:00
chriseth
505fa7763f Fix checks for "using for ... global" for libraries. 2022-05-02 12:40:56 +02:00
chriseth
c3a5c83d38
Merge pull request #12971 from shekhirin/fix-parser-error
fix(parser): error for unexpected token
2022-05-02 11:26:36 +02:00
Nobuhiko Otoba
f6c0edc902 Add a require statement to the Ballot contract 2022-04-30 12:51:59 +02:00
Alexey Shekhirin
cb24e5d545
fix(parser): error for unexpected token 2022-04-29 16:13:04 +04:00
chriseth
d55b84ff63
Merge pull request #12861 from ethereum/disallow-returndatacopy-in-pure-functions
Disallow RETURNDATACOPY and RETURNDATASIZE in inline assembly in pure functions
2022-04-28 13:15:04 +02:00
chriseth
0eb1ceeca1
Merge pull request #12939 from aathan/clarify-received-ether-function-note
Clarify receive ether function note
2022-04-28 13:12:06 +02:00
a3d4
048b253a93 Refix MSVC Debug crash 2022-04-26 01:52:56 +02:00
Christian Parpart
fbecdbe76d
Merge pull request #12798 from ethereum/lsp-tests-expectations
LSP.py: Implement expectations directly in the test files
2022-04-25 15:27:57 +02:00
aathan
43ff61f185
Update functions.rst 2022-04-15 12:24:48 -07:00
Kamil Śliwak
559174054f
Merge pull request #12936 from ethereum/fix-parallel-soltest-ci-runs-overwriting-xml-test-output
Prevent parallel soltest runs from overwriting each other's XML test output
2022-04-14 15:02:42 +02:00
Kamil Śliwak
5111e7543c soltest.sh: Prevent parallel tests from overwriting each other's XML test output 2022-04-13 20:08:15 +02:00
Kamil Śliwak
25923c1f08
Merge pull request #12562 from ethereum/brink-ext-test
External test for Brink
2022-04-13 15:06:57 +02:00
Kamil Śliwak
8e085432bb External test for Brink 2022-04-13 13:43:48 +02:00
Kamil Śliwak
e30d0a6199 externalTests: Allow adding extra settings to presets 2022-04-13 13:43:48 +02:00
Marenz
afd9feead4 LSP.py: Implement simple send/respond framework 2022-04-13 13:22:05 +02:00
Daniel Kirchner
9e92c7a466
Merge pull request #12926 from ethereum/disable-macos-dependency-cache-in-ci
Disable dependency caching on macOS in CI
2022-04-11 17:38:37 +02:00
Kamil Śliwak
4ac46ebf40 Disable dependency caching on macOS in CI 2022-04-11 16:01:29 +02:00
Kamil Śliwak
6931c939e0 CI: Make osx test jobs handle dependency installation even if b_osx does not install them 2022-04-11 16:01:29 +02:00
Leo
140e59d190
Merge pull request #12429 from ethereum/smt_encode_call
[SMTChecker] abi.encodeCall
2022-04-11 14:12:04 +02:00
Kamil Śliwak
e684b36b25
Merge pull request #12908 from tharun634/move-docs
Moved `docs.sh` script to `docs/`
2022-04-11 13:51:05 +02:00
Leo Alt
f9fa76c9d3 smt encode call 2022-04-11 12:19:41 +02:00
wechman
e980a29186 Set CommonSubexpressionEliminator max chunk size to 2000 2022-04-11 08:31:04 +02:00
wechman
91638ed7b2 fixup! Limit max chunk size in CommonSubexpressionEliminator::feedItems 2022-04-11 08:31:04 +02:00
wechman
63f53a19dd Limit max chunk size in CommonSubexpressionEliminator::feedItems 2022-04-11 08:31:04 +02:00
wechman
b74a27e946 ExpressionClasses performance optimization 2022-04-11 08:31:04 +02:00
Kamil Śliwak
0b81194350
Merge pull request #12916 from sourabhxyz/develop
inheritance.rst: Fix capitalization in multiple inheritance example
2022-04-10 18:36:13 +02:00
sourabh.xyz
9867fbcfb0
Update inheritance.rst
Fixed typo 'owned' → 'Owned'.
2022-04-09 13:17:07 +05:30
Kamil Śliwak
d9c6ceca09
Merge pull request #12866 from jiq4449/develop
Renamed AssemblyStack to YulStack
2022-04-08 22:24:09 +02:00
Kamil Śliwak
4e1de370d7
Merge pull request #12909 from bytecurl/develop
Add `.DS_Store` and `Thumbs.db` to `.gitignore`
2022-04-08 21:20:51 +02:00
Kamil Śliwak
23e77e9a84 docs.sh: Fail on all errors, includding undefined variables and failures in piped commands 2022-04-08 20:41:31 +02:00
Kamil Śliwak
efd0024853 docs.sh: Make the script independent of the working directory 2022-04-08 20:41:31 +02:00
Tharun K
a608bc12f7 Moved docs.sh script to docs/ 2022-04-08 20:41:22 +02:00
Joshua Quinones
e1a59397c6 Renamed AssemblyStack to YulStack
All files, references, variables, comments, etc. were renamed to YulStack.
2022-04-08 20:28:55 +02:00
Bytecurl
c5bf750bf3 Add .DS_Store and Thumbs.db to .gitignore
Add OS specific local files that should not be included in a git repository - .DS_Store (macOS) and Thumbs.db (Windows)
2022-04-08 20:24:27 +02:00
Kamil Śliwak
f567eb1fb2 Disallow RETURNDATASIZE and RETURNDATACOPY in inline assembly blocks in pure functions 2022-04-08 14:48:35 +02:00
Kamil Śliwak
fb7c969ce8 Tests for assembly instructions allowed with mutable/view/pure functions 2022-04-08 14:47:32 +02:00
Daniel Kirchner
15c2a33eb3
Merge pull request #12910 from ethereum/updatesToGasAndDelegate
Some updates to gas and delegatecall.
2022-04-07 22:06:46 +02:00
chriseth
22d8c0aecd Some updates to gas and delegatecall. 2022-04-07 21:34:36 +02:00
Kamil Śliwak
e340cf6ca2
Merge pull request #12876 from aathan/why-is-this-inline-assembly-not-memory-safe
[Docs] clarify the reason for the memory-unsafe assembly example being unsafe
2022-04-07 18:41:41 +02:00
aathan
9e2b26e046 Clarify the reason for the memory-unsafe assembly example being unsafe 2022-04-07 18:03:02 +02:00
Kamil Śliwak
0dd7f9c871
Merge pull request #12901 from aathan/clarify-base-contract-constructors
Clarify base contract constructors (re request of PR #12872)
2022-04-07 13:33:05 +02:00
Christian Parpart
e74f03056c
Merge pull request #12283 from ethereum/soltest-graceful-error-handling
Graceful error handling in soltest/isoltest + improved soltestAssert()
2022-04-07 13:12:43 +02:00
Nishant Sachdeva
803585d2e6
Merge pull request #12751 from andreb0x/patch-2
updates to gas section
2022-04-07 13:02:06 +05:30
Daniel Kirchner
52f5ffd876
Merge pull request #12804 from ethereum/benchmark-differ
Benchmark differ
2022-04-07 09:24:01 +02:00
andreb0x
60416120af Update introduction-to-smart-contracts.rst
modifying "write" to "transactions"
2022-04-07 10:05:46 +05:30
andreb0x
39f3175a37 updates to gas section
small modifications for clarity

updates to delegatecall

Update introduction-to-smart-contracts.rst

modifying "write" to "transactions"

updates to gas section

small modifications for clarity

Update introduction-to-smart-contracts.rst

modifying "write" to "transactions"

updates to gas section

small modifications for clarity

updates to delegatecall
2022-04-07 10:05:46 +05:30
Kamil Śliwak
b3048ccf07 Use EXIT_FAILURE and EXIT_SUCCESS constants in exit() and when returning from main() 2022-04-06 22:27:08 +02:00
Kamil Śliwak
7c83559881 soltest: Handle CLI validation errors gracefully 2022-04-06 22:26:21 +02:00
Kamil Śliwak
cf6704ae06 isoltest: Do not return an error code from --help 2022-04-06 22:26:21 +02:00
Kamil Śliwak
7bace8d25d soltest: Don't assume that parse() can never return false 2022-04-06 22:26:21 +02:00
Kamil Śliwak
ed8403f456 isoltest: Handle parsing errors differently from unexpected exceptions 2022-04-06 22:26:21 +02:00
Kamil Śliwak
3c5930dd8e Put arguments in parantheses in assert macro definitions 2022-04-06 22:26:21 +02:00
Kamil Śliwak
0bb885dab2 Bring soltestAssert() up to date with solAssert()
- Allow omitting description.
- Provide a default description.
- Use a custom exception type derived from util::Exception rather than std::exception.
2022-04-06 22:26:10 +02:00
Daniel Kirchner
31b5485779
Merge pull request #12902 from a3d4/fix-msvc-debug-stack-crash
Fix MSVC Debug crash
2022-04-06 20:34:44 +02:00
Daniel Kirchner
c71d0aec83
Merge pull request #12898 from ethereum/via-ir-equivalence-tests
Create split_on_empty_lines_into_numbered_files function in scripts/common.sh
2022-04-06 13:16:24 +02:00
wechman
4d8a34370e Create split_on_empty_lines_into_numbered_files function in scripts/common.sh 2022-04-06 07:26:18 +02:00
a3d4
44093f2ed6 Fix MSVC Debug crash 2022-04-06 01:34:58 +02:00
aathan
fd0df0b05d
Update inheritance.rst 2022-04-05 12:19:59 -07:00
Kamil Śliwak
34dd30d71b
Merge pull request #12885 from StrongerXi/improve-array-size-too-large-error-message
Improve error message for static array with size too large
2022-04-05 18:09:59 +02:00
Ryan
3a17274691 Improve error message for static array with size too large 2022-04-05 17:36:37 +02:00
Kamil Śliwak
8c9856c52c benchmark_diff: Add table mode with support for json, console and markdown output 2022-04-05 15:43:18 +02:00
Kamil Śliwak
ee5e878ad7 benchmark_diff: A Python script for diffing summarized benchmarks from external tests 2022-04-05 15:40:28 +02:00
Mathias L. Baumann
0944e6853f
Merge pull request #12899 from ethereum/lsp-publishDiagnostics-trace-helper
Implements $/setTrace and uses trace logging.
2022-04-05 14:24:18 +02:00
Christian Parpart
2d07ea3d42 Implements $/setTrace and uses trace logging.
For helping the caller to know in advance how many files are expected
with a response for publishDiagnostics.
2022-04-05 13:51:42 +02:00
Damian Wechman
d0bd365d2c
Merge pull request #12179 from akali/pretty-json
Set handlers use unified jsonPrint with prettifier if needed
2022-04-05 07:05:53 +02:00
Daniel Kirchner
fd763fa6ad
Merge pull request #12851 from ethereum/via-ir-equivalence-tests
Tests for the equivalence of one and two-stage compilation via IR ports multi-file contracts
2022-04-04 20:19:27 +02:00
Aisultan Kali
96376264e8 Set handlers use unified jsonPrint with prettifier if needed 2022-04-04 20:17:11 +02:00
Kamil Śliwak
1bc1f8bdbb
Merge pull request #12835 from dtedesco1/develop
Fix MultiSigWallet.sol order of functions
2022-04-04 17:37:28 +02:00
Kamil Śliwak
c06308146a
Merge pull request #12828 from ethereum/errorForUnary
Use error message for unary operators.
2022-04-04 17:13:28 +02:00
Kamil Śliwak
256db16a61
Merge pull request #12873 from aathan/patch-17
abstract-contracts.rst: Clarify when a contract may or must be marked abstract
2022-04-04 17:11:50 +02:00
dtedesco1
2fabb3db8f attempt rebase, fix free function, fix check errors 2022-04-04 22:49:12 +08:00
Kamil Śliwak
8d51eb6ea9
Merge pull request #12887 from ethereum/fix-broken-bash-syntax-external-tests-sh
Fix broken `${}` syntax in `externalTests.sh` (redo)
2022-04-04 14:50:37 +02:00
aathan
6f4844648f abstract-contracts.rst: Clarify when a contract may or must be marked abstract 2022-04-04 14:21:49 +02:00
Kamil Śliwak
c7222044a2 externalTests.sh: Fix broken ${} syntax in the script 2022-04-04 14:16:42 +02:00
chriseth
755e043a6d Use error message for unary operators. 2022-04-04 16:53:36 +05:30
Leo
5f4c91cc6d
Merge pull request #12702 from ethereum/ninja-build-fix
cmake/EthCompilerSettings.cmake: generator expression fix for ninja.
2022-04-04 13:11:28 +02:00
wechman
1e7688e8a1 Tests for the equivalence of one and two-stage compilation via IR supports multi-file contracts 2022-04-04 11:09:43 +02:00
Leo
37a4e9e3db
Merge pull request #12868 from ethereum/ext-tests-workaround-for-ethers-5.6.2-breaking-revert-string-testing
Workarounds for ext test breakage (ethers.js downgrade, disabled polygon test in zeppelin, switch to compiler-only in elementfi)
2022-04-04 11:05:15 +02:00
Kamil Śliwak
73443c0ada elementfi: Switch all presets to compile-only 2022-04-01 23:06:21 +02:00
Kamil Śliwak
5ef0048d85 zeppelin: Disable the newly added Polygon-Child test, failing via IR due to Hardhat heuristics 2022-04-01 23:06:21 +02:00
Kamil Śliwak
b445e7e74c Revert "perpetual-pools: Use Hardhat 2.8.4 to work around @openzeppelin/hardhat-upgrades's problem with parallel compilation on Hardhat 2.9.0"
This reverts commit 30008465bf.
2022-03-28 19:51:46 +02:00
Kamil Śliwak
34c06c27a5 Downgrade ethers.js to 5.6.1 in ens, gnosis, euler, perpetual-pools and uniswap external tests 2022-03-28 17:56:30 +02:00
chriseth
c4909e99c1
Merge pull request #12750 from nishant-sachdeva/abi_encodecall_should_properly_convert_function_type_to_externally_called_function
typeCheckAbiEncodeCallFunction should type check the arguments on functionPointerType->asExternallyCallableFunction instead of the plain function type
2022-03-24 15:16:55 +01:00
nishant-sachdeva
4c6066bfad typeCheckAbiEncodeCallFunction should type check the arguments on functionPointerType->asExternallyCallableFunction instead of teh plain function type 2022-03-24 18:53:46 +05:30
chriseth
b08190c284
Merge pull request #12799 from ethereum/asm-json-export
libevmasm: refactor asm-json export & add support for source list.
2022-03-24 12:13:21 +01:00
chriseth
d39de36051
Merge pull request #12842 from aathan/patch-4
Update mapping-types.rst
2022-03-24 12:12:05 +01:00
aathan
54fa215885
Update mapping-types.rst
typo
2022-03-23 17:15:17 -07:00
Alexander Arlt
1a0988e503 libevmasm: refactor asm-json export & add support for source list. 2022-03-23 15:58:07 -05:00
chriseth
b35cda5998
Merge pull request #12838 from aathan/patch-1
Update value-types.rst
2022-03-23 18:45:05 +01:00
Mathias L. Baumann
6c06d27f00
Merge pull request #12839 from ethereum/lsp-test-fail-fast
lsp.py: Adds --fail-fast (-f) to terminate early on first failure.
2022-03-23 18:24:07 +01:00
Christian Parpart
13a4c79a9b lsp.py: Adds --fail-fast (-f) to terminate early on first failure. 2022-03-23 17:34:04 +01:00
aathan
07c9384b44
Update value-types.rst 2022-03-22 23:06:23 -07:00
Christian Parpart
43f29c00da
Merge pull request #12724 from ethereum/lsp-tests
Implement & use markers in existing test framework
2022-03-21 13:54:33 +01:00
Marenz
0bf674b442 LSP test: Minor refactoring and better exception reporting 2022-03-21 13:23:02 +01:00
chriseth
430ecb6e16
Merge pull request #12795 from ethereum/morePopRemovalInPeepholeOptimizer
More pop removal in peephole optimizer.
2022-03-17 12:22:48 +01:00
chriseth
cd19023bfb
Merge pull request #12810 from hroussille/create2-documentation-error
Fixed ambiguity in the create2 address computation doc
2022-03-17 11:46:50 +01:00
Hector Roussille
040c444a2a Fixed ambiguity in the create2 address computation doc
specify that arguments are encoded using abi.encode in the example code
2022-03-16 19:56:11 +01:00
chriseth
10b581b8e8
Merge pull request #12808 from ethereum/simplifyRematCandidates
Simplify rematerialization candidates.
2022-03-16 17:42:38 +01:00
chriseth
a054285f31 Simplify rematerialization candidates. 2022-03-16 16:43:21 +01:00
chriseth
af86a80536
Merge pull request #12796 from ethereum/refactorStackCompressor
Refactor stack compressor
2022-03-16 16:36:41 +01:00
Daniel Kirchner
4b9c01752d Test updates. 2022-03-16 15:34:38 +01:00
Daniel Kirchner
54ab09fee8 Additional peephole optimizer rules for removing side-effect free instructions before simple terminations. 2022-03-16 15:34:37 +01:00
chriseth
936b07a979
Merge pull request #12805 from ethereum/setversionto0814
Set version to 0.8.14.
2022-03-16 15:29:20 +01:00
chriseth
e786bf9b5a Set version to 0.8.14. 2022-03-16 14:38:15 +01:00
chriseth
abaa5c0eb3
Merge pull request #12801 from ethereum/cse-optimization
CSE optimization
2022-03-16 13:54:28 +01:00
wechman
8b0845fe97 CommonSubexpressionEliminator performance optimization 2022-03-16 12:57:38 +01:00
chriseth
281b68b83a
Merge pull request #12803 from ethereum/documentsatetvarinitcahnge
Move state variable initialization to top.
2022-03-16 12:43:43 +01:00
chriseth
1be21e2670 Move state variable initialization to top. 2022-03-16 12:23:23 +01:00
chriseth
6eece8114a
Merge pull request #12800 from ethereum/setreleasefor0813
Set release date.
2022-03-16 11:12:57 +01:00
chriseth
acd488532d Set release date. 2022-03-16 10:28:40 +01:00
chriseth
75abe92eb2 Refactor stack compressor. 2022-03-15 21:28:47 +01:00
chriseth
724af73fb8
Merge pull request #12759 from ethereum/evmCodeTransformAvoidPops
Avoid unnecessary pops in evm code transform.
2022-03-15 19:14:46 +01:00
Daniel Kirchner
5cd98006d4 Fill in junk in stack layouts on terminating control flow paths. 2022-03-15 18:36:55 +01:00
Daniel Kirchner
b6cd3e154c Test case for current behaviour. 2022-03-15 18:36:30 +01:00
chriseth
5afa2adec2
Merge pull request #12775 from ethereum/refactorDataFlowAnalyzer
Refactor data flow analyzer state access.
2022-03-15 15:52:40 +01:00
chriseth
d946b6b3a0
Merge pull request #12793 from ethereum/hasDefaultHelper
Add helper to see if a switch has a default case.
2022-03-15 15:20:53 +01:00
chriseth
28593839d9 Add helper to see if a switch has a default case. 2022-03-15 14:29:54 +01:00
chriseth
2858f705c1
Merge pull request #12791 from ethereum/usingForDocAtFileLevel
[DOC] Using for at file level.
2022-03-15 12:36:39 +01:00
chriseth
0bc29f2cb5 Using for at file level. 2022-03-15 12:07:28 +01:00
chriseth
c6ac1625bd
Merge pull request #12773 from ethereum/encodeCallBug
Fix encodeCall bug.
2022-03-15 10:52:13 +01:00
Daniel Kirchner
8cb01a9953 Fix and updated test. 2022-03-15 10:23:09 +01:00
Daniel Kirchner
db27051024 Test for old behaviour. 2022-03-15 10:23:09 +01:00
Daniel Kirchner
353759c1d4
Merge pull request #12680 from devtooligan/fix/underscore-prefix
fix: corrects _ prefixes
2022-03-14 22:58:42 +01:00
chriseth
afdf22f5c7 Create a state struct. 2022-03-14 19:32:33 +01:00
chriseth
eab4ca906c Refactor data flow analyzer state access. 2022-03-14 19:32:33 +01:00
chriseth
e154d43176
Merge pull request #12288 from ethereum/exportUsing
Using global
2022-03-14 18:57:26 +01:00
chriseth
9188519f11 Using for with global binding. 2022-03-14 17:39:14 +01:00
Bhargava Shastry
e19c366532
Merge pull request #12789 from ethereum/yulFuzzerCustomMutation
Permit control flow mutations in global scope of a Yul program.
2022-03-14 16:23:18 +01:00
Richie
beb51068bb
fix: corrects _ prefixes 2022-03-14 08:03:10 -07:00
chriseth
7f360e61fc
Merge pull request #12781 from ethereum/fixImportDirectiveVisits
Fix import directive visits in type checker and view pure checker.
2022-03-14 15:35:37 +01:00
chriseth
3d8fc6b126
Merge pull request #12760 from ethereum/viaIRNonExperimental
Mark viaIR code generation as non-experimental.
2022-03-14 15:30:15 +01:00
Bhargava Shastry
e0d9dec874 Permit control flow mutations in global scope of a Yul program. 2022-03-14 15:04:32 +01:00
chriseth
9ef590cc9f
Merge pull request #12696 from ethereum/unreliableAstJsonTests
Fix unreliable ASTJson tests
2022-03-14 15:02:54 +01:00
Daniel Kirchner
0f1a63c3fa Fix import directive visits in type checker and view pure checker. 2022-03-14 14:53:06 +01:00
Daniel Kirchner
0172f61340 No longer mark Yul as experimental. 2022-03-14 14:48:01 +01:00
Daniel Kirchner
e58c0b561d Mark viaIR code generation as non-experimental. 2022-03-14 14:48:00 +01:00
wechman
8a254b7a7f Use sol file to validate test variants 2022-03-14 14:21:30 +01:00
wechman
4c1224e3bf Generate ASTJSONTest variants only if a file with expected result exists 2022-03-14 14:21:30 +01:00
wechman
371a531381 Add "fail after parsing" scenario to ASTJSON tests 2022-03-14 14:21:30 +01:00
wechman
f431c6f058 Support compilation fail scenarios in ASTJSON tests 2022-03-14 14:21:06 +01:00
wechman
38639417e1 Non-fatal erros do not stop ASTJSON test execution 2022-03-14 14:21:06 +01:00
wechman
5f7ff667b9 Fix syntax errors in ASTJSON tests 2022-03-14 14:21:06 +01:00
wechman
d609409624 Add not_existing_import.json to ASTJSON tests 2022-03-14 14:21:06 +01:00
chriseth
3f6beaa0ad
Merge pull request #12121 from ethereum/extend-using-statement
Extend using statement
2022-03-14 14:10:16 +01:00
Daniel Kirchner
63e65a6818
Merge pull request #12788 from ethereum/cleanupchangelog
Clean up changelog.
2022-03-14 13:59:30 +01:00
chriseth
a059ca1dab Clean up changelog. 2022-03-14 13:06:33 +01:00
chriseth
16a69816f0
Merge pull request #12430 from ethereum/lsp-goto-definition
LSP goto definition
2022-03-14 13:03:01 +01:00
hrkrshnn
672951ccc7 Extend using-for. 2022-03-14 12:33:44 +01:00
Daniel Kirchner
db30f4d495
Merge pull request #12787 from ethereum/stackTooDeepMemorySafeSuggestion
Change memory-safe assembly annotation suggestion during stack too deep errors.
2022-03-14 12:30:29 +01:00
Christian Parpart
2b2f8acc12 LSP: Implements goto-definition. 2022-03-14 11:59:41 +01:00
Daniel Kirchner
9410e125da Change memory-safe assembly annotation suggestion during stack too deep errors. 2022-03-14 11:54:09 +01:00
Christian Parpart
1035eacb53 LSP: Introduce HandlerBase for future LSP-feature implementations. 2022-03-14 10:52:39 +01:00
chriseth
60463cfd11
Merge pull request #12716 from ethereum/set-c-locale
Don't set locale used by C++ stdlib to the value from `LC_ALL` env variable even if it's valid
2022-03-14 10:38:19 +01:00
chriseth
401a0465d7
Merge pull request #12708 from nishant-sachdeva/warn_when_rationals_implicitly_converting_to_mobile_type
Document behaviour of ternary operator of literals.
2022-03-14 10:25:30 +01:00
nishant-sachdeva
b7a9daa2f8 Generate warning when rational numbers are converted to their mobile type without explicit requests 2022-03-14 14:04:46 +05:30
Kamil Śliwak
2d834eaf67 A script and CI job for testing the compiler with different locales 2022-03-14 09:08:01 +01:00
wechman
9dc26af829 Use "C" instead user environment locale in solc 2022-03-14 09:07:48 +01:00
Daniel Kirchner
26963775fe
Merge pull request #12736 from ethereum/reenable-tests-via-ir-in-ext-tests
Re-enable running tests via IR in external tests in cases where they don't pass due to Hardhat heuristics
2022-03-11 13:44:55 +01:00
Daniel Kirchner
09f667948b
Merge pull request #12746 from tfire/fix/remove-namespace-ast-annotations
Remove use of `using namespace` in header file
2022-03-11 12:49:13 +01:00
Nishant Sachdeva
1827df8a2d
Merge pull request #12779 from nishant-sachdeva/distinguish_different_types_in_error_messages_from_abiEncodecall
Error messages from abi encodecall are giving more details about the types of the involved variables
2022-03-11 16:50:45 +05:30
Daniel Kirchner
c13e611e98
Merge pull request #12768 from ethereum/euler-timeout-fix-attempt-2
Euler timeout fix: switch to TEST_TIMEOUT variable
2022-03-11 12:04:05 +01:00
nishant-sachdeva
624d2d3968 Error messages from abi encodecall are giving more details about the types of the involved variables 2022-03-11 16:14:55 +05:30
Tyler
3357567453 Fix CommonSyntaxTest.cpp and others 2022-03-10 18:16:12 -05:00
Tyler
1c58b91075 Merge branch 'develop' of github.com:tfire/solidity into fix/remove-namespace-ast-annotations 2022-03-10 17:39:29 -05:00
Tyler
1653b6c5b7 more qualifying 2022-03-10 17:36:46 -05:00
chriseth
4263b893a3
Merge pull request #12672 from ethereum/redundantStoreEliminatorLimited
Redundant store eliminator limited
2022-03-10 19:45:40 +01:00
chriseth
4f02be110c Unused store eliminator. 2022-03-10 18:25:28 +01:00
Daniel Kirchner
921c4fd5e5
Merge pull request #12754 from ethereum/optimizerEqIszero
Some more peephole optimizer rules.
2022-03-10 15:16:27 +01:00
Kamil Śliwak
b5caa77482 euler: Use project's own TEST_TIMEOUT var for changing the timeout instead of mocha settings 2022-03-10 14:52:51 +01:00
chriseth
b3fe042884 Optimize eq iszero jumpi to xor jumpi and remove double jump. 2022-03-10 14:41:41 +01:00
Kamil Śliwak
e9f3f9361d Re-enable running tests in external tests via IR in cases where they don't pass due to Hardhat heuristics 2022-03-10 14:13:00 +01:00
Daniel Kirchner
2b201f21a1
Merge pull request #12758 from ethereum/accessToTypeDefinition
Provide generic access to type definition for user-defined types.
2022-03-10 13:16:39 +01:00
Daniel Kirchner
794752c649
Merge pull request #12765 from ethereum/euler-timeout-fix
Increase Hardhat timeout in Euler ext test
2022-03-10 13:15:59 +01:00
Daniel Kirchner
02637d56e5
Merge pull request #12766 from ethereum/removeUnneededHeader
Remove unneeded header files.
2022-03-10 13:14:26 +01:00
chriseth
6ab31420af Remove unneeded header files. 2022-03-10 09:55:05 +01:00
chriseth
356c83ad8e
Merge pull request #12763 from kanedaaaa/develop
doc: improve explanation of interfaces
2022-03-10 08:45:21 +01:00
chriseth
eff76f0f82
Merge pull request #12195 from ethereum/update-gnosis-ext-test
Run GnosisSafe external tests with Hardhat and directly on upstream
2022-03-10 08:42:11 +01:00
Tyler
047034544e Merge branch 'develop' of github.com:tfire/solidity into fix/remove-namespace-ast-annotations 2022-03-09 18:55:22 -05:00
Kamil Śliwak
9ef600e572 euler: Override Hardhat test timeout 2022-03-09 20:37:08 +01:00
Kamil Śliwak
438c082488 CI: Remove the compile-only run for Gnosis 2022-03-09 19:57:16 +01:00
Kamil Śliwak
304c3984ad Update gnosis external test to use upstream directly and use Hardhat 2022-03-09 19:57:16 +01:00
Kamil Śliwak
bebdcccacd
Merge pull request #12764 from ethereum/elementfi-disable-flaky-mockerc20yearnvault-tests
Disable flaky ElementFi tests in `mockERC20YearnVaultTest`
2022-03-09 19:55:05 +01:00
Kamil Śliwak
68bdb7f2e0 Disable flaky ElementFi tests 2022-03-09 18:58:02 +01:00
kanedaaaa
1b93db7863 doc: improve explanation of interfaces 2022-03-09 18:35:14 +01:00
Daniel Kirchner
efc00bef55
Merge pull request #12748 from ethereum/markCreationAssembly
Store whether an evmasm Assembly is creation code.
2022-03-09 18:30:31 +01:00
Daniel Kirchner
e7a3814977 Unit test. 2022-03-09 17:53:28 +01:00
Daniel Kirchner
e0c837b33b Remove isCreation flag from OptimiserSettings. 2022-03-09 17:53:28 +01:00
Daniel Kirchner
b57e856426 Adjust documentation. 2022-03-09 17:53:28 +01:00
Daniel Kirchner
0a9d752b8b Add test case and adjust tests. 2022-03-09 17:53:28 +01:00
Daniel Kirchner
ce0a3e93f2 Store whether an evmasm Assembly is creation code. 2022-03-09 17:42:29 +01:00
chriseth
a5a65eec9e
Merge pull request #12761 from ethereum/simplifyPeepholeOptimizerTemplate
Simplify peephole optimizer template.
2022-03-09 16:41:43 +01:00
chriseth
859869c4dd Simplify peephole optimizer template. 2022-03-09 16:03:57 +01:00
Christian Parpart
c6fcb6c395
Merge pull request #12749 from ethereum/cmake-refactor-libsolc
[CMake] Refactor libsolc linker flag for EXPORTED_FUNCTIONS and make it more readable.
2022-03-09 13:33:48 +01:00
Christian Parpart
b3daef7665 [CMake] Refactor libsolc linker flag for EXPORTED_FUNCTIONS and make it more readable. 2022-03-09 13:03:23 +01:00
chriseth
7bd6cba79c Provide generic access to type definition for user-defined types. 2022-03-09 10:41:57 +01:00
Tyler
519e1c9402 Specify namespaces
Fix references into solidity::util
2022-03-08 00:09:17 -05:00
chriseth
145186f68c
Merge pull request #12723 from ethereum/docs-translation-updates
[DOCS] Updated translation links / rewording of language influences
2022-03-07 18:09:29 +01:00
chriseth
77c40cd2af
Merge pull request #12740 from ethereum/remove-locale-dependent-operations
Replace all locale-dependent operations with locale-agnostic counterparts
2022-03-07 17:56:58 +01:00
wechman
52dfccca98 Replace all locale-dependent operations with locale-agnostic counterparts 2022-03-07 17:23:08 +01:00
franzihei
4d9a078798 updates index with language links 2022-03-07 13:05:00 +01:00
chriseth
57e012da98
Merge pull request #12663 from ethereum/assemblyAnnotationDialectString
Assembly annotation as memory-safe using assembly flags.
2022-03-07 13:03:08 +01:00
chriseth
79eba921b8
Merge pull request #12659 from paarthmadan/pm/base-64-test-cases
Add Base64 test cases with and without inline assembly
2022-03-07 12:57:49 +01:00
chriseth
4f19d68ee9
Merge pull request #12620 from ethereum/assemblyAnnotation
Memory-safety annotation for inline assembly.
2022-03-07 12:48:41 +01:00
chriseth
81f1de241b
Merge pull request #12747 from ethereum/removeUnusedAssemblyEntryPoint
Remove unused entry point to evmasm Assembly.
2022-03-07 12:44:44 +01:00
Daniel Kirchner
06820e1b1e Remove unused entry point to evmasm Assembly. 2022-03-07 12:14:08 +01:00
Leo
7c91dd05a7
Merge pull request #12741 from david-k/develop
[Doc] Fix leftover use of divModWithSlacks
2022-03-07 10:12:47 +01:00
Tyler
a890c82f9d Remove use of using namespace in header file 2022-03-06 23:16:10 -05:00
Paarth Madan
17fa85a2fb Add Base64 test cases with and without inline assembly
Adds two implementations of Base64 encoding as specified in RFC4648.
Implementation (1) uses inline assembly, while Implementation (2) is
written purely in Solidity.

Assertions are added to replicate the test vectors specified in the RFC
for Base64 to ensure both implementations to specification.
2022-03-05 19:51:46 -05:00
Daniel Kirchner
198b705361
Merge pull request #12721 from ethereum/fixIterableMapping
Fix iterable mapping example.
2022-03-04 15:27:56 +01:00
Daniel Kirchner
c9373061aa
Merge pull request #12742 from msooseth/style_fix
Fixing style issue in ExecutionFramework.cpp
2022-03-04 15:23:25 +01:00
Mate Soos
66a779d267 Fixing style issue in ExecutionFramework.cpp
It should be `auto const&` not `const auto&`
2022-03-04 12:20:57 +01:00
david-k
cb4ffbfbb7
Fix leftover use of divModWithSlacks in doc
The option `divModWithSlacks` was previously changed to `divModNoSlacks`.
However, this was not reflected in the documentation.
2022-03-04 11:02:54 +01:00
Kamil Śliwak
999a53c984
Merge pull request #12684 from nishant-sachdeva/external_contract_wasting_gas_by_return_value
Never allocate more memory than the type size for static returns in external calls
2022-03-03 15:58:22 +01:00
nishant-sachdeva
beabc51c20 returnSize assigned according to truth value of returnInfo.dynamicReturnSize 2022-03-03 18:55:10 +05:30
Alexander Arlt
ebefb5d980
Merge pull request #12727 from ethereum/update-ci-cmake-jq-buildpacks
Update CI to use new buildpacks.
2022-03-02 15:55:17 -05:00
Alexander Arlt
de916dcc0b
Merge pull request #12726 from ethereum/update-buildpacks-cmake-jq
Update buildpacks to include `jq`.
2022-03-02 15:54:37 -05:00
Alexander Arlt
ab0ab4491d Update CI to use new buildpacks. 2022-03-02 11:43:57 -05:00
Daniel Kirchner
b3764ad4ef
Merge pull request #12733 from ethereum/perpetual-pools-fix-race-condition-due-to-hardhat-parallel-compilation
Workaround for a race condition in Perpetual Pools ext test due to parallel compilation on Hardhat 2.9.0
2022-03-02 17:22:26 +01:00
Daniel Kirchner
46d8611e90 Adjust grammar. 2022-03-02 17:07:11 +01:00
Daniel Kirchner
0381de54c2 Update docs. 2022-03-02 17:07:11 +01:00
Daniel Kirchner
93dd8ad553 Tests. 2022-03-02 17:07:11 +01:00
Daniel Kirchner
290b1c3a90 Allow memory-safe inline assembly dialect flag. 2022-03-02 17:07:11 +01:00
Kamil Śliwak
30008465bf perpetual-pools: Use Hardhat 2.8.4 to work around @openzeppelin/hardhat-upgrades's problem with parallel compilation on Hardhat 2.9.0 2022-03-02 16:47:55 +01:00
Daniel Kirchner
6b6e163be5 Tests. 2022-03-02 16:42:28 +01:00
Daniel Kirchner
ad13062978 Patch external tests with a safe inline assembly annotation. 2022-03-02 16:42:28 +01:00
Daniel Kirchner
62a997ac97 Documentation. 2022-03-02 16:42:28 +01:00
Daniel Kirchner
dfb7bf2853 Report memoryguard in stack too deep error. 2022-03-02 16:42:28 +01:00
Daniel Kirchner
9bcfcc61a7 Inline assembly without memory effects is implicitly memory safe. 2022-03-02 16:42:28 +01:00
Daniel Kirchner
e6848caac1 Allow annotating inline assembly as memory-safe. 2022-03-02 16:42:28 +01:00
chriseth
d118f21417
Merge pull request #12729 from ethereum/splitOutDisassemble
Split out disassemble to remove numeric from instruction includes.
2022-03-02 16:18:17 +01:00
chriseth
b0dcd7b915 Split out disassemble to remove numeric from instruction includes. 2022-03-02 15:30:41 +01:00
Alexander Arlt
149a730f4a Update buildpacks to include jq. 2022-03-02 09:23:49 -05:00
Daniel Kirchner
e8520a667b
Merge pull request #12730 from ethereum/saveRestoreNestingDepth
Also save and restore the nesting depth.
2022-03-02 14:21:56 +01:00
chriseth
63f0a22c5d Also save and restore the nesting depth. 2022-03-02 13:49:40 +01:00
chriseth
2bcb027533
Merge pull request #12693 from ethereum/extendSideEffects
Extend side effects
2022-03-01 23:48:06 +01:00
chriseth
d0d4bca35b Extend side effects to operations. 2022-03-01 16:06:20 +01:00
chriseth
5369bdc8fb
Merge pull request #12722 from ethereum/smt_fix_nondet
Ignore cex in SMT test
2022-03-01 12:26:48 +01:00
chriseth
466251b5a0
Merge pull request #12689 from callezenwaka/develop
Fix typos on doc
2022-02-28 19:04:03 +01:00
Callis Ezenwaka
5134dafb8e Update typo in using-for.rst
Update typo in using-for.rst
2022-02-28 19:03:13 +01:00
Leo Alt
bef69b595b Ignore cex in SMT test 2022-02-28 18:56:20 +01:00
chriseth
fb7cdda891 Fix iterable mapping example. 2022-02-28 17:57:19 +01:00
chriseth
6df5342d88
Merge pull request #12697 from ethereum/revive-wasm-rebuild
Revive wasm rebuild scripts
2022-02-28 13:29:37 +01:00
chriseth
19f0f85984
Merge pull request #12714 from ethereum/remove-outdated-release-scripts
Remove outdated release scripts
2022-02-28 13:10:28 +01:00
chriseth
ebd584fcfb
Merge pull request #12206 from ethereum/extractExternalFunctionPart
Extract external function part
2022-02-28 13:04:14 +01:00
Kamil Śliwak
e0cc2d4ce2
Merge pull request #12715 from ethereum/release-checklist-restore-source-tarball-instructions
Put source tarball creation instructions back on the release checklist
2022-02-28 13:02:57 +01:00
Kamil Śliwak
8962d53e3c
Merge pull request #12701 from a3d4/fix-running-tests-from-any-drive
Fix running path-related tests from any Windows drive
2022-02-28 12:58:45 +01:00
chriseth
5a94a7c9be
Merge pull request #12698 from Abdulkarim4u/develop
fixed grammar on doc.
2022-02-28 12:40:01 +01:00
chriseth
ca4c983973
Merge pull request #12695 from ethereum/less-confusing-err
Make error message less confusing
2022-02-28 12:36:47 +01:00
Kamil Śliwak
1762482a56 Add instructions for creating the source tarball back to the release checklist 2022-02-28 12:22:25 +01:00
Kamil Śliwak
1f9fab84a6 Remove release.sh/.bat scripts we no longer use 2022-02-24 17:54:17 +01:00
Kamil Śliwak
1aacb67a10
Merge pull request #12703 from ethereum/diff-color-fix
scripts/common.sh: 'diff --color' not supported by macOS.
2022-02-24 17:47:19 +01:00
Alexander Arlt
b741ca3ab5 scripts/common.sh: 'diff --color' not supported by macOS. 2022-02-23 19:23:35 -05:00
Kamil Śliwak
e7d93f8376
Merge pull request #12678 from devtooligan/fix/remove-snake
Fix: remove lower_case_with_underscores and Capitalized_Words_With_Underscores
2022-02-23 10:38:57 +01:00
Kamil Śliwak
47d7793174
Merge pull request #12692 from ethereum/addcodeowners
Add codeowners file.
2022-02-22 21:01:03 +01:00
a3d4
50ae21d1bf Fix running tests from any drive 2022-02-22 18:11:42 +01:00
Alexander Arlt
f7b29d55da cmake/EthCompilerSettings.cmake: generator expression fix for ninja. 2022-02-22 08:26:37 -05:00
chriseth
c5070d8633
Update .github/CODEOWNERS
Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
2022-02-22 10:22:11 +01:00
Richie
49f06dacdf fix: remove lower_case_with_underscores and Capitalized_Words_With_Underscores from code examples 2022-02-21 10:53:35 -08:00
chriseth
5db2907636
Merge pull request #12653 from nishant-sachdeva/selector_for_custom_errors
Added errorSelector field for custom errors
2022-02-21 17:42:36 +01:00
nishant-sachdeva
195f72e844 Added errorSelector field for custom errors 2022-02-21 19:14:33 +05:30
chriseth
e9592c3f8e Update tests. 2022-02-21 14:32:52 +01:00
chriseth
106921c278 Extract external function part into its own function. 2022-02-21 14:32:52 +01:00
Abdul Karim Moro
2834003848
fixed grammar on doc.
If readers can gain additional pieces of  information on smart contracts, then  "more details" should be correct.
2022-02-19 08:31:26 +09:00
Kamil Śliwak
1f5407521a wasm-rebuild: Print tags that will be processed 2022-02-18 21:49:25 +01:00
Kamil Śliwak
42ac3b29b4 wasm-rebuild: Update solc-bin URL 2022-02-18 21:49:25 +01:00
Kamil Śliwak
dda05655b0 wasm-rebuild: Patch storebytecode.sh from 0.6.1 not to use latest solc-js 2022-02-18 21:49:10 +01:00
Kamil Śliwak
c38cc8b736 wasm-rebuild: Revert solc-js changes - not needed because the script uses an old branch of solc-js 2022-02-18 21:49:10 +01:00
Kamil Śliwak
076bc516c8 wasm-rebuild: Upgrade packages to get newer SSL certificates required to be able to download boost over HTTPS 2022-02-18 21:49:10 +01:00
Kamil Śliwak
8d0f10c2fb wasm-rebuild: Incorrect comment about script location 2022-02-18 21:48:37 +01:00
Kamil Śliwak
0d28b8395a storebytecode.sh: Update outdated script docstring. 2022-02-18 21:48:32 +01:00
Marenz
175580fe90 Make error message less confusing 2022-02-17 16:52:36 +01:00
chriseth
daad9a42c1
Merge pull request #12690 from ethereum/ppabuildscript
Update PPA build script.
2022-02-17 16:20:22 +01:00
chriseth
a674406299
Merge pull request #12694 from wesbz/yul-doc-table-fix
Fixing a typo in doc's EVM dialect in Yul's doc.
2022-02-17 11:53:22 +01:00
Wes Bouaziz
e9cc45b258
Fixing a typo in doc's EVM dialect in Yul's doc.
It's the tiniest typo but it's visible on the website.
2022-02-17 10:57:28 +01:00
chriseth
bf31344484 Add codeowners file. 2022-02-17 09:59:52 +01:00
chriseth
4ee7684afc Update PPA build script. 2022-02-17 09:39:54 +01:00
Richie
635ca409f8 fix: shorten line length per code review 2022-02-16 12:06:33 -08:00
chriseth
da50176b1f
Merge pull request #12686 from ethereum/setVersionTo0813
Set version to 0.8.13
2022-02-16 16:44:23 +01:00
chriseth
eb57e23ba0
Merge pull request #12685 from ethereum/bypass-prebuilt-artifacts-in-yield-ext-test
Neutralize packaged Uniswap contracts in yield-liquidator external test
2022-02-16 16:42:41 +01:00
chriseth
6a479fece1
Merge pull request #12683 from ethereum/ext_foundry
Added solidity visual auditor for VSCode
2022-02-16 16:39:38 +01:00
chriseth
65ba798caf Set version to 0.8.13 2022-02-16 16:12:18 +01:00
Kamil Śliwak
8aa3b7fea0 Neutralize packaged Uniswap contracts in yield-liquidator external test 2022-02-16 13:16:44 +01:00
Sleepy
59f28d385a Added solidity visual auditor for VSCode 2022-02-16 11:05:41 +01:00
Richie
e2d87c1bcc tweak: expand definition of suggested collision naming convention 2022-02-15 19:35:11 -08:00
5513 changed files with 100528 additions and 46275 deletions

View File

@ -7,15 +7,15 @@ The docker images are build locally on the developer machine:
```sh
cd .circleci/docker/
docker build -t ethereum/solidity-buildpack-deps:ubuntu2004-<revision> -f Dockerfile.ubuntu2004 .
docker push ethereum/solidity-buildpack-deps:ubuntu2004-<revision>
docker build -t ethereum/solidity-buildpack-deps:ubuntu2204-<revision> -f Dockerfile.ubuntu2204 .
docker push ethereum/solidity-buildpack-deps:ubuntu2204-<revision>
```
The current revisions per docker image are stored in [circle ci pipeline parameters](https://github.com/CircleCI-Public/api-preview-docs/blob/master/docs/pipeline-parameters.md#pipeline-parameters) called `<image-desc>-docker-image-rev` (e.g., `ubuntu-2004-docker-image-rev`). Please update the value assigned to the parameter(s) corresponding to the docker image(s) being updated at the time of the update. Please verify that the value assigned to the parameter matches the revision part of the docker image tag (`<revision>` in the docker build/push snippet shown above). Otherwise, the docker image used by circle ci and the one actually pushed to docker hub will differ.
The current revisions per docker image are stored in [circle ci pipeline parameters](https://github.com/CircleCI-Public/api-preview-docs/blob/master/docs/pipeline-parameters.md#pipeline-parameters) called `<image-desc>-docker-image-rev` (e.g., `ubuntu-2204-docker-image-rev`). Please update the value assigned to the parameter(s) corresponding to the docker image(s) being updated at the time of the update. Please verify that the value assigned to the parameter matches the revision part of the docker image tag (`<revision>` in the docker build/push snippet shown above). Otherwise, the docker image used by circle ci and the one actually pushed to docker hub will differ.
Once the docker image has been built and pushed to Dockerhub, you can find it at:
https://hub.docker.com/r/ethereum/solidity-buildpack-deps:ubuntu2004-<revision>
https://hub.docker.com/r/ethereum/solidity-buildpack-deps:ubuntu2204-<revision>
where the image tag reflects the target OS and revision to build Solidity and run its tests on.
@ -24,7 +24,7 @@ where the image tag reflects the target OS and revision to build Solidity and ru
```sh
cd solidity
# Mounts your local solidity directory in docker container for testing
docker run -v `pwd`:/src/solidity -ti ethereum/solidity-buildpack-deps:ubuntu2004-<revision> /bin/bash
docker run -v `pwd`:/src/solidity -ti ethereum/solidity-buildpack-deps:ubuntu2204-<revision> /bin/bash
cd /src/solidity
<commands_to_test_build_with_new_docker_image>
```

1
.circleci/cln-asan.supp Normal file
View File

@ -0,0 +1 @@
leak:*libcln*

View File

@ -0,0 +1,59 @@
#!/usr/bin/env bash
set -euo pipefail
#------------------------------------------------------------------------------
# Compares bytecode reports generated by prepare_report.py/.js.
#
# ------------------------------------------------------------------------------
# This file is part of solidity.
#
# solidity is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# solidity is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with solidity. If not, see <http://www.gnu.org/licenses/>
#
# (c) 2023 solidity contributors.
#------------------------------------------------------------------------------
no_cli_platforms=(
emscripten
)
native_platforms=(
ubuntu2004-static
ubuntu
osx
windows
)
interfaces=(
cli
standard-json
)
for preset in "$@"; do
report_files=()
for platform in "${no_cli_platforms[@]}"; do
report_files+=("bytecode-report-${platform}-${preset}.txt")
done
for platform in "${native_platforms[@]}"; do
for interface in "${interfaces[@]}"; do
report_files+=("bytecode-report-${platform}-${interface}-${preset}.txt")
done
done
echo "Reports to compare:"
printf -- "- %s\n" "${report_files[@]}"
if ! diff --brief --report-identical-files --from-file "${report_files[@]}"; then
diff --unified=0 --report-identical-files --from-file "${report_files[@]}" | head --lines 50
zip "bytecode-reports-${preset}.zip" "${report_files[@]}"
exit 1
fi
done

File diff suppressed because it is too large Load Diff

View File

@ -52,7 +52,8 @@ function validate_checksum {
if [ ! -f /usr/local/lib/libz3.a ] # if this file does not exists (cache was not restored), rebuild dependencies
then
brew unlink python
brew update
brew upgrade
brew install boost
brew install cmake
brew install wget
@ -61,11 +62,11 @@ then
./scripts/install_obsolete_jsoncpp_1_7_4.sh
# z3
z3_version="4.8.14"
z3_version="4.12.1"
z3_dir="z3-${z3_version}-x64-osx-10.16"
z3_package="${z3_dir}.zip"
wget "https://github.com/Z3Prover/z3/releases/download/z3-${z3_version}/${z3_package}"
validate_checksum "$z3_package" 1341671670e0c4e72da80815128a68975ee90816d50ceaf6bd820f06babe2cfd
validate_checksum "$z3_package" 7601f844de6d906235140d0f76cca58be7ac716f3e2c29c35845aa24b24f73b9
unzip "$z3_package"
rm "$z3_package"
cp "${z3_dir}/bin/libz3.a" /usr/local/lib
@ -74,18 +75,11 @@ then
rm -r "$z3_dir"
# evmone
evmone_version="0.8.0"
evmone_version="0.10.0"
evmone_package="evmone-${evmone_version}-darwin-x86_64.tar.gz"
wget "https://github.com/ethereum/evmone/releases/download/v${evmone_version}/${evmone_package}"
validate_checksum "$evmone_package" e8efef478822f0ed6d0493e89004181e895893f93963152a2a81589acc3a0828
validate_checksum "$evmone_package" 1b7773779287d7908baca6b8d556a98800cbd7d6e5c910b55fa507642bc0a15c
tar xzpf "$evmone_package" -C /usr/local
rm "$evmone_package"
# hera
hera_version="0.5.0"
hera_package="hera-${hera_version}-darwin-x86_64.tar.gz"
wget "https://github.com/ewasm/hera/releases/download/v${hera_version}/${hera_package}"
validate_checksum "$hera_package" 190050d7ace384ecd79ec1b1f607a9ff40e196b4eec75932958d4814d221d059
tar xzpf "$hera_package" -C /usr/local
rm "$hera_package"
fi

View File

@ -0,0 +1,79 @@
#!/usr/bin/env bash
set -euo pipefail
#------------------------------------------------------------------------------
# Splits all test source code into multiple files, generates bytecode and metadata
# for each file and combines it into a single report.txt file.
#
# The script is meant to be executed in CI on all supported platforms. All generated
# reports must be identical for a given compiler version.
#
# ------------------------------------------------------------------------------
# This file is part of solidity.
#
# solidity is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# solidity is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with solidity. If not, see <http://www.gnu.org/licenses/>
#
# (c) 2023 solidity contributors.
#------------------------------------------------------------------------------
(( $# == 4 )) || { >&2 echo "Wrong number of arguments."; exit 1; }
label="$1"
binary_type="$2"
binary_path="$3" # This path must be absolute
preset="$4"
[[ $binary_type == native || $binary_type == solcjs ]] || { >&2 echo "Invalid binary type: ${binary_type}"; exit 1; }
# NOTE: Locale affects the order of the globbed files.
export LC_ALL=C
mkdir test-cases/
cd test-cases/
echo "Preparing input files"
python3 ../scripts/isolate_tests.py ../test/
# FIXME: These cases crash because of https://github.com/ethereum/solidity/issues/13583
rm ./*_bytecode_too_large_*.sol ./*_combined_too_large_*.sol
if [[ $binary_type == native ]]; then
interface=$(echo -e "standard-json\ncli" | circleci tests split)
echo "Selected interface: ${interface}"
echo "Generating bytecode reports"
python3 ../scripts/bytecodecompare/prepare_report.py \
"$binary_path" \
--interface "$interface" \
--preset "$preset" \
--report-file "../bytecode-report-${label}-${interface}-${preset}.txt"
else
echo "Installing solc-js"
git clone --depth 1 https://github.com/ethereum/solc-js.git solc-js
cp "$binary_path" solc-js/soljson.js
cd solc-js/
npm install
npm run build
cd ..
npm install ./solc-js/dist
cp ../scripts/bytecodecompare/prepare_report.js .
echo "Generating bytecode reports"
# shellcheck disable=SC2035
./prepare_report.js \
--preset "$preset" \
*.sol > "../bytecode-report-${label}-${preset}.txt"
fi

45
.circleci/parallel_cli_tests.py Executable file
View File

@ -0,0 +1,45 @@
#!/usr/bin/env python3
import subprocess
import sys
# Slowest CLI tests, whose execution takes time on the order of minutes (as of June 2023).
# When adding/removing items here, remember to update `parallelism` value in jobs that run this script.
# TODO: We should switch to time-based splitting but that requires JUnit XML report support in cmdlineTests.sh.
tests_to_run_in_parallel = [
'~ast_import_export', # ~7 min
'~ast_export_with_stop_after_parsing', # ~4 min
'~soljson_via_fuzzer', # ~3 min
'~via_ir_equivalence', # ~1 min
'~compilation_tests', # ~1 min
'~documentation_examples', # ~1 min
'*', # This item represents all the remaining tests
]
# Ask CircleCI to select a subset of tests for this parallel execution.
# If `parallelism` in CI config is set correctly, we should get just one but we can handle any split.
selected_tests = subprocess.check_output(
['circleci', 'tests', 'split'],
input='\n'.join(tests_to_run_in_parallel),
encoding='ascii',
).strip().split('\n')
selected_tests = set(selected_tests) - {''}
excluded_tests = set(tests_to_run_in_parallel) - selected_tests
assert selected_tests.issubset(set(tests_to_run_in_parallel))
if len(selected_tests) == 0:
print("No tests to run.")
sys.exit(0)
if '*' in selected_tests:
filters = [arg for test_name in excluded_tests for arg in ['--exclude', test_name]]
else:
filters = list(selected_tests)
subprocess.run(
['test/cmdlineTests.sh'] + filters,
stdin=sys.stdin,
stdout=sys.stdout,
stderr=sys.stderr,
check=True,
)

View File

@ -6,7 +6,7 @@ cd "$PSScriptRoot\.."
if ( -not $? ) { throw "Cannot execute solc --version." }
mkdir test_results
.\build\test\Release\soltest.exe --color_output=no --show_progress=yes --logger=JUNIT,error,test_results/result.xml -- --no-smt
.\build\test\Release\soltest.exe --color_output=no --show_progress=yes --logger=JUNIT,error,test_results/result.xml --logger=HRF,error,stdout -- --no-smt
if ( -not $? ) { throw "Unoptimized soltest run failed." }
.\build\test\Release\soltest.exe --color_output=no --show_progress=yes --logger=JUNIT,error,test_results/result_opt.xml -- --optimize --no-smt
if ( -not $? ) { throw "Optimized soltest run failed." }
.\build\test\Release\soltest.exe --color_output=no --show_progress=yes --logger=JUNIT,error,test_results/result_opt.xml --logger=HRF,error,stdout -- --optimize --no-smt
if ( -not $? ) { throw "Optimized soltest run failed." }

View File

@ -36,6 +36,7 @@ set -e
OPTIMIZE=${OPTIMIZE:-"0"}
EVM=${EVM:-"invalid"}
CPUs=${CPUs:-3}
REPODIR="$(realpath "$(dirname "$0")/..")"
IFS=" " read -r -a BOOST_TEST_ARGS <<< "$BOOST_TEST_ARGS"
@ -67,14 +68,14 @@ get_logfile_basename() {
# long-running test cases are next to each other.
CIRCLE_NODE_INDEX=$(((CIRCLE_NODE_INDEX + 23 * INDEX_SHIFT) % CIRCLE_NODE_TOTAL))
CPUs=3
PIDs=()
for run in $(seq 0 $((CPUs - 1)))
do
BOOST_TEST_ARGS_RUN=(
"--color_output=no"
"--show_progress=yes"
"--logger=JUNIT,error,test_results/$(get_logfile_basename "$run").xml"
"--logger=JUNIT,error,test_results/$(get_logfile_basename "$((CPUs * CIRCLE_NODE_INDEX + run))").xml"
"--logger=HRF,error,stdout"
"${BOOST_TEST_ARGS[@]}"
)
SOLTEST_ARGS=("--evm-version=$EVM" "${SOLTEST_FLAGS[@]}")
@ -91,7 +92,7 @@ do
done
# wait for individual processes to get their exit status
for pid in ${PIDs[*]}
for pid in "${PIDs[@]}"
do
wait "$pid"
done

View File

@ -31,8 +31,8 @@ REPODIR="$(realpath "$(dirname "$0")"/..)"
# shellcheck source=scripts/common.sh
source "${REPODIR}/scripts/common.sh"
EVM_VALUES=(homestead byzantium constantinople petersburg istanbul berlin london)
DEFAULT_EVM=london
EVM_VALUES=(homestead byzantium constantinople petersburg istanbul berlin london paris shanghai)
DEFAULT_EVM=shanghai
[[ " ${EVM_VALUES[*]} " =~ $DEFAULT_EVM ]]
OPTIMIZE_VALUES=(0 1)
@ -50,9 +50,6 @@ for OPTIMIZE in "${OPTIMIZE_VALUES[@]}"
do
for EVM in "${EVM_VALUES[@]}"
do
# run tests against hera ewasm evmc vm, only if OPTIMIZE == 0 and evm version is byzantium
EWASM_ARGS=""
[ "${EVM}" = "byzantium" ] && [ "${OPTIMIZE}" = "0" ] && EWASM_ARGS="--ewasm"
ENFORCE_GAS_ARGS=""
[ "${EVM}" = "${DEFAULT_EVM}" ] && ENFORCE_GAS_ARGS="--enforce-gas-cost"
# Run SMTChecker tests only when OPTIMIZE == 0
@ -61,11 +58,11 @@ do
EVM="$EVM" \
OPTIMIZE="$OPTIMIZE" \
SOLTEST_FLAGS="$SOLTEST_FLAGS $ENFORCE_GAS_ARGS $EWASM_ARGS" \
SOLTEST_FLAGS="$SOLTEST_FLAGS $ENFORCE_GAS_ARGS" \
BOOST_TEST_ARGS="-t !@nooptions $DISABLE_SMTCHECKER" \
INDEX_SHIFT="$INDEX_SHIFT" \
"${REPODIR}/.circleci/soltest.sh"
INDEX_SHIFT=$((INDEX_SHIFT + 1))
done
done
done

View File

@ -12,7 +12,7 @@ Language: Cpp
BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignAfterOpenBracket: AlwaysBreak
AlignEscapedNewlinesLeft: true
AlignEscapedNewlines: Left
AlwaysBreakAfterReturnType: None
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: false

1
.github/CODEOWNERS vendored Normal file
View File

@ -0,0 +1 @@
/docs/style-guide.rst @fulldecent

View File

@ -1,5 +1,10 @@
---
name: Bug Report
about: Problems, deficiencies, inaccuracies or crashes discovered on Solidity.
title: ''
labels: 'bug :bug:'
assignees: ''
---
<!--## Prerequisites
@ -31,7 +36,7 @@ name: Bug Report
<!--
Please provide a *minimal* source code example to trigger the bug you have found.
Please also mention any command line flags that are necessary for triggering the bug.
Please also mention any command-line flags that are necessary for triggering the bug.
Provide as much information as necessary to reproduce the bug.
```solidity

View File

@ -1,14 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Bug Report
url: https://github.com/ethereum/solidity/issues/new?template=bug_report.md&projects=ethereum/solidity/43&labels=bug+%3Abug%3A
about: Bug reports about the Solidity Compiler.
- name: Documentation Issue
url: https://github.com/ethereum/solidity/issues/new?template=documentation_issue.md&projects=ethereum/solidity/43&labels=documentation+%3Abook%3A
about: Solidity documentation.
- name: Feature Request
url: https://github.com/ethereum/solidity/issues/new?template=feature_request.md&projects=ethereum/solidity/43&labels=feature
about: Solidity language or infrastructure feature requests.
- name: Report a security vulnerability
url: https://github.com/ethereum/solidity/security/policy
about: Please review our security policy for more details.
- name: Initiate a language design or feedback discussion
url: https://forum.soliditylang.org
about: Open a thread on the Solidity forum.

View File

@ -1,5 +1,10 @@
---
name: Documentation Issue
about: Corrections, improvements or requests for new content on Solidity's documentation.
title: ''
labels: 'documentation :book:'
assignees: ''
---
## Page

View File

@ -1,5 +1,11 @@
---
name: Feature Request
about: Ideas, comments or messages asking for a particular functionality to be added
to Solidity.
title: ''
labels: feature
assignees: ''
---
<!--## Prerequisites
@ -10,6 +16,8 @@ name: Feature Request
- [Solidity chat](https://gitter.im/ethereum/solidity)
- [Stack Overflow](https://ethereum.stackexchange.com/)
- Ensure the issue isn't already reported (check `feature` and `language design` labels).
- If you feel uncertain about your feature request, perhaps it's better to open a language design or feedback forum thread via the issue selector, or by going to the forum directly.
- [Solidity forum](https://forum.soliditylang.org/)
*Delete the above section and the instructions in the sections below before submitting*
-->

View File

@ -5,9 +5,10 @@ on:
branches: [ develop ]
paths:
- 'scripts/docker/buildpack-deps/Dockerfile.emscripten'
- 'scripts/docker/buildpack-deps/Dockerfile.ubuntu1604.clang.ossfuzz'
- 'scripts/docker/buildpack-deps/Dockerfile.ubuntu2004.clang'
- 'scripts/docker/buildpack-deps/Dockerfile.ubuntu.clang.ossfuzz'
- 'scripts/docker/buildpack-deps/Dockerfile.ubuntu2004'
- 'scripts/docker/buildpack-deps/Dockerfile.ubuntu2204.clang'
- 'scripts/docker/buildpack-deps/Dockerfile.ubuntu2204'
jobs:
buildpack-deps:
@ -22,7 +23,7 @@ jobs:
strategy:
fail-fast: false
matrix:
image_variant: [emscripten, ubuntu1604.clang.ossfuzz, ubuntu2004.clang, ubuntu2004]
image_variant: [emscripten, ubuntu.clang.ossfuzz, ubuntu2004, ubuntu2204.clang, ubuntu2204]
steps:
- uses: actions/checkout@v2
@ -37,6 +38,9 @@ jobs:
- name: comment PR
if: "env.DOCKER_IMAGE"
uses: aarlt/comment-on-pr@v1.2.0
# NOTE: Can't update to v1.3.1 due to an error: `/entrypoint.sh:5:in 'require_relative': cannot load such file -- /lib/github (LoadError)`
uses: unsplash/comment-on-pr@ffe8f97ccc63ce12c3c23c6885b169db67958d3b #v1.3.0
with:
msg: "`${{ env.DOCKER_IMAGE }} ${{ env.DOCKER_REPO_DIGEST }}`."
msg: "`${{ env.DOCKER_IMAGE }} ${{ env.DOCKER_REPO_DIGEST }}`."
check_for_duplicate_msg: false

51
.github/workflows/stale.yml vendored Normal file
View File

@ -0,0 +1,51 @@
name: Check stale issues and pull requests
on:
workflow_dispatch:
schedule:
- cron: '0 12 * * *'
permissions:
issues: write
pull-requests: write
env:
BEFORE_ISSUE_STALE: 90
BEFORE_ISSUE_CLOSE: 7
BEFORE_PR_STALE: 14
BEFORE_PR_CLOSE: 7
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v6
with:
debug-only: false
days-before-issue-stale: ${{ env.BEFORE_ISSUE_STALE }}
days-before-issue-close: ${{ env.BEFORE_ISSUE_CLOSE }}
stale-issue-message: |
This issue has been marked as stale due to inactivity for the last ${{ env.BEFORE_ISSUE_STALE }} days.
It will be automatically closed in ${{ env.BEFORE_ISSUE_CLOSE }} days.
close-issue-message: |
Hi everyone! This issue has been automatically closed due to inactivity.
If you think this issue is still relevant in the latest Solidity version and you have something to [contribute](https://docs.soliditylang.org/en/latest/contributing.html), feel free to reopen.
However, unless the issue is a concrete proposal that can be implemented, we recommend starting a language discussion on the [forum](https://forum.soliditylang.org) instead.
ascending: true
stale-issue-label: stale
close-issue-label: 'closed due inactivity'
exempt-issue-labels: 'bug :bug:,epic,roadmap,selected for development,must have,must have eventually,smt'
stale-pr-message: |
This pull request is stale because it has been open for ${{ env.BEFORE_PR_STALE }} days with no activity.
It will be closed in ${{ env.BEFORE_PR_CLOSE }} days unless the `stale` label is removed.
close-pr-message: |
This pull request was closed due to a lack of activity for ${{ env.BEFORE_PR_CLOSE }} days after it was stale.
stale-pr-label: stale
close-pr-label: closed-due-inactivity
days-before-pr-stale: ${{ env.BEFORE_PR_STALE }}
days-before-pr-close: ${{ env.BEFORE_PR_CLOSE }}
exempt-pr-labels: 'external contribution :star:,roadmap,epic'
exempt-draft-pr: false
exempt-all-milestones: true
remove-stale-when-updated: true
operations-per-run: 256

View File

@ -0,0 +1,37 @@
name: External contributor greeter
on:
pull_request_target:
types:
- opened
env:
DRY_RUN: false
jobs:
comment-external-pr:
runs-on: ubuntu-latest
steps:
# Note: this step requires that the INTERNAL_CONTRIBUTORS environment variable
# is already defined in the repository with the current json list of internal contributors.
- name: Comment on external contribution PR
if: "!contains(fromJSON(vars.INTERNAL_CONTRIBUTORS), github.event.pull_request.user.login)"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR: ${{ github.event.pull_request.html_url }}
run: |
echo "Commenting in a newly submitted or reopened external PR: $PR"
if [[ $DRY_RUN == 'false' ]]; then
gh pr edit "$PR" --add-label "external contribution :star:"
comment_body=(
"Thank you for your contribution to the Solidity compiler! A team member will follow up shortly."
"\n\n"
"If you haven't read our [contributing guidelines](https://docs.soliditylang.org/en/latest/contributing.html) and our "
"[review checklist](https://github.com/ethereum/solidity/blob/develop/ReviewChecklist.md) before, "
"please do it now, this makes the reviewing process and accepting your contribution smoother."
"\n\n"
"If you have any questions or need our help, feel free to post them in the PR or talk to us directly on the "
"[#solidity-dev](https://matrix.to/#/#ethereum_solidity-dev:gitter.im) channel on Matrix."
)
gh pr comment $PR --body "$(IFS='' ; echo -e "${comment_body[*]}")"
fi

40
.gitignore vendored
View File

@ -1,11 +1,16 @@
commit_hash.txt
prerelease.txt
/commit_hash.txt
/prerelease.txt
# Auth config for ppa release
/.release_ppa_auth
# Compiled Object files
*.slo
*.lo
*.o
*.obj
*.pyc
__pycache__
# Precompiled Headers
*.gch
@ -16,15 +21,15 @@ prerelease.txt
*.dylib
*.dll
# Fortran module files
*.mod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# ignore git mergetool backup files
*.orig
# Executables
*.exe
*.out
@ -33,14 +38,10 @@ prerelease.txt
# Build directory
/build*
emscripten_build/
docs/_build
docs/_static/robots.txt
__pycache__
docs/utils/*.pyc
/deps/downloads/
deps/install
deps/cache
cmake-build-*/
/docs/_build
/docs/_static/robots.txt
/deps
/reports
# vim stuff
[._]*.sw[a-p]
@ -50,14 +51,15 @@ cmake-build-*/
*~
# IDE files
.idea
.vscode
browse.VC.db
CMakeLists.txt.user
/.idea/
/.vscode/
/browse.VC.db
/CMakeLists.txt.user
/CMakeSettings.json
/.vs
/.cproject
/.project
# place to put local temporary files
tmp
# OS specific local files
.DS_Store
Thumbs.db

18
.readthedocs.yml Normal file
View File

@ -0,0 +1,18 @@
version: 2
build:
os: ubuntu-22.04
tools:
python: "3.11"
sphinx:
builder: html
configuration: docs/conf.py
formats:
- pdf
- epub
python:
install:
- requirements: docs/requirements.txt

View File

@ -1,11 +1,11 @@
cmake_minimum_required(VERSION 3.13.0)
set(ETH_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}/cmake" CACHE PATH "The the path to the cmake directory")
set(ETH_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}/cmake" CACHE PATH "The path to the cmake directory")
list(APPEND CMAKE_MODULE_PATH ${ETH_CMAKE_DIR})
# Set the build type, if none was specified.
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
if(EXISTS "${PROJECT_SOURCE_DIR}/.git")
set(DEFAULT_BUILD_TYPE "RelWithDebInfo")
else()
set(DEFAULT_BUILD_TYPE "Release")
@ -21,7 +21,7 @@ include(EthPolicy)
eth_policy()
# project name and version should be set after cmake_policy CMP0048
set(PROJECT_VERSION "0.8.12")
set(PROJECT_VERSION "0.8.22")
# OSX target needed in order to support std::visit
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14")
project(solidity VERSION ${PROJECT_VERSION} LANGUAGES C CXX)
@ -35,6 +35,8 @@ endif()
option(SOLC_LINK_STATIC "Link solc executable statically on supported platforms" OFF)
option(SOLC_STATIC_STDLIBS "Link solc against static versions of libgcc and libstdc++ on supported platforms" OFF)
option(STRICT_Z3_VERSION "Use the latest version of Z3" ON)
option(PEDANTIC "Enable extra warnings and pedantic build flags. Treat all warnings as errors." ON)
option(PROFILE_OPTIMIZER_STEPS "Output performance metrics for the optimiser steps." OFF)
# Setup cccache.
include(EthCcache)
@ -48,6 +50,14 @@ include_directories(SYSTEM ${JSONCPP_INCLUDE_DIR})
find_package(Threads)
if(NOT PEDANTIC)
message(WARNING "-- Pedantic build flags turned off. Warnings will not make compilation fail. This is NOT recommended in development builds.")
endif()
if (PROFILE_OPTIMIZER_STEPS)
add_definitions(-DPROFILE_OPTIMIZER_STEPS)
endif()
# Figure out what compiler and system are we using
include(EthCompilerSettings)
@ -56,17 +66,17 @@ include(EthUtils)
# Create license.h from LICENSE.txt and template
# Converting to char array is required due to MSVC's string size limit.
file(READ ${CMAKE_SOURCE_DIR}/LICENSE.txt LICENSE_TEXT HEX)
file(READ ${PROJECT_SOURCE_DIR}/LICENSE.txt LICENSE_TEXT HEX)
string(REGEX MATCHALL ".." LICENSE_TEXT "${LICENSE_TEXT}")
string(REGEX REPLACE ";" ",\n\t0x" LICENSE_TEXT "${LICENSE_TEXT}")
set(LICENSE_TEXT "0x${LICENSE_TEXT}")
configure_file("${CMAKE_SOURCE_DIR}/cmake/templates/license.h.in" include/license.h)
configure_file("${PROJECT_SOURCE_DIR}/cmake/templates/license.h.in" include/license.h)
include(EthOptions)
configure_project(TESTS)
set(LATEST_Z3_VERSION "4.8.14")
set(MINIMUM_Z3_VERSION "4.8.0")
set(LATEST_Z3_VERSION "4.12.1")
set(MINIMUM_Z3_VERSION "4.8.16")
find_package(Z3)
if (${Z3_FOUND})
if (${STRICT_Z3_VERSION})
@ -130,6 +140,7 @@ add_subdirectory(libevmasm)
add_subdirectory(libyul)
add_subdirectory(libsolidity)
add_subdirectory(libsolc)
add_subdirectory(libstdlib)
add_subdirectory(tools)
if (NOT EMSCRIPTEN)

View File

@ -55,10 +55,8 @@ further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at chris@ethereum.org which only goes to
Christian Reitwiessner or axic@ethereum.org which only goes to Alex Beregszaszi.
To report an issue involving either of them please email Hudson Jameson at
hudson@ethereum.org.
reported by contacting the project team at solidity@ethereum.org.
To report an issue involving the Solidity team please email José Pedro Cabrita at zepedro@ethereum.org.
All complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.

View File

@ -51,10 +51,11 @@ To set indentation and tab width settings uniformly, the repository contains an
## 1. Namespaces
1. No `using namespace` declarations in header files.
2. Use `using namespace std;` in cpp files, but avoid importing namespaces from boost and others.
3. All symbols should be declared in a namespace except for final applications.
4. Use anonymous namespaces for helpers whose scope is a cpp file only.
5. Preprocessor symbols should be prefixed with the namespace in all-caps and an underscore.
2. `using namespace solidity;` and other project local namespaces is fine in cpp files, and generally encouraged.
3. Avoid `using namespace` at file level for third party libraries, such as boost, ranges, etc.
4. All symbols should be declared in a namespace except for final applications.
5. Use anonymous namespaces for helpers whose scope is a cpp file only.
6. Preprocessor symbols should be prefixed with the namespace in all-caps and an underscore.
Only in the header:
```cpp
@ -65,16 +66,6 @@ std::tuple<float, float> meanAndSigma(std::vector<float> const& _v);
}
```
Only in the cpp file:
```cpp
#include <cassert>
using namespace std;
tuple<float, float> myNamespace::meanAndSigma(vector<float> const& _v)
{
// ...
}
```
## 2. Preprocessor
1. File comment is always at top, and includes:
@ -116,7 +107,7 @@ Use `solAssert` and `solUnimplementedAssert` generously to check assumptions tha
1. {Typename} + {qualifiers} + {name}.
2. Only one per line.
3. Associate */& with type, not variable (at ends with parser, but more readable, and safe if in conjunction with (b)).
4. Favour declarations close to use; don't habitually declare at top of scope ala C.
4. Favour declarations close to use; do not habitually declare at top of scope ala C.
5. Pass non-trivial parameters as const reference, unless the data is to be copied into the function, then either pass by const reference or by value and use std::move.
6. If a function returns multiple values, use std::tuple (std::pair acceptable) or better introduce a struct type. Do not use */& arguments.
7. Use parameters of pointer type only if ``nullptr`` is a valid argument, use references otherwise. Often, ``std::optional`` is better suited than a raw pointer.
@ -179,7 +170,7 @@ for (map<ComplexTypeOne, ComplexTypeTwo>::iterator i = l.begin(); i != l.end();
## 9. Naming
1. Avoid unpronouncable names.
1. Avoid unpronounceable names.
2. Names should be shortened only if they are extremely common, but shortening should be generally avoided
3. Avoid prefixes of initials (e.g. do not use `IMyInterface`, `CMyImplementation`)
4. Find short, memorable & (at least semi-) descriptive names for commonly used classes or name-fragments:

View File

@ -1,3 +1,284 @@
### 0.8.22 (unreleased)
Language Features:
* Allow defining events at file level.
Compiler Features:
* Parser: Remove the experimental error recovery mode (``--error-recovery`` / ``settings.parserErrorRecovery``).
* Yul Optimizer: If ``PUSH0`` is supported, favor zero literals over storing zero values in variables.
* Yul Optimizer: Run the ``Rematerializer`` and ``UnusedPruner`` steps at the end of the default clean-up sequence.
Bugfixes:
* AST: Fix wrong initial ID for Yul nodes in the AST.
* Code Generator: Fix output from via-IR code generator being dependent on which files were discovered by import callback. In some cases, a different AST ID assignment would alter the order of functions in internal dispatch, resulting in superficially different but semantically equivalent bytecode.
* NatSpec: Fix internal error when requesting userdoc or devdoc for a contract that emits an event defined in a foreign contract or interface.
* SMTChecker: Fix encoding error that causes loops to unroll after completion.
* SMTChecker: Fix inconsistency on constant condition checks when ``while`` or ``for`` loops are unrolled before the condition check.
### 0.8.21 (2023-07-19)
Important Bugfixes:
* Code Generator: Always generate code for the expression in ``<expression>.selector`` in the legacy code generation pipeline.
* Yul Optimizer: Fix ``FullInliner`` step (``i``) not preserving the evaluation order of arguments passed into inlined functions in code that is not in expression-split form (i.e. when using a custom optimizer sequence in which the step not preceded by ``ExpressionSplitter`` (``x``)).
Language Features:
* Allow qualified access to events from other contracts.
* Relax restrictions on initialization of immutable variables. Reads and writes may now happen at any point at construction time outside of functions and modifiers. Explicit initialization is no longer mandatory.
Compiler Features:
* Commandline Interface: Add ``--ast-compact-json`` output in assembler mode.
* Commandline Interface: Add ``--ir-ast-json`` and ``--ir-optimized-ast-json`` outputs for Solidity input, providing AST in compact JSON format for IR and optimized IR.
* Commandline Interface: Respect ``--optimize-yul`` and ``--no-optimize-yul`` in compiler mode and accept them in assembler mode as well. ``--optimize --no-optimize-yul`` combination now allows enabling EVM assembly optimizer without enabling Yul optimizer.
* EWasm: Remove EWasm backend.
* Parser: Introduce ``pragma experimental solidity``, which will enable an experimental language mode that in particular has no stability guarantees between non-breaking releases and is not suited for production use.
* SMTChecker: Add ``--model-checker-print-query`` CLI option and ``settings.modelChecker.printQuery`` JSON option to output the SMTChecker queries in the SMTLIB2 format. This requires using ``smtlib2`` solver only.
* Standard JSON Interface: Add ``ast`` file-level output for Yul input.
* Standard JSON Interface: Add ``irAst`` and ``irOptimizedAst`` contract-level outputs for Solidity input, providing AST in compact JSON format for IR and optimized IR.
* Yul Optimizer: Remove experimental ``ReasoningBasedSimplifier`` optimization step.
* Yul Optimizer: Stack-to-memory mover is now enabled by default whenever possible for via IR code generation and pure Yul compilation.
Bugfixes:
* Code Generator: Disallow complex expressions whose results are types, built-ins, modules or some unassignable functions. The legacy code generation pipeline would not actually evaluate them, discarding any side-effects they might have.
* Code Generator: Fix not entirely deterministic order of functions in unoptimized Yul output. The choice of C++ compiler in some cases would result in different (but equivalent) bytecode (especially from native binaries vs emscripten binaries).
* Commandline Interface: Fix internal error when using ``--stop-after parsing`` and requesting some of the outputs that require full analysis or compilation.
* Commandline Interface: It is no longer possible to specify both ``--optimize-yul`` and ``--no-optimize-yul`` at the same time.
* SMTChecker: Fix encoding of side-effects inside ``if`` and ``ternary conditional``statements in the BMC engine.
* SMTChecker: Fix false negative when a verification target can be violated only by trusted external call from another public function.
* SMTChecker: Fix generation of invalid SMT-LIB2 scripts in BMC engine with trusted mode for external calls when CHC engine times out.
* SMTChecker: Fix internal error caused by incorrectly classifying external function call using function pointer as a public getter.
* SMTChecker: Fix internal error caused by using external identifier to encode member access to functions that take an internal function as a parameter.
* Standard JSON Interface: Fix an incomplete AST being returned when analysis is interrupted by certain kinds of fatal errors.
* Type Checker: Disallow using certain unassignable function types in complex expressions.
* Type Checker: Function declaration types referring to different declarations are no longer convertible to each other.
* Yul Optimizer: Ensure that the assignment of memory slots for variables moved to memory does not depend on AST IDs that may depend on whether additional files are included during compilation.
* Yul Optimizer: Fix ``FullInliner`` step not ignoring code that is not in expression-split form.
* Yul Optimizer: Fix optimized IR being unnecessarily passed through the Yul optimizer again before bytecode generation.
AST Changes:
* AST: Add the ``experimentalSolidity`` field to the ``SourceUnit`` nodes, which indicate whether the experimental parsing mode has been enabled via ``pragma experimental solidity``.
### 0.8.20 (2023-05-10)
Compiler Features:
* Assembler: Use ``push0`` for placing ``0`` on the stack for EVM versions starting from "Shanghai". This decreases the deployment and runtime costs.
* EVM: Set default EVM version to "Shanghai".
* EVM: Support for the EVM Version "Shanghai".
* NatSpec: Add support for NatSpec documentation in ``enum`` definitions.
* NatSpec: Add support for NatSpec documentation in ``struct`` definitions.
* NatSpec: Include NatSpec from events that are emitted by a contract but defined outside of it in userdoc and devdoc output.
* Optimizer: Re-implement simplified version of ``UnusedAssignEliminator`` and ``UnusedStoreEliminator``. It can correctly remove some unused assignments in deeply nested loops that were ignored by the old version.
* Parser: Unary plus is no longer recognized as a unary operator in the AST and triggers an error at the parsing stage (rather than later during the analysis).
* SMTChecker: Add CLI option ``--model-checker-bmc-loop-iterations`` and a JSON option ``settings.modelChecker.bmcLoopIterations`` that specify how many loop iterations the BMC engine should unroll. Note that false negatives are possible when unrolling loops. This is due to the possibility that bmc loop iteration setting is less than actual number of iterations needed to complete a loop.
* SMTChecker: Group all messages about unsupported language features in a single warning. The CLI option ``--model-checker-show-unsupported`` and the JSON option ``settings.modelChecker.showUnsupported`` can be enabled to show the full list.
* SMTChecker: Properties that are proved safe are now reported explicitly at the end of analysis. By default, only the number of safe properties is shown. The CLI option ``--model-checker-show-proved-safe`` and the JSON option ``settings.modelChecker.showProvedSafe`` can be enabled to show the full list of safe properties.
* Standard JSON Interface: Add experimental support for importing ASTs via Standard JSON.
* Yul EVM Code Transform: If available, use ``push0`` instead of ``codesize`` to produce an arbitrary value on stack in order to create equal stack heights between branches.
Bugfixes:
* ABI: Include events in the ABI that are emitted by a contract but defined outside of it.
* Immutables: Disallow initialization of immutables in try/catch statements.
* SMTChecker: Fix false positives in ternary operators that contain verification targets in its branches, directly or indirectly.
AST Changes:
* AST: Add the ``internalFunctionIDs`` field to the AST nodes of contracts containing IDs of functions that may be called via the internal dispatch. The field is a map from function AST IDs to internal dispatch function IDs. These IDs are always generated, but they are only used in via-IR code generation.
* AST: Add the ``usedEvents`` field to ``ContractDefinition`` which contains the AST IDs of all events emitted by the contract as well as all events defined and inherited by the contract.
### 0.8.19 (2023-02-22)
Language Features:
* Allow defining custom operators for user-defined value types via ``using {f as +} for T global`` syntax.
Compiler Features:
* SMTChecker: New trusted mode that assumes that any compile-time available code is the actual used code even in external calls. This can be used via the CLI option ``--model-checker-ext-calls trusted`` or the JSON field ``settings.modelChecker.extCalls: "trusted"``.
Bugfixes:
* Assembler: Avoid duplicating subassembly bytecode where possible.
* Code Generator: Avoid including references to the deployed label of referenced functions if they are called right away.
* ContractLevelChecker: Properly distinguish the case of missing base constructor arguments from having an unimplemented base function.
* SMTChecker: Fix internal error caused by unhandled ``z3`` expressions that come from the solver when bitwise operators are used.
* SMTChecker: Fix internal error when using the custom NatSpec annotation to abstract free functions.
* TypeChecker: Also allow external library functions in ``using for``.
AST Changes:
* AST: Add ``function`` field to ``UnaryOperation`` and ``BinaryOperation`` AST nodes. ``functionList`` in ``UsingForDirective`` AST nodes will now contain ``operator`` and ``definition`` members instead of ``function`` when the list entry defines an operator.
### 0.8.18 (2023-02-01)
Language Features:
* Allow named parameters in mapping types.
Compiler Features:
* Commandline Interface: Add ``--no-cbor-metadata`` that skips CBOR metadata from getting appended at the end of the bytecode.
* Commandline Interface: Return exit code ``2`` on uncaught exceptions.
* EVM: Deprecate ``block.difficulty`` and disallow ``difficulty()`` in inline assembly for EVM versions >= paris. The change is due to the renaming introduced by [EIP-4399](https://eips.ethereum.org/EIPS/eip-4399).
* EVM: Introduce ``block.prevrandao`` in Solidity and ``prevrandao()`` in inline assembly for EVM versions >= paris.
* EVM: Set the default EVM version to "Paris".
* EVM: Support for the EVM version "Paris".
* Language Server: Add basic document hover support.
* Natspec: Add event Natspec inheritance for devdoc.
* Optimizer: Added optimization rule ``and(shl(X, Y), shl(X, Z)) => shl(X, and(Y, Z))``.
* Parser: More detailed error messages about invalid version pragmas.
* SMTChecker: Make ``z3`` the default solver for the BMC and CHC engines instead of all solvers.
* SMTChecker: Support Eldarica as a Horn solver for the CHC engine when using the CLI option ``--model-checker-solvers eld``. The binary ``eld`` must be available in the system.
* Solidity Upgrade Tool: Remove ``solidity-upgrade`` tool.
* Standard JSON: Add a boolean field ``settings.metadata.appendCBOR`` that skips CBOR metadata from getting appended at the end of the bytecode.
* TypeChecker: Warn when using deprecated builtin ``selfdestruct``.
* Yul EVM Code Transform: Generate more optimal code for user-defined functions that always terminate a transaction. No return labels will be pushed for calls to functions that always terminate.
* Yul Optimizer: Allow replacing the previously hard-coded cleanup sequence by specifying custom steps after a colon delimiter (``:``) in the sequence string.
* Yul Optimizer: Eliminate ``keccak256`` calls if the value was already calculated by a previous call and can be reused.
Bugfixes:
* Parser: Disallow several ``indexed`` attributes for the same event parameter.
* Parser: Disallow usage of the ``indexed`` attribute for modifier parameters.
* SMTChecker: Fix display error for negative integers that are one more than powers of two.
* SMTChecker: Fix internal error on chain assignments using static fully specified state variables.
* SMTChecker: Fix internal error on multiple wrong SMTChecker natspec entries.
* SMTChecker: Fix internal error when a public library function is called internally.
* SMTChecker: Fix internal error when deleting struct member of function type.
* SMTChecker: Fix internal error when using user-defined types as mapping indices or struct members.
* SMTChecker: Improved readability for large integers that are powers of two or almost powers of two in error messages.
* TypeChecker: Fix bug where private library functions could be attached with ``using for`` outside of their declaration scope.
* Yul Optimizer: Hash hex and decimal literals according to their value instead of their representation, improving the detection of equivalent functions.
### 0.8.17 (2022-09-08)
Important Bugfixes:
* Yul Optimizer: Prevent the incorrect removal of storage writes before calls to Yul functions that conditionally terminate the external EVM call.
Compiler Features:
* Code Generator: More efficient overflow checks for multiplication.
* Language Server: Analyze all files in a project by default (can be customized by setting ``'file-load-strategy'`` to ``'directly-opened-and-on-import'`` in LSP settings object).
* Yul Optimizer: Simplify the starting offset of zero-length operations to zero.
Bugfixes:
* Type Checker: Fix internal compiler error on tuple assignments with invalid left-hand side.
* Yul IR Code Generation: Fix internal compiler error when accessing the ``.slot`` member of a mapping through a storage reference in inline assembly.
Build System:
* Allow disabling pedantic warnings and do not treat warnings as errors during compiler build when ``-DPEDANTIC=OFF`` flag is passed to CMake.
* Update emscripten to version 3.1.19.
### 0.8.16 (2022-08-08)
Important Bugfixes:
* Code Generation: Fix data corruption that affected ABI-encoding of calldata values represented by tuples: structs at any nesting level; argument lists of external functions, events and errors; return value lists of external functions. The 32 leading bytes of the first dynamically-encoded value in the tuple would get zeroed when the last component contained a statically-encoded array.
Compiler Features:
* Code Generator: More efficient code for checked addition and subtraction.
* TypeChecker: Support using library constants in initializers of other constants.
* Yul IR Code Generation: Improved copy routines for arrays with packed storage layout.
* Yul Optimizer: Add rule to convert ``mod(add(X, Y), A)`` into ``addmod(X, Y, A)``, if ``A`` is a power of two.
* Yul Optimizer: Add rule to convert ``mod(mul(X, Y), A)`` into ``mulmod(X, Y, A)``, if ``A`` is a power of two.
Bugfixes:
* Commandline Interface: Disallow the following options outside of the compiler mode: ``--via-ir``,``--metadata-literal``, ``--metadata-hash``, ``--model-checker-show-unproved``, ``--model-checker-div-mod-no-slacks``, ``--model-checker-engine``, ``--model-checker-invariants``, ``--model-checker-solvers``, ``--model-checker-timeout``, ``--model-checker-contracts``, ``--model-checker-targets``.
* Type Checker: Fix compiler crash on tuple assignments involving certain patterns with unary tuples on the left-hand side.
* Type Checker: Fix compiler crash when ``abi.encodeCall`` received a tuple expression instead of an inline tuple.
* Type Checker: Fix null dereference in ``abi.encodeCall`` type checking of free function.
### 0.8.15 (2022-06-15)
Important Bugfixes:
* Code Generation: Avoid writing dirty bytes to storage when copying ``bytes`` arrays.
* Yul Optimizer: Keep all memory side-effects of inline assembly blocks.
Language Features:
* Add `E.selector` for a non-anonymous event `E` to access the 32-byte selector topic.
Compiler Features:
* Language Server: Add rudimentary support for semantic highlighting.
* Language Server: Adds support for configuring ``include-paths`` JSON settings object that can be passed during LSP configuration stage.
* Language Server: Always add ``{project_root}/node_modules`` to include search paths.
* Type Checker: Warn about assignments involving multiple pushes to storage ``bytes`` that may invalidate references.
* Yul Optimizer: Improve inlining heuristics for via IR code generation and pure Yul compilation.
Bugfixes:
* ABI Encoder: When encoding an empty string coming from storage do not add a superfluous empty slot for data.
* Common Subexpression Eliminator: Process assembly items in chunks with maximum size of 2000. It helps to avoid extremely time-consuming searches during code optimization.
* DocString Parser: Fix ICE caused by an immutable struct with mapping.
* Yul IR Code Generation: More robust cleanup in corner cases during memory to storage copies.
* Yul Optimizer: Do not remove ``returndatacopy`` in cases in which it might perform out-of-bounds reads that unconditionally revert as out-of-gas. Previously, any ``returndatacopy`` that wrote to memory that was never read from was removed without accounting for the out-of-bounds condition.
### 0.8.14 (2022-05-17)
Important Bugfixes:
* ABI Encoder: When ABI-encoding values from calldata that contain nested arrays, correctly validate the nested array length against ``calldatasize()`` in all cases.
* Override Checker: Allow changing data location for parameters only when overriding external functions.
Compiler Features:
* Assembly-Json Exporter: Include source list in `sourceList` field.
* Commandline Interface: Option ``--pretty-json`` works also with the following options: ``--abi``, ``--asm-json``, ``--ast-compact-json``, ``--devdoc``, ``--storage-layout``, ``--userdoc``.
* Language Server: Allow full filesystem access to language server.
* Peephole Optimizer: Remove operations without side effects before simple terminations.
* SMTChecker: Support ``abi.encodeCall`` taking into account the called selector.
Bugfixes:
* Assembly-Json Exporter: Fix assembly json export to store jump types of operations in `jumpType` field instead of `value`.
* SMTChecker: Fix ABI compatibility with z3 >=4.8.16.
* SMTChecker: Fix bug when z3 is selected but not available at runtime.
* Type Checker: Properly check restrictions of ``using ... global`` in conjunction with libraries.
* TypeChecker: Convert parameters of function type to how they would be called for ``abi.encodeCall``.
### 0.8.13 (2022-03-16)
Important Bugfixes:
* Code Generator: Correctly encode literals used in ``abi.encodeCall`` in place of fixed bytes arguments.
Language Features:
* General: Allow annotating inline assembly as memory-safe to allow optimizations and stack limit evasion that rely on respecting Solidity's memory model.
* General: ``using M for Type;`` is allowed at file level and ``M`` can now also be a brace-enclosed list of free functions or library functions.
* General: ``using ... for T global;`` is allowed at file level where the user-defined type ``T`` has been defined, resulting in the effect of the statement being available everywhere ``T`` is available.
Compiler Features:
* Commandline Interface: Allow the use of ``--via-ir`` in place of ``--experimental-via-ir``.
* Compilation via Yul IR is no longer marked as experimental.
* JSON-AST: Added selector field for errors and events.
* Language Server: Implements goto-definition.
* Peephole Optimizer: Optimize comparisons in front of conditional jumps and conditional jumps across a single unconditional jump.
* Yul EVM Code Transform: Avoid unnecessary ``pop``s on terminating control flow.
* Yul IR Code Generation: When the result of an external call is statically-sized, ignore any returndata past the size expected by the compiler.
* Yul Optimizer: Remove ``sstore`` and ``mstore`` operations that are never read from.
Bugfixes:
* General: Fix internal error for locales with unusual capitalization rules. Locale set in the environment is now completely ignored.
* Type Checker: Fix incorrect type checker errors when importing overloaded functions.
* Yul IR Code Generation: Optimize embedded creation code with correct settings. This fixes potential mismatches between the constructor code of a contract compiled in isolation and the bytecode in ``type(C).creationCode``, resp. the bytecode used for ``new C(...)``.
### 0.8.12 (2022-02-16)
Language Features:

View File

@ -27,11 +27,11 @@ For a good overview and starting point, please check out the official [Solidity
Solidity is a statically-typed curly-braces programming language designed for developing smart contracts
that run on the Ethereum Virtual Machine. Smart contracts are programs that are executed inside a peer-to-peer
network where nobody has special authority over the execution, and thus they allow to implement tokens of value,
network where nobody has special authority over the execution, and thus they allow anyone to implement tokens of value,
ownership, voting, and other kinds of logic.
When deploying contracts, you should use the latest released version of
Solidity. This is because breaking changes, as well as new features and bug fixes are
Solidity. This is because breaking changes, as well as new features and bug fixes, are
introduced regularly. We currently use a 0.x version
number [to indicate this fast pace of change](https://semver.org/#spec-item-4).
@ -66,7 +66,7 @@ browser-based IDE. Here are some example contracts:
## Documentation
The Solidity documentation is hosted at [Read the docs](https://docs.soliditylang.org).
The Solidity documentation is hosted using [Read the Docs](https://docs.soliditylang.org).
## Development
@ -79,8 +79,8 @@ You can find our current feature and bug priorities for forthcoming
releases in the [projects section](https://github.com/ethereum/solidity/projects).
## Maintainers
* [@axic](https://github.com/axic)
* [@chriseth](https://github.com/chriseth)
The Solidity programming language and compiler are open-source community projects governed by a core team.
The core team is sponsored by the [Ethereum Foundation](https://ethereum.foundation/).
## License
Solidity is licensed under [GNU General Public License v3.0](LICENSE.txt).

View File

@ -1,67 +1,97 @@
## Checklist for making a release:
### Requirements
- [ ] Lauchpad (Ubuntu One) account
- [ ] gnupg key (has to be version 1, gpg2 won't work) for `your-name@ethereum.org` created and uploaded
- [ ] Readthedocs account, access to the Solidity project
- [ ] Write access to https://github.com/ethereum/homebrew-ethereum
- [ ] GitHub account with access to [solidity](https://github.com/ethereum/solidity), [solc-js](https://github.com/ethereum/solc-js),
[solc-bin](https://github.com/ethereum/solc-bin), [homebrew-ethereum](https://github.com/ethereum/homebrew-ethereum),
[solidity-website](https://github.com/ethereum/solidity-website).
- [ ] DockerHub account with push rights to the [``solc`` image](https://hub.docker.com/r/ethereum/solc).
- [ ] Launchpad (Ubuntu One) account with a membership in the ["Ethereum" team](https://launchpad.net/~ethereum) and
a gnupg key for your email in the ``ethereum.org`` domain (has to be version 1, gpg2 won't work).
- [ ] Ubuntu/Debian dependencies of the PPA scripts: ``devscripts``, ``debhelper``, ``dput``, ``git``, ``wget``, ``ca-certificates``.
- [ ] [npm Registry](https://www.npmjs.com) account added as a collaborator for the [``solc`` package](https://www.npmjs.com/package/solc).
- [ ] Access to the [solidity_lang Twitter account](https://twitter.com/solidity_lang).
- [ ] [Reddit](https://www.reddit.com) account that is at least 10 days old with a minimum of 20 comment karma (``/r/ethereum`` requirements).
### Documentation check
- [ ] Run `make linkcheck` from within `docs/` and fix any broken links it finds. Ignore false positives caused by `href` anchors and dummy links not meant to work.
### Pre-flight checks
At least a day before the release:
- [ ] Run ``make linkcheck`` from within ``docs/`` and fix any broken links it finds.
Ignore false positives caused by ``href`` anchors and dummy links not meant to work.
- [ ] Double-check that [the most recent docs builds at readthedocs](https://readthedocs.org/projects/solidity/builds/) succeeded.
- [ ] Make sure that all merged PRs that should have changelog entries do have them.
- [ ] Rerun CI on the top commits of main branches in all repositories that do not have daily activity by creating a test branch or PR:
- [ ] ``solc-js``
- [ ] ``solc-bin`` (make sure the bytecode comparison check did run)
- [ ] ``homebrew-ethereum``
- [ ] (Optional) Create a prerelease in our Ubuntu PPA by following the steps in the PPA section below on ``develop`` rather than on a tag.
This is recommended especially when dealing with PPA for the first time, when we add a new Ubuntu version or when the PPA scripts were modified in this release cycle.
- [ ] Verify that the release tarball of ``solc-js`` works.
Bump version locally, add ``soljson.js`` from CI, build it, compare the file structure with the previous version, install it locally and try to use it.
### Drafts
At least a day before the release:
- [ ] Create a draft PR to sort the changelog.
- [ ] Create draft PRs to bump version in ``solidity`` and ``solc-js``.
- [ ] Create a draft of the release on github.
- [ ] Create a draft PR to update soliditylang.org.
- [ ] Create drafts of blog posts.
- [ ] Prepare drafts of Twitter, Reddit and Solidity Forum announcements.
### Blog Post
- [ ] Create a post on https://github.com/ethereum/solidity-blog and explain some of the new features or concepts.
- [ ] Create a post on [solidity-website](https://github.com/ethereum/solidity-website/tree/main/src/posts) in the ``Releases`` category and explain some of the new features or concepts.
- [ ] Create a post on [solidity-website](https://github.com/ethereum/solidity-website/tree/main/src/posts) in the ``Security Alerts`` category in case of important bug(s).
### Changelog
- [ ] Sort the changelog entries alphabetically and correct any errors you notice.
- [ ] Create a commit on a new branch that updates the ``Changelog`` to include a release date.
- [ ] Run ``./scripts/tests.sh`` to update the bug list.
- [ ] Create a pull request and wait for the tests, merge it.
- [ ] Sort the changelog entries alphabetically and correct any errors you notice. Commit it.
- [ ] Update the changelog to include a release date.
- [ ] Run ``scripts/update_bugs_by_version.py`` to regenerate ``bugs_by_version.json`` from the changelog and ``bugs.json``.
Make sure that the resulting ``bugs_by_version.json`` has a new, empty entry for the new version.
- [ ] Commit changes, create a pull request and wait for the tests. Then merge it.
- [ ] Copy the changelog into the release blog post.
### Create the Release
- [ ] Create Github release page: https://github.com/ethereum/solidity/releases/new
- [ ] On the release page, select the ``develop`` branch as new target and set tag to the new version (e.g. `v0.8.5`) (make sure you only `SAVE DRAFT` instead of `PUBLISH RELEASE` before the actual release)
- [ ] Thank voluntary contributors in the Github release page (use ``git shortlog -s -n -e v0.5.3..origin/develop``).
- [ ] Create a [release on GitHub](https://github.com/ethereum/solidity/releases/new).
Set the target to the ``develop`` branch and the tag to the new version, e.g. ``v0.8.5``.
Include the following warning: ``**The release is still in progress and the binaries may not yet be available from all sources.**``.
Do not publish it yet - click the ``Save draft`` button instead.
- [ ] Thank voluntary contributors in the GitHub release notes.
Use ``scripts/list_contributors.sh v<previous version>`` to get initial list of names.
Remove different variants of the same name manually before using the output.
- [ ] Check that all tests on the latest commit in ``develop`` are green.
- [ ] Click the `PUBLISH RELEASE` button on the release page, creating the tag.
- [ ] Click the ``Publish release`` button on the release page, creating the tag.
- [ ] Wait for the CI runs on the tag itself.
### Download Binaries
- [ ] Take the ``solc.exe`` binary from the ``b_win_release`` run of the released commit in circle-ci and add it to the release page as ``solc-windows.exe``.
- [ ] Take the ``solc`` binary from the ``b_osx`` run of the released commit in circle-ci and add it to the release page as ``solc-macos``.
- [ ] Take the ``solc`` binary from the ``b_ubu_static`` run of the released commit in circle-ci and add it to the release page as ``solc-static-linux``.
- [ ] Take the ``soljson.js`` binary from the ``b_ems`` run of the released commit in circle-ci and add it to the release page as ``soljson.js``.
### Update [solc-bin](https://github.com/ethereum/solc-bin/)
- [ ] Copy files to solc-bin:
```bash
VERSION=0.8.4
COMMIT="c7e474f2"
SOLC_BIN="/home/me/solc-bin"
chmod +x solc-static-linux solc-macos
cp soljson.js $SOLC_BIN/bin/soljson-v$VERSION+commit.$COMMIT.js
cp solc-static-linux $SOLC_BIN/linux-amd64/solc-linux-amd64-v$VERSION+commit.$COMMIT
cp solc-macos $SOLC_BIN/macosx-amd64/solc-macosx-amd64-v$VERSION+commit.$COMMIT
cp solc-windows.exe $SOLC_BIN/windows-amd64/solc-windows-amd64-v$VERSION+commit.$COMMIT.exe
- [ ] Run ``./update --reuse-hashes`` in ``solc-bin`` and verify that the script has updated ``list.js``, ``list.txt`` and ``list.json`` files correctly and that symlinks to the new release have been added in ``solc-bin/wasm/`` and ``solc-bin/emscripten-wasm32/``.
- [ ] Create a pull request and merge.
### Upload Release Artifacts and Publish Binaries
- [ ] Switch to the tag that archives have to be created for.
- [ ] Create the ``prerelease.txt`` file: (``echo -n > prerelease.txt``).
- [ ] Run ``scripts/create_source_tarball.sh`` while being on the tag to create the source tarball. This will create the tarball in a directory called ``upload``.
- [ ] Take the tarball from the upload directory (its name should be ``solidity_x.x.x.tar.gz``, otherwise ``prerelease.txt`` was missing in the step before) and upload the source tarball to the release page.
- [ ] Take the ``github-binaries.tar`` tarball from ``c_release_binaries`` run of the tagged commit in circle-ci and add all binaries from it to the release page.
Make sure it contains four binaries: ``solc-windows.exe``, ``solc-macos``, ``solc-static-linux`` and ``soljson.js``.
- [ ] Take the ``solc-bin-binaries.tar`` tarball from ``c_release_binaries`` run of the tagged commit in circle-ci and add all binaries from it to solc-bin.
- [ ] Run ``npm run update -- --reuse-hashes`` in ``solc-bin`` and verify that the script has updated ``list.js``, ``list.txt`` and ``list.json`` files correctly and that symlinks to the new release have been added in ``solc-bin/wasm/`` and ``solc-bin/emscripten-wasm32/``.
- [ ] Create a pull request in solc-bin and merge.
### Homebrew and MacOS
- [ ] Update the version and the hash (``sha256sum solidity_$VERSION.tar.gz``) in https://github.com/Homebrew/homebrew-core/blob/master/Formula/solidity.rb
- [ ] Update the version and the hash (``sha256sum solidity_$VERSION.tar.gz``) in https://github.com/ethereum/homebrew-ethereum/blob/master/solidity.rb
- [ ] Update the version and the hash (``sha256sum solidity_$VERSION.tar.gz``) in the [``solidity`` formula in Homebrew core repository](https://github.com/Homebrew/homebrew-core/blob/master/Formula/solidity.rb).
- [ ] Update the version and the hash (``sha256sum solidity_$VERSION.tar.gz``) in [our custom ``solidity`` Homebrew formula](https://github.com/ethereum/homebrew-ethereum/blob/master/solidity.rb).
### Docker
- [ ] Run ``./scripts/docker_deploy_manual.sh v$VERSION``).
- [ ] Run ``./scripts/docker_deploy_manual.sh v$VERSION``.
### PPA
- [ ] Make sure the ``ethereum/cpp-build-deps`` PPA repository contains libz3-static-dev builds for all current versions of ubuntu. If not run ``scripts/deps-ppa/static-z3.sh`` (after changing email address and key id and adding the missing ubuntu version) and wait for the builds to succeed before continuing.
- [ ] Change ``scripts/release_ppa.sh`` to match your key's email and key id; double-check that ``DISTRIBUTIONS`` contains the most recent versions.
- [ ] Run ``scripts/release_ppa.sh v$VERSION`` to create the PPA release (you need the relevant openssl key).
- [ ] Wait for the ``~ethereum/ubuntu/ethereum-static`` PPA build to be finished and published for *all platforms*. SERIOUSLY: DO NOT PROCEED EARLIER!!! *After* the static builds are *published*, copy the static package to the ``~ethereum/ubuntu/ethereum`` PPA for the destination series ``Trusty``, ``Xenial`` and ``Bionic`` while selecting ``Copy existing binaries``.
### Documentation
- [ ] Build the new version on https://readthedocs.org/projects/solidity/ (select `latest` at the bottom of the page and click `BUILD`).
- [ ] In the admin panel, select `Versions` in the menu and set the default version to the released one.
- [ ] Create ``.release_ppa_auth`` at the root of your local Solidity checkout and set ``LAUNCHPAD_EMAIL`` and ``LAUNCHPAD_KEYID`` to your key's email and key id.
- [ ] Double-check that the ``DISTRIBUTIONS`` list in ``scripts/release_ppa.sh`` and ``scripts/deps-ppa/static_z3.sh`` contains the most recent versions of Ubuntu.
- [ ] Make sure the [``~ethereum/cpp-build-deps`` PPA repository](https://launchpad.net/~ethereum/+archive/ubuntu/cpp-build-deps) contains ``libz3-static-dev builds`` for all current versions of Ubuntu.
Note that it may be included in the ``z3-static`` multipackage (follow the ``View package details`` link to check).
If not present, run ``scripts/deps-ppa/static_z3.sh`` and wait for the builds to succeed before continuing.
- [ ] Run ``scripts/release_ppa.sh v$VERSION`` to create the PPA release.
This will create a single package containing static binary for older Ubuntu versions in the [``~ethereum/ethereum-static`` PPA](https://launchpad.net/~ethereum/+archive/ubuntu/ethereum-static)
and separate packages with dynamically-linked binaries for recent versions (those listed in ``DISTRIBUTIONS``) in the [``~ethereum/ethereum`` PPA](https://launchpad.net/~ethereum/+archive/ubuntu/ethereum).
- [ ] Wait for the build to be finished and published for *all architectures* (currently we only build for ``amd64``, but we may add ``arm`` in the future).
**SERIOUSLY: DO NOT PROCEED EARLIER!!!**
- [ ] *After* the package with the static build is *published*, use it to create packages for older Ubuntu versions.
Copy the static package to the [``~ethereum/ethereum`` PPA](https://launchpad.net/~ethereum/+archive/ubuntu/ethereum)
for the destination series ``Trusty``, ``Xenial`` and ``Bionic`` while selecting ``Copy existing binaries``.
### Release solc-js
- [ ] Wait until solc-bin was properly deployed. You can test this via remix - a test run through remix is advisable anyway.
@ -71,9 +101,17 @@
- [ ] Create a tag using ``git tag --annotate v$VERSION`` and push it with ``git push --tags``.
### Post-release
- [ ] Publish the blog post.
- [ ] Make sure the documentation for the new release has been published successfully.
Go to the [documentation status page at ReadTheDocs](https://readthedocs.org/projects/solidity/) and verify that the new version is listed, works and is marked as default.
- [ ] Remove "still in progress" warning from the [release notes](https://github.com/ethereum/solidity/releases).
- [ ] Merge the [blog posts](https://github.com/ethereum/solidity-website/pulls) related to the release.
- [ ] Create a commit to increase the version number on ``develop`` in ``CMakeLists.txt`` and add a new skeleton changelog entry.
- [ ] Announce on Twitter, including links to the release and the blog post.
- [ ] Share announcement on Reddit and Solidity forum.
- [ ] Update the release information section on [soliditylang.org](https://github.com/ethereum/solidity-portal).
- [ ] Lean back, wait for bug reports and repeat from step 1 :)
- [ ] Update the release information section [in the source of soliditylang.org](https://github.com/ethereum/solidity-website/blob/main/src/pages/index.tsx).
- [ ] Announce on [Twitter](https://twitter.com/solidity_lang), including links to the release and the blog post.
- [ ] Announce on [Fosstodon](https://fosstodon.org/@solidity/), including links to the release and the blog post.
- [ ] Share the announcement on Reddit in [``/r/ethdev``](https://reddit.com/r/ethdev/), cross-posted to [``/r/ethereum``](https://reddit.com/r/ethereum/).
- [ ] Share the announcement on the [Solidity forum](https://forum.soliditylang.org) in the ``Announcements`` category.
- [ ] Share the announcement on [Project Updates](https://discord.com/channels/420394352083337236/798974456704925696)
- [ ] Share the announcement on [`#solidity` channel on Matrix](https://matrix.to/#/#ethereum_solidity:gitter.im)
- [ ] Share the announcement on [`#solc-tooling`](https://matrix.to/#/#solc-tooling:matrix.org)
- [ ] Lean back, wait for bug reports and repeat from step 1 :).

200
ReviewChecklist.md Normal file
View File

@ -0,0 +1,200 @@
# PR Review Checklist
The Solidity compiler is a critical piece of infrastructure in the Ethereum ecosystem.
For this reason, our review process is quite strict and all PRs have to fulfill certain quality
expectations and guidelines.
The list below is meant to reduce the workload on the core team by helping contributors self-identify
and solve common issues before they are pointed out in the review.
It is also meant to serve as a final checklist for reviewers to go through before approving a PR.
## Before You Submit a PR
- [ ] **Do you have any other open PRs?**
Work on a PR is not done until it is merged or closed.
Our reviewing capacity is limited, so we require that external contributors work on **no more than one PR at a time**.
- If your PR is not getting reviewed, feel free to bring it to our attention on the [#solidity-dev](https://gitter.im/ethereum/solidity-dev) channel.
- Unless they were requested, we are going to close any excess PRs, leaving only the earliest one open.
You may reopen them, one at a time, when your current PR is done.
- [ ] **Is the issue ready to be worked on?**
- If the issue does not have a desirability label (`nice to have`, `should have`,
`must have eventually`, `must have`, `roadmap`) we have not yet decided whether to implement it.
- If the issue has the `needs design` label, we have not yet decided how it should be implemented.
- `good first issue candidate` means that the issue will potentially be a `good first issue`
eventually but at the moment it is not yet ready to be worked on.
- [ ] **Is this a breaking change?** Breaking changes should be based on the `breaking` branch rather than on the `develop` branch.
- [ ] **Does the PR actually address the issue?**
- [ ] Mention the issue number in the PR description.
If the PR solves it completely, use the `Fixes #<issue number>` form so that Github will close the issue automatically.
- [ ] Do not include the issue number in the PR title, branch name or commit description.
- [ ] When submitting a PR from a fork **create a branch and give it a descriptive name.**
E.g. `fix-array-abi-encoding-bug`.
Do not submit PRs directly from the `develop` branch of your fork since it makes rebasing and fetching new changes harder.
- [ ] **Does the PR depend on other PRs?**
- [ ] If the PR has dependencies, mention them in bold in the description.
- [ ] Avoid basing PRs from forks on branches other than `develop` or `breaking` because
GitHub closes them when the base branch gets merged.
Do this only for PRs created directly in the main repo.
- [ ] **Does the PR update test expectations to match the modified code?** If not, your PR will not pass some of the `_soltest_`, jobs in CI.
In many cases the expectations can be updated automatically:
- `cmdlineTests.sh --update` for command-line tests.
- `isoltest --enforce-gas-cost --accept-updates` for soltest-based tests.
- If your PR affects gas costs, an extra run of `isoltest --enforce-gas-cost --optimize --accept-updates` is needed to update gas expectations with optimizer enabled.
- Review updated files before committing them.
**Are expectations correct and do updated tests still serve their purpose?**
## Abandoned PRs
- [ ] **Is the submitter still responsive?**
- If the PR had no activity from the submitter in the last 2 weeks (despite receiving reviews and our prompts) we consider it abandoned.
- [ ] **Is the abandoned PR easy to finish or relevant?**
- Apply the `takeover` label if the PR can be finished without significant effort or is something that actually needs to be done right now.
Otherwise close it.
It can still be taken over later or reopened by the submitter but until then we should not be getting sidetracked by it.
## Light Review
Before an in-depth review, it is recommended to give new PRs a quick, superficial review, which
is not meant to provide complete and detailed feedback, but instead give the submitter a rough idea
if the PR is even on the right track and let them solve the obvious problems on their own.
Light review should focus on the following three areas:
- [ ] **Are there any obvious mistakes?** Style issues, bad practices, easy to identify bugs, etc.
- [ ] **Is there anything missing?** Tests (of the right kind), documentation, etc. Does it address the whole issue?
- [ ] **Is it the right solution?** Are there better ways to do this? Is the change even necessary?
If the answers above are "Yes, Yes, No", thank the contributor for their effort and **close the PR**.
## Coding Style and Good Practices
- [ ] Does the PR follow our [coding style](CODING_STYLE.md)?
### Reliability
- [ ] **Use assertions liberally.** If you are certain your assumption will not be broken, prove it with `solAssert()`.
- [ ] **Validate inputs and handle errors**. Note that assertions are **not** validation.
### Readability
- [ ] **Choose good names.**
- [ ] Is the name straightforward to understand?
Do you feel the need to jump back to the definition and remind yourself what it was whenever you see it?
- [ ] Is the name unambiguous in the context where it is used?
- [ ] Avoid abbreviations.
- [ ] **Source files, classes and public functions should have docstrings.**
- [ ] **Avoid code duplication.** But not fanatically. Minimal amounts of duplication are acceptable if it aids readability.
- [ ] **Do not leave dead or commented-out code behind.** You can still see old code in history.
If you really have a good reason to do it, always leave a comment explaining what it is and why it is there.
- [ ] **Mark hacks as such.** If you have to leave behind a temporary workaround, make
sure to include a comment that explains why and in what circumstances it can be removed.
Preferably link to an issue you reported upstream.
- [ ] **Avoid obvious comments.**
- [ ] **Do include comments when the reader may need extra context to understand the code.**
### Commits and PRs
- [ ] **Avoid hiding functional changes inside refactors.**
E.g. when fixing a small bug, or changing user-visible behavior, put the change in a separate commit.
Do not mix it with another change that renames things or reformats the code around, making the fix itself hard to identify.
- [ ] **Whenever possible, split off refactors or unrelated changes into separate PRs.**
Smaller PRs are easier and quicker to review.
Splitting off refactors helps focus on the main point of the PR.
### Common Pitfalls
The following points are all covered by the coding style but come up so often that it is worth singling them out here:
- [ ] **Always initialize value types in the definition,** even if you are sure you will assign them later.
- [ ] **Use "east const" style.** I.e. `T const*`, not `const T *`.
- [ ] **Keep indentation consistent.** See our [`.editorconfig`](.editorconfig).
- [ ] Tabs for C++. But use them for indentation only. Any whitespace later on the line must consist of spaces.
- [ ] 4 spaces for most other file types.
- [ ] **Use `auto` sparingly.** Only use it when the actual type is very long and complicated or when it is
already used elsewhere in the same expression.
- [ ] **Indent braces and parentheses in a way that makes nesting clear.**
- [ ] **Use `using namespace` only in `.cpp` files.** Use it for `std` and our own modules.
Avoid unnecessary `std::` prefix in `.cpp` files (except for `std::move` and `std::forward`).
- [ ] **Use range-based loops and destructuring.**
- [ ] **Include any headers you use directly,** even if they are implicitly included through other headers.
## Documentation
- [ ] **Does the PR update relevant documentation?**
### Documentation Style and Good Practices
- [ ] **Use double backticks in RST (``` ``x`` ```). Prefer single backticks in Markdown (`` `x` ``),**
but note that double backticks are valid too and we use them in some cases for legacy reasons.
- [ ] **Always start a new sentence on a new line.**
This way you do not have to rewrap the surrounding text when you rewrite the sentence.
This also makes changes actually easier to spot in the diff.
## Testing
### What to Test
- [ ] **Is newly added code adequately covered by tests?** Have you considered all the important corner cases?
- If it is a bugfix:
- [ ] **The PR must include tests that reproduce the bug.**
- [ ] **Are there gaps in test coverage of the buggy feature?** Fill them by adding more tests.
- [ ] **Try to break it.** Can you of any similar features that could also be buggy?
Play with the repro and include prominent variants as separate test cases, even if they don't trigger a bug.
- [ ] **Positive cases (code that compiles) should have a semantic test.**
- [ ] **Negative cases (code with compilation errors) should have a syntax test.**
- [ ] **Avoid mixing positive and negative cases in the same syntax test.**
If the test produces an error, we stop at the analysis stage and we will not detect
problems that only occur in code generation, optimizer or assembler.
- [ ] If you have to do it, at least mark positive cases inside the file with a short comment.
- This way, when the test is updated, it is easier to verify that these cases still do not trigger an error.
- [ ] New syntax: **does it have an [`ASTJSON`](test/libsolidity/ASTJSON/) test?**
- [ ] New CLI or StandardJSON option:
- [ ] **Does it have a [command-line test](test/cmdlineTests/)?**
- [ ] **Is the option listed for every input mode in [`CommandLineParser` tests](test/solc/CommandLineParser.cpp)?**
- [ ] **Did you consider interactions with other language features?**
- [ ] Are all types covered? Structs? Enums? Contracts/libraries/interfaces? User-defined value types?
Value types: integers, fixed bytes, `address`, `address payable`, `bool`? Function pointers?
Static and dynamic arrays? `string` and `bytes`? Mappings?
Values of types that cannot be named: literals, tuples, array slices, storage references?
- [ ] If it accepts a function, does it also accept an event or an error? These have function types but are not functions.
- [ ] If it affects free functions, what about internal library functions?
- [ ] Attached library functions? Functions attached with `using for`?
- [ ] Possible combinations of `storage`, `memory`, `calldata`, `immutable`, `constant`?
Remember that internal functions can take `storage` arguments.
- [ ] Does it work at construction time as well? What if you store it at construction time and read after deployment?
- [ ] What about importing it from a different module or inheriting it?
- [ ] Have you tested it with the ternary operator?
### Test Style and Good Practices
- [ ] **Make test case file names long and specific enough** so that it is easy to guess what is inside.
When checking if we have the case already covered the name is usually the only clue we see.
- [ ] Place them in the right subdirectory.
- [ ] **Avoid simply appending numbers to the name to distinguish similar cases.**
Coming up with good names is hard but figuring out if any of hundreds of tests with names that
match your search actually fits your case is even harder.
- [ ] **Do not include version pragma and the SPDX comment in semantic and syntax test cases**.
In other test types include them if necessary to suppress warnings.
- [ ] **If you have to use a version pragma, avoid hard-coding version.** Use `pragma solidity *`.
- [ ] **When writing StandardJSON command-line tests, use `urls` instead of `content`** and put
the Solidity or Yul code in a separate file.
## Compiler-specific
- [ ] **Are error messages sensible and understandable to users?**
- [ ] **Are error codes consistent?**
- [ ] Avoid randomly changing or reassigning error codes.
- [ ] Avoid defining separate codes for trivial variants of the same issue.
Make it easy for tools to consistently refer to the same error with the same code.
- [ ] **Error messages should end with a full stop.**
- [ ] **Prefer Ranges v3 to Boost where possible.**
## Take a Step Back
- [ ] **Do you fully understand what the PR does and why?**
- [ ] **Are you confident that the code works and does not break unrelated functionality?**
- [ ] **Is this a reasonable way to achieve the goal stated in the issue?**
- [ ] **Is the code simple?** Does the PR achieve its objective at the cost of significant
complexity that may be a source of future bugs?
- [ ] **Is the code efficient?** Does the PR introduce any major performance bottlenecks?
- [ ] **Does the PR introduce any breaking changes beyond what was agreed in the issue?**
## Final Checks Before Merging
- [ ] **Is the PR rebased on top of the `develop` branch** (or `breaking` if it is a breaking change)?
- [ ] **Did all CI checks pass?**
- Note that we have a few jobs that tend to randomly fail due to outside factors, especially external tests (with `_ext_` in the name).
If these fail, rebase on latest `develop` (or `breaking`) and try rerunning them.
Note also that not all of these checks are required for the PR to be merged.
- [ ] If the change is visible to users, **does the PR have a [changelog](Changelog.md) entry?**
- [ ] Is the changelog entry in the right section?
Make sure to move it up if there was a release recently.
- [ ] **Is commit history simple and understandable?**
- [ ] Each commit should be a self-contained, logical step leading the goal of the PR, without going back and forth.
In particular, review fixups should be squashed into the commits they fix.
- [ ] Do not include any merge commits in your branch. Please use rebase to keep up to date with the base branch.
- [ ] **Is the PR properly labeled?**
- Use `external contribution` label to mark PRs not coming from the core team.
- If the PR depends on other PRs, use `has dependencies` and set the base branch accordingly.
- Labels like `documentation` or `optimizer` are helpful for filtering PRs.

View File

@ -23,47 +23,63 @@ if(NOT EMSCRIPTEN)
endif()
endif()
eth_add_cxx_compiler_flag_if_supported(-Wimplicit-fallthrough)
if(PEDANTIC)
eth_add_cxx_compiler_flag_if_supported(-Wimplicit-fallthrough)
endif()
# Prevent the path of the source directory from ending up in the binary via __FILE__ macros.
eth_add_cxx_compiler_flag_if_supported("-fmacro-prefix-map=${CMAKE_SOURCE_DIR}=/solidity")
eth_add_cxx_compiler_flag_if_supported("-fmacro-prefix-map=${PROJECT_SOURCE_DIR}=/solidity")
# -Wpessimizing-move warns when a call to std::move would prevent copy elision
# if the argument was not wrapped in a call. This happens when moving a local
# variable in a return statement when the variable is the same type as the
# return type or using a move to create a new object from a temporary object.
eth_add_cxx_compiler_flag_if_supported(-Wpessimizing-move)
if(PEDANTIC)
eth_add_cxx_compiler_flag_if_supported(-Wpessimizing-move)
endif()
# -Wredundant-move warns when an implicit move would already be made, so the
# std::move call is not needed, such as when moving a local variable in a return
# that is different from the return type.
eth_add_cxx_compiler_flag_if_supported(-Wredundant-move)
if(PEDANTIC)
eth_add_cxx_compiler_flag_if_supported(-Wredundant-move)
endif()
if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang"))
# Enables all the warnings about constructions that some users consider questionable,
# and that are easy to avoid. Also enable some extra warning flags that are not
# enabled by -Wall. Finally, treat at warnings-as-errors, which forces developers
# to fix warnings as they arise, so they don't accumulate "to be fixed later".
add_compile_options(-Wall)
add_compile_options(-Wextra)
add_compile_options(-Werror)
add_compile_options(-pedantic)
add_compile_options(-Wmissing-declarations)
add_compile_options(-Wno-unknown-pragmas)
add_compile_options(-Wimplicit-fallthrough)
add_compile_options(-Wsign-conversion)
add_compile_options(-Wconversion)
if(PEDANTIC)
add_compile_options(-Wall)
add_compile_options(-Wextra)
add_compile_options(-Werror)
add_compile_options(-pedantic)
add_compile_options(-Wmissing-declarations)
add_compile_options(-Wno-unknown-pragmas)
add_compile_options(-Wimplicit-fallthrough)
add_compile_options(-Wsign-conversion)
add_compile_options(-Wconversion)
eth_add_cxx_compiler_flag_if_supported(
$<$<COMPILE_LANGUAGE:CXX>:-Wextra-semi>
)
eth_add_cxx_compiler_flag_if_supported(-Wfinal-dtor-non-final-class)
eth_add_cxx_compiler_flag_if_supported(-Wnewline-eof)
eth_add_cxx_compiler_flag_if_supported(-Wsuggest-destructor-override)
eth_add_cxx_compiler_flag_if_supported(-Wduplicated-cond)
eth_add_cxx_compiler_flag_if_supported(-Wduplicate-enum)
eth_add_cxx_compiler_flag_if_supported(-Wlogical-op)
eth_add_cxx_compiler_flag_if_supported(-Wno-unknown-attributes)
check_cxx_compiler_flag(-Wextra-semi WEXTRA_SEMI)
if(WEXTRA_SEMI)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wextra-semi>)
endif()
# See https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=6b927b1297e66e26e62e722bf15c921dcbbd25b9
check_cxx_compiler_flag(-Wno-dangling-reference WNO_DANGLING_REFERENCE)
if (WNO_DANGLING_REFERENCE)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wno-dangling-reference>)
endif()
eth_add_cxx_compiler_flag_if_supported(-Wfinal-dtor-non-final-class)
eth_add_cxx_compiler_flag_if_supported(-Wnewline-eof)
eth_add_cxx_compiler_flag_if_supported(-Wsuggest-destructor-override)
eth_add_cxx_compiler_flag_if_supported(-Wduplicated-cond)
eth_add_cxx_compiler_flag_if_supported(-Wduplicate-enum)
eth_add_cxx_compiler_flag_if_supported(-Wlogical-op)
eth_add_cxx_compiler_flag_if_supported(-Wno-unknown-attributes)
endif()
# Configuration-specific compiler settings.
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3 -DETH_DEBUG")
@ -157,7 +173,9 @@ elseif (DEFINED MSVC)
add_compile_options(/MP) # enable parallel compilation
add_compile_options(/EHsc) # specify Exception Handling Model in msvc
add_compile_options(/WX) # enable warnings-as-errors
if(PEDANTIC)
add_compile_options(/WX) # enable warnings-as-errors
endif()
add_compile_options(/wd4068) # disable unknown pragma warning (4068)
add_compile_options(/wd4996) # disable unsafe function warning (4996)
add_compile_options(/wd4503) # disable decorated name length exceeded, name was truncated (4503)

View File

@ -20,4 +20,16 @@ macro (eth_policy)
# Allow selecting MSVC runtime library using CMAKE_MSVC_RUNTIME_LIBRARY.
cmake_policy(SET CMP0091 NEW)
endif()
# Avoid warning about DOWNLOAD_EXTRACT_TIMESTAMP in CMake 3.24:
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
cmake_policy(SET CMP0135 NEW)
endif()
if(POLICY CMP0115)
# Require explicit extensions for source files, do not guess.
# The extra calls to GetFileAttributesW significantly slow down cmake on Windows.
# https://gitlab.kitware.com/cmake/cmake/-/issues/23154
cmake_policy(SET CMP0115 NEW)
endif()
endmacro()

View File

@ -48,3 +48,11 @@ function(detect_stray_source_files FILELIST DIRECTORY)
message(SEND_ERROR "The following source files are present but are not compiled: ${sources}")
endif()
endfunction(detect_stray_source_files)
# CreateExportedFunctionsForEMSDK(OUTPUT_VARIABLE Symbol1 Symbol2 ... SymbolN)
function(CreateExportedFunctionsForEMSDK OUTPUT_VARIABLE)
list(TRANSFORM ARGN PREPEND "\"_")
list(TRANSFORM ARGN APPEND "\"")
list(JOIN ARGN "," ARGN)
set(${OUTPUT_VARIABLE} "[${ARGN}]" PARENT_SCOPE)
endfunction()

View File

@ -2,11 +2,11 @@ include(FetchContent)
FetchContent_Declare(
fmtlib
PREFIX "${CMAKE_BINARY_DIR}/deps"
DOWNLOAD_DIR "${CMAKE_SOURCE_DIR}/deps/downloads"
DOWNLOAD_NAME fmt-8.0.1.tar.gz
URL https://github.com/fmtlib/fmt/archive/8.0.1.tar.gz
URL_HASH SHA256=b06ca3130158c625848f3fb7418f235155a4d389b2abc3a6245fb01cb0eb1e01
PREFIX "${PROJECT_BINARY_DIR}/deps"
DOWNLOAD_DIR "${PROJECT_SOURCE_DIR}/deps/downloads"
DOWNLOAD_NAME fmt-9.1.0.tar.gz
URL https://github.com/fmtlib/fmt/archive/9.1.0.tar.gz
URL_HASH SHA256=5dea48d1fcddc3ec571ce2058e13910a0d4a6bab4cc09a809d8b1dd1c88ae6f2
)
if (CMAKE_VERSION VERSION_LESS "3.14.0")

View File

@ -6,7 +6,7 @@ else()
set(JSONCPP_CMAKE_COMMAND ${CMAKE_COMMAND})
endif()
set(prefix "${CMAKE_BINARY_DIR}/deps")
set(prefix "${PROJECT_BINARY_DIR}/deps")
set(JSONCPP_LIBRARY "${prefix}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}jsoncpp${CMAKE_STATIC_LIBRARY_SUFFIX}")
set(JSONCPP_INCLUDE_DIR "${prefix}/include")
@ -42,7 +42,7 @@ endif()
ExternalProject_Add(jsoncpp-project
PREFIX "${prefix}"
DOWNLOAD_DIR "${CMAKE_SOURCE_DIR}/deps/downloads"
DOWNLOAD_DIR "${PROJECT_SOURCE_DIR}/deps/downloads"
DOWNLOAD_NAME jsoncpp-1.9.3.tar.gz
URL https://github.com/open-source-parsers/jsoncpp/archive/1.9.3.tar.gz
URL_HASH SHA256=8593c1d69e703563d94d8c12244e2e18893eeb9a8a9f8aa3d09a327aa45c8f7d

View File

@ -6,15 +6,15 @@ else()
set(RANGE_V3_CMAKE_COMMAND ${CMAKE_COMMAND})
endif()
set(prefix "${CMAKE_BINARY_DIR}/deps")
set(prefix "${PROJECT_BINARY_DIR}/deps")
set(RANGE_V3_INCLUDE_DIR "${prefix}/include")
ExternalProject_Add(range-v3-project
PREFIX "${prefix}"
DOWNLOAD_DIR "${CMAKE_SOURCE_DIR}/deps/downloads"
DOWNLOAD_NAME range-v3-0.11.0.tar.gz
URL https://github.com/ericniebler/range-v3/archive/0.11.0.tar.gz
URL_HASH SHA256=376376615dbba43d3bef75aa590931431ecb49eb36d07bb726a19f680c75e20c
DOWNLOAD_DIR "${PROJECT_SOURCE_DIR}/deps/downloads"
DOWNLOAD_NAME range-v3-0.12.0.tar.gz
URL https://github.com/ericniebler/range-v3/archive/0.12.0.tar.gz
URL_HASH SHA256=015adb2300a98edfceaf0725beec3337f542af4915cec4d0b89fa0886f4ba9cb
CMAKE_COMMAND ${RANGE_V3_CMAKE_COMMAND}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}

View File

@ -1,13 +0,0 @@
// The generation of this file is defined in libyul/CMakeLists.txt.
// This file was generated by using the content of libyul/backends/wasm/polyfill/@EWASM_POLYFILL_NAME@.yul.
#pragma once
namespace solidity::yul::wasm::polyfill
{
static char const @EWASM_POLYFILL_NAME@[] = {
@EWASM_POLYFILL_CONTENT@, 0
};
} // namespace solidity::yul::wasm::polyfill

View File

@ -89,8 +89,8 @@ For most of the topics the compiler will provide suggestions.
* Explicit data location for all variables of struct, array or mapping types is
now mandatory. This is also applied to function parameters and return
variables. For example, change ``uint[] x = m_x`` to ``uint[] storage x =
m_x``, and ``function f(uint[][] x)`` to ``function f(uint[][] memory x)``
variables. For example, change ``uint[] x = z`` to ``uint[] storage x =
z``, and ``function f(uint[][] x)`` to ``function f(uint[][] memory x)``
where ``memory`` is the data location and might be replaced by ``storage`` or
``calldata`` accordingly. Note that ``external`` functions require
parameters with a data location of ``calldata``.
@ -137,7 +137,7 @@ For most of the topics the compiler will provide suggestions.
``payable`` or create a new internal function for the program logic that
uses ``msg.value``.
* For clarity reasons, the command line interface now requires ``-`` if the
* For clarity reasons, the command-line interface now requires ``-`` if the
standard input is used as source.
Deprecated Elements
@ -147,18 +147,18 @@ This section lists changes that deprecate prior features or syntax. Note that
many of these changes were already enabled in the experimental mode
``v0.5.0``.
Command Line and JSON Interfaces
Command-line and JSON Interfaces
--------------------------------
* The command line option ``--formal`` (used to generate Why3 output for
* The command-line option ``--formal`` (used to generate Why3 output for
further formal verification) was deprecated and is now removed. A new
formal verification module, the SMTChecker, is enabled via ``pragma
experimental SMTChecker;``.
* The command line option ``--julia`` was renamed to ``--yul`` due to the
* The command-line option ``--julia`` was renamed to ``--yul`` due to the
renaming of the intermediate language ``Julia`` to ``Yul``.
* The ``--clone-bin`` and ``--combined-json clone-bin`` command line options
* The ``--clone-bin`` and ``--combined-json clone-bin`` command-line options
were removed.
* Remappings with empty prefix are disallowed.
@ -483,7 +483,7 @@ New version:
return data;
}
using address_make_payable for address;
using AddressMakePayable for address;
// Data location for 'arr' must be specified
function g(uint[] memory /* arr */, bytes8 x, OtherContract otherContract, address unknownContract) public payable {
// 'otherContract.transfer' is not provided.
@ -500,7 +500,7 @@ New version:
// 'address payable' should be used whenever possible.
// To increase clarity, we suggest the use of a library for
// the conversion (provided after the contract in this example).
address payable addr = unknownContract.make_payable();
address payable addr = unknownContract.makePayable();
require(addr.send(1 ether));
// Since uint32 (4 bytes) is smaller than bytes8 (8 bytes),
@ -516,8 +516,8 @@ New version:
// We can define a library for explicitly converting ``address``
// to ``address payable`` as a workaround.
library address_make_payable {
function make_payable(address x) internal pure returns (address payable) {
library AddressMakePayable {
function makePayable(address x) internal pure returns (address payable) {
return address(uint160(x));
}
}

View File

@ -12,7 +12,7 @@ For the full list check
Changes the Compiler Might not Warn About
=========================================
This section lists changes where the behaviour of your code might
This section lists changes where the behavior of your code might
change without the compiler telling you about it.
* The resulting type of an exponentiation is the type of the base. It used to be the smallest type
@ -53,6 +53,8 @@ For most of the topics the compiler will provide suggestions.
If the name contains a dot, its prefix up to the dot may not conflict with any declaration outside the inline
assembly block.
* In inline assembly, opcodes that do not take arguments are now represented as "built-in functions" instead of standalone identifiers. So ``gas`` is now ``gas()``.
* State variable shadowing is now disallowed. A derived contract can only
declare a state variable ``x``, if there is no visible state variable with
the same name in any of its bases.
@ -103,23 +105,23 @@ Interface Changes
=================
This section lists changes that are unrelated to the language itself, but that have an effect on the interfaces of
the compiler. These may change the way how you use the compiler on the command line, how you use its programmable
the compiler. These may change the way how you use the compiler on the command-line, how you use its programmable
interface, or how you analyze the output produced by it.
New Error Reporter
~~~~~~~~~~~~~~~~~~
A new error reporter was introduced, which aims at producing more accessible error messages on the command line.
It is enabled by default, but passing ``--old-reporter`` falls back to the the deprecated old error reporter.
A new error reporter was introduced, which aims at producing more accessible error messages on the command-line.
It is enabled by default, but passing ``--old-reporter`` falls back to the deprecated old error reporter.
Metadata Hash Options
~~~~~~~~~~~~~~~~~~~~~
The compiler now appends the `IPFS <https://ipfs.io/>`_ hash of the metadata file to the end of the bytecode by default
(for details, see documentation on :doc:`contract metadata <metadata>`). Before 0.6.0, the compiler appended the
`Swarm <https://ethersphere.github.io/swarm-home/>`_ hash by default, and in order to still support this behaviour,
the new command line option ``--metadata-hash`` was introduced. It allows you to select the hash to be produced and
appended, by passing either ``ipfs`` or ``swarm`` as value to the ``--metadata-hash`` command line option.
`Swarm <https://ethersphere.github.io/swarm-home/>`_ hash by default, and in order to still support this behavior,
the new command-line option ``--metadata-hash`` was introduced. It allows you to select the hash to be produced and
appended, by passing either ``ipfs`` or ``swarm`` as value to the ``--metadata-hash`` command-line option.
Passing the value ``none`` completely removes the hash.
These changes can also be used via the :ref:`Standard JSON Interface<compiler-api>` and effect the metadata JSON generated by the compiler.
@ -174,3 +176,6 @@ This section gives detailed instructions on how to update prior code for every b
``override`` to every overriding function. For multiple inheritance, add ``override(A, B, ..)``,
where you list all contracts that define the overridden function in the parentheses. When
multiple bases define the same function, the inheriting contract must override all conflicting functions.
* In inline assembly, add ``()`` to all opcodes that do not otherwise accept an argument.
For example, change ``pc`` to ``pc()``, and ``gas`` to ``gas()``.

View File

@ -10,18 +10,18 @@ For the full list check
Silent Changes of the Semantics
===============================
This section lists changes where existing code changes its behaviour without
This section lists changes where existing code changes its behavior without
the compiler notifying you about it.
* Arithmetic operations revert on underflow and overflow. You can use ``unchecked { ... }`` to use
the previous wrapping behaviour.
the previous wrapping behavior.
Checks for overflow are very common, so we made them the default to increase readability of code,
even if it comes at a slight increase of gas costs.
* ABI coder v2 is activated by default.
You can choose to use the old behaviour using ``pragma abicoder v1;``.
You can choose to use the old behavior using ``pragma abicoder v1;``.
The pragma ``pragma experimental ABIEncoderV2;`` is still valid, but it is deprecated and has no effect.
If you want to be explicit, please use ``pragma abicoder v2;`` instead.
@ -57,7 +57,7 @@ New Restrictions
This section lists changes that might cause existing contracts to not compile anymore.
* There are new restrictions related to explicit conversions of literals. The previous behaviour in
* There are new restrictions related to explicit conversions of literals. The previous behavior in
the following cases was likely ambiguous:
1. Explicit conversions from negative literals and literals larger than ``type(uint160).max`` to
@ -106,7 +106,7 @@ This section lists changes that might cause existing contracts to not compile an
* The global functions ``log0``, ``log1``, ``log2``, ``log3`` and ``log4`` have been removed.
These are low-level functions that were largely unused. Their behaviour can be accessed from inline assembly.
These are low-level functions that were largely unused. Their behavior can be accessed from inline assembly.
* ``enum`` definitions cannot contain more than 256 members.
@ -173,4 +173,4 @@ How to update your code
- Change ``msg.sender.transfer(x)`` to ``payable(msg.sender).transfer(x)`` or use a stored variable of ``address payable`` type.
- Change ``x**y**z`` to ``(x**y)**z``.
- Use inline assembly as a replacement for ``log0``, ..., ``log4``.
- Negate unsigned integers by subtracting them from the maximum value of the type and adding 1 (e.g. ``type(uint256).max - x + 1``, while ensuring that `x` is not zero)
- Negate unsigned integers by subtracting them from the maximum value of the type and adding 1 (e.g. ``type(uint256).max - x + 1``, while ensuring that ``x`` is not zero)

View File

@ -34,7 +34,6 @@ help:
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@ -116,12 +115,6 @@ latexpdf:
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
latexpdfja:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through platex and dvipdfmx..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo

23
docs/README.md Normal file
View File

@ -0,0 +1,23 @@
# Solidity Language Docs
## Local environment setup
1. Install python https://www.python.org/downloads/
1. Install sphinx (the tool used to generate the docs) https://www.sphinx-doc.org/en/master/usage/installation.html
Go to `/docs` and run `./docs.sh` to install dependencies and build the project:
```sh
cd docs
./docs.sh
```
That will output the generated htmls under _build/
## Serve environment
```py
python3 -m http.server -d _build/html --cgi 8080
```
Visit dev server at http://localhost:8080

595
docs/_static/css/custom-dark.css vendored Normal file
View File

@ -0,0 +1,595 @@
/* DARK MODE STYLING */
/* code directives */
:root[style*=dark] .method dt,
:root[style*=dark] .class dt,
:root[style*=dark] .data dt,
:root[style*=dark] .attribute dt,
:root[style*=dark] .function dt,
:root[style*=dark] .classmethod dt,
:root[style*=dark] .exception dt,
:root[style*=dark] .descclassname,
:root[style*=dark] .descname {
background-color: #2d2d2d !important;
}
:root[style*=dark] .rst-content dl:not(.docutils) dt {
background-color: #0008;
border-top: solid 3px #fff2;
border-left: solid 3px #fff2;
}
:root[style*=dark] em.property {
color: #888888;
}
/* tables */
:root[style*=dark] .rst-content table.docutils td {
border: 0px;
}
:root[style*=dark] .rst-content table.docutils:not(.field-list) tr:nth-child(2n-1) td {
background-color: #0002;
}
:root[style*=dark] .rst-content pre {
background: none;
}
/* inlined code highlights */
:root[style*=dark] .xref,
:root[style*=dark] .py-meth {
color: #aaddff !important;
font-weight: normal !important;
}
/* highlight color search text */
:root[style*=dark] .rst-content .highlighted {
background: #ff5722;
box-shadow: 0 0 0 2px #f0978b;
}
/* notes, warnings, hints */
:root[style*=dark] .hint .admonition-title {
background: #2aa87c !important;
}
:root[style*=dark] .warning .admonition-title {
background: #cc4444 !important;
}
:root[style*=dark] .admonition-title {
background: #3a7ca8 !important;
}
:root[style*=dark] .admonition,
:root[style*=dark] .note {
background-color: #0008 !important;
}
/* table of contents */
:root[style*=dark] .sidebar {
background-color: #191919 !important;
}
:root[style*=dark] .sidebar-title {
background-color: #2b2b2b !important;
}
:root[style*=dark] .wy-menu-vertical code.docutils.literal.notranslate {
background: none !important;
border: none !important;
}
:root[style*=dark] .toc-backref {
color: grey !important;
}
:root[style*=dark] .highlight {
background: #0008;
color: #f8f8f2
}
:root[style*=dark] .highlight .c {
color: #888
}
/* Comment */
:root[style*=dark] .highlight .err {
color: #960050;
background-color: #1e0010
}
/* Error */
:root[style*=dark] .highlight .k {
color: #66d9ef
}
/* Keyword */
:root[style*=dark] .highlight .l {
color: #ae81ff
}
/* Literal */
:root[style*=dark] .highlight .n {
color: #f8f8f2
}
/* Name */
:root[style*=dark] .highlight .o {
color: #f92672
}
/* Operator */
:root[style*=dark] .highlight .p {
color: #f8f8f2
}
/* Punctuation */
:root[style*=dark] .highlight .ch {
color: #888
}
/* Comment.Hashbang */
:root[style*=dark] .highlight .cm {
color: #888
}
/* Comment.Multiline */
:root[style*=dark] .highlight .cp {
color: #888
}
/* Comment.Preproc */
:root[style*=dark] .highlight .cpf {
color: #888
}
/* Comment.PreprocFile */
:root[style*=dark] .highlight .c1 {
color: #888
}
/* Comment.Single */
:root[style*=dark] .highlight .cs {
color: #888
}
/* Comment.Special */
:root[style*=dark] .highlight .gd {
color: #f92672
}
/* Generic.Deleted */
:root[style*=dark] .highlight .ge {
font-style: italic
}
/* Generic.Emph */
:root[style*=dark] .highlight .gi {
color: #a6e22e
}
/* Generic.Inserted */
:root[style*=dark] .highlight .gs {
font-weight: bold
}
/* Generic.Strong */
:root[style*=dark] .highlight .gu {
color: #888
}
/* Generic.Subheading */
:root[style*=dark] .highlight .kc {
color: #66d9ef
}
/* Keyword.Constant */
:root[style*=dark] .highlight .kd {
color: #66d9ef
}
/* Keyword.Declaration */
:root[style*=dark] .highlight .kn {
color: #f92672
}
/* Keyword.Namespace */
:root[style*=dark] .highlight .kp {
color: #66d9ef
}
/* Keyword.Pseudo */
:root[style*=dark] .highlight .kr {
color: #66d9ef
}
/* Keyword.Reserved */
:root[style*=dark] .highlight .kt {
color: #66d9ef
}
/* Keyword.Type */
:root[style*=dark] .highlight .ld {
color: #e6db74
}
/* Literal.Date */
:root[style*=dark] .highlight .m {
color: #ae81ff
}
/* Literal.Number */
:root[style*=dark] .highlight .s {
color: #e6db74
}
/* Literal.String */
:root[style*=dark] .highlight .na {
color: #a6e22e
}
/* Name.Attribute */
:root[style*=dark] .highlight .nb {
color: #f8f8f2
}
/* Name.Builtin */
:root[style*=dark] .highlight .nc {
color: #a6e22e
}
/* Name.Class */
:root[style*=dark] .highlight .no {
color: #66d9ef
}
/* Name.Constant */
:root[style*=dark] .highlight .nd {
color: #a6e22e
}
/* Name.Decorator */
:root[style*=dark] .highlight .ni {
color: #f8f8f2
}
/* Name.Entity */
:root[style*=dark] .highlight .ne {
color: #a6e22e
}
/* Name.Exception */
:root[style*=dark] .highlight .nf {
color: #a6e22e
}
/* Name.Function */
:root[style*=dark] .highlight .nl {
color: #f8f8f2
}
/* Name.Label */
:root[style*=dark] .highlight .nn {
color: #f8f8f2
}
/* Name.Namespace */
:root[style*=dark] .highlight .nx {
color: #a6e22e
}
/* Name.Other */
:root[style*=dark] .highlight .py {
color: #f8f8f2
}
/* Name.Property */
:root[style*=dark] .highlight .nt {
color: #f92672
}
/* Name.Tag */
:root[style*=dark] .highlight .nv {
color: #f8f8f2
}
/* Name.Variable */
:root[style*=dark] .highlight .ow {
color: #f92672
}
/* Operator.Word */
:root[style*=dark] .highlight .w {
color: #f8f8f2
}
/* Text.Whitespace */
:root[style*=dark] .highlight .mb {
color: #ae81ff
}
/* Literal.Number.Bin */
:root[style*=dark] .highlight .mf {
color: #ae81ff
}
/* Literal.Number.Float */
:root[style*=dark] .highlight .mh {
color: #ae81ff
}
/* Literal.Number.Hex */
:root[style*=dark] .highlight .mi {
color: #ae81ff
}
/* Literal.Number.Integer */
:root[style*=dark] .highlight .mo {
color: #ae81ff
}
/* Literal.Number.Oct */
:root[style*=dark] .highlight .sa {
color: #e6db74
}
/* Literal.String.Affix */
:root[style*=dark] .highlight .sb {
color: #e6db74
}
/* Literal.String.Backtick */
:root[style*=dark] .highlight .sc {
color: #e6db74
}
/* Literal.String.Char */
:root[style*=dark] .highlight .dl {
color: #e6db74
}
/* Literal.String.Delimiter */
:root[style*=dark] .highlight .sd {
color: #e6db74
}
/* Literal.String.Doc */
:root[style*=dark] .highlight .s2 {
color: #e6db74
}
/* Literal.String.Double */
:root[style*=dark] .highlight .se {
color: #ae81ff
}
/* Literal.String.Escape */
:root[style*=dark] .highlight .sh {
color: #e6db74
}
/* Literal.String.Heredoc */
:root[style*=dark] .highlight .si {
color: #e6db74
}
/* Literal.String.Interpol */
:root[style*=dark] .highlight .sx {
color: #e6db74
}
/* Literal.String.Other */
:root[style*=dark] .highlight .sr {
color: #e6db74
}
/* Literal.String.Regex */
:root[style*=dark] .highlight .s1 {
color: #e6db74
}
/* Literal.String.Single */
:root[style*=dark] .highlight .ss {
color: #e6db74
}
/* Literal.String.Symbol */
:root[style*=dark] .highlight .bp {
color: #f8f8f2
}
/* Name.Builtin.Pseudo */
:root[style*=dark] .highlight .fm {
color: #a6e22e
}
/* Name.Function.Magic */
:root[style*=dark] .highlight .vc {
color: #f8f8f2
}
/* Name.Variable.Class */
:root[style*=dark] .highlight .vg {
color: #f8f8f2
}
/* Name.Variable.Global */
:root[style*=dark] .highlight .vi {
color: #f8f8f2
}
/* Name.Variable.Instance */
:root[style*=dark] .highlight .vm {
color: #f8f8f2
}
/* Name.Variable.Magic */
:root[style*=dark] .highlight .il {
color: #ae81ff
}
/* Grammar */
:root[style*=dark] .railroad-diagram {
fill: white;
}
:root[style*=dark] .railroad-diagram path {
stroke: white;
}
:root[style*=dark] .railroad-diagram rect {
stroke: white;
}
:root[style*=dark] .a4 .sig-name {
background-color: transparent !important;
}

View File

@ -1,23 +1,185 @@
pre {
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word;
/* ROOT DECLARATIONS */
:root {
/* Text */
--color-a: #2B247C;
--color-b: #672AC8;
--color-c: #5554D9;
--color-d: #9F94E8;
--color-e: #AEC0F1;
--color-f: #E6E3EC;
/* Background */
--white: #FAF8FF;
--black: #110C4E;
--menu-bg: #2B247C06;
--shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
--navHeight: 4.5rem;
--sideWidth: 300px;
--maxWidth: 80rem;
--desktopInlinePadding: 2rem;
--mobileInlinePadding: 1rem;
--currentVersionHeight: 45px;
text-rendering: geometricPrecision;
-webkit-font-smoothing: antialiased;
}
.wy-table-responsive table td, .wy-table-responsive table th {
a,
button {
border-radius: 0;
}
:root[style*=dark] {
--color-a: #E6E3EC !important;
--color-b: #AEC0F1 !important;
--color-c: #9F94E8 !important;
--color-d: #5554D9 !important;
--color-e: #672AC8 !important;
--color-f: #2B247C !important;
--white: #110C4E !important;
--black: #FAF8FF !important;
--menu-bg: #E6E3EC06 !important;
}
html,
body,
.unified-header::before,
.wy-nav-side,
.rst-versions,
code,
div,
input[type=text],
a,
.wy-grid-for-nav {
transition: background 150ms ease-in-out;
}
html,
body,
.wy-grid-for-nav {
background-color: var(--color-f) !important;
}
body {
font-family: "Overpass", sans-serif;
}
a {
color: var(--color-c);
}
a, section {
scroll-margin-top: calc(var(--navHeight) + 2rem);
}
hr {
margin-block: 2rem;
border-color: var(--color-d) !important;
}
/* HEADER STYLES */
h1 {
font-family: 'Overpass', sans-serif;
font-weight: 700;
font-size: 44px;
color: var(--color-a) !important;
line-height: 1.1;
text-wrap: balance;
margin-top: 4rem;
margin-bottom: 1.5rem;
}
section:first-of-type h1:first-of-type {
font-family: 'Overpass mono', monospace;
font-size: 48px;
margin-top: 3rem;
margin-bottom: 5rem;
}
h2 {
font-family: 'Overpass', sans-serif;
font-weight: 700;
font-size: 38px;
color: var(--color-a) !important;
line-height: 46px;
text-wrap: balance;
margin-top: 4rem;
margin-bottom: 1.5rem;
}
*:not([role=navigation])>p[role=heading]>span,
h3 {
font-family: 'Overpass', sans-serif;
font-weight: 700;
font-size: 32px;
color: var(--color-a) !important;
line-height: 46px;
text-wrap: balance;
margin-top: 4rem;
margin-bottom: 1.5rem;
}
h4 {
font-family: 'Overpass', sans-serif;
font-weight: 700;
font-size: 32px;
color: var(--color-a) !important;
line-height: 46px;
text-wrap: balance;
margin-top: 3rem;
margin-bottom: 1.5rem;
}
h5 {
font-family: 'Overpass', sans-serif;
font-weight: 700;
font-size: 18px;
color: var(--color-a) !important;
line-height: 1.4;
text-wrap: balance;
}
h6 {
font-family: 'Overpass', sans-serif;
font-weight: 700;
font-size: 16px;
color: var(--color-a) !important;
line-height: 1.4;
text-wrap: balance;
}
span.pre,
pre {
/* css-3 */
white-space: pre-wrap;
/* Mozilla, since 1999 */
white-space: -moz-pre-wrap;
/* Opera 4-6 */
white-space: -pre-wrap;
/* Opera 7 */
white-space: -o-pre-wrap;
word-wrap: break-word;
font-family: 'Overpass Mono', monospace;
}
small,
small * {
font-size: 12px;
}
.wy-table-responsive table td,
.wy-table-responsive table th {
white-space: normal;
}
.rst-content table.docutils td {
vertical-align: top;
}
/* links */
.rst-content a:not(:visited) {
color: #002fa7;
}
.rst-content .highlighted {
background: #eac545;
}
@ -27,60 +189,638 @@ pre {
background: #fafafa;
}
.wy-side-nav-search img.logo {
width: 100px !important;
padding: 0;
}
.wy-side-nav-search > a {
padding: 0;
margin: 0;
}
/* project version (displayed under project logo) */
.wy-side-nav-search .version {
color: #272525 !important;
}
/* menu section headers */
.wy-menu .caption {
color: #65afff !important;
.wy-side-nav-search>div.version {
color: var(--color-b);
margin-top: 0;
margin-bottom: 0.5rem;
text-align: start;
}
/* Link to Remix IDE shown next to code snippets */
p.remix-link-container {
position: relative;
right: -100%; /* Positioned next to the the top-right corner of the code block following it. */
}
a.remix-link {
position: absolute; /* Remove it from normal flow not to affect the original position of the snippet. */
top: 0.5em;
width: 3.236em; /* Size of the margin (= right-side padding in .wy-nav-content in the current theme). */
}
a.remix-link .link-icon {
background: url("../img/solid-share-arrow.svg") no-repeat;
.rst-content p.remix-link-container {
display: block;
width: 1.5em;
height: 1.5em;
margin: auto;
text-align: right;
margin: 0;
line-height: 1em;
}
a.remix-link .link-text {
display: none; /* Visible only on hover. */
width: 3.3em; /* Narrow enough to get two lines of text. */
margin: auto;
text-align: center;
font-size: 0.8em;
line-height: normal;
color: black;
.rst-content .remix-link-container a.remix-link {
font-size: 0.7em;
padding: 0.1em 0.5em;
background: transparent;
color: var(--color-a) !important;
border: 1px solid var(--color-a);
text-decoration: none;
}
a.remix-link:hover {
.rst-content div.highlight-solidity,
.rst-content div.highlight-yul {
margin-top: 0;
}
/* CUSTOMIZATION UPDATES */
.wy-nav-content-wrap,
.wy-nav-content {
background: transparent !important;
}
.wy-side-nav-search {
background-color: transparent !important;
color: var(--color-a) !important;
box-shadow: 0 4 4 0 var(--color-a);
border-bottom: 1px solid var(--color-d) !important;
}
.wy-side-nav-search svg {
color: var(--color-a) !important;
}
.wy-nav-top {
background-color: transparent !important;
color: var(--color-a) !important;
}
.wy-nav-top a {
color: var(--color-a) !important;
}
.wy-breadcrumbs a.icon-home:before {
content: "Documentation";
font-family: "Overpass", sans-serif;
}
.rst-content table.docutils thead {
color: var(--color-a);
}
code.docutils.literal.notranslate {
padding: 2px 4px;
font-size: 0.875em;
font-family: "Overpass Mono", monospace;
background: var(--white);
color: var(--color-c);
border: 0px;
}
dt code.docutils.literal.notranslate {
background: none;
}
.wy-nav-content {
color: var(--color-a);
}
/* .rst-content a:not(:visited) { */
/* color: var(--color-b) !important; */
/* } */
.rst-content a:visited {
color: var(--color-c) !important;
}
.rst-content a {
text-decoration: underline;
}
.rst-content a:where(:focus, :focus-visible, :hover) {
color: var(--color-d) !important;
}
.wy-side-scroll a {
color: var(--color-a);
background: transparent;
font-size: 1rem;
line-height: 125%;
}
.wy-menu-vertical li.current a,
.wy-menu-vertical li.current li a,
.wy-menu-vertical li.current li a code {
border: none;
color: var(--color-a);
}
ul.current ul,
.wy-menu-vertical li.current a:hover,
.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a,
.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a,
.wy-menu-vertical li.toctree-l4.current li.toctree-l5>a,
.wy-menu-vertical li.toctree-l5.current li.toctree-l6>a,
.wy-menu-vertical li.current {
background: var(--menu-bg) !important;
}
.wy-menu.wy-menu-vertical>ul {
margin-bottom: 3rem;
}
.wy-menu.wy-menu-vertical>p {
color: var(--color-c);
}
.wy-menu-vertical li.on a,
.wy-menu-vertical li.current>a {
background: var(--menu-bg) !important;
border-bottom: 0px !important;
border-top: 0px !important;
}
.btn {
border-radius: 0;
text-decoration: none !important;
}
.wy-breadcrumbs-aside a,
.wy-breadcrumbs-aside a:visited,
a.fa.fa-github,
a.fa.fa-github:visited,
a.fa.fa-github:not(:visited),
a.btn.btn-neutral:visited,
a.btn.btn-neutral:not(:visited),
a.btn.btn-neutral {
background: transparent !important;
color: var(--color-a) !important;
border: 2px solid var(--color-a) !important;
text-decoration: none;
}
.rst-content .remix-link-container a.remix-link:hover,
.wy-breadcrumbs-aside a:hover,
a.fa.fa-github:hover,
a.btn.btn-neutral:hover {
background: var(--white) !important;
color: var(--color-b) !important;
border-color: var(--color-b) !important;
}
footer .rst-footer-buttons {
display: flex;
justify-content: center;
gap: 2rem;
}
/**
* Customization for the unified layout
*/
/* Site wrapper, and two children: header and rest */
.unified-wrapper {
position: relative;
display: flex;
flex-direction: column;
inset: 0;
max-width: var(--maxWidth);
margin-inline: auto;
}
/* Site header */
.unified-header {
position: fixed;
top: 0;
inset-inline: 0;
z-index: 99999;
display: flex;
align-items: center;
box-shadow: var(--shadow);
}
.unified-header .inner-header {
display: flex;
margin-inline: auto;
width: 100%;
max-width: var(--maxWidth);
align-items: center;
justify-content: space-between;
padding-inline: var(--desktopInlinePadding);
padding-block: 1rem;
}
.unified-header::before {
content: "";
position: absolute;
inset: 0;
opacity: 95%;
background: var(--color-f);
z-index: -1;
backdrop-filter: blur(3px);
}
.unified-header .home-link {
display: block;
text-decoration: none;
width: 25px;
height: 40px;
}
.unified-header .home-link:hover .solidity-logo {
transform: scale(1.1);
transition: transform 100ms ease-in-out;
}
.unified-header img.solidity-logo {
transform: scale(1);
transition: transform 100ms ease-in-out;
width: 100%;
height: 100%;
}
.unified-header .nav-bar {
display: flex;
align-items: center;
justify-content: flex-end;
}
.unified-header .nav-bar .nav-button-container {
display: flex;
align-items: center;
justify-content: center;
gap: 0.5rem;
}
.unified-header .nav-link {
display: inline-block;
padding-inline: 8px;
padding-block: 4px;
font-size: 14px;
font-family: 'Overpass Mono', monospace;
text-decoration: none;
color: var(--color-a);
letter-spacing: -0.02em;
font-weight: 400;
box-sizing: content-box;
border-bottom: 1px solid transparent;
white-space: nowrap;
}
.unified-header .nav-link.active {
background: var(--white);
}
.unified-header .nav-link:hover {
color: var(--color-c);
border-bottom: 1px solid var(--color-c);
}
/* Rest: Flex-row, with two children: side bar, and content */
.unified-wrapper .wy-grid-for-nav {
position: relative !important;
display: flex;
margin-inline: auto;
}
/* First child: Side bar */
.unified-wrapper .wy-grid-for-nav nav.wy-nav-side {
position: fixed;
display: flex;
flex-direction: column;
background: var(--color-f);
color: var(--color-a);
padding-bottom: unset !important;
z-index: 10 !important;
min-height: unset !important;
width: var(--sideWidth) !important;
top: var(--navHeight);
bottom: 0;
left: auto;
overflow: auto;
}
.unified-wrapper .wy-grid-for-nav nav.wy-nav-side .wy-side-scroll {
position: static !important;
width: unset !important;
overflow: unset !important;
height: unset !important;
padding-bottom: 2rem;
}
.unified-wrapper .wy-grid-for-nav nav.wy-nav-side .wy-side-scroll .wy-side-nav-search {
margin: 0 !important;
width: var(--sideWidth) !important;
}
.wy-nav-side,
.wy-side-scroll,
.wy-side-nav-search,
.my-menu {
width: 100% !important;
}
.wy-nav-side input[type=text] {
font-family: "Overpass", sans-serif;
border-radius: 0;
border-color: var(--color-d);
background: var(--white);
box-shadow: none;
color: var(--color-a);
}
.wy-nav-side input[type=text]::placeholder {
font-family: "Overpass", sans-serif;
color: var(--color-e);
font-size: 16px;
position: relative;
top: 4px;
}
/* Second child: Content */
.unified-wrapper .wy-grid-for-nav .wy-nav-content {
width: 100%;
max-width: unset !important; /* override */
padding-inline: var(--desktopInlinePadding);
margin-inline-start: var(--sideWidth);
margin-top: var(--navHeight);
}
.unified-wrapper .wy-grid-for-nav .wy-nav-content .rst-content {
max-width: min(70ch, calc(100vw - 2 * var(--desktopInlinePadding) - var(--sideWidth)));
margin-inline: auto;
}
.unified-wrapper.menu-open .backdrop {
opacity: 0.5;
}
a.remix-link:hover .link-text {
display: block;
.unified-wrapper .wy-nav-side,
.unified-wrapper .rst-versions {
left: auto;
}
.unified-wrapper .backdrop {
opacity: 0;
transition: opacity 200ms ease-in-out;
}
@media (max-width: 768px) {
h2 {
margin-top: 3rem;
margin-bottom: 1rem;
}
h3 {
margin-top: 3rem;
margin-bottom: 1rem;
}
h4 {
margin-top: 2rem;
margin-bottom: 1rem;
}
/* Menu closed styles */
.unified-header .nav-link {
display: none;
}
.unified-header .inner-header {
padding-inline: var(--mobileInlinePadding);
}
.unified-wrapper .wy-grid-for-nav nav.wy-nav-side {
transform: translateX(-100%);
transition: transform 200ms ease-in-out;
}
/* Menu open styles */
.unified-wrapper.menu-open nav.wy-nav-side {
transform: translateX(0);
transition: transform 200ms ease-in-out;
}
.unified-wrapper.menu-open .rst-versions {
position: sticky;
bottom: 0;
width: 100%;
}
.unified-wrapper.menu-open .backdrop {
display: block;
position: fixed;
inset: 0;
opacity: 1;
transition: opacity 200ms ease-in-out;
z-index: 5;
background: #0006;
}
a.skip-to-content {
display: none;
}
.wy-nav-content {
margin-inline-start: 0 !important;
}
.rst-content {
max-width: 100% !important;
}
.wy-side-scroll {
padding-bottom: 0 !important;
}
}
ul.search .context {
color: var(--color-a) !important;
}
.rst-versions {
background: var(--color-f);
}
.rst-versions.shift-up {
height: unset !important;
max-height: unset !important;
overflow-y: unset !important;
}
.rst-content dl:not(.docutils) dt {
color: var(--color-a);
background-color: #fff8;
border-top: solid 3px #0002;
border-inline-start: solid 3px #0002;
padding: 2px 6px;
}
.rst-versions .rst-current-version {
border-color: var(--color-d) !important;
}
.rst-current-version *,
.rst-current-version .fa:before,
.rst-current-version .fa-element {
color: var(--color-b) !important;
}
.rst-current-version dt,
.rst-current-version dd,
.rst-current-version dd a,
.rst-other-versions dl:last-of-type dt,
.rst-other-versions dl:last-of-type dd,
.rst-other-versions dl:last-of-type dd a {
font-size: 14px !important;
}
.rst-other-versions {
background: var(--white) !important;
color: var(--color-a) !important;
max-height: calc(100vh - var(--navHeight) - var(--currentVersionHeight));
overflow-y: scroll;
}
.rst-other-versions a {
text-decoration: underline;
color: var(--color-c) !important;
}
.rst-other-versions dt {
color: var(--color-a) !important;
}
.rst-other-versions dl {
margin-bottom: 1.5rem !important;
}
.rst-other-versions dl:last-of-type {
margin-top: 2rem !important;
}
/* Bottom Search */
.wy-nav-side input[type=text],
.rst-other-versions dl:last-of-type dd {
width: 100%;
}
.rst-other-versions dl:last-of-type dt {
color: var(--color-b) !important;
}
.rst-other-versions dl:last-of-type div[style*=padding],
.rst-other-versions dl dd:first-of-type a {
padding-inline-start: 0 !important;
}
button.toctree-expand {
color: var(--black) !important;
}
/* Light/dark color mode toggle 🌓 */
button.color-toggle {
display: inline-flex;
appearance: none;
-webkit-box-align: center;
align-items: center;
-webkit-box-pack: center;
justify-content: center;
user-select: none;
outline: none;
height: 28px;
width: 28px;
background: none;
border: none;
padding: 6px;
margin: 6px;
transition-duration: 200ms;
transition-property: background-color,
color,
fill,
stroke,
opacity;
}
button.color-toggle:focus-visible {
outline: 2px solid var(--color-c);
color: var(--color-c);
}
button.color-toggle:hover {
color: var(--color-c);
background: #0002;
}
button.color-toggle .color-toggle-icon {
width: 100%;
height: 100%;
margin: 0;
display: inline-block;
line-height: 1em;
-webkit-flex-shrink: 0;
-ms-flex-negative: 0;
flex-shrink: 0;
vertical-align: middle;
/* color: var(--color-a); */
}
button.mobile-menu-button {
display: none;
}
@media (max-width: 768px) {
nav.wy-nav-top {
display: none;
}
button.mobile-menu-button {
display: flex;
}
}
.hidden {
display: none;
}
#search-results .search li:first-child,
#search-results .search li {
border-color: var(--color-d);
}
#search-results .search li:last-child {
border: 0px;
}
.forum-link::after {
content: ' ↗';
font-size: 14px;
font-family: 'Overpass Mono', monospace;
}
.wy-breadcrumbs>li {
padding-top: 8px;
}
.wy-breadcrumbs-aside a {
padding: 0.5rem 0.75rem;
font-size: 12px;
font-family: "'Overpass'", sans-serif;
font-weight: 700;
}
a.skip-to-content:visited,
a.skip-to-content:not(:visited),
a.skip-to-content {
display: block;
pointer-events: none;
width: fit-content;
opacity: 0;
transition: opacity 200ms ease-in-out;
padding: 2px 4px;
font-size: 14px;
margin-inline-end: auto;
margin-inline-start: 1.5rem;
color: var(--color-a);
white-space: nowrap;
}
a.skip-to-content:focus {
opacity: 1;
transition: opacity 200ms ease-in-out;
}
#content {
scroll-margin-top: 6rem;
scroll-behavior: smooth;
}

View File

@ -1,635 +0,0 @@
/* links */
.rst-content a:not(:visited) {
color: #aaddff !important;
}
/* code directives */
.method dt,
.class dt,
.data dt,
.attribute dt,
.function dt,
.classmethod dt,
.exception dt,
.descclassname,
.descname {
background-color: #2d2d2d !important;
}
.rst-content dl:not(.docutils) dt {
color: #aaddff;
background-color: #2d2d2d;
border-top: solid 3px #525252;
border-left: solid 3px #525252;
}
em.property {
color: #888888;
}
/* tables */
.rst-content table.docutils thead {
color: #ddd;
}
.rst-content table.docutils td {
border: 0px;
}
.rst-content table.docutils:not(.field-list) tr:nth-child(2n-1) td {
background-color: #5a5a5a;
}
.rst-content pre {
background: none;
}
/* inlined code highlights */
.xref,
.py-meth,
.rst-content a code {
color: #aaddff !important;
font-weight: normal !important;
}
.rst-content code {
color: #eee !important;
font-weight: normal !important;
}
code.literal {
background-color: #2d2d2d !important;
border: 1px solid #6d6d6d !important;
}
code.docutils.literal.notranslate {
color: #ddd;
}
/* highlight color search text */
.rst-content .highlighted {
background: #ff5722;
box-shadow: 0 0 0 2px #f0978b;
}
/* notes, warnings, hints */
.hint .admonition-title {
background: #2aa87c !important;
}
.warning .admonition-title {
background: #cc4444 !important;
}
.admonition-title {
background: #3a7ca8 !important;
}
.admonition,
.note {
background-color: #2d2d2d !important;
}
/* table of contents */
.wy-nav-content-wrap {
background-color: rgba(0, 0, 0, 0.6) !important;
}
.sidebar {
background-color: #191919 !important;
}
.sidebar-title {
background-color: #2b2b2b !important;
}
.wy-menu-vertical a {
color: #ddd;
}
.wy-menu-vertical code.docutils.literal.notranslate {
color: #404040;
background: none !important;
border: none !important;
}
.wy-nav-content {
background: #3c3c3c;
color: #dddddd;
}
.wy-menu-vertical li.on a,
.wy-menu-vertical li.current>a {
background: #a3a3a3;
border-bottom: 0px !important;
border-top: 0px !important;
}
.wy-menu-vertical li.current {
background: #b3b3b3;
}
.toc-backref {
color: grey !important;
}
.highlight .hll {
background-color: #49483e
}
.highlight {
background: #222;
color: #f8f8f2
}
.highlight .c {
color: #888
}
/* Comment */
.highlight .err {
color: #960050;
background-color: #1e0010
}
/* Error */
.highlight .k {
color: #66d9ef
}
/* Keyword */
.highlight .l {
color: #ae81ff
}
/* Literal */
.highlight .n {
color: #f8f8f2
}
/* Name */
.highlight .o {
color: #f92672
}
/* Operator */
.highlight .p {
color: #f8f8f2
}
/* Punctuation */
.highlight .ch {
color: #888
}
/* Comment.Hashbang */
.highlight .cm {
color: #888
}
/* Comment.Multiline */
.highlight .cp {
color: #888
}
/* Comment.Preproc */
.highlight .cpf {
color: #888
}
/* Comment.PreprocFile */
.highlight .c1 {
color: #888
}
/* Comment.Single */
.highlight .cs {
color: #888
}
/* Comment.Special */
.highlight .gd {
color: #f92672
}
/* Generic.Deleted */
.highlight .ge {
font-style: italic
}
/* Generic.Emph */
.highlight .gi {
color: #a6e22e
}
/* Generic.Inserted */
.highlight .gs {
font-weight: bold
}
/* Generic.Strong */
.highlight .gu {
color: #888
}
/* Generic.Subheading */
.highlight .kc {
color: #66d9ef
}
/* Keyword.Constant */
.highlight .kd {
color: #66d9ef
}
/* Keyword.Declaration */
.highlight .kn {
color: #f92672
}
/* Keyword.Namespace */
.highlight .kp {
color: #66d9ef
}
/* Keyword.Pseudo */
.highlight .kr {
color: #66d9ef
}
/* Keyword.Reserved */
.highlight .kt {
color: #66d9ef
}
/* Keyword.Type */
.highlight .ld {
color: #e6db74
}
/* Literal.Date */
.highlight .m {
color: #ae81ff
}
/* Literal.Number */
.highlight .s {
color: #e6db74
}
/* Literal.String */
.highlight .na {
color: #a6e22e
}
/* Name.Attribute */
.highlight .nb {
color: #f8f8f2
}
/* Name.Builtin */
.highlight .nc {
color: #a6e22e
}
/* Name.Class */
.highlight .no {
color: #66d9ef
}
/* Name.Constant */
.highlight .nd {
color: #a6e22e
}
/* Name.Decorator */
.highlight .ni {
color: #f8f8f2
}
/* Name.Entity */
.highlight .ne {
color: #a6e22e
}
/* Name.Exception */
.highlight .nf {
color: #a6e22e
}
/* Name.Function */
.highlight .nl {
color: #f8f8f2
}
/* Name.Label */
.highlight .nn {
color: #f8f8f2
}
/* Name.Namespace */
.highlight .nx {
color: #a6e22e
}
/* Name.Other */
.highlight .py {
color: #f8f8f2
}
/* Name.Property */
.highlight .nt {
color: #f92672
}
/* Name.Tag */
.highlight .nv {
color: #f8f8f2
}
/* Name.Variable */
.highlight .ow {
color: #f92672
}
/* Operator.Word */
.highlight .w {
color: #f8f8f2
}
/* Text.Whitespace */
.highlight .mb {
color: #ae81ff
}
/* Literal.Number.Bin */
.highlight .mf {
color: #ae81ff
}
/* Literal.Number.Float */
.highlight .mh {
color: #ae81ff
}
/* Literal.Number.Hex */
.highlight .mi {
color: #ae81ff
}
/* Literal.Number.Integer */
.highlight .mo {
color: #ae81ff
}
/* Literal.Number.Oct */
.highlight .sa {
color: #e6db74
}
/* Literal.String.Affix */
.highlight .sb {
color: #e6db74
}
/* Literal.String.Backtick */
.highlight .sc {
color: #e6db74
}
/* Literal.String.Char */
.highlight .dl {
color: #e6db74
}
/* Literal.String.Delimiter */
.highlight .sd {
color: #e6db74
}
/* Literal.String.Doc */
.highlight .s2 {
color: #e6db74
}
/* Literal.String.Double */
.highlight .se {
color: #ae81ff
}
/* Literal.String.Escape */
.highlight .sh {
color: #e6db74
}
/* Literal.String.Heredoc */
.highlight .si {
color: #e6db74
}
/* Literal.String.Interpol */
.highlight .sx {
color: #e6db74
}
/* Literal.String.Other */
.highlight .sr {
color: #e6db74
}
/* Literal.String.Regex */
.highlight .s1 {
color: #e6db74
}
/* Literal.String.Single */
.highlight .ss {
color: #e6db74
}
/* Literal.String.Symbol */
.highlight .bp {
color: #f8f8f2
}
/* Name.Builtin.Pseudo */
.highlight .fm {
color: #a6e22e
}
/* Name.Function.Magic */
.highlight .vc {
color: #f8f8f2
}
/* Name.Variable.Class */
.highlight .vg {
color: #f8f8f2
}
/* Name.Variable.Global */
.highlight .vi {
color: #f8f8f2
}
/* Name.Variable.Instance */
.highlight .vm {
color: #f8f8f2
}
/* Name.Variable.Magic */
.highlight .il {
color: #ae81ff
}
/* Literal.Number.Integer.Long */
/* Link to Remix IDE shown over code snippets */
a.remix-link {
filter: invert(1); /* The icon is black. In dark mode we want it white. */
}

2
docs/_static/css/fonts.css vendored Normal file
View File

@ -0,0 +1,2 @@
@import url("https://fonts.cdnfonts.com/css/overpass");
@import url("https://fonts.cdnfonts.com/css/overpass-mono");

399
docs/_static/css/pygments.css vendored Normal file
View File

@ -0,0 +1,399 @@
pre {
line-height: 125%;
}
td.linenos .normal {
color: inherit;
background-color: transparent;
padding-left: 5px;
padding-right: 5px;
}
span.linenos {
color: inherit;
background-color: transparent;
padding-left: 5px;
padding-right: 5px;
}
td.linenos .special {
color: #000000;
background-color: #ffffc0;
padding-left: 5px;
padding-right: 5px;
}
span.linenos.special {
color: #000000;
background-color: #ffffc0;
padding-left: 5px;
padding-right: 5px;
}
.highlight .hll {
background-color: #ffffcc
}
.highlight {
background: #eeffcc;
}
.highlight .c {
color: #408090;
font-style: italic
}
/* Comment */
.highlight .err {
border: 1px solid #FF0000
}
/* Error */
.highlight .k {
color: #007020;
font-weight: bold
}
/* Keyword */
.highlight .o {
color: #666666
}
/* Operator */
.highlight .ch {
color: #408090;
font-style: italic
}
/* Comment.Hashbang */
.highlight .cm {
color: #408090;
font-style: italic
}
/* Comment.Multiline */
.highlight .cp {
color: #007020
}
/* Comment.Preproc */
.highlight .cpf {
color: #408090;
font-style: italic
}
/* Comment.PreprocFile */
.highlight .c1 {
color: #408090;
font-style: italic
}
/* Comment.Single */
.highlight .cs {
color: #408090;
background-color: #fff0f0
}
/* Comment.Special */
.highlight .gd {
color: #A00000
}
/* Generic.Deleted */
.highlight .ge {
font-style: italic
}
/* Generic.Emph */
.highlight .gr {
color: #FF0000
}
/* Generic.Error */
.highlight .gh {
color: #000080;
font-weight: bold
}
/* Generic.Heading */
.highlight .gi {
color: #00A000
}
/* Generic.Inserted */
.highlight .go {
color: #333333
}
/* Generic.Output */
.highlight .gp {
color: #c65d09;
font-weight: bold
}
/* Generic.Prompt */
.highlight .gs {
font-weight: bold
}
/* Generic.Strong */
.highlight .gu {
color: #800080;
font-weight: bold
}
/* Generic.Subheading */
.highlight .gt {
color: #0044DD
}
/* Generic.Traceback */
.highlight .kc {
color: #007020;
font-weight: bold
}
/* Keyword.Constant */
.highlight .kd {
color: #007020;
font-weight: bold
}
/* Keyword.Declaration */
.highlight .kn {
color: #007020;
font-weight: bold
}
/* Keyword.Namespace */
.highlight .kp {
color: #007020
}
/* Keyword.Pseudo */
.highlight .kr {
color: #007020;
font-weight: bold
}
/* Keyword.Reserved */
.highlight .kt {
color: #902000
}
/* Keyword.Type */
.highlight .m {
color: #208050
}
/* Literal.Number */
.highlight .s {
color: #4070a0
}
/* Literal.String */
.highlight .na {
color: #4070a0
}
/* Name.Attribute */
.highlight .nb {
color: #007020
}
/* Name.Builtin */
.highlight .nc {
color: #0e84b5;
font-weight: bold
}
/* Name.Class */
.highlight .no {
color: #60add5
}
/* Name.Constant */
.highlight .nd {
color: #555555;
font-weight: bold
}
/* Name.Decorator */
.highlight .ni {
color: #d55537;
font-weight: bold
}
/* Name.Entity */
.highlight .ne {
color: #007020
}
/* Name.Exception */
.highlight .nf {
color: #06287e
}
/* Name.Function */
.highlight .nl {
color: #002070;
font-weight: bold
}
/* Name.Label */
.highlight .nn {
color: #0e84b5;
font-weight: bold
}
/* Name.Namespace */
.highlight .nt {
color: #062873;
font-weight: bold
}
/* Name.Tag */
.highlight .nv {
color: #bb60d5
}
/* Name.Variable */
.highlight .ow {
color: #007020;
font-weight: bold
}
/* Operator.Word */
.highlight .w {
color: #bbbbbb
}
/* Text.Whitespace */
.highlight .mb {
color: #208050
}
/* Literal.Number.Bin */
.highlight .mf {
color: #208050
}
/* Literal.Number.Float */
.highlight .mh {
color: #208050
}
/* Literal.Number.Hex */
.highlight .mi {
color: #208050
}
/* Literal.Number.Integer */
.highlight .mo {
color: #208050
}
/* Literal.Number.Oct */
.highlight .sa {
color: #4070a0
}
/* Literal.String.Affix */
.highlight .sb {
color: #4070a0
}
/* Literal.String.Backtick */
.highlight .sc {
color: #4070a0
}
/* Literal.String.Char */
.highlight .dl {
color: #4070a0
}
/* Literal.String.Delimiter */
.highlight .sd {
color: #4070a0;
font-style: italic
}
/* Literal.String.Doc */
.highlight .s2 {
color: #4070a0
}
/* Literal.String.Double */
.highlight .se {
color: #4070a0;
font-weight: bold
}
/* Literal.String.Escape */
.highlight .sh {
color: #4070a0
}
/* Literal.String.Heredoc */
.highlight .si {
color: #70a0d0;
font-style: italic
}
/* Literal.String.Interpol */
.highlight .sx {
color: #c65d09
}
/* Literal.String.Other */
.highlight .sr {
color: #235388
}
/* Literal.String.Regex */
.highlight .s1 {
color: #4070a0
}
/* Literal.String.Single */
.highlight .ss {
color: #517918
}
/* Literal.String.Symbol */
.highlight .bp {
color: #007020
}
/* Name.Builtin.Pseudo */
.highlight .fm {
color: #06287e
}
/* Name.Function.Magic */
.highlight .vc {
color: #bb60d5
}
/* Name.Variable.Class */
.highlight .vg {
color: #bb60d5
}
/* Name.Variable.Global */
.highlight .vi {
color: #bb60d5
}
/* Name.Variable.Instance */
.highlight .vm {
color: #bb60d5
}
/* Name.Variable.Magic */
.highlight .il {
color: #208050
}
/* Literal.Number.Integer.Long */

View File

@ -9,6 +9,13 @@ input[type=checkbox] {
padding: 10px;
display: flex;
justify-content: space-between;
background-color: var(--color-f);
border-top: 1px solid var(--color-c);
}
.fa-caret-down,
.fa-book {
color: var(--color-a) !important;
}
.rst-versions .rst-current-version .fa-book,
@ -76,8 +83,6 @@ html.transition *:after {
transition-delay: 0 !important;
}
nav.wy-nav-side {
/* The default padding of 2em is too small and the "Keyword Index" link gets obscured
* by the version toggle. */
padding-bottom: 3em;
}
.wy-menu-vertical a:hover {
background-color: #0002;
}

BIN
docs/_static/img/favicon.ico vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
docs/_static/img/favicon.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 949 B

3
docs/_static/img/hamburger-dark.svg vendored Normal file
View File

@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="#E6E3EC" xmlns="http://www.w3.org/2000/svg" focusable="false" class="color-toggle-icon" aria-hidden="true">
<path d="M 3 5 A 1.0001 1.0001 0 1 0 3 7 L 21 7 A 1.0001 1.0001 0 1 0 21 5 L 3 5 z M 3 11 A 1.0001 1.0001 0 1 0 3 13 L 21 13 A 1.0001 1.0001 0 1 0 21 11 L 3 11 z M 3 17 A 1.0001 1.0001 0 1 0 3 19 L 21 19 A 1.0001 1.0001 0 1 0 21 17 L 3 17 z" />
</svg>

After

Width:  |  Height:  |  Size: 413 B

3
docs/_static/img/hamburger-light.svg vendored Normal file
View File

@ -0,0 +1,3 @@
<svg width="24px" height="24px" fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" focusable="false" class="color-toggle-icon" aria-hidden="true">
<path fill="#2B247C" d="M 3 5 A 1.0001 1.0001 0 1 0 3 7 L 21 7 A 1.0001 1.0001 0 1 0 21 5 L 3 5 z M 3 11 A 1.0001 1.0001 0 1 0 3 13 L 21 13 A 1.0001 1.0001 0 1 0 21 11 L 3 11 z M 3 17 A 1.0001 1.0001 0 1 0 3 19 L 21 19 A 1.0001 1.0001 0 1 0 21 17 L 3 17 z" />
</svg>

After

Width:  |  Height:  |  Size: 437 B

8
docs/_static/img/logo-dark.svg vendored Normal file
View File

@ -0,0 +1,8 @@
<svg width="100" height="160" viewBox="0 0 100 160" fill="#E6E3EC" xmlns="http://www.w3.org/2000/svg">
<path opacity="0.8" d="M50 44.3013L25 1L0 44.3013L25 87.6025L50 44.3013Z" />
<path opacity="0.45" d="M50 44.3091L75 1.00781L25 1.00781L0 44.3091H50Z" />
<path opacity="0.6" d="M75 1.00781L25 1.00781L50 44.3091H100L75 1.00781Z" />
<path opacity="0.8" d="M50 115.699L75 159L100 115.699L75 72.3975L50 115.699Z" />
<path opacity="0.45" d="M50 115.691L25 158.993H75L100 115.691L50 115.691Z" />
<path opacity="0.6" d="M25 158.993H75L50 115.691L0 115.691L25 158.993Z" />
</svg>

After

Width:  |  Height:  |  Size: 574 B

8
docs/_static/img/logo.svg vendored Normal file
View File

@ -0,0 +1,8 @@
<svg width="100" height="160" viewBox="0 0 100 160" fill="#2B247C" xmlns="http://www.w3.org/2000/svg">
<path opacity="0.8" d="M50 44.3013L25 1L0 44.3013L25 87.6025L50 44.3013Z" />
<path opacity="0.45" d="M50 44.3091L75 1.00781L25 1.00781L0 44.3091H50Z" />
<path opacity="0.6" d="M75 1.00781L25 1.00781L50 44.3091H100L75 1.00781Z" />
<path opacity="0.8" d="M50 115.699L75 159L100 115.699L75 72.3975L50 115.699Z" />
<path opacity="0.45" d="M50 115.691L25 158.993H75L100 115.691L50 115.691Z" />
<path opacity="0.6" d="M25 158.993H75L50 115.691L0 115.691L25 158.993Z" />
</svg>

After

Width:  |  Height:  |  Size: 574 B

3
docs/_static/img/moon.svg vendored Normal file
View File

@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="#2B247C" xmlns="http://www.w3.org/2000/svg" focusable="false" class="color-toggle-icon" aria-hidden="true">
<path d="M21.4,13.7C20.6,13.9,19.8,14,19,14c-5,0-9-4-9-9c0-0.8,0.1-1.6,0.3-2.4c0.1-0.3,0-0.7-0.3-1 c-0.3-0.3-0.6-0.4-1-0.3C4.3,2.7,1,7.1,1,12c0,6.1,4.9,11,11,11c4.9,0,9.3-3.3,10.6-8.1c0.1-0.3,0-0.7-0.3-1 C22.1,13.7,21.7,13.6,21.4,13.7z" />
</svg>

After

Width:  |  Height:  |  Size: 408 B

13
docs/_static/img/sun.svg vendored Normal file
View File

@ -0,0 +1,13 @@
<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" focusable="false" class="color-toggle-icon" aria-hidden="true">
<g stroke-linejoin="round" stroke-linecap="round" stroke-width="2" fill="none" stroke="#E6E3EC">
<circle cx="12" cy="12" r="5" />
<path d="M12 1v2" />
<path d="M12 21v2" />
<path d="M4.22 4.22l1.42 1.42" />
<path d="M18.36 18.36l1.42 1.42" />
<path d="M1 12h2" />
<path d="M21 12h2" />
<path d="M4.22 19.78l1.42-1.42" />
<path d="M18.36 5.64l1.42-1.42" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 554 B

38
docs/_static/js/constants.js vendored Normal file
View File

@ -0,0 +1,38 @@
// Site URL
const SITE_URL = "https://docs.soliditylang.org"
const { origin, pathname } = location;
const pathSplit = pathname.split("/");
const rootPath = origin.includes(SITE_URL) && pathSplit.length > 3 ? pathSplit.splice(1, 2).join("/") : ''
const ROOT_URL = `${origin}/${rootPath}`;
// Color mode constants
const [DARK, LIGHT] = ["dark", "light"];
const LIGHT_LOGO_PATH = `${ROOT_URL}/_static/img/logo.svg`;
const DARK_LOGO_PATH = `${ROOT_URL}/_static/img/logo-dark.svg`;
const SUN_ICON_PATH = `${ROOT_URL}/_static/img/sun.svg`;
const MOON_ICON_PATH = `${ROOT_URL}/_static/img/moon.svg`;
const LIGHT_HAMBURGER_PATH = `${ROOT_URL}/_static/img/hamburger-light.svg`;
const DARK_HAMBURGER_PATH = `${ROOT_URL}/_static/img/hamburger-dark.svg`;
const COLOR_TOGGLE_ICON_CLASS = "color-toggle-icon";
const SOLIDITY_LOGO_CLASS = "solidity-logo";
const LS_COLOR_SCHEME = "color-scheme";
// Solidity navigation constants
const SOLIDITY_HOME_URL = "https://soliditylang.org";
const BLOG_URL = `${SOLIDITY_HOME_URL}/blog`;
const DOCS_URL = "/";
const USE_CASES_PATH = `${SOLIDITY_HOME_URL}/use-cases`;
const CONTRIBUTE_PATH = `/en/latest/contributing.html`;
const ABOUT_PATH = `${SOLIDITY_HOME_URL}/about`;
const FORUM_URL = "https://forum.soliditylang.org/";
const NAV_LINKS = [
{ name: "Blog", href: BLOG_URL },
{ name: "Documentation", href: DOCS_URL },
{ name: "Use cases", href: USE_CASES_PATH },
{ name: "Contribute", href: CONTRIBUTE_PATH },
{ name: "About", href: ABOUT_PATH },
{ name: "Forum", href: FORUM_URL },
];
const MOBILE_MENU_TOGGLE_CLASS = "shift";
const WRAPPER_CLASS = "unified-wrapper";

250
docs/_static/js/initialize.js vendored Normal file
View File

@ -0,0 +1,250 @@
const getLogoSrc = (isDark) => (isDark ? DARK_LOGO_PATH : LIGHT_LOGO_PATH);
const getModeIconSrc = (isDark) => (isDark ? SUN_ICON_PATH : MOON_ICON_PATH);
const getMenuIconSrc = (isDark) =>
isDark ? DARK_HAMBURGER_PATH : LIGHT_HAMBURGER_PATH;
function addFooterNote() {
const contentInfo = document.querySelector("div[role=contentinfo]");
const footerNote = document.createElement("p");
footerNote.classList.add("footer-note");
footerNote.innerHTML =
'Customized with ❤️ by the <a href="https://ethereum.org/" target="_blank">ethereum.org</a> team.';
contentInfo.parentNode.insertBefore(footerNote, contentInfo.nextSibling);
}
function rearrangeDom() {
const bodyDivs = document.querySelectorAll("body>div");
bodyDivs.forEach((div) => div.remove());
const wrapperDiv = document.createElement("div");
wrapperDiv.classList.add(WRAPPER_CLASS);
bodyDivs.forEach((div) => wrapperDiv.appendChild(div));
document.body.prepend(wrapperDiv);
const rstVersions = document.querySelector(".rst-versions");
rstVersions.remove();
const wyNavSide = document.querySelector("nav.wy-nav-side");
wyNavSide.appendChild(rstVersions);
const backdrop = document.createElement("div");
backdrop.classList.add("backdrop");
wrapperDiv.appendChild(backdrop);
const content = document.querySelector(".wy-nav-content");
content.id = "content";
const oldWrap = document.querySelector("section.wy-nav-content-wrap");
oldWrap.remove();
document.querySelector(".wy-grid-for-nav").appendChild(content);
}
function buildHeader() {
const isDarkMode = localStorage.getItem(LS_COLOR_SCHEME) == DARK;
const header = document.createElement("div");
header.classList.add("unified-header");
document.querySelector(`.${WRAPPER_CLASS}`).prepend(header);
const innerHeader = document.createElement("div");
innerHeader.classList.add("inner-header");
header.appendChild(innerHeader);
const homeLink = document.createElement("a");
homeLink.classList.add("home-link");
homeLink.href = SOLIDITY_HOME_URL;
homeLink.ariaLabel = "Solidity home";
innerHeader.appendChild(homeLink);
const logo = document.createElement("img");
logo.classList.add(SOLIDITY_LOGO_CLASS);
logo.src = getLogoSrc(isDarkMode);
logo.alt = "Solidity logo";
homeLink.appendChild(logo);
const skipToContent = document.createElement("a");
skipToContent.classList.add("skip-to-content");
skipToContent.href = "#content";
skipToContent.innerText = "{skip to content}";
innerHeader.appendChild(skipToContent);
const navBar = document.createElement("nav");
navBar.classList.add("nav-bar");
innerHeader.appendChild(navBar);
const linkElements = NAV_LINKS.map(({ name, href }) => {
const link = document.createElement("a");
link.classList.add("nav-link");
link.setAttribute("key", name);
link.setAttribute("href", href);
link.setAttribute("aria-label", name);
if (href === FORUM_URL) {
link.classList.add("forum-link");
link.setAttribute("target", "_blank");
link.setAttribute("rel", "noopener noreferrer");
}
link.innerText = name;
return link;
});
linkElements.forEach((link) => navBar.appendChild(link));
// Flex wrapper for color mode and mobile menu buttons
const navButtonContainer = document.createElement("div");
navButtonContainer.classList.add("nav-button-container");
navBar.appendChild(navButtonContainer);
// Build color toggle
const toggleIcon = document.createElement("img");
toggleIcon.classList.add(COLOR_TOGGLE_ICON_CLASS);
toggleIcon.src = getModeIconSrc(isDarkMode);
toggleIcon.alt = "Color mode toggle icon";
toggleIcon.setAttribute("aria-hidden", "true");
toggleIcon.setAttribute("key", "toggle icon");
const colorModeButton = document.createElement("button");
colorModeButton.classList.add("color-toggle");
colorModeButton.setAttribute("type", "button");
colorModeButton.setAttribute("aria-label", "Toggle light dark mode");
colorModeButton.setAttribute("key", "color mode button");
colorModeButton.addEventListener("click", toggleColorMode);
colorModeButton.appendChild(toggleIcon);
navButtonContainer.appendChild(colorModeButton);
// Build mobile hamburger menu
const menuIcon = document.createElement("img");
menuIcon.classList.add(COLOR_TOGGLE_ICON_CLASS);
menuIcon.src = getMenuIconSrc(isDarkMode);
menuIcon.alt = "Toggle menu";
menuIcon.setAttribute("aria-hidden", "true");
menuIcon.setAttribute("key", "menu icon");
const menuButton = document.createElement("button");
menuButton.classList.add("color-toggle");
menuButton.classList.add("mobile-menu-button");
menuButton.setAttribute("type", "button");
menuButton.setAttribute("aria-label", "Toggle menu");
menuButton.setAttribute("key", "menu button");
menuButton.addEventListener("click", toggleMenu);
menuButton.appendChild(menuIcon);
navButtonContainer.appendChild(menuButton);
}
const updateActiveNavLink = () => {
const navLinks = document.querySelectorAll(".unified-header .nav-link");
navLinks.forEach((link) => {
const href = link.getAttribute("href");
if (document.documentURI.includes("contributing.html")) {
link.classList[href.includes("contributing.html") ? "add" : "remove"](
"active"
);
} else {
link.classList[document.documentURI.includes(href) ? "add" : "remove"](
"active"
);
}
});
};
document.addEventListener("locationchange", updateActiveNavLink);
function updateGitHubEditPath() {
// Replaces the version number in the GitHub edit path with "develop"
const gitHubEditAnchor = document.querySelector(".wy-breadcrumbs-aside > a");
const url = new URL(gitHubEditAnchor.href);
const split = url.pathname.split("/");
const versionIndex = split.indexOf("blob") + 1;
split[versionIndex] = "develop";
url.pathname = split.join("/");
gitHubEditAnchor.setAttribute("href", url.toString());
gitHubEditAnchor.setAttribute("target", "_blank");
gitHubEditAnchor.setAttribute("rel", "noopener noreferrer");
}
function initialize() {
// Rearrange DOM elements for styling
rearrangeDom();
// Check localStorage for existing color scheme preference
var prefersDark = localStorage.getItem(LS_COLOR_SCHEME) == DARK;
// Check link for search param "color"... it may be "light" or "dark"
var urlParams = new URLSearchParams(window.location.search);
if (urlParams.size > 0) {
// This is used for color mode continuity between the main Solidity Lang site and the docs
var colorSchemeParam = urlParams.get("color");
// If present, overwrite prefersDark accordingly
if (colorSchemeParam) {
prefersDark = colorSchemeParam == DARK;
}
// Remove "color" search param from URL
const { location, title } = document;
const { pathname, origin, search, hash } = location;
const newSearchParams = new URLSearchParams(search);
newSearchParams.delete("color");
const sanitizedSearch =
newSearchParams.size < 1 ? "" : "?" + newSearchParams.toString();
window.history.replaceState(
origin,
title,
pathname + sanitizedSearch + hash
);
}
// In case none existed, establish localStorage color scheme preference
var mode = prefersDark ? DARK : LIGHT;
localStorage.setItem(LS_COLOR_SCHEME, mode);
// Select the root element and set the style attribute to denote color-scheme attribute
document
.querySelector(":root")
.setAttribute("style", `--color-scheme: ${mode}`);
// Remove old input and RTD logo anchor element
document.querySelector("input[name=mode]").remove();
document.querySelector("label[for=switch]").remove();
document.querySelector(".wy-side-nav-search > a").remove();
// Add footer note
addFooterNote();
// Build header
buildHeader();
// Close menu
toggleMenu({ force: false });
// Update active nav link
updateActiveNavLink();
// Update GitHub edit path to direct to `develop` branch
updateGitHubEditPath();
}
document.addEventListener("DOMContentLoaded", initialize);
const handleClick = (e) => {
if (e.target.closest(".backdrop")) {
toggleMenu({ force: false });
}
if (e.target.closest("a")) {
const target = e.target.closest("a");
const href = target.getAttribute("href");
if (href.includes(SOLIDITY_HOME_URL)) {
const url = new URL(href);
const params = new URLSearchParams(url.search);
params.set("color", localStorage.getItem(LS_COLOR_SCHEME));
url.search = params.toString();
target.setAttribute("href", url.toString());
}
}
};
document.addEventListener("click", handleClick);
const handleKeyDown = (e) => {
if (e.metaKey && e.key === "k") {
document.querySelector("#rtd-search-form input").focus();
} else if (e.key === "Escape") {
toggleMenu({ force: false });
}
if (e.metaKey && e.code === "Backslash") {
toggleColorMode();
}
};
document.addEventListener("keydown", handleKeyDown);

View File

@ -1,38 +1,47 @@
document.addEventListener('DOMContentLoaded', function() {
function toggleColorMode() {
// Check localStorage for previous color scheme preference, assign the opposite
var newMode = localStorage.getItem(LS_COLOR_SCHEME) == DARK ? LIGHT : DARK;
function toggleCssMode(isDay) {
var mode = (isDay ? "Day" : "Night");
localStorage.setItem("css-mode", mode);
// Update localStorage with new color scheme preference
localStorage.setItem(LS_COLOR_SCHEME, newMode);
var daysheet = $('link[href="_static/pygments.css"]')[0].sheet;
daysheet.disabled = !isDay;
// Update the root element with the new color scheme preference
document
.querySelector(":root")
.setAttribute("style", `--color-scheme: ${newMode}`);
var nightsheet = $('link[href="_static/css/dark.css"]')[0];
if (!isDay && nightsheet === undefined) {
var element = document.createElement("link");
element.setAttribute("rel", "stylesheet");
element.setAttribute("type", "text/css");
element.setAttribute("href", "_static/css/dark.css");
document.getElementsByTagName("head")[0].appendChild(element);
return;
}
if (nightsheet !== undefined) {
nightsheet.sheet.disabled = isDay;
}
// Update logo
document
.querySelector(`img.${SOLIDITY_LOGO_CLASS}`)
.setAttribute("src", newMode === LIGHT ? LIGHT_LOGO_PATH : DARK_LOGO_PATH);
// Update color mode toggle icon
document
.querySelector(`img.${COLOR_TOGGLE_ICON_CLASS}`)
.setAttribute("src", newMode === LIGHT ? MOON_ICON_PATH : SUN_ICON_PATH);
// Update hamburger menu icon color
document
.querySelector("button.mobile-menu-button img")
.setAttribute(
"src",
newMode === LIGHT ? LIGHT_HAMBURGER_PATH : DARK_HAMBURGER_PATH
);
}
function toggleMenu(options = {}) {
const handleClassToggle = ({ classList }, className) => {
if (typeof options.force !== "undefined") {
classList.toggle(className, options.force);
} else {
classList.toggle(className);
}
var initial = localStorage.getItem("css-mode") != "Night";
var checkbox = document.querySelector('input[name=mode]');
toggleCssMode(initial);
checkbox.checked = initial;
checkbox.addEventListener('change', function() {
document.documentElement.classList.add('transition');
window.setTimeout(() => {
document.documentElement.classList.remove('transition');
}, 1000)
toggleCssMode(this.checked);
})
});
};
document
.querySelectorAll('[data-toggle="rst-versions"]')
.forEach((e) => handleClassToggle(e, MOBILE_MENU_TOGGLE_CLASS));
document
.querySelectorAll('[data-toggle="wy-nav-shift"]')
.forEach((e) => handleClassToggle(e, MOBILE_MENU_TOGGLE_CLASS));
handleClassToggle(document.querySelector(`.${WRAPPER_CLASS}`), "menu-open");
}

View File

@ -13,13 +13,13 @@ The Contract Application Binary Interface (ABI) is the standard way to interact
from outside the blockchain and for contract-to-contract interaction. Data is encoded according to its type,
as described in this specification. The encoding is not self describing and thus requires a schema in order to decode.
We assume the interface functions of a contract are strongly typed, known at compilation time and static.
We assume that the interface functions of a contract are strongly typed, known at compilation time and static.
We assume that all contracts will have the interface definitions of any contracts they call available at compile-time.
This specification does not address contracts whose interface is dynamic or otherwise known only at run-time.
.. _abi_function_selector:
.. index:: selector
.. index:: ! selector; of a function
Function Selector
=================
@ -29,7 +29,7 @@ first (left, high-order in big-endian) four bytes of the Keccak-256 hash of the
the function. The signature is defined as the canonical expression of the basic prototype without data
location specifier, i.e.
the function name with the parenthesised list of parameter types. Parameter types are split by a single
comma - no spaces are used.
comma no spaces are used.
.. note::
The return type of a function is not part of this signature. In
@ -133,7 +133,7 @@ The encoding is designed to have the following properties, which are especially
previous version of the ABI, the number of reads scaled linearly with the total number of dynamic
parameters in the worst case.
2. The data of a variable or array element is not interleaved with other data and it is
2. The data of a variable or an array element is not interleaved with other data and it is
relocatable, i.e. it only uses relative "addresses".
@ -191,9 +191,9 @@ on the type of ``X`` being
- ``T[]`` where ``X`` has ``k`` elements (``k`` is assumed to be of type ``uint256``):
``enc(X) = enc(k) enc([X[0], ..., X[k-1]])``
``enc(X) = enc(k) enc((X[0], ..., X[k-1]))``
i.e. it is encoded as if it were an array of static size ``k``, prefixed with
i.e. it is encoded as if it were a tuple with ``k`` elements of the same type (resp. an array of static size ``k``), prefixed with
the number of elements.
- ``bytes``, of length ``k`` (which is assumed to be of type ``uint256``):
@ -252,7 +252,7 @@ Given the contract:
}
Thus for our ``Foo`` example if we wanted to call ``baz`` with the parameters ``69`` and
Thus, for our ``Foo`` example if we wanted to call ``baz`` with the parameters ``69`` and
``true``, we would pass 68 bytes total, which can be broken down into:
- ``0xcdcd77c0``: the Method ID. This is derived as the first 4 bytes of the Keccak hash of
@ -308,10 +308,10 @@ In total:
Use of Dynamic Types
====================
A call to a function with the signature ``f(uint,uint32[],bytes10,bytes)`` with values
A call to a function with the signature ``f(uint256,uint32[],bytes10,bytes)`` with values
``(0x123, [0x456, 0x789], "1234567890", "Hello, world!")`` is encoded in the following way:
We take the first four bytes of ``sha3("f(uint256,uint32[],bytes10,bytes)")``, i.e. ``0x8be65246``.
We take the first four bytes of ``keccak("f(uint256,uint32[],bytes10,bytes)")``, i.e. ``0x8be65246``.
Then we encode the head parts of all four arguments. For the static types ``uint256`` and ``bytes10``,
these are directly the values we want to pass, whereas for the dynamic types ``uint32[]`` and ``bytes``,
we use the offset in bytes to the start of their data area, measured from the start of the value
@ -348,7 +348,7 @@ All together, the encoding is (newline after function selector and each 32-bytes
000000000000000000000000000000000000000000000000000000000000000d
48656c6c6f2c20776f726c642100000000000000000000000000000000000000
Let us apply the same principle to encode the data for a function with a signature ``g(uint[][],string[])``
Let us apply the same principle to encode the data for a function with a signature ``g(uint256[][],string[])``
with values ``([[1, 2], [3]], ["one", "two", "three"])`` but start from the most atomic parts of the encoding:
First we encode the length and data of the first embedded dynamic array ``[1, 2]`` of the first root array ``[[1, 2], [3]]``:
@ -417,7 +417,7 @@ thus ``e = 0x00000000000000000000000000000000000000000000000000000000000000e0``.
Note that the encodings of the embedded elements of the root arrays are not dependent on each other
and have the same encodings for a function with a signature ``g(string[],uint[][])``.
and have the same encodings for a function with a signature ``g(string[],uint256[][])``.
Then we encode the length of the first root array:
@ -503,6 +503,7 @@ efficient search and arbitrary legibility by defining events with two arguments
indexed, one not — intended to hold the same value.
.. _abi_errors:
.. index:: error, selector; of an error
Errors
======
@ -562,7 +563,7 @@ A function description is a JSON object with the fields:
blockchain state <pure-functions>`), ``view`` (:ref:`specified to not modify the blockchain
state <view-functions>`), ``nonpayable`` (function does not accept Ether - the default) and ``payable`` (function accepts Ether).
Constructor and fallback function never have ``name`` or ``outputs``. Fallback function doesn't have ``inputs`` either.
Constructor, receive, and fallback never have ``name`` or ``outputs``. Receive and fallback do not have ``inputs`` either.
.. note::
Sending non-zero Ether to non-payable function will revert the transaction.
@ -580,7 +581,7 @@ An event description is a JSON object with fairly similar fields:
* ``name``: the name of the parameter.
* ``type``: the canonical type of the parameter (more below).
* ``components``: used for tuple types (more below).
* ``indexed``: ``true`` if the field is part of the log's topics, ``false`` if it one of the log's data segment.
* ``indexed``: ``true`` if the field is part of the log's topics, ``false`` if it is one of the log's data segments.
- ``anonymous``: ``true`` if the event was declared as ``anonymous``.
@ -596,7 +597,7 @@ Errors look as follows:
.. note::
There can be multiple errors with the same name and even with identical signature
in the JSON array, for example if the errors originate from different
in the JSON array; for example, if the errors originate from different
files in the smart contract or are referenced from another smart contract.
For the ABI, only the name of the error itself is relevant and not where it is
defined.
@ -645,7 +646,7 @@ would result in the JSON:
Handling tuple types
--------------------
Despite that names are intentionally not part of the ABI encoding they do make a lot of sense to be included
Despite the fact that names are intentionally not part of the ABI encoding, they do make a lot of sense to be included
in the JSON to enable displaying it to the end user. The structure is nested in the following way:
An object with members ``name``, ``type`` and potentially ``components`` describes a typed variable.
@ -653,7 +654,7 @@ The canonical type is determined until a tuple type is reached and the string de
to that point is stored in ``type`` prefix with the word ``tuple``, i.e. it will be ``tuple`` followed by
a sequence of ``[]`` and ``[k]`` with
integers ``k``. The components of the tuple are then stored in the member ``components``,
which is of array type and has the same structure as the top-level object except that
which is of an array type and has the same structure as the top-level object except that
``indexed`` is not allowed there.
As an example, the code
@ -737,10 +738,10 @@ Strict Encoding Mode
====================
Strict encoding mode is the mode that leads to exactly the same encoding as defined in the formal specification above.
This means offsets have to be as small as possible while still not creating overlaps in the data areas and thus no gaps are
This means that offsets have to be as small as possible while still not creating overlaps in the data areas, and thus no gaps are
allowed.
Usually, ABI decoders are written in a straightforward way just following offset pointers, but some decoders
Usually, ABI decoders are written in a straightforward way by just following offset pointers, but some decoders
might enforce strict mode. The Solidity ABI decoder currently does not enforce strict mode, but the encoder
always creates data in strict mode.
@ -776,7 +777,7 @@ More specifically:
encoding of its elements **with** padding.
- Dynamically-sized types like ``string``, ``bytes`` or ``uint[]`` are encoded
without their length field.
- The encoding of ``string`` or ``bytes`` does not apply padding at the end
- The encoding of ``string`` or ``bytes`` does not apply padding at the end,
unless it is part of an array or struct (then it is padded to a multiple of
32 bytes).
@ -804,7 +805,7 @@ Encoding of Indexed Event Parameters
====================================
Indexed event parameters that are not value types, i.e. arrays and structs are not
stored directly but instead a keccak256-hash of an encoding is stored. This encoding
stored directly but instead a Keccak-256 hash of an encoding is stored. This encoding
is defined as follows:
- the encoding of a ``bytes`` and ``string`` value is just the string contents

View File

@ -11,7 +11,7 @@ visual diff of the assembly before and after a change is often very enlightening
Consider the following contract (named, say ``contract.sol``):
.. code-block:: Solidity
.. code-block:: solidity
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.5.0 <0.9.0;

View File

@ -8,7 +8,7 @@ Inline Assembly
You can interleave Solidity statements with inline assembly in a language close
to the one of the Ethereum virtual machine. This gives you more fine-grained control,
to the one of the Ethereum Virtual Machine. This gives you more fine-grained control,
which is especially useful when you are enhancing the language by writing libraries.
The language used for inline assembly in Solidity is called :ref:`Yul <yul>`
@ -45,19 +45,19 @@ Solidity language without a compiler change.
pragma solidity >=0.4.16 <0.9.0;
library GetCode {
function at(address _addr) public view returns (bytes memory o_code) {
function at(address addr) public view returns (bytes memory code) {
assembly {
// retrieve the size of the code, this needs assembly
let size := extcodesize(_addr)
let size := extcodesize(addr)
// allocate output byte array - this could also be done without assembly
// by using o_code = new bytes(size)
o_code := mload(0x40)
// by using code = new bytes(size)
code := mload(0x40)
// new "memory end" including padding
mstore(0x40, add(o_code, and(add(add(size, 0x20), 0x1f), not(0x1f))))
mstore(0x40, add(code, and(add(add(size, 0x20), 0x1f), not(0x1f))))
// store length in memory
mstore(o_code, size)
mstore(code, size)
// actually retrieve the code, this needs assembly
extcodecopy(_addr, add(o_code, 0x20), 0, size)
extcodecopy(addr, add(code, 0x20), 0, size)
}
}
}
@ -74,49 +74,49 @@ efficient code, for example:
library VectorSum {
// This function is less efficient because the optimizer currently fails to
// remove the bounds checks in array access.
function sumSolidity(uint[] memory _data) public pure returns (uint sum) {
for (uint i = 0; i < _data.length; ++i)
sum += _data[i];
function sumSolidity(uint[] memory data) public pure returns (uint sum) {
for (uint i = 0; i < data.length; ++i)
sum += data[i];
}
// We know that we only access the array in bounds, so we can avoid the check.
// 0x20 needs to be added to an array because the first slot contains the
// array length.
function sumAsm(uint[] memory _data) public pure returns (uint sum) {
for (uint i = 0; i < _data.length; ++i) {
function sumAsm(uint[] memory data) public pure returns (uint sum) {
for (uint i = 0; i < data.length; ++i) {
assembly {
sum := add(sum, mload(add(add(_data, 0x20), mul(i, 0x20))))
sum := add(sum, mload(add(add(data, 0x20), mul(i, 0x20))))
}
}
}
// Same as above, but accomplish the entire code within inline assembly.
function sumPureAsm(uint[] memory _data) public pure returns (uint sum) {
function sumPureAsm(uint[] memory data) public pure returns (uint sum) {
assembly {
// Load the length (first 32 bytes)
let len := mload(_data)
let len := mload(data)
// Skip over the length field.
//
// Keep temporary variable so it can be incremented in place.
//
// NOTE: incrementing _data would result in an unusable
// _data variable after this assembly block
let data := add(_data, 0x20)
// NOTE: incrementing data would result in an unusable
// data variable after this assembly block
let dataElementLocation := add(data, 0x20)
// Iterate until the bound is not met.
for
{ let end := add(data, mul(len, 0x20)) }
lt(data, end)
{ data := add(data, 0x20) }
{ let end := add(dataElementLocation, mul(len, 0x20)) }
lt(dataElementLocation, end)
{ dataElementLocation := add(dataElementLocation, 0x20) }
{
sum := add(sum, mload(data))
sum := add(sum, mload(dataElementLocation))
}
}
}
}
.. index:: selector; of a function
Access to External Variables, Functions and Libraries
-----------------------------------------------------
@ -126,20 +126,20 @@ You can access Solidity variables and other identifiers by using their name.
Local variables of value type are directly usable in inline assembly.
They can both be read and assigned to.
Local variables that refer to memory evaluate to the address of the variable in memory not the value itself.
Local variables that refer to memory evaluate to the address of the variable in memory, not the value itself.
Such variables can also be assigned to, but note that an assignment will only change the pointer and not the data
and that it is your responsibility to respect Solidity's memory management.
See :ref:`Conventions in Solidity <conventions-in-solidity>`.
Similarly, local variables that refer to statically-sized calldata arrays or calldata structs
evaluate to the address of the variable in calldata, not the value itself.
The variable can also be assigned a new offset, but note that no validation to ensure that
the variable will not point beyond ``calldatasize()`` is performed.
The variable can also be assigned a new offset, but note that no validation is performed to ensure that
the variable will not point beyond ``calldatasize()``.
For external function pointers the address and the function selector can be
accessed using ``x.address`` and ``x.selector``.
The selector consists of four right-aligned bytes.
Both values are can be assigned to. For example:
Both values can be assigned to. For example:
.. code-block:: solidity
:force:
@ -205,7 +205,7 @@ Local Solidity variables are available for assignments, for example:
``assembly { signextend(<num_bytes_of_x_minus_one>, x) }``
Since Solidity 0.6.0 the name of a inline assembly variable may not
Since Solidity 0.6.0, the name of a inline assembly variable may not
shadow any declaration visible in the scope of the inline assembly block
(including variable, contract and function declarations).
@ -228,6 +228,11 @@ of their block is reached.
Conventions in Solidity
-----------------------
.. _assembly-typed-variables:
Values of Typed Variables
=========================
In contrast to EVM assembly, Solidity has types which are narrower than 256 bits,
e.g. ``uint24``. For efficiency, most arithmetic operations ignore the fact that
types can be shorter than 256
@ -237,13 +242,18 @@ This means that if you access such a variable
from within inline assembly, you might have to manually clean the higher-order bits
first.
.. _assembly-memory-management:
Memory Management
=================
Solidity manages memory in the following way. There is a "free memory pointer"
at position ``0x40`` in memory. If you want to allocate memory, use the memory
starting from where this pointer points at and update it.
There is no guarantee that the memory has not been used before and thus
you cannot assume that its contents are zero bytes.
There is no built-in mechanism to release or free allocated memory.
Here is an assembly snippet you can use for allocating memory that follows the process outlined above
Here is an assembly snippet you can use for allocating memory that follows the process outlined above:
.. code-block:: yul
@ -266,5 +276,103 @@ first slot of the array and followed by the array elements.
.. warning::
Statically-sized memory arrays do not have a length field, but it might be added later
to allow better convertibility between statically- and dynamically-sized arrays, so
to allow better convertibility between statically and dynamically-sized arrays; so,
do not rely on this.
Memory Safety
=============
Without the use of inline assembly, the compiler can rely on memory to remain in a well-defined
state at all times. This is especially relevant for :ref:`the new code generation pipeline via Yul IR <ir-breaking-changes>`:
this code generation path can move local variables from stack to memory to avoid stack-too-deep errors and
perform additional memory optimizations, if it can rely on certain assumptions about memory use.
While we recommend to always respect Solidity's memory model, inline assembly allows you to use memory
in an incompatible way. Therefore, moving stack variables to memory and additional memory optimizations are,
by default, globally disabled in the presence of any inline assembly block that contains a memory operation
or assigns to Solidity variables in memory.
However, you can specifically annotate an assembly block to indicate that it in fact respects Solidity's memory
model as follows:
.. code-block:: solidity
assembly ("memory-safe") {
...
}
In particular, a memory-safe assembly block may only access the following memory ranges:
- Memory allocated by yourself using a mechanism like the ``allocate`` function described above.
- Memory allocated by Solidity, e.g. memory within the bounds of a memory array you reference.
- The scratch space between memory offset 0 and 64 mentioned above.
- Temporary memory that is located *after* the value of the free memory pointer at the beginning of the assembly block,
i.e. memory that is "allocated" at the free memory pointer without updating the free memory pointer.
Furthermore, if the assembly block assigns to Solidity variables in memory, you need to assure that accesses to
the Solidity variables only access these memory ranges.
Since this is mainly about the optimizer, these restrictions still need to be followed, even if the assembly block
reverts or terminates. As an example, the following assembly snippet is not memory safe, because the value of
``returndatasize()`` may exceed the 64 byte scratch space:
.. code-block:: solidity
assembly {
returndatacopy(0, 0, returndatasize())
revert(0, returndatasize())
}
On the other hand, the following code *is* memory safe, because memory beyond the location pointed to by the
free memory pointer can safely be used as temporary scratch space:
.. code-block:: solidity
assembly ("memory-safe") {
let p := mload(0x40)
returndatacopy(p, 0, returndatasize())
revert(p, returndatasize())
}
Note that you do not need to update the free memory pointer if there is no following allocation,
but you can only use memory starting from the current offset given by the free memory pointer.
If the memory operations use a length of zero, it is also fine to just use any offset (not only if it falls into the scratch space):
.. code-block:: solidity
assembly ("memory-safe") {
revert(0, 0)
}
Note that not only memory operations in inline assembly itself can be memory-unsafe, but also assignments to
Solidity variables of reference type in memory. For example the following is not memory-safe:
.. code-block:: solidity
bytes memory x;
assembly {
x := 0x40
}
x[0x20] = 0x42;
Inline assembly that neither involves any operations that access memory nor assigns to any Solidity variables
in memory is automatically considered memory-safe and does not need to be annotated.
.. warning::
It is your responsibility to make sure that the assembly actually satisfies the memory model. If you annotate
an assembly block as memory-safe, but violate one of the memory assumptions, this **will** lead to incorrect and
undefined behavior that cannot easily be discovered by testing.
In case you are developing a library that is meant to be compatible across multiple versions
of Solidity, you can use a special comment to annotate an assembly block as memory-safe:
.. code-block:: solidity
/// @solidity memory-safe-assembly
assembly {
...
}
Note that we will disallow the annotation via comment in a future breaking release; so, if you are not concerned with
backward-compatibility with older compiler versions, prefer using the dialect string.

View File

@ -67,7 +67,7 @@ When using the Solidity logo, please respect the Solidity logo guidelines.
Solidity Logo Guidelines
========================
.. image:: logo.svg
.. image:: solidity_logo.svg
:width: 256
*(Right click on the logo to download it.)*

View File

@ -1,4 +1,110 @@
[
{
"uid": "SOL-2023-2",
"name": "FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"summary": "Optimizer sequences containing FullInliner do not preserve the evaluation order of arguments of inlined function calls in code that is not in expression-split form.",
"description": "Function call arguments in Yul are evaluated right to left. This order matters when the argument expressions have side-effects, and changing it may change contract behavior. FullInliner is an optimizer step that can replace a function call with the body of that function. The transformation involves assigning argument expressions to temporary variables, which imposes an explicit evaluation order. FullInliner was written with the assumption that this order does not necessarily have to match usual argument evaluation order because the argument expressions have no side-effects. In most circumstances this assumption is true because the default optimization step sequence contains the ExpressionSplitter step. ExpressionSplitter ensures that the code is in *expression-split form*, which means that function calls cannot appear nested inside expressions, and all function call arguments have to be variables. The assumption is, however, not guaranteed to be true in general. Version 0.6.7 introduced a setting allowing users to specify an arbitrary optimization step sequence, making it possible for the FullInliner to actually encounter argument expressions with side-effects, which can result in behavior differences between optimized and unoptimized bytecode. Contracts compiled without optimization or with the default optimization sequence are not affected. To trigger the bug the user has to explicitly choose compiler settings that contain a sequence with FullInliner step not preceded by ExpressionSplitter.",
"link": "https://blog.soliditylang.org/2023/07/19/full-inliner-non-expression-split-argument-evaluation-order-bug/",
"introduced": "0.6.7",
"fixed": "0.8.21",
"severity": "low",
"conditions": {
"yulOptimizer": true
}
},
{
"uid": "SOL-2023-1",
"name": "MissingSideEffectsOnSelectorAccess",
"summary": "Accessing the ``.selector`` member on complex expressions leaves the expression unevaluated in the legacy code generation.",
"description": "When accessing the ``.selector`` member on an expression with side-effects, like an assignment, a function call or a conditional, the expression would not be evaluated in the legacy code generation. This would happen in expressions where the functions used in the expression were all known at compilation time, regardless of whether the whole expression could be evaluated at compilation time or not. Note that the code generated by the IR pipeline was unaffected and would behave as expected.",
"link": "https://blog.soliditylang.org/2023/07/19/missing-side-effects-on-selector-access-bug/",
"introduced": "0.6.2",
"fixed": "0.8.21",
"severity": "low",
"conditions": {
"viaIR": false
}
},
{
"uid": "SOL-2022-7",
"name": "StorageWriteRemovalBeforeConditionalTermination",
"summary": "Calling functions that conditionally terminate the external EVM call using the assembly statements ``return(...)`` or ``stop()`` may result in incorrect removals of prior storage writes.",
"description": "A call to a Yul function that conditionally terminates the external EVM call could result in prior storage writes being incorrectly removed by the Yul optimizer. This used to happen in cases in which it would have been valid to remove the store, if the Yul function in question never actually terminated the external call, and the control flow always returned back to the caller instead. Conditional termination within the same Yul block instead of within a called function was not affected. In Solidity with optimized via-IR code generation, any storage write before a function conditionally calling ``return(...)`` or ``stop()`` in inline assembly, may have been incorrectly removed, whenever it would have been valid to remove the write without the ``return(...)`` or ``stop()``. In optimized legacy code generation, only inline assembly that did not refer to any Solidity variables and that involved conditionally-terminating user-defined assembly functions could be affected.",
"link": "https://blog.soliditylang.org/2022/09/08/storage-write-removal-before-conditional-termination/",
"introduced": "0.8.13",
"fixed": "0.8.17",
"severity": "medium/high",
"conditions": {
"yulOptimizer": true
}
},
{
"uid": "SOL-2022-6",
"name": "AbiReencodingHeadOverflowWithStaticArrayCleanup",
"summary": "ABI-encoding a tuple with a statically-sized calldata array in the last component would corrupt 32 leading bytes of its first dynamically encoded component.",
"description": "When ABI-encoding a statically-sized calldata array, the compiler always pads the data area to a multiple of 32-bytes and ensures that the padding bytes are zeroed. In some cases, this cleanup used to be performed by always writing exactly 32 bytes, regardless of how many needed to be zeroed. This was done with the assumption that the data that would eventually occupy the area past the end of the array had not yet been written, because the encoder processes tuple components in the order they were given. While this assumption is mostly true, there is an important corner case: dynamically encoded tuple components are stored separately from the statically-sized ones in an area called the *tail* of the encoding and the tail immediately follows the *head*, which is where the statically-sized components are placed. The aforementioned cleanup, if performed for the last component of the head would cross into the tail and overwrite up to 32 bytes of the first component stored there with zeros. The only array type for which the cleanup could actually result in an overwrite were arrays with ``uint256`` or ``bytes32`` as the base element type and in this case the size of the corrupted area was always exactly 32 bytes. The problem affected tuples at any nesting level. This included also structs, which are encoded as tuples in the ABI. Note also that lists of parameters and return values of functions, events and errors are encoded as tuples.",
"link": "https://blog.soliditylang.org/2022/08/08/calldata-tuple-reencoding-head-overflow-bug/",
"introduced": "0.5.8",
"fixed": "0.8.16",
"severity": "medium",
"conditions": {
"ABIEncoderV2": true
}
},
{
"uid": "SOL-2022-5",
"name": "DirtyBytesArrayToStorage",
"summary": "Copying ``bytes`` arrays from memory or calldata to storage may result in dirty storage values.",
"description": "Copying ``bytes`` arrays from memory or calldata to storage is done in chunks of 32 bytes even if the length is not a multiple of 32. Thereby, extra bytes past the end of the array may be copied from calldata or memory to storage. These dirty bytes may then become observable after a ``.push()`` without arguments to the bytes array in storage, i.e. such a push will not result in a zero value at the end of the array as expected. This bug only affects the legacy code generation pipeline, the new code generation pipeline via IR is not affected.",
"link": "https://blog.soliditylang.org/2022/06/15/dirty-bytes-array-to-storage-bug/",
"introduced": "0.0.1",
"fixed": "0.8.15",
"severity": "low"
},
{
"uid": "SOL-2022-4",
"name": "InlineAssemblyMemorySideEffects",
"summary": "The Yul optimizer may incorrectly remove memory writes from inline assembly blocks, that do not access solidity variables.",
"description": "The Yul optimizer considers all memory writes in the outermost Yul block that are never read from as unused and removes them. This is valid when that Yul block is the entire Yul program, which is always the case for the Yul code generated by the new via-IR pipeline. Inline assembly blocks are never optimized in isolation when using that pipeline. Instead they are optimized as a part of the whole Yul input. However, the legacy code generation pipeline (which is still the default) runs the Yul optimizer individually on an inline assembly block if the block does not refer to any local variables defined in the surrounding Solidity code. Consequently, memory writes in such inline assembly blocks are removed as well, if the written memory is never read from in the same assembly block, even if the written memory is accessed later, for example by a subsequent inline assembly block.",
"link": "https://blog.soliditylang.org/2022/06/15/inline-assembly-memory-side-effects-bug/",
"introduced": "0.8.13",
"fixed": "0.8.15",
"severity": "medium",
"conditions": {
"yulOptimizer": true
}
},
{
"uid": "SOL-2022-3",
"name": "DataLocationChangeInInternalOverride",
"summary": "It was possible to change the data location of the parameters or return variables from ``calldata`` to ``memory`` and vice-versa while overriding internal and public functions. This caused invalid code to be generated when calling such a function internally through virtual function calls.",
"description": "When calling external functions, it is irrelevant if the data location of the parameters is ``calldata`` or ``memory``, the encoding of the data does not change. Because of that, changing the data location when overriding external functions is allowed. The compiler incorrectly also allowed a change in the data location for overriding public and internal functions. Since public functions can be called internally as well as externally, this causes invalid code to be generated when such an incorrectly overridden function is called internally through the base contract. The caller provides a memory pointer, but the called function interprets it as a calldata pointer or vice-versa.",
"link": "https://blog.soliditylang.org/2022/05/17/data-location-inheritance-bug/",
"introduced": "0.6.9",
"fixed": "0.8.14",
"severity": "very low"
},
{
"uid": "SOL-2022-2",
"name": "NestedCalldataArrayAbiReencodingSizeValidation",
"summary": "ABI-reencoding of nested dynamic calldata arrays did not always perform proper size checks against the size of calldata and could read beyond ``calldatasize()``.",
"description": "Calldata validation for nested dynamic types is deferred until the first access to the nested values. Such an access may for example be a copy to memory or an index or member access to the outer type. While in most such accesses calldata validation correctly checks that the data area of the nested array is completely contained in the passed calldata (i.e. in the range [0, calldatasize()]), this check may not be performed, when ABI encoding such nested types again directly from calldata. For instance, this can happen, if a value in calldata with a nested dynamic array is passed to an external call, used in ``abi.encode`` or emitted as event. In such cases, if the data area of the nested array extends beyond ``calldatasize()``, ABI encoding it did not revert, but continued reading values from beyond ``calldatasize()`` (i.e. zero values).",
"link": "https://blog.soliditylang.org/2022/05/17/calldata-reencode-size-check-bug/",
"introduced": "0.5.8",
"fixed": "0.8.14",
"severity": "very low"
},
{
"uid": "SOL-2022-1",
"name": "AbiEncodeCallLiteralAsFixedBytesBug",
"summary": "Literals used for a fixed length bytes parameter in ``abi.encodeCall`` were encoded incorrectly.",
"description": "For the encoding, the compiler only considered the types of the expressions in the second argument of ``abi.encodeCall`` itself, but not the parameter types of the function given as first argument. In almost all cases the abi encoding of the type of the expression matches the abi encoding of the parameter type of the given function. This is because the type checker ensures the expression is implicitly convertible to the respective parameter type. However this is not true for number literals used for fixed bytes types shorter than 32 bytes, nor for string literals used for any fixed bytes type. Number literals were encoded as numbers instead of being shifted to become left-aligned. String literals were encoded as dynamically sized memory strings instead of being converted to a left-aligned bytes value.",
"link": "https://blog.soliditylang.org/2022/03/16/encodecall-bug/",
"introduced": "0.8.11",
"fixed": "0.8.13",
"severity": "very low"
},
{
"uid": "SOL-2021-4",
"name": "UserDefinedValueTypesBug",
@ -8,7 +114,6 @@
"introduced": "0.8.8",
"fixed": "0.8.9",
"severity": "very low"
},
{
"uid": "SOL-2021-3",

View File

@ -68,7 +68,7 @@ conditions
If no conditions are given, assume that the bug is present.
check
This field contains different checks that report whether the smart contract
contains the bug or not. The first type of check are Javascript regular
contains the bug or not. The first type of check are JavaScript regular
expressions that are to be matched against the source code ("source-regex")
if the bug is present. If there is no match, then the bug is very likely
not present. If there is a match, the bug might be present. For improved

View File

@ -1,6 +1,7 @@
{
"0.1.0": {
"bugs": [
"DirtyBytesArrayToStorage",
"KeccakCaching",
"EmptyByteArrayCopy",
"DynamicArrayCleanup",
@ -22,6 +23,7 @@
},
"0.1.1": {
"bugs": [
"DirtyBytesArrayToStorage",
"KeccakCaching",
"EmptyByteArrayCopy",
"DynamicArrayCleanup",
@ -43,6 +45,7 @@
},
"0.1.2": {
"bugs": [
"DirtyBytesArrayToStorage",
"KeccakCaching",
"EmptyByteArrayCopy",
"DynamicArrayCleanup",
@ -64,6 +67,7 @@
},
"0.1.3": {
"bugs": [
"DirtyBytesArrayToStorage",
"KeccakCaching",
"EmptyByteArrayCopy",
"DynamicArrayCleanup",
@ -85,6 +89,7 @@
},
"0.1.4": {
"bugs": [
"DirtyBytesArrayToStorage",
"KeccakCaching",
"EmptyByteArrayCopy",
"DynamicArrayCleanup",
@ -107,6 +112,7 @@
},
"0.1.5": {
"bugs": [
"DirtyBytesArrayToStorage",
"KeccakCaching",
"EmptyByteArrayCopy",
"DynamicArrayCleanup",
@ -129,6 +135,7 @@
},
"0.1.6": {
"bugs": [
"DirtyBytesArrayToStorage",
"KeccakCaching",
"EmptyByteArrayCopy",
"DynamicArrayCleanup",
@ -153,6 +160,7 @@
},
"0.1.7": {
"bugs": [
"DirtyBytesArrayToStorage",
"KeccakCaching",
"EmptyByteArrayCopy",
"DynamicArrayCleanup",
@ -177,6 +185,7 @@
},
"0.2.0": {
"bugs": [
"DirtyBytesArrayToStorage",
"KeccakCaching",
"EmptyByteArrayCopy",
"DynamicArrayCleanup",
@ -202,6 +211,7 @@
},
"0.2.1": {
"bugs": [
"DirtyBytesArrayToStorage",
"KeccakCaching",
"EmptyByteArrayCopy",
"DynamicArrayCleanup",
@ -227,6 +237,7 @@
},
"0.2.2": {
"bugs": [
"DirtyBytesArrayToStorage",
"KeccakCaching",
"EmptyByteArrayCopy",
"DynamicArrayCleanup",
@ -252,6 +263,7 @@
},
"0.3.0": {
"bugs": [
"DirtyBytesArrayToStorage",
"KeccakCaching",
"EmptyByteArrayCopy",
"DynamicArrayCleanup",
@ -279,6 +291,7 @@
},
"0.3.1": {
"bugs": [
"DirtyBytesArrayToStorage",
"KeccakCaching",
"EmptyByteArrayCopy",
"DynamicArrayCleanup",
@ -305,6 +318,7 @@
},
"0.3.2": {
"bugs": [
"DirtyBytesArrayToStorage",
"KeccakCaching",
"EmptyByteArrayCopy",
"DynamicArrayCleanup",
@ -331,6 +345,7 @@
},
"0.3.3": {
"bugs": [
"DirtyBytesArrayToStorage",
"KeccakCaching",
"EmptyByteArrayCopy",
"DynamicArrayCleanup",
@ -356,6 +371,7 @@
},
"0.3.4": {
"bugs": [
"DirtyBytesArrayToStorage",
"KeccakCaching",
"EmptyByteArrayCopy",
"DynamicArrayCleanup",
@ -381,6 +397,7 @@
},
"0.3.5": {
"bugs": [
"DirtyBytesArrayToStorage",
"KeccakCaching",
"EmptyByteArrayCopy",
"DynamicArrayCleanup",
@ -406,6 +423,7 @@
},
"0.3.6": {
"bugs": [
"DirtyBytesArrayToStorage",
"KeccakCaching",
"EmptyByteArrayCopy",
"DynamicArrayCleanup",
@ -429,6 +447,7 @@
},
"0.4.0": {
"bugs": [
"DirtyBytesArrayToStorage",
"KeccakCaching",
"EmptyByteArrayCopy",
"DynamicArrayCleanup",
@ -452,6 +471,7 @@
},
"0.4.1": {
"bugs": [
"DirtyBytesArrayToStorage",
"KeccakCaching",
"EmptyByteArrayCopy",
"DynamicArrayCleanup",
@ -475,6 +495,7 @@
},
"0.4.10": {
"bugs": [
"DirtyBytesArrayToStorage",
"KeccakCaching",
"EmptyByteArrayCopy",
"DynamicArrayCleanup",
@ -497,6 +518,7 @@
},
"0.4.11": {
"bugs": [
"DirtyBytesArrayToStorage",
"KeccakCaching",
"EmptyByteArrayCopy",
"DynamicArrayCleanup",
@ -518,6 +540,7 @@
},
"0.4.12": {
"bugs": [
"DirtyBytesArrayToStorage",
"KeccakCaching",
"EmptyByteArrayCopy",
"DynamicArrayCleanup",
@ -538,6 +561,7 @@
},
"0.4.13": {
"bugs": [
"DirtyBytesArrayToStorage",
"KeccakCaching",
"EmptyByteArrayCopy",
"DynamicArrayCleanup",
@ -558,6 +582,7 @@
},
"0.4.14": {
"bugs": [
"DirtyBytesArrayToStorage",
"KeccakCaching",
"EmptyByteArrayCopy",
"DynamicArrayCleanup",
@ -577,6 +602,7 @@
},
"0.4.15": {
"bugs": [
"DirtyBytesArrayToStorage",
"KeccakCaching",
"EmptyByteArrayCopy",
"DynamicArrayCleanup",
@ -595,6 +621,7 @@
},
"0.4.16": {
"bugs": [
"DirtyBytesArrayToStorage",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
"EmptyByteArrayCopy",
@ -616,6 +643,7 @@
},
"0.4.17": {
"bugs": [
"DirtyBytesArrayToStorage",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
"EmptyByteArrayCopy",
@ -638,6 +666,7 @@
},
"0.4.18": {
"bugs": [
"DirtyBytesArrayToStorage",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
"EmptyByteArrayCopy",
@ -659,6 +688,7 @@
},
"0.4.19": {
"bugs": [
"DirtyBytesArrayToStorage",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
"EmptyByteArrayCopy",
@ -681,6 +711,7 @@
},
"0.4.2": {
"bugs": [
"DirtyBytesArrayToStorage",
"KeccakCaching",
"EmptyByteArrayCopy",
"DynamicArrayCleanup",
@ -703,6 +734,7 @@
},
"0.4.20": {
"bugs": [
"DirtyBytesArrayToStorage",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
"EmptyByteArrayCopy",
@ -725,6 +757,7 @@
},
"0.4.21": {
"bugs": [
"DirtyBytesArrayToStorage",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
"EmptyByteArrayCopy",
@ -747,6 +780,7 @@
},
"0.4.22": {
"bugs": [
"DirtyBytesArrayToStorage",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
"EmptyByteArrayCopy",
@ -769,6 +803,7 @@
},
"0.4.23": {
"bugs": [
"DirtyBytesArrayToStorage",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
"EmptyByteArrayCopy",
@ -790,6 +825,7 @@
},
"0.4.24": {
"bugs": [
"DirtyBytesArrayToStorage",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
"EmptyByteArrayCopy",
@ -811,6 +847,7 @@
},
"0.4.25": {
"bugs": [
"DirtyBytesArrayToStorage",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
"EmptyByteArrayCopy",
@ -830,6 +867,7 @@
},
"0.4.26": {
"bugs": [
"DirtyBytesArrayToStorage",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
"EmptyByteArrayCopy",
@ -846,6 +884,7 @@
},
"0.4.3": {
"bugs": [
"DirtyBytesArrayToStorage",
"KeccakCaching",
"EmptyByteArrayCopy",
"DynamicArrayCleanup",
@ -867,6 +906,7 @@
},
"0.4.4": {
"bugs": [
"DirtyBytesArrayToStorage",
"KeccakCaching",
"EmptyByteArrayCopy",
"DynamicArrayCleanup",
@ -887,6 +927,7 @@
},
"0.4.5": {
"bugs": [
"DirtyBytesArrayToStorage",
"KeccakCaching",
"EmptyByteArrayCopy",
"DynamicArrayCleanup",
@ -910,6 +951,7 @@
},
"0.4.6": {
"bugs": [
"DirtyBytesArrayToStorage",
"KeccakCaching",
"EmptyByteArrayCopy",
"DynamicArrayCleanup",
@ -932,6 +974,7 @@
},
"0.4.7": {
"bugs": [
"DirtyBytesArrayToStorage",
"KeccakCaching",
"EmptyByteArrayCopy",
"DynamicArrayCleanup",
@ -954,6 +997,7 @@
},
"0.4.8": {
"bugs": [
"DirtyBytesArrayToStorage",
"KeccakCaching",
"EmptyByteArrayCopy",
"DynamicArrayCleanup",
@ -976,6 +1020,7 @@
},
"0.4.9": {
"bugs": [
"DirtyBytesArrayToStorage",
"KeccakCaching",
"EmptyByteArrayCopy",
"DynamicArrayCleanup",
@ -998,6 +1043,7 @@
},
"0.5.0": {
"bugs": [
"DirtyBytesArrayToStorage",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
"EmptyByteArrayCopy",
@ -1017,6 +1063,7 @@
},
"0.5.1": {
"bugs": [
"DirtyBytesArrayToStorage",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
"EmptyByteArrayCopy",
@ -1036,6 +1083,9 @@
},
"0.5.10": {
"bugs": [
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"NestedCalldataArrayAbiReencodingSizeValidation",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
"EmptyByteArrayCopy",
@ -1051,6 +1101,9 @@
},
"0.5.11": {
"bugs": [
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"NestedCalldataArrayAbiReencodingSizeValidation",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
"EmptyByteArrayCopy",
@ -1065,6 +1118,9 @@
},
"0.5.12": {
"bugs": [
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"NestedCalldataArrayAbiReencodingSizeValidation",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
"EmptyByteArrayCopy",
@ -1079,6 +1135,9 @@
},
"0.5.13": {
"bugs": [
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"NestedCalldataArrayAbiReencodingSizeValidation",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
"EmptyByteArrayCopy",
@ -1093,6 +1152,9 @@
},
"0.5.14": {
"bugs": [
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"NestedCalldataArrayAbiReencodingSizeValidation",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
"EmptyByteArrayCopy",
@ -1109,6 +1171,9 @@
},
"0.5.15": {
"bugs": [
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"NestedCalldataArrayAbiReencodingSizeValidation",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
"EmptyByteArrayCopy",
@ -1124,6 +1189,9 @@
},
"0.5.16": {
"bugs": [
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"NestedCalldataArrayAbiReencodingSizeValidation",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
"EmptyByteArrayCopy",
@ -1138,6 +1206,9 @@
},
"0.5.17": {
"bugs": [
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"NestedCalldataArrayAbiReencodingSizeValidation",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
"EmptyByteArrayCopy",
@ -1151,6 +1222,7 @@
},
"0.5.2": {
"bugs": [
"DirtyBytesArrayToStorage",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
"EmptyByteArrayCopy",
@ -1170,6 +1242,7 @@
},
"0.5.3": {
"bugs": [
"DirtyBytesArrayToStorage",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
"EmptyByteArrayCopy",
@ -1189,6 +1262,7 @@
},
"0.5.4": {
"bugs": [
"DirtyBytesArrayToStorage",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
"EmptyByteArrayCopy",
@ -1208,6 +1282,7 @@
},
"0.5.5": {
"bugs": [
"DirtyBytesArrayToStorage",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
"EmptyByteArrayCopy",
@ -1229,6 +1304,7 @@
},
"0.5.6": {
"bugs": [
"DirtyBytesArrayToStorage",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
"EmptyByteArrayCopy",
@ -1250,6 +1326,7 @@
},
"0.5.7": {
"bugs": [
"DirtyBytesArrayToStorage",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
"EmptyByteArrayCopy",
@ -1269,6 +1346,9 @@
},
"0.5.8": {
"bugs": [
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"NestedCalldataArrayAbiReencodingSizeValidation",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
"EmptyByteArrayCopy",
@ -1287,6 +1367,9 @@
},
"0.5.9": {
"bugs": [
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"NestedCalldataArrayAbiReencodingSizeValidation",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
"EmptyByteArrayCopy",
@ -1304,6 +1387,9 @@
},
"0.6.0": {
"bugs": [
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"NestedCalldataArrayAbiReencodingSizeValidation",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
"EmptyByteArrayCopy",
@ -1319,6 +1405,9 @@
},
"0.6.1": {
"bugs": [
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"NestedCalldataArrayAbiReencodingSizeValidation",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
"EmptyByteArrayCopy",
@ -1333,6 +1422,12 @@
},
"0.6.10": {
"bugs": [
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"DataLocationChangeInInternalOverride",
"NestedCalldataArrayAbiReencodingSizeValidation",
"SignedImmutables",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
@ -1343,6 +1438,12 @@
},
"0.6.11": {
"bugs": [
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"DataLocationChangeInInternalOverride",
"NestedCalldataArrayAbiReencodingSizeValidation",
"SignedImmutables",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
@ -1353,6 +1454,12 @@
},
"0.6.12": {
"bugs": [
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"DataLocationChangeInInternalOverride",
"NestedCalldataArrayAbiReencodingSizeValidation",
"SignedImmutables",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
@ -1363,6 +1470,10 @@
},
"0.6.2": {
"bugs": [
"MissingSideEffectsOnSelectorAccess",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"NestedCalldataArrayAbiReencodingSizeValidation",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
"EmptyByteArrayCopy",
@ -1377,6 +1488,10 @@
},
"0.6.3": {
"bugs": [
"MissingSideEffectsOnSelectorAccess",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"NestedCalldataArrayAbiReencodingSizeValidation",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
"EmptyByteArrayCopy",
@ -1391,6 +1506,10 @@
},
"0.6.4": {
"bugs": [
"MissingSideEffectsOnSelectorAccess",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"NestedCalldataArrayAbiReencodingSizeValidation",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
"EmptyByteArrayCopy",
@ -1405,6 +1524,10 @@
},
"0.6.5": {
"bugs": [
"MissingSideEffectsOnSelectorAccess",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"NestedCalldataArrayAbiReencodingSizeValidation",
"SignedImmutables",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
@ -1419,6 +1542,10 @@
},
"0.6.6": {
"bugs": [
"MissingSideEffectsOnSelectorAccess",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"NestedCalldataArrayAbiReencodingSizeValidation",
"SignedImmutables",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
@ -1432,6 +1559,11 @@
},
"0.6.7": {
"bugs": [
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"NestedCalldataArrayAbiReencodingSizeValidation",
"SignedImmutables",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
@ -1445,6 +1577,11 @@
},
"0.6.8": {
"bugs": [
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"NestedCalldataArrayAbiReencodingSizeValidation",
"SignedImmutables",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
@ -1455,6 +1592,12 @@
},
"0.6.9": {
"bugs": [
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"DataLocationChangeInInternalOverride",
"NestedCalldataArrayAbiReencodingSizeValidation",
"SignedImmutables",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
@ -1466,6 +1609,12 @@
},
"0.7.0": {
"bugs": [
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"DataLocationChangeInInternalOverride",
"NestedCalldataArrayAbiReencodingSizeValidation",
"SignedImmutables",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
@ -1476,6 +1625,12 @@
},
"0.7.1": {
"bugs": [
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"DataLocationChangeInInternalOverride",
"NestedCalldataArrayAbiReencodingSizeValidation",
"SignedImmutables",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
@ -1487,6 +1642,12 @@
},
"0.7.2": {
"bugs": [
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"DataLocationChangeInInternalOverride",
"NestedCalldataArrayAbiReencodingSizeValidation",
"SignedImmutables",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
@ -1497,6 +1658,12 @@
},
"0.7.3": {
"bugs": [
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"DataLocationChangeInInternalOverride",
"NestedCalldataArrayAbiReencodingSizeValidation",
"SignedImmutables",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching",
@ -1506,6 +1673,12 @@
},
"0.7.4": {
"bugs": [
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"DataLocationChangeInInternalOverride",
"NestedCalldataArrayAbiReencodingSizeValidation",
"SignedImmutables",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching"
@ -1514,6 +1687,12 @@
},
"0.7.5": {
"bugs": [
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"DataLocationChangeInInternalOverride",
"NestedCalldataArrayAbiReencodingSizeValidation",
"SignedImmutables",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching"
@ -1522,6 +1701,12 @@
},
"0.7.6": {
"bugs": [
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"DataLocationChangeInInternalOverride",
"NestedCalldataArrayAbiReencodingSizeValidation",
"SignedImmutables",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching"
@ -1530,6 +1715,12 @@
},
"0.8.0": {
"bugs": [
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"DataLocationChangeInInternalOverride",
"NestedCalldataArrayAbiReencodingSizeValidation",
"SignedImmutables",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching"
@ -1538,6 +1729,12 @@
},
"0.8.1": {
"bugs": [
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"DataLocationChangeInInternalOverride",
"NestedCalldataArrayAbiReencodingSizeValidation",
"SignedImmutables",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching"
@ -1545,27 +1742,135 @@
"released": "2021-01-27"
},
"0.8.10": {
"bugs": [],
"bugs": [
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"DataLocationChangeInInternalOverride",
"NestedCalldataArrayAbiReencodingSizeValidation"
],
"released": "2021-11-09"
},
"0.8.11": {
"bugs": [],
"bugs": [
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"DataLocationChangeInInternalOverride",
"NestedCalldataArrayAbiReencodingSizeValidation",
"AbiEncodeCallLiteralAsFixedBytesBug"
],
"released": "2021-12-20"
},
"0.8.12": {
"bugs": [],
"bugs": [
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"DataLocationChangeInInternalOverride",
"NestedCalldataArrayAbiReencodingSizeValidation",
"AbiEncodeCallLiteralAsFixedBytesBug"
],
"released": "2022-02-16"
},
"0.8.13": {
"bugs": [
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"StorageWriteRemovalBeforeConditionalTermination",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"InlineAssemblyMemorySideEffects",
"DataLocationChangeInInternalOverride",
"NestedCalldataArrayAbiReencodingSizeValidation"
],
"released": "2022-03-16"
},
"0.8.14": {
"bugs": [
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"StorageWriteRemovalBeforeConditionalTermination",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"InlineAssemblyMemorySideEffects"
],
"released": "2022-05-17"
},
"0.8.15": {
"bugs": [
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"StorageWriteRemovalBeforeConditionalTermination",
"AbiReencodingHeadOverflowWithStaticArrayCleanup"
],
"released": "2022-06-15"
},
"0.8.16": {
"bugs": [
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"StorageWriteRemovalBeforeConditionalTermination"
],
"released": "2022-08-08"
},
"0.8.17": {
"bugs": [
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess"
],
"released": "2022-09-08"
},
"0.8.18": {
"bugs": [
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess"
],
"released": "2023-02-01"
},
"0.8.19": {
"bugs": [
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess"
],
"released": "2023-02-22"
},
"0.8.2": {
"bugs": [
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"DataLocationChangeInInternalOverride",
"NestedCalldataArrayAbiReencodingSizeValidation",
"SignedImmutables",
"ABIDecodeTwoDimensionalArrayMemory",
"KeccakCaching"
],
"released": "2021-03-02"
},
"0.8.20": {
"bugs": [
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess"
],
"released": "2023-05-10"
},
"0.8.21": {
"bugs": [],
"released": "2023-07-19"
},
"0.8.3": {
"bugs": [
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"DataLocationChangeInInternalOverride",
"NestedCalldataArrayAbiReencodingSizeValidation",
"SignedImmutables",
"ABIDecodeTwoDimensionalArrayMemory"
],
@ -1573,37 +1878,74 @@
},
"0.8.4": {
"bugs": [
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"DataLocationChangeInInternalOverride",
"NestedCalldataArrayAbiReencodingSizeValidation",
"SignedImmutables"
],
"released": "2021-04-21"
},
"0.8.5": {
"bugs": [
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"DataLocationChangeInInternalOverride",
"NestedCalldataArrayAbiReencodingSizeValidation",
"SignedImmutables"
],
"released": "2021-06-10"
},
"0.8.6": {
"bugs": [
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"DataLocationChangeInInternalOverride",
"NestedCalldataArrayAbiReencodingSizeValidation",
"SignedImmutables"
],
"released": "2021-06-22"
},
"0.8.7": {
"bugs": [
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"DataLocationChangeInInternalOverride",
"NestedCalldataArrayAbiReencodingSizeValidation",
"SignedImmutables"
],
"released": "2021-08-11"
},
"0.8.8": {
"bugs": [
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"DataLocationChangeInInternalOverride",
"NestedCalldataArrayAbiReencodingSizeValidation",
"UserDefinedValueTypesBug",
"SignedImmutables"
],
"released": "2021-09-27"
},
"0.8.9": {
"bugs": [],
"bugs": [
"FullInlinerNonExpressionSplitArgumentEvaluationOrder",
"MissingSideEffectsOnSelectorAccess",
"AbiReencodingHeadOverflowWithStaticArrayCleanup",
"DirtyBytesArrayToStorage",
"DataLocationChangeInInternalOverride",
"NestedCalldataArrayAbiReencodingSizeValidation"
],
"released": "2021-09-29"
}
}

View File

@ -2,75 +2,17 @@
Cheatsheet
**********
.. index:: precedence
.. _order:
.. index:: operator;precedence
Order of Precedence of Operators
================================
The following is the order of precedence for operators, listed in order of evaluation.
.. include:: types/operator-precedence-table.rst
+------------+-------------------------------------+--------------------------------------------+
| Precedence | Description | Operator |
+============+=====================================+============================================+
| *1* | Postfix increment and decrement | ``++``, ``--`` |
+ +-------------------------------------+--------------------------------------------+
| | New expression | ``new <typename>`` |
+ +-------------------------------------+--------------------------------------------+
| | Array subscripting | ``<array>[<index>]`` |
+ +-------------------------------------+--------------------------------------------+
| | Member access | ``<object>.<member>`` |
+ +-------------------------------------+--------------------------------------------+
| | Function-like call | ``<func>(<args...>)`` |
+ +-------------------------------------+--------------------------------------------+
| | Parentheses | ``(<statement>)`` |
+------------+-------------------------------------+--------------------------------------------+
| *2* | Prefix increment and decrement | ``++``, ``--`` |
+ +-------------------------------------+--------------------------------------------+
| | Unary minus | ``-`` |
+ +-------------------------------------+--------------------------------------------+
| | Unary operations | ``delete`` |
+ +-------------------------------------+--------------------------------------------+
| | Logical NOT | ``!`` |
+ +-------------------------------------+--------------------------------------------+
| | Bitwise NOT | ``~`` |
+------------+-------------------------------------+--------------------------------------------+
| *3* | Exponentiation | ``**`` |
+------------+-------------------------------------+--------------------------------------------+
| *4* | Multiplication, division and modulo | ``*``, ``/``, ``%`` |
+------------+-------------------------------------+--------------------------------------------+
| *5* | Addition and subtraction | ``+``, ``-`` |
+------------+-------------------------------------+--------------------------------------------+
| *6* | Bitwise shift operators | ``<<``, ``>>`` |
+------------+-------------------------------------+--------------------------------------------+
| *7* | Bitwise AND | ``&`` |
+------------+-------------------------------------+--------------------------------------------+
| *8* | Bitwise XOR | ``^`` |
+------------+-------------------------------------+--------------------------------------------+
| *9* | Bitwise OR | ``|`` |
+------------+-------------------------------------+--------------------------------------------+
| *10* | Inequality operators | ``<``, ``>``, ``<=``, ``>=`` |
+------------+-------------------------------------+--------------------------------------------+
| *11* | Equality operators | ``==``, ``!=`` |
+------------+-------------------------------------+--------------------------------------------+
| *12* | Logical AND | ``&&`` |
+------------+-------------------------------------+--------------------------------------------+
| *13* | Logical OR | ``||`` |
+------------+-------------------------------------+--------------------------------------------+
| *14* | Ternary operator | ``<conditional> ? <if-true> : <if-false>`` |
+ +-------------------------------------+--------------------------------------------+
| | Assignment operators | ``=``, ``|=``, ``^=``, ``&=``, ``<<=``, |
| | | ``>>=``, ``+=``, ``-=``, ``*=``, ``/=``, |
| | | ``%=`` |
+------------+-------------------------------------+--------------------------------------------+
| *15* | Comma operator | ``,`` |
+------------+-------------------------------------+--------------------------------------------+
.. index:: abi;decode, abi;encode, abi;encodePacked, abi;encodeWithSelector, abi;encodeCall, abi;encodeWithSignature
.. index:: assert, block, coinbase, difficulty, number, block;number, timestamp, block;timestamp, msg, data, gas, sender, value, gas price, origin, revert, require, keccak256, ripemd160, sha256, ecrecover, addmod, mulmod, cryptography, this, super, selfdestruct, balance, codehash, send
Global Variables
================
ABI Encoding and Decoding Functions
===================================
- ``abi.decode(bytes memory encodedData, (...)) returns (...)``: :ref:`ABI <ABI>`-decodes
the provided data. The types are given in parentheses as second argument.
@ -83,17 +25,45 @@ Global Variables
- ``abi.encodeCall(function functionPointer, (...)) returns (bytes memory)``: ABI-encodes a call to ``functionPointer`` with the arguments found in the
tuple. Performs a full type-check, ensuring the types match the function signature. Result equals ``abi.encodeWithSelector(functionPointer.selector, (...))``
- ``abi.encodeWithSignature(string memory signature, ...) returns (bytes memory)``: Equivalent
to ``abi.encodeWithSelector(bytes4(keccak256(bytes(signature)), ...)``
to ``abi.encodeWithSelector(bytes4(keccak256(bytes(signature))), ...)``
.. index:: bytes;concat, string;concat
Members of ``bytes`` and ``string``
====================================
- ``bytes.concat(...) returns (bytes memory)``: :ref:`Concatenates variable number of
arguments to one byte array<bytes-concat>`
- ``string.concat(...) returns (string memory)``: :ref:`Concatenates variable number of
arguments to one string array<string-concat>`
.. index:: address;balance, address;codehash, address;send, address;code, address;transfer
Members of ``address``
======================
- ``<address>.balance`` (``uint256``): balance of the :ref:`address` in Wei
- ``<address>.code`` (``bytes memory``): code at the :ref:`address` (can be empty)
- ``<address>.codehash`` (``bytes32``): the codehash of the :ref:`address`
- ``<address payable>.send(uint256 amount) returns (bool)``: send given amount of Wei to :ref:`address`,
returns ``false`` on failure
- ``<address payable>.transfer(uint256 amount)``: send given amount of Wei to :ref:`address`, throws on failure
.. index:: blockhash, block, block;basefree, block;chainid, block;coinbase, block;difficulty, block;gaslimit, block;number, block;prevrandao, block;timestamp
.. index:: gasleft, msg;data, msg;sender, msg;sig, msg;value, tx;gasprice, tx;origin
Block and Transaction Properties
================================
- ``blockhash(uint blockNumber) returns (bytes32)``: hash of the given block - only works for 256 most recent blocks
- ``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>`_)
- ``block.chainid`` (``uint``): current chain id
- ``block.coinbase`` (``address payable``): current block miner's address
- ``block.difficulty`` (``uint``): current block difficulty
- ``block.difficulty`` (``uint``): current block difficulty (``EVM < Paris``). For other EVM versions it behaves as a deprecated alias for ``block.prevrandao`` that will be removed in the next breaking release
- ``block.gaslimit`` (``uint``): current block gaslimit
- ``block.number`` (``uint``): current block number
- ``block.prevrandao`` (``uint``): random number provided by the beacon chain (``EVM >= Paris``) (see `EIP-4399 <https://eips.ethereum.org/EIPS/eip-4399>`_ )
- ``block.timestamp`` (``uint``): current block timestamp in seconds since Unix epoch
- ``gasleft() returns (uint256)``: remaining gas
- ``msg.data`` (``bytes``): complete calldata
@ -102,6 +72,12 @@ Global Variables
- ``msg.value`` (``uint``): number of wei sent with the message
- ``tx.gasprice`` (``uint``): gas price of the transaction
- ``tx.origin`` (``address``): sender of the transaction (full call chain)
.. index:: assert, require, revert
Validations and Assertions
==========================
- ``assert(bool condition)``: abort execution and revert state changes if condition is ``false`` (use for internal error)
- ``require(bool condition)``: abort execution and revert state changes if condition is ``false`` (use
for malformed input or error in external component)
@ -109,7 +85,12 @@ Global Variables
condition is ``false`` (use for malformed input or error in external component). Also provide error message.
- ``revert()``: abort execution and revert state changes
- ``revert(string memory message)``: abort execution and revert state changes providing an explanatory string
- ``blockhash(uint blockNumber) returns (bytes32)``: hash of the given block - only works for 256 most recent blocks
.. index:: cryptography, keccak256, sha256, ripemd160, ecrecover, addmod, mulmod
Mathematical and Cryptographic Functions
========================================
- ``keccak256(bytes memory) returns (bytes32)``: compute the Keccak-256 hash of the input
- ``sha256(bytes memory) returns (bytes32)``: compute the SHA-256 hash of the input
- ``ripemd160(bytes memory) returns (bytes20)``: compute the RIPEMD-160 hash of the input
@ -119,15 +100,21 @@ Global Variables
arbitrary precision and does not wrap around at ``2**256``. Assert that ``k != 0`` starting from version 0.5.0.
- ``mulmod(uint x, uint y, uint k) returns (uint)``: compute ``(x * y) % k`` where the multiplication is performed
with arbitrary precision and does not wrap around at ``2**256``. Assert that ``k != 0`` starting from version 0.5.0.
.. index:: this, super, selfdestruct
Contract-related
================
- ``this`` (current contract's type): the current contract, explicitly convertible to ``address`` or ``address payable``
- ``super``: the contract one level higher in the inheritance hierarchy
- ``super``: a contract one level higher in the inheritance hierarchy
- ``selfdestruct(address payable recipient)``: destroy the current contract, sending its funds to the given address
- ``<address>.balance`` (``uint256``): balance of the :ref:`address` in Wei
- ``<address>.code`` (``bytes memory``): code at the :ref:`address` (can be empty)
- ``<address>.codehash`` (``bytes32``): the codehash of the :ref:`address`
- ``<address payable>.send(uint256 amount) returns (bool)``: send given amount of Wei to :ref:`address`,
returns ``false`` on failure
- ``<address payable>.transfer(uint256 amount)``: send given amount of Wei to :ref:`address`, throws on failure
.. index:: type;name, type;creationCode, type;runtimeCode, type;interfaceId, type;min, type;max
Type Information
================
- ``type(C).name`` (``string``): the name of the contract
- ``type(C).creationCode`` (``bytes memory``): creation bytecode of the given contract, see :ref:`Type Information<meta-type>`.
- ``type(C).runtimeCode`` (``bytes memory``): runtime bytecode of the given contract, see :ref:`Type Information<meta-type>`.
@ -135,35 +122,6 @@ Global Variables
- ``type(T).min`` (``T``): the minimum value representable by the integer type ``T``, see :ref:`Type Information<meta-type>`.
- ``type(T).max`` (``T``): the maximum value representable by the integer type ``T``, see :ref:`Type Information<meta-type>`.
.. note::
When contracts are evaluated off-chain rather than in context of a transaction included in a
block, you should not assume that ``block.*`` and ``tx.*`` refer to values from any specific
block or transaction. These values are provided by the EVM implementation that executes the
contract and can be arbitrary.
.. note::
Do not rely on ``block.timestamp`` or ``blockhash`` as a source of randomness,
unless you know what you are doing.
Both the timestamp and the block hash can be influenced by miners to some degree.
Bad actors in the mining community can for example run a casino payout function on a chosen hash
and just retry a different hash if they did not receive any money.
The current block timestamp must be strictly larger than the timestamp of the last block,
but the only guarantee is that it will be somewhere between the timestamps of two
consecutive blocks in the canonical chain.
.. note::
The block hashes are not available for all blocks for scalability reasons.
You can only access the hashes of the most recent 256 blocks, all other
values will be zero.
.. note::
In version 0.5.0, the following aliases were removed: ``suicide`` as alias for ``selfdestruct``,
``msg.gas`` as alias for ``gasleft``, ``block.blockhash`` as alias for ``blockhash`` and
``sha3`` as alias for ``keccak256``.
.. note::
In version 0.7.0, the alias ``now`` (for ``block.timestamp``) was removed.
.. index:: visibility, public, private, external, internal
@ -192,21 +150,11 @@ Modifiers
- ``view`` for functions: Disallows modification of state.
- ``payable`` for functions: Allows them to receive Ether together with a call.
- ``constant`` for state variables: Disallows assignment (except initialisation), does not occupy storage slot.
- ``immutable`` for state variables: Allows exactly one assignment at construction time and is constant afterwards. Is stored in code.
- ``immutable`` for state variables: Allows assignment at construction time and is constant when deployed. Is stored in code.
- ``anonymous`` for events: Does not store event signature as topic.
- ``indexed`` for event parameters: Stores the parameter as topic.
- ``virtual`` for functions and modifiers: Allows the function's or modifier's
behaviour to be changed in derived contracts.
behavior to be changed in derived contracts.
- ``override``: States that this function, modifier or public state variable changes
the behaviour of a function or modifier in a base contract.
the behavior of a function or modifier in a base contract.
Reserved Keywords
=================
These keywords are reserved in Solidity. They might become part of the syntax in the future:
``after``, ``alias``, ``apply``, ``auto``, ``byte``, ``case``, ``copyof``, ``default``,
``define``, ``final``, ``implements``, ``in``, ``inline``, ``let``, ``macro``, ``match``,
``mutable``, ``null``, ``of``, ``partial``, ``promise``, ``reference``, ``relocatable``,
``sealed``, ``sizeof``, ``static``, ``supports``, ``switch``, ``typedef``, ``typeof``,
``var``.

View File

@ -18,7 +18,7 @@ introduces a potential security risk. You may read
more about this on the :ref:`security_considerations` page.
The following is an example of the withdrawal pattern in practice in
a contract where the goal is to send the most money to the
a contract where the goal is to send the most of some compensation, e.g. Ether, to the
contract in order to become the "richest", inspired by
`King of the Ether <https://www.kingoftheether.com/>`_.
@ -34,7 +34,7 @@ you receive the funds of the person who is now the richest.
address public richest;
uint public mostSent;
mapping (address => uint) pendingWithdrawals;
mapping(address => uint) pendingWithdrawals;
/// The amount of Ether sent was not higher than
/// the currently highest amount.
@ -55,7 +55,7 @@ you receive the funds of the person who is now the richest.
function withdraw() public {
uint amount = pendingWithdrawals[msg.sender];
// Remember to zero the pending refund before
// sending to prevent re-entrancy attacks
// sending to prevent reentrancy attacks
pendingWithdrawals[msg.sender] = 0;
payable(msg.sender).transfer(amount);
}
@ -163,9 +163,9 @@ restrictions highly readable.
// prepend a check that only passes
// if the function is called from
// a certain address.
modifier onlyBy(address _account)
modifier onlyBy(address account)
{
if (msg.sender != _account)
if (msg.sender != account)
revert Unauthorized();
// Do not forget the "_;"! It will
// be replaced by the actual function
@ -173,17 +173,17 @@ restrictions highly readable.
_;
}
/// Make `_newOwner` the new owner of this
/// Make `newOwner` the new owner of this
/// contract.
function changeOwner(address _newOwner)
function changeOwner(address newOwner)
public
onlyBy(owner)
{
owner = _newOwner;
owner = newOwner;
}
modifier onlyAfter(uint _time) {
if (block.timestamp < _time)
modifier onlyAfter(uint time) {
if (block.timestamp < time)
revert TooEarly();
_;
}
@ -205,21 +205,21 @@ restrictions highly readable.
// refunded, but only after the function body.
// This was dangerous before Solidity version 0.4.0,
// where it was possible to skip the part after `_;`.
modifier costs(uint _amount) {
if (msg.value < _amount)
modifier costs(uint amount) {
if (msg.value < amount)
revert NotEnoughEther();
_;
if (msg.value > _amount)
payable(msg.sender).transfer(msg.value - _amount);
if (msg.value > amount)
payable(msg.sender).transfer(msg.value - amount);
}
function forceOwnerChange(address _newOwner)
function forceOwnerChange(address newOwner)
public
payable
costs(200 ether)
{
owner = _newOwner;
owner = newOwner;
// just some example condition
if (uint160(owner) & 0 == 1)
// This did not refund for Solidity
@ -315,8 +315,8 @@ function finishes.
uint public creationTime = block.timestamp;
modifier atStage(Stages _stage) {
if (stage != _stage)
modifier atStage(Stages stage_) {
if (stage != stage_)
revert FunctionInvalidAtThisStage();
_;
}

View File

@ -31,7 +31,10 @@ def setup(sphinx):
sphinx.add_lexer('Solidity', SolidityLexer)
sphinx.add_lexer('Yul', YulLexer)
sphinx.add_css_file('css/fonts.css')
sphinx.add_css_file('css/custom.css')
sphinx.add_css_file('css/custom-dark.css')
sphinx.add_css_file('css/pygments.css')
# -- General configuration ------------------------------------------------
@ -45,6 +48,7 @@ extensions = [
'sphinx_a4doc',
'html_extra_template_renderer',
'remix_code_links',
'sphinx.ext.imgconverter',
]
a4_base_path = os.path.dirname(__file__) + '/grammar'
@ -63,7 +67,7 @@ master_doc = 'index'
# General information about the project.
project = 'Solidity'
project_copyright = '2016-2021, Ethereum'
project_copyright = '2016-2023, The Solidity Authors'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
@ -131,7 +135,6 @@ html_theme = 'sphinx_rtd_theme'
# documentation.
html_theme_options = {
'logo_only': True,
'style_nav_header_background': '#65afff',
'display_version': True,
}
@ -147,12 +150,12 @@ html_theme_options = {
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
html_logo = "logo.svg"
# html_logo = "logo.svg"
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None
html_favicon = "_static/img/favicon.ico"
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
@ -161,7 +164,7 @@ html_static_path = ['_static']
html_css_files = ["css/toggle.css"]
html_js_files = ["js/toggle.js"]
html_js_files = ["js/constants.js", "js/initialize.js", "js/toggle.js"]
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
@ -209,7 +212,7 @@ html_extra_templates = {
#html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True
html_show_sphinx = False
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True

View File

@ -6,12 +6,15 @@
Abstract Contracts
******************
Contracts need to be marked as abstract when at least one of their functions is not implemented.
Contracts may be marked as abstract even though all functions are implemented.
Contracts must be marked as abstract when at least one of their functions is not implemented or when
they do not provide arguments for all of their base contract constructors.
Even if this is not the case, a contract may still be marked abstract, such as when you do not intend
for the contract to be created directly. Abstract contracts are similar to :ref:`interfaces` but an
interface is more limited in what it can declare.
This can be done by using the ``abstract`` keyword as shown in the following example. Note that this contract needs to be
defined as abstract, because the function ``utterance()`` was defined, but no implementation was
provided (no implementation body ``{ }`` was given).
An abstract contract is declared using the ``abstract`` keyword as shown in the following example.
Note that this contract needs to be defined as abstract, because the function ``utterance()`` is declared,
but no implementation was provided (no implementation body ``{ }`` was given).
.. code-block:: solidity

View File

@ -30,25 +30,29 @@ Not all types for constants and immutables are implemented at this time. The onl
.. code-block:: solidity
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.4;
pragma solidity ^0.8.21;
uint constant X = 32**22 + 8;
contract C {
string constant TEXT = "abc";
bytes32 constant MY_HASH = keccak256("abc");
uint immutable decimals;
uint immutable decimals = 18;
uint immutable maxBalance;
address immutable owner = msg.sender;
constructor(uint _decimals, address _reference) {
decimals = _decimals;
constructor(uint decimals_, address ref) {
if (decimals_ != 0)
// Immutables are only immutable when deployed.
// At construction time they can be assigned to any number of times.
decimals = decimals_;
// Assignments to immutables can even access the environment.
maxBalance = _reference.balance;
maxBalance = ref.balance;
}
function isBalanceTooHigh(address _other) public view returns (bool) {
return _other.balance > maxBalance;
function isBalanceTooHigh(address other) public view returns (bool) {
return other.balance > maxBalance;
}
}
@ -74,25 +78,34 @@ Immutable
=========
Variables declared as ``immutable`` are a bit less restricted than those
declared as ``constant``: Immutable variables can be assigned an arbitrary
value in the constructor of the contract or at the point of their declaration.
They can be assigned only once and can, from that point on, be read even during
construction time.
declared as ``constant``: Immutable variables can be assigned a
value at construction time.
The value can be changed at any time before deployment and then it becomes permanent.
One additional restriction is that immutables can only be assigned to inside expressions for which
there is no possibility of being executed after creation.
This excludes all modifier definitions and functions other than constructors.
There are no restrictions on reading immutable variables.
The read is even allowed to happen before the variable is written to for the first time because variables in
Solidity always have a well-defined initial value.
For this reason it is also allowed to never explicitly assign a value to an immutable.
.. warning::
When accessing immutables at construction time, please keep the :ref:`initialization order
<state-variable-initialization-order>` in mind.
Even if you provide an explicit initializer, some expressions may end up being evaluated before
that initializer, especially when they are at a different level in inheritance hierarchy.
.. note::
Before Solidity 0.8.21 initialization of immutable variables was more restrictive.
Such variables had to be initialized exactly once at construction time and could not be read
before then.
The contract creation code generated by the compiler will modify the
contract's runtime code before it is returned by replacing all references
to immutables by the values assigned to the them. This is important if
to immutables with the values assigned to them. This is important if
you are comparing the
runtime code generated by the compiler with the one actually stored in the
blockchain.
.. note::
Immutables that are assigned at their declaration are only considered
initialized once the constructor of the contract is executing.
This means you cannot initialize immutables inline with a value
that depends on another immutable. You can do this, however,
inside the constructor of the contract.
This is a safeguard against different interpretations about the order
of state variable initialization and constructor execution, especially
with regards to inheritance.
blockchain. The compiler outputs where these immutables are located in the deployed bytecode
in the ``immutableReferences`` field of the :ref:`compiler JSON standard output <compiler-api>`.

View File

@ -8,7 +8,7 @@ Contracts can be created "from outside" via Ethereum transactions or from within
IDEs, such as `Remix <https://remix.ethereum.org/>`_, make the creation process seamless using UI elements.
One way to create contracts programmatically on Ethereum is via the JavaScript API `web3.js <https://github.com/ethereum/web3.js>`_.
One way to create contracts programmatically on Ethereum is via the JavaScript API `web3.js <https://github.com/web3/web3.js>`_.
It has a function called `web3.eth.Contract <https://web3js.readthedocs.io/en/1.0/web3-eth-contract.html#new-contract>`_
to facilitate contract creation.
@ -48,7 +48,7 @@ This means that cyclic creation dependencies are impossible.
// This is the constructor which registers the
// creator and the assigned name.
constructor(bytes32 _name) {
constructor(bytes32 name_) {
// State variables are accessed via their name
// and not via e.g. `this.owner`. Functions can
// be accessed directly or through `this.f`,
@ -65,7 +65,7 @@ This means that cyclic creation dependencies are impossible.
// no real way to verify that.
// This does not create a new contract.
creator = TokenCreator(msg.sender);
name = _name;
name = name_;
}
function changeName(bytes32 newName) public {

View File

@ -1,5 +1,4 @@
.. index:: ! error, revert
.. index:: ! error, revert, ! selector; of an error
.. _errors:
*******************************
@ -80,3 +79,8 @@ of the built-in type ``Panic(uint256)``.
by default. This means that an inner call
can "forge" revert data that looks like it could have come from the
contract that called it.
Members of Errors
=================
- ``error.selector``: A ``bytes4`` value containing the error selector.

View File

@ -1,4 +1,4 @@
.. index:: ! event
.. index:: ! event, ! event; anonymous, ! event; indexed, ! event; topic
.. _events:
@ -9,9 +9,10 @@ Events
Solidity events give an abstraction on top of the EVM's logging functionality.
Applications can subscribe and listen to these events through the RPC interface of an Ethereum client.
Events are inheritable members of contracts. When you call them, they cause the
Events can be defined at file level or as inheritable members of contracts (including interfaces and libraries).
When you call them, they cause the
arguments to be stored in the transaction's log - a special data structure
in the blockchain. These logs are associated with the address of the contract,
in the blockchain. These logs are associated with the address of the contract that emitted them,
are incorporated into the blockchain, and stay there as long as a block is
accessible (forever as of now, but this might
change with Serenity). The Log and its event data is not accessible from within
@ -73,6 +74,18 @@ four indexed arguments rather than three.
In particular, it is possible to "fake" the signature of another event
using an anonymous event.
.. index:: ! selector; of an event
Members of Events
=================
- ``event.selector``: For non-anonymous events, this is a ``bytes32`` value
containing the ``keccak256`` hash of the event signature, as used in the default topic.
Example
=======
.. code-block:: solidity
// SPDX-License-Identifier: GPL-3.0
@ -80,18 +93,18 @@ four indexed arguments rather than three.
contract ClientReceipt {
event Deposit(
address indexed _from,
bytes32 indexed _id,
uint _value
address indexed from,
bytes32 indexed id,
uint value
);
function deposit(bytes32 _id) public payable {
function deposit(bytes32 id) public payable {
// Events are emitted using `emit`, followed by
// the name of the event and the arguments
// (if any) in parentheses. Any such invocation
// (even deeply nested) can be detected from
// the JavaScript API by filtering for `Deposit`.
emit Deposit(msg.sender, _id, msg.value);
emit Deposit(msg.sender, id, msg.value);
}
}
@ -126,9 +139,9 @@ The output of the above looks like the following (trimmed):
{
"returnValues": {
"_from": "0x1111…FFFFCCCC",
"_id": "0x50…sd5adb20",
"_value": "0x420042"
"from": "0x1111…FFFFCCCC",
"id": "0x50…sd5adb20",
"value": "0x420042"
},
"raw": {
"data": "0x7f…91385",
@ -137,8 +150,8 @@ The output of the above looks like the following (trimmed):
}
Additional Resources for Understanding Events
==============================================
=============================================
- `Javascript documentation <https://github.com/ethereum/web3.js/blob/1.x/docs/web3-eth-contract.rst#events>`_
- `JavaScript documentation <https://github.com/web3/web3.js/blob/1.x/docs/web3-eth-contract.rst#events>`_
- `Example usage of events <https://github.com/ethchange/smart-exchange/blob/master/lib/contracts/SmartExchange.sol>`_
- `How to access them in js <https://github.com/ethchange/smart-exchange/blob/master/lib/exchange_transactions.js>`_

View File

@ -6,7 +6,7 @@
Function Modifiers
******************
Modifiers can be used to change the behaviour of functions in a declarative way.
Modifiers can be used to change the behavior of functions in a declarative way.
For example,
you can use a modifier to automatically check a condition prior to executing the function.
@ -19,6 +19,7 @@ if they are marked ``virtual``. For details, please see
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.1 <0.9.0;
// This will report a warning due to deprecated selfdestruct
contract owned {
constructor() { owner = payable(msg.sender); }
@ -60,7 +61,7 @@ if they are marked ``virtual``. For details, please see
}
contract Register is priced, destructible {
mapping (address => bool) registeredAddresses;
mapping(address => bool) registeredAddresses;
uint price;
constructor(uint initialPrice) { price = initialPrice; }
@ -72,8 +73,8 @@ if they are marked ``virtual``. For details, please see
registeredAddresses[msg.sender] = true;
}
function changePrice(uint _price) public onlyOwner {
price = _price;
function changePrice(uint price_) public onlyOwner {
price = price_;
}
}
@ -111,6 +112,12 @@ whitespace-separated list and are evaluated in the order presented.
Modifiers cannot implicitly access or change the arguments and return values of functions they modify.
Their values can only be passed to them explicitly at the point of invocation.
In function modifiers, it is necessary to specify when you want the function to which the modifier is
applied to be run. The placeholder statement (denoted by a single underscore character ``_``) is used to
denote where the body of the function being modified should be inserted. Note that the
placeholder operator is different from using underscores as leading or trailing characters in variable
names, which is a stylistic choice.
Explicit returns from a modifier or function body only leave the current
modifier or function body. Return variables are assigned and
control flow continues after the ``_`` in the preceding modifier.
@ -125,7 +132,7 @@ variables are set to their :ref:`default values<default-value>` just as if the f
body.
The ``_`` symbol can appear in the modifier multiple times. Each occurrence is replaced with
the function body.
the function body, and the function returns the return value of the final occurrence.
Arbitrary expressions are allowed for modifier arguments and in this context,
all symbols visible from the function are visible in the modifier. Symbols

View File

@ -1,4 +1,4 @@
.. index:: ! functions
.. index:: ! functions, ! function;free
.. _functions:
@ -17,17 +17,17 @@ that call them, similar to internal library functions.
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.1 <0.9.0;
function sum(uint[] memory _arr) pure returns (uint s) {
for (uint i = 0; i < _arr.length; i++)
s += _arr[i];
function sum(uint[] memory arr) pure returns (uint s) {
for (uint i = 0; i < arr.length; i++)
s += arr[i];
}
contract ArrayExample {
bool found;
function f(uint[] memory _arr) public {
function f(uint[] memory arr) public {
// This calls the free function internally.
// The compiler will add its code to the contract.
uint s = sum(_arr);
uint s = sum(arr);
require(s >= 10);
found = true;
}
@ -35,10 +35,10 @@ that call them, similar to internal library functions.
.. note::
Functions defined outside a contract are still always executed
in the context of a contract. They still have access to the variable ``this``,
can call other contracts, send them Ether and destroy the contract that called them,
in the context of a contract.
They still can call other contracts, send them Ether and destroy the contract that called them,
among other things. The main difference to functions defined inside a contract
is that free functions do not have direct access to storage variables and functions
is that free functions do not have direct access to the variable ``this``, storage variables and functions
not in their scope.
.. _function-parameters-return-variables:
@ -65,23 +65,13 @@ with two integers, you would use something like the following:
contract Simple {
uint sum;
function taker(uint _a, uint _b) public {
sum = _a + _b;
function taker(uint a, uint b) public {
sum = a + b;
}
}
Function parameters can be used as any other local variable and they can also be assigned to.
.. note::
An :ref:`external function<external-function-calls>` cannot accept a
multi-dimensional array as an input
parameter. This functionality is possible if you enable the ABI coder v2
by adding ``pragma abicoder v2;`` to your source file.
An :ref:`internal function<external-function-calls>` can accept a
multi-dimensional array without enabling the feature.
.. index:: return array, return string, array, string, array of strings, dynamic array, variably sized array, return struct, struct
Return Variables
@ -99,13 +89,13 @@ two integers passed as function parameters, then you use something like:
pragma solidity >=0.4.16 <0.9.0;
contract Simple {
function arithmetic(uint _a, uint _b)
function arithmetic(uint a, uint b)
public
pure
returns (uint o_sum, uint o_product)
returns (uint sum, uint product)
{
o_sum = _a + _b;
o_product = _a * _b;
sum = a + b;
product = a * b;
}
}
@ -126,12 +116,12 @@ statement:
pragma solidity >=0.4.16 <0.9.0;
contract Simple {
function arithmetic(uint _a, uint _b)
function arithmetic(uint a, uint b)
public
pure
returns (uint o_sum, uint o_product)
returns (uint sum, uint product)
{
return (_a + _b, _a * _b);
return (a + b, a * b);
}
}
@ -139,12 +129,16 @@ If you use an early ``return`` to leave a function that has return variables,
you must provide return values together with the return statement.
.. note::
You cannot return some types from non-internal functions, notably
multi-dimensional dynamic arrays and structs. If you enable the
ABI coder v2 by adding ``pragma abicoder v2;``
to your source file then more types are available, but
``mapping`` types are still limited to inside a single contract and you
cannot transfer them.
You cannot return some types from non-internal functions.
This includes the types listed below and any composite types that recursively contain them:
- mappings,
- internal function types,
- reference types with location set to ``storage``,
- multi-dimensional arrays (applies only to :ref:`ABI coder v1 <abi_coder>`),
- structs (applies only to :ref:`ABI coder v1 <abi_coder>`).
This restriction does not apply to library functions because of their different :ref:`internal ABI <library-selectors>`.
.. _multi-return:
@ -256,7 +250,7 @@ Reverting a state change is not considered a "state modification", as only chang
state made previously in code that did not have the ``view`` or ``pure`` restriction
are reverted and that code has the option to catch the ``revert`` and not pass it on.
This behaviour is also in line with the ``STATICCALL`` opcode.
This behavior is also in line with the ``STATICCALL`` opcode.
.. warning::
It is not possible to prevent functions from reading the state at the level
@ -283,7 +277,7 @@ This behaviour is also in line with the ``STATICCALL`` opcode.
Special Functions
=================
.. index:: ! receive ether function, function;receive ! receive
.. index:: ! receive ether function, function;receive, ! receive
.. _receive-ether-function:
@ -303,7 +297,7 @@ on plain Ether transfers (e.g. via ``.send()`` or ``.transfer()``). If no such
function exists, but a payable :ref:`fallback function <fallback-function>`
exists, the fallback function will be called on a plain Ether transfer. If
neither a receive Ether nor a payable fallback function is present, the
contract cannot receive Ether through regular transactions and throws an
contract cannot receive Ether through a transaction that does not represent a payable function call and throws an
exception.
In the worst case, the ``receive`` function can only rely on 2300 gas being
@ -317,12 +311,13 @@ will consume more gas than the 2300 gas stipend:
- Sending Ether
.. warning::
Contracts that receive Ether directly (without a function call, i.e. using ``send`` or ``transfer``)
but do not define a receive Ether function or a payable fallback function
throw an exception, sending back the Ether (this was different
before Solidity v0.4.0). So if you want your contract to receive Ether,
When Ether is sent directly to a contract (without a function call, i.e. sender uses ``send`` or ``transfer``)
but the receiving contract does not define a receive Ether function or a payable fallback function,
an exception will be thrown, sending back the Ether (this was different
before Solidity v0.4.0). If you want your contract to receive Ether,
you have to implement a receive Ether function (using payable fallback functions for receiving Ether is
not recommended, since it would not fail on interface confusions).
not recommended, since the fallback is invoked and would not fail for interface confusions
on the part of the sender).
.. warning::
@ -362,7 +357,7 @@ Fallback Function
-----------------
A contract can have at most one ``fallback`` function, declared using either ``fallback () external [payable]``
or ``fallback (bytes calldata _input) external [payable] returns (bytes memory _output)``
or ``fallback (bytes calldata input) external [payable] returns (bytes memory output)``
(both without the ``function`` keyword).
This function must have ``external`` visibility. A fallback function can be virtual, can override
and can have modifiers.
@ -373,8 +368,8 @@ all and there is no :ref:`receive Ether function <receive-ether-function>`.
The fallback function always receives data, but in order to also receive Ether
it must be marked ``payable``.
If the version with parameters is used, ``_input`` will contain the full data sent to the contract
(equal to ``msg.data``) and can return data in ``_output``. The returned data will not be
If the version with parameters is used, ``input`` will contain the full data sent to the contract
(equal to ``msg.data``) and can return data in ``output``. The returned data will not be
ABI-encoded. Instead it will be returned without modifications (not even padding).
In the worst case, if a payable fallback function is also used in
@ -397,7 +392,7 @@ operations as long as there is enough gas passed on to it.
for the function selector and then
you can use ``abi.decode`` together with the array slice syntax to
decode ABI-encoded data:
``(c, d) = abi.decode(_input[4:], (uint256, uint256));``
``(c, d) = abi.decode(input[4:], (uint256, uint256));``
Note that this should only be used as a last resort and
proper functions should be used instead.
@ -486,13 +481,13 @@ The following example shows overloading of the function
pragma solidity >=0.4.16 <0.9.0;
contract A {
function f(uint _in) public pure returns (uint out) {
out = _in;
function f(uint value) public pure returns (uint out) {
out = value;
}
function f(uint _in, bool _really) public pure returns (uint out) {
if (_really)
out = _in;
function f(uint value, bool really) public pure returns (uint out) {
if (really)
out = value;
}
}
@ -506,12 +501,12 @@ externally visible functions differ by their Solidity types but not by their ext
// This will not compile
contract A {
function f(B _in) public pure returns (B out) {
out = _in;
function f(B value) public pure returns (B out) {
out = value;
}
function f(address _in) public pure returns (address out) {
out = _in;
function f(address value) public pure returns (address out) {
out = value;
}
}
@ -539,12 +534,12 @@ candidate, resolution fails.
pragma solidity >=0.4.16 <0.9.0;
contract A {
function f(uint8 _in) public pure returns (uint8 out) {
out = _in;
function f(uint8 val) public pure returns (uint8 out) {
out = val;
}
function f(uint256 _in) public pure returns (uint256 out) {
out = _in;
function f(uint256 val) public pure returns (uint256 out) {
out = val;
}
}

View File

@ -40,7 +40,7 @@ Details are given in the following example.
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
// This will report a warning due to deprecated selfdestruct
contract Owned {
constructor() { owner = payable(msg.sender); }
@ -54,7 +54,7 @@ Details are given in the following example.
// accessed externally via `this`, though.
contract Destructible is Owned {
// The keyword `virtual` means that the function can change
// its behaviour in derived classes ("overriding").
// its behavior in derived classes ("overriding").
function destroy() virtual public {
if (msg.sender == owner) selfdestruct(owner);
}
@ -76,9 +76,9 @@ Details are given in the following example.
}
// Multiple inheritance is possible. Note that `owned` is
// Multiple inheritance is possible. Note that `Owned` is
// also a base class of `Destructible`, yet there is only a single
// instance of `owned` (as for virtual inheritance in C++).
// instance of `Owned` (as for virtual inheritance in C++).
contract Named is Owned, Destructible {
constructor(bytes32 name) {
Config config = Config(0xD5f9D8D94886E70b06E474c3fB14Fd43E2f23970);
@ -115,7 +115,7 @@ Details are given in the following example.
// Here, we only specify `override` and not `virtual`.
// This means that contracts deriving from `PriceFeed`
// cannot change the behaviour of `destroy` anymore.
// cannot change the behavior of `destroy` anymore.
function destroy() public override(Destructible, Named) { Named.destroy(); }
function get() public view returns(uint r) { return info; }
@ -130,6 +130,7 @@ seen in the following example:
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
// This will report a warning due to deprecated selfdestruct
contract owned {
constructor() { owner = payable(msg.sender); }
@ -162,6 +163,7 @@ explicitly in the final override, but this function will bypass
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
// This will report a warning due to deprecated selfdestruct
contract owned {
constructor() { owner = payable(msg.sender); }
@ -291,7 +293,7 @@ and ends at a contract mentioning a function with that signature
that does not override.
If you do not mark a function that overrides as ``virtual``, derived
contracts can no longer change the behaviour of that function.
contracts can no longer change the behavior of that function.
.. note::
@ -421,8 +423,8 @@ equivalent to ``constructor() {}``. For example:
abstract contract A {
uint public a;
constructor(uint _a) {
a = _a;
constructor(uint a_) {
a = a_;
}
}
@ -434,16 +436,16 @@ You can use internal parameters in a constructor (for example storage pointers).
the contract has to be marked :ref:`abstract <abstract-contract>`, because these parameters
cannot be assigned valid values from outside but only through the constructors of derived contracts.
.. warning ::
.. warning::
Prior to version 0.4.22, constructors were defined as functions with the same name as the contract.
This syntax was deprecated and is not allowed anymore in version 0.5.0.
.. warning ::
.. warning::
Prior to version 0.7.0, you had to specify the visibility of constructors as either
``internal`` or ``public``.
.. index:: ! base;constructor
.. index:: ! base;constructor, inheritance list, contract;abstract, abstract contract
Arguments for Base Constructors
===============================
@ -459,7 +461,7 @@ derived contracts need to specify all of them. This can be done in two ways:
contract Base {
uint x;
constructor(uint _x) { x = _x; }
constructor(uint x_) { x = x_; }
}
// Either directly specify in the inheritance list...
@ -467,16 +469,25 @@ derived contracts need to specify all of them. This can be done in two ways:
constructor() {}
}
// or through a "modifier" of the derived constructor.
// or through a "modifier" of the derived constructor...
contract Derived2 is Base {
constructor(uint _y) Base(_y * _y) {}
constructor(uint y) Base(y * y) {}
}
// or declare abstract...
abstract contract Derived3 is Base {
}
// and have the next concrete derived contract initialize it.
contract DerivedFromDerived is Derived3 {
constructor() Base(10 + 10) {}
}
One way is directly in the inheritance list (``is Base(7)``). The other is in
the way a modifier is invoked as part of
the derived constructor (``Base(_y * _y)``). The first way to
the derived constructor (``Base(y * y)``). The first way to
do it is more convenient if the constructor argument is a
constant and defines the behaviour of the contract or
constant and defines the behavior of the contract or
describes it. The second way has to be used if the
constructor arguments of the base depend on those of the
derived contract. Arguments have to be given either in the
@ -484,7 +495,12 @@ inheritance list or in modifier-style in the derived constructor.
Specifying arguments in both places is an error.
If a derived contract does not specify the arguments to all of its base
contracts' constructors, it will be abstract.
contracts' constructors, it must be declared abstract. In that case, when
another contract derives from it, that other contract's inheritance list
or constructor must provide the necessary parameters
for all base classes that haven't had their parameters specified (otherwise,
that other contract must be declared abstract as well). For example, in the above
code snippet, see ``Derived3`` and ``DerivedFromDerived``.
.. index:: ! inheritance;multiple, ! linearization, ! C3 linearization

View File

@ -10,7 +10,7 @@ Interfaces are similar to abstract contracts, but they cannot have any functions
There are further restrictions:
- They cannot inherit from other contracts, but they can inherit from other interfaces.
- All declared functions must be external.
- All declared functions must be external in the interface, even if they are public in the contract.
- They cannot declare a constructor.
- They cannot declare state variables.
- They cannot declare modifiers.
@ -65,7 +65,7 @@ inheritance.
Types defined inside interfaces and other contract-like structures
can be accessed from other contracts: ``Token.TokenType`` or ``Token.Coin``.
.. warning:
.. warning::
Interfaces have supported ``enum`` types since :doc:`Solidity version 0.5.0 <050-breaking-changes>`, make
sure the pragma version specifies this version as a minimum.

View File

@ -146,16 +146,16 @@ custom types without the overhead of external function calls:
r.limbs[0] = x;
}
function add(bigint memory _a, bigint memory _b) internal pure returns (bigint memory r) {
r.limbs = new uint[](max(_a.limbs.length, _b.limbs.length));
function add(bigint memory a, bigint memory b) internal pure returns (bigint memory r) {
r.limbs = new uint[](max(a.limbs.length, b.limbs.length));
uint carry = 0;
for (uint i = 0; i < r.limbs.length; ++i) {
uint a = limb(_a, i);
uint b = limb(_b, i);
uint limbA = limb(a, i);
uint limbB = limb(b, i);
unchecked {
r.limbs[i] = a + b + carry;
r.limbs[i] = limbA + limbB + carry;
if (a + b < a || (a + b == type(uint).max && carry > 0))
if (limbA + limbB < limbA || (limbA + limbB == type(uint).max && carry > 0))
carry = 1;
else
carry = 0;
@ -172,8 +172,8 @@ custom types without the overhead of external function calls:
}
}
function limb(bigint memory _a, uint _limb) internal pure returns (uint) {
return _limb < _a.limbs.length ? _a.limbs[_limb] : 0;
function limb(bigint memory a, uint index) internal pure returns (uint) {
return index < a.limbs.length ? a.limbs[index] : 0;
}
function max(uint a, uint b) private pure returns (uint) {
@ -215,7 +215,7 @@ In comparison to contracts, libraries are restricted in the following ways:
(These might be lifted at a later point.)
.. _library-selectors:
.. index:: selector
.. index:: ! selector; of a library function
Function Signatures and Selectors in Libraries
==============================================

View File

@ -1,4 +1,4 @@
.. index:: ! using for, library
.. index:: ! using for, library, ! operator;user-defined, function;free
.. _using-for:
@ -6,71 +6,146 @@
Using For
*********
The directive ``using A for B;`` can be used to attach library
functions (from the library ``A``) to any type (``B``)
in the context of a contract.
These functions will receive the object they are called on
The directive ``using A for B`` can be used to attach
functions (``A``) as operators to user-defined value types
or as member functions to any type (``B``).
The member functions receive the object they are called on
as their first parameter (like the ``self`` variable in Python).
The operator functions receive operands as parameters.
The effect of ``using A for *;`` is that the functions from
the library ``A`` are attached to *any* type.
It is valid either at file level or inside a contract,
at contract level.
In both situations, *all* functions in the library are attached,
The first part, ``A``, can be one of:
- A list of functions, optionally with an operator name assigned (e.g.
``using {f, g as +, h, L.t} for uint``).
If no operator is specified, the function can be either a library function or a free function and
is attached to the type as a member function.
Otherwise it must be a free function and it becomes the definition of that operator on the type.
- The name of a library (e.g. ``using L for uint``) -
all non-private functions of the library are attached to the type
as member functions
At file level, the second part, ``B``, has to be an explicit type (without data location specifier).
Inside contracts, you can also use ``*`` in place of the type (e.g. ``using L for *;``),
which has the effect that all functions of the library ``L``
are attached to *all* types.
If you specify a library, *all* non-private functions in the library get attached,
even those where the type of the first parameter does not
match the type of the object. The type is checked at the
point the function is called and function overload
resolution is performed.
If you use a list of functions (e.g. ``using {f, g, h, L.t} for uint``),
then the type (``uint``) has to be implicitly convertible to the
first parameter of each of these functions. This check is
performed even if none of these functions are called.
Note that private library functions can only be specified when ``using for`` is inside a library.
If you define an operator (e.g. ``using {f as +} for T``), then the type (``T``) must be a
:ref:`user-defined value type <user-defined-value-types>` and the definition must be a ``pure`` function.
Operator definitions must be global.
The following operators can be defined this way:
+------------+----------+---------------------------------------------+
| Category | Operator | Possible signatures |
+============+==========+=============================================+
| Bitwise | ``&`` | ``function (T, T) pure returns (T)`` |
| +----------+---------------------------------------------+
| | ``|`` | ``function (T, T) pure returns (T)`` |
| +----------+---------------------------------------------+
| | ``^`` | ``function (T, T) pure returns (T)`` |
| +----------+---------------------------------------------+
| | ``~`` | ``function (T) pure returns (T)`` |
+------------+----------+---------------------------------------------+
| Arithmetic | ``+`` | ``function (T, T) pure returns (T)`` |
| +----------+---------------------------------------------+
| | ``-`` | ``function (T, T) pure returns (T)`` |
| + +---------------------------------------------+
| | | ``function (T) pure returns (T)`` |
| +----------+---------------------------------------------+
| | ``*`` | ``function (T, T) pure returns (T)`` |
| +----------+---------------------------------------------+
| | ``/`` | ``function (T, T) pure returns (T)`` |
| +----------+---------------------------------------------+
| | ``%`` | ``function (T, T) pure returns (T)`` |
+------------+----------+---------------------------------------------+
| Comparison | ``==`` | ``function (T, T) pure returns (bool)`` |
| +----------+---------------------------------------------+
| | ``!=`` | ``function (T, T) pure returns (bool)`` |
| +----------+---------------------------------------------+
| | ``<`` | ``function (T, T) pure returns (bool)`` |
| +----------+---------------------------------------------+
| | ``<=`` | ``function (T, T) pure returns (bool)`` |
| +----------+---------------------------------------------+
| | ``>`` | ``function (T, T) pure returns (bool)`` |
| +----------+---------------------------------------------+
| | ``>=`` | ``function (T, T) pure returns (bool)`` |
+------------+----------+---------------------------------------------+
Note that unary and binary ``-`` need separate definitions.
The compiler will choose the right definition based on how the operator is invoked.
The ``using A for B;`` directive is active only within the current
contract, including within all of its functions, and has no effect
outside of the contract in which it is used. The directive
may only be used inside a contract, not inside any of its functions.
scope (either the contract or the current module/source unit),
including within all of its functions, and has no effect
outside of the contract or module in which it is used.
When the directive is used at file level and applied to a
user-defined type which was defined at file level in the same file,
the word ``global`` can be added at the end. This will have the
effect that the functions and operators are attached to the type everywhere
the type is available (including other files), not only in the
scope of the using statement.
Let us rewrite the set example from the
:ref:`libraries` in this way:
:ref:`libraries` section in this way, using file-level functions
instead of library functions.
.. code-block:: solidity
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.6.0 <0.9.0;
pragma solidity ^0.8.13;
// This is the same code as before, just without comments
struct Data { mapping(uint => bool) flags; }
// Now we attach functions to the type.
// The attached functions can be used throughout the rest of the module.
// If you import the module, you have to
// repeat the using directive there, for example as
// import "flags.sol" as Flags;
// using {Flags.insert, Flags.remove, Flags.contains}
// for Flags.Data;
using {insert, remove, contains} for Data;
library Set {
function insert(Data storage self, uint value)
public
returns (bool)
{
if (self.flags[value])
return false; // already there
self.flags[value] = true;
return true;
}
function insert(Data storage self, uint value)
returns (bool)
{
if (self.flags[value])
return false; // already there
self.flags[value] = true;
return true;
}
function remove(Data storage self, uint value)
public
returns (bool)
{
if (!self.flags[value])
return false; // not there
self.flags[value] = false;
return true;
}
function remove(Data storage self, uint value)
returns (bool)
{
if (!self.flags[value])
return false; // not there
self.flags[value] = false;
return true;
}
function contains(Data storage self, uint value)
public
view
returns (bool)
{
return self.flags[value];
}
function contains(Data storage self, uint value)
view
returns (bool)
{
return self.flags[value];
}
contract C {
using Set for Data; // this is the crucial change
Data knownValues;
function register(uint value) public {
@ -82,12 +157,13 @@ Let us rewrite the set example from the
}
}
It is also possible to extend elementary types in that way:
It is also possible to extend built-in types in that way.
In this example, we will use a library.
.. code-block:: solidity
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.6.8 <0.9.0;
pragma solidity ^0.8.13;
library Search {
function indexOf(uint[] storage self, uint value)
@ -100,27 +176,61 @@ It is also possible to extend elementary types in that way:
return type(uint).max;
}
}
using Search for uint[];
contract C {
using Search for uint[];
uint[] data;
function append(uint value) public {
data.push(value);
}
function replace(uint _old, uint _new) public {
function replace(uint from, uint to) public {
// This performs the library function call
uint index = data.indexOf(_old);
uint index = data.indexOf(from);
if (index == type(uint).max)
data.push(_new);
data.push(to);
else
data[index] = _new;
data[index] = to;
}
}
Note that all external library calls are actual EVM function calls. This means that
if you pass memory or value types, a copy will be performed, even of the
if you pass memory or value types, a copy will be performed, even in case of the
``self`` variable. The only situation where no copy will be performed
is when storage reference variables are used or when internal library
functions are called.
Another example shows how to define a custom operator for a user-defined type:
.. code-block:: solidity
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.19;
type UFixed16x2 is uint16;
using {
add as +,
div as /
} for UFixed16x2 global;
uint32 constant SCALE = 100;
function add(UFixed16x2 a, UFixed16x2 b) pure returns (UFixed16x2) {
return UFixed16x2.wrap(UFixed16x2.unwrap(a) + UFixed16x2.unwrap(b));
}
function div(UFixed16x2 a, UFixed16x2 b) pure returns (UFixed16x2) {
uint32 a32 = UFixed16x2.unwrap(a);
uint32 b32 = UFixed16x2.unwrap(b);
uint32 result32 = a32 * SCALE / b32;
require(result32 <= type(uint16).max, "Divide overflow");
return UFixed16x2.wrap(uint16(a32 * SCALE / b32));
}
contract Math {
function avg(UFixed16x2 a, UFixed16x2 b) public pure returns (UFixed16x2) {
return (a + b) / UFixed16x2.wrap(200);
}
}

View File

@ -200,12 +200,12 @@ The next example is more complex:
struct Data {
uint a;
bytes3 b;
mapping (uint => uint) map;
mapping(uint => uint) map;
uint[3] c;
uint[] d;
bytes e;
}
mapping (uint => mapping(bool => Data[])) public data;
mapping(uint => mapping(bool => Data[])) public data;
}
It generates a function of the following form. The mapping and arrays (with the

View File

@ -2,7 +2,7 @@
Contributing
############
Help is always welcome and there are plenty of options how you can contribute to Solidity.
Help is always welcome and there are plenty of options to contribute to Solidity.
In particular, we appreciate support in the following areas:
@ -12,7 +12,7 @@ In particular, we appreciate support in the following areas:
`"good first issue" <https://github.com/ethereum/solidity/labels/good%20first%20issue>`_ which are
meant as introductory issues for external contributors.
* Improving the documentation.
* Translating the documentation into more languages.
* `Translating <https://github.com/solidity-docs>`_ the documentation into more languages.
* Responding to questions from other users on `StackExchange
<https://ethereum.stackexchange.com>`_ and the `Solidity Gitter Chat
<https://gitter.im/ethereum/solidity>`_.
@ -22,18 +22,17 @@ To get started, you can try :ref:`building-from-source` in order to familiarize
yourself with the components of Solidity and the build process. Also, it may be
useful to become well-versed at writing smart-contracts in Solidity.
Please note that this project is released with a `Contributor Code of Conduct <https://raw.githubusercontent.com/ethereum/solidity/develop/CODE_OF_CONDUCT.md>`_. By participating in this project - in the issues, pull requests, or Gitter channels - you agree to abide by its terms.
Please note that this project is released with a `Contributor Code of Conduct <https://raw.githubusercontent.com/ethereum/solidity/develop/CODE_OF_CONDUCT.md>`_. By participating in this project — in the issues, pull requests, or Gitter channels — you agree to abide by its terms.
Team Calls
==========
If you have issues or pull requests to discuss, or are interested in hearing what
the team and contributors are working on, you can join our public team calls:
the team and contributors are working on, you can join our public team call:
- Mondays at 3pm CET/CEST.
- Wednesdays at 2pm CET/CEST.
- Wednesdays at 3PM CET/CEST.
Both calls take place on `Jitsi <https://meet.ethereum.org/solidity>`_.
The call takes place on `Jitsi <https://meet.soliditylang.org/>`_.
How to Report Issues
====================
@ -46,10 +45,13 @@ reporting issues, please mention the following details:
* Source code (if applicable).
* Operating system.
* Steps to reproduce the issue.
* Actual vs. expected behaviour.
* Actual vs. expected behavior.
Reducing the source code that caused the issue to a bare minimum is always
very helpful and sometimes even clarifies a misunderstanding.
very helpful, and sometimes even clarifies a misunderstanding.
For technical discussions about language design, a post in the
`Solidity forum <https://forum.soliditylang.org/>`_ is the correct place (see :ref:`solidity_language_design`).
Workflow for Pull Requests
==========================
@ -67,7 +69,7 @@ Additionally, if you are writing a new feature, please ensure you add appropriat
test cases under ``test/`` (see below).
However, if you are making a larger change, please consult with the `Solidity Development Gitter channel
<https://gitter.im/ethereum/solidity-dev>`_ (different from the one mentioned above, this one is
<https://gitter.im/ethereum/solidity-dev>`_ (different from the one mentioned above this one is
focused on compiler and language development instead of language usage) first.
New features and bugfixes should be added to the ``Changelog.md`` file: please
@ -78,6 +80,9 @@ Finally, please make sure you respect the `coding style
for this project. Also, even though we do CI testing, please test your code and
ensure that it builds locally before submitting a pull request.
We highly recommend going through our `review checklist <https://github.com/ethereum/solidity/blob/develop/ReviewChecklist.md>`_ before submitting the pull request.
We thoroughly review every PR and will help you get it right, but there are many common problems that can be easily avoided, making the review much smoother.
Thank you for your help!
Running the Compiler Tests
@ -88,18 +93,17 @@ Prerequisites
For running all compiler tests you may want to optionally install a few
dependencies (`evmone <https://github.com/ethereum/evmone/releases>`_,
`libz3 <https://github.com/Z3Prover/z3>`_, and
`libhera <https://github.com/ewasm/hera>`_).
`libz3 <https://github.com/Z3Prover/z3>`_).
On macOS some of the testing scripts expect GNU coreutils to be installed.
On macOS systems, some of the testing scripts expect GNU coreutils to be installed.
This can be easiest accomplished using Homebrew: ``brew install coreutils``.
On Windows systems make sure that you have a privilege to create symlinks,
On Windows systems, make sure that you have a privilege to create symlinks,
otherwise several tests may fail.
Administrators should have that privilege, but you may also
`grant it to other users <https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/create-symbolic-links#policy-management>`_
`grant it to other users <https://learn.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/create-symbolic-links#policy-management>`_
or
`enable Developer Mode <https://docs.microsoft.com/en-us/windows/apps/get-started/enable-your-device-for-development>`_.
`enable Developer Mode <https://learn.microsoft.com/en-us/windows/apps/get-started/enable-your-device-for-development>`_.
Running the Tests
-----------------
@ -110,27 +114,21 @@ Running ``build/test/soltest`` or its wrapper ``scripts/soltest.sh`` is sufficie
The ``./scripts/tests.sh`` script executes most Solidity tests automatically,
including those bundled into the `Boost C++ Test Framework <https://www.boost.org/doc/libs/release/libs/test/doc/html/index.html>`_
application ``soltest`` (or its wrapper ``scripts/soltest.sh``), as well as command line tests and
application ``soltest`` (or its wrapper ``scripts/soltest.sh``), as well as command-line tests and
compilation tests.
The test system automatically tries to discover the location of
the `evmone <https://github.com/ethereum/evmone/releases>`_ for running the semantic tests.
The ``evmone`` library must be located in the ``deps`` or ``deps/lib`` directory relative to the
current working directory, to its parent or its parent's parent. Alternatively an explicit location
current working directory, to its parent or its parent's parent. Alternatively, an explicit location
for the ``evmone`` shared object can be specified via the ``ETH_EVMONE`` environment variable.
``evmone`` is needed mainly for running semantic and gas tests.
If you do not have it installed, you can skip these tests by passing the ``--no-semantic-tests``
flag to ``scripts/soltest.sh``.
Running Ewasm tests is disabled by default and can be explicitly enabled
via ``./scripts/soltest.sh --ewasm`` and requires `hera <https://github.com/ewasm/hera>`_
to be found by ``soltest``.
The mechanism for locating the ``hera`` library is the same as for ``evmone``, except that the
variable for specifying an explicit location is called ``ETH_HERA``.
The ``evmone`` and ``hera`` libraries should both end with the file name
The ``evmone`` library should both end with the file name
extension ``.so`` on Linux, ``.dll`` on Windows systems and ``.dylib`` on macOS.
For running SMT tests, the ``libz3`` library must be installed and locatable
@ -141,7 +139,7 @@ SMT tests by exporting ``SMT_FLAGS=--no-smt`` before running ``./scripts/tests.s
running ``./scripts/soltest.sh --no-smt``.
These tests are ``libsolidity/smtCheckerTests`` and ``libsolidity/smtCheckerTestsJSON``.
.. note ::
.. note::
To get a list of all unit tests run by Soltest, run ``./build/test/soltest --list_content=HRF``.
@ -162,7 +160,7 @@ See especially:
- `run_test (-t) <https://www.boost.org/doc/libs/release/libs/test/doc/html/boost_test/utf_reference/rt_param_reference/run_test.html>`_ to run specific tests cases, and
- `report-level (-r) <https://www.boost.org/doc/libs/release/libs/test/doc/html/boost_test/utf_reference/rt_param_reference/report_level.html>`_ give a more detailed report.
.. note ::
.. note::
Those working in a Windows environment wanting to run the above basic sets
without libz3. Using Git Bash, you use: ``./build/test/Release/soltest.exe -- --no-smt``.
@ -170,6 +168,7 @@ See especially:
If you want to debug using GDB, make sure you build differently than the "usual".
For example, you could run the following command in your ``build`` folder:
.. code-block:: bash
cmake -DCMAKE_BUILD_TYPE=Debug ..
@ -240,12 +239,12 @@ provides a way to edit, update or skip the current contract file, or quit the ap
It offers several options for failing tests:
- ``edit``: ``isoltest`` tries to open the contract in an editor so you can adjust it. It either uses the editor given on the command line (as ``isoltest --editor /path/to/editor``), in the environment variable ``EDITOR`` or just ``/usr/bin/editor`` (in that order).
- ``edit``: ``isoltest`` tries to open the contract in an editor so you can adjust it. It either uses the editor given on the command-line (as ``isoltest --editor /path/to/editor``), in the environment variable ``EDITOR`` or just ``/usr/bin/editor`` (in that order).
- ``update``: Updates the expectations for contract under test. This updates the annotations by removing unmet expectations and adding missing expectations. The test is then run again.
- ``skip``: Skips the execution of this particular test.
- ``quit``: Quits ``isoltest``.
All of these options apply to the current contract, expect ``quit`` which stops the entire testing process.
All of these options apply to the current contract, except ``quit`` which stops the entire testing process.
Automatically updating the test above changes it to
@ -270,6 +269,62 @@ and re-run the test. It now passes again:
Do not put more than one contract into a single file, unless you are testing inheritance or cross-contract calls.
Each file should test one aspect of your new feature.
Command-line Tests
------------------
Our suite of end-to-end command-line tests checks the behaviour of the compiler binary as a whole
in various scenarios.
These tests are located in `test/cmdlineTests/ <https://github.com/ethereum/solidity/tree/develop/test/cmdlineTests>`_,
one per subdirectory, and can be executed using the ``cmdlineTests.sh`` script.
By default the script runs all available tests.
You can also provide one or more `file name patterns <https://www.gnu.org/software/bash/manual/bash.html#Filename-Expansion>`_,
in which case only the tests matching at least one pattern will be executed.
It is also possible to exclude files matching a specific pattern by prefixing it with ``--exclude``.
By default the script assumes that a ``solc`` binary is available inside the ``build/`` subdirectory
inside the working copy.
If you build the compiler outside of the source tree, you can use the ``SOLIDITY_BUILD_DIR`` environment
variable to specify a different location for the build directory.
Example:
.. code-block:: bash
export SOLIDITY_BUILD_DIR=~/solidity/build/
test/cmdlineTests.sh "standard_*" "*_yul_*" --exclude "standard_yul_*"
The commands above will run tests from directories starting with ``test/cmdlineTests/standard_`` and
subdirectories of ``test/cmdlineTests/`` that have ``_yul_`` somewhere in the name,
but no test whose name starts with ``standard_yul_`` will be executed.
It will also assume that the file ``solidity/build/solc/solc`` inside your home directory is the
compiler binary (unless you are on Windows -- then ``solidity/build/solc/Release/solc.exe``).
There are several kinds of command-line tests:
- *Standard JSON test*: contains at least an ``input.json`` file.
In general may contain:
- ``input.json``: input file to be passed to the ``--standard-json`` option on the command line.
- ``output.json``: expected Standard JSON output.
- ``args``: extra command-line arguments passed to ``solc``.
- *CLI test*: contains at least an ``input.*`` file (other than ``input.json``).
In general may contain:
- ``input.*``: a single input file, whose name will be supplied to ``solc`` on the command line.
Usually ``input.sol`` or ``input.yul``.
- ``args``: extra command-line arguments passed to ``solc``.
- ``stdin``: content to be passed to ``solc`` via standard input.
- ``output``: expected content of the standard output.
- ``err``: expected content of the standard error output.
- ``exit``: expected exit code. If not provided, zero is expected.
- *Script test*: contains a ``test.*`` file.
In general may contain:
- ``test.*``: a single script to run, usually ``test.sh`` or ``test.py``.
The script must be executable.
Running the Fuzzer via AFL
==========================
@ -292,7 +347,7 @@ Next, build Solidity (or just the ``solfuzzer`` binary) with AFL as your compile
cmake .. -DCMAKE_C_COMPILER=path/to/afl-gcc -DCMAKE_CXX_COMPILER=path/to/afl-g++
make solfuzzer
At this stage you should be able to see a message similar to the following:
At this stage, you should be able to see a message similar to the following:
.. code-block:: text
@ -351,7 +406,7 @@ The AFL documentation states that the corpus (the initial input files) should no
too large. The files themselves should not be larger than 1 kB and there should be
at most one input file per functionality, so better start with a small number of.
There is also a tool called ``afl-cmin`` that can trim input files
that result in similar behaviour of the binary.
that result in similar behavior of the binary.
Now run the fuzzer (the ``-m`` extends the size of memory to 60 MB):
@ -398,18 +453,17 @@ contributions to Solidity.
English Language
----------------
Use English, with British English spelling preferred, unless using project or brand names. Try to reduce the usage of
local slang and references, making your language as clear to all readers as possible. Below are some references to help:
Use International English, unless using project or brand names. Try to reduce the usage of
local slang and references, making your language as clear to all readers as possible.
Below are some references to help:
* `Simplified technical English <https://en.wikipedia.org/wiki/Simplified_Technical_English>`_
* `International English <https://en.wikipedia.org/wiki/International_English>`_
* `British English spelling <https://en.oxforddictionaries.com/spelling/british-and-spelling>`_
.. note::
While the official Solidity documentation is written in English, there are community contributed :ref:`translations`
in other languages available. Please refer to the `translation guide <https://github.com/solidity-docs/translation-guide>`_
in other languages available. Please refer to the `translation guide <https://github.com/solidity-docs#solidity-documentation-translation-guide>`_
for information on how to contribute to the community translations.
Title Case for Headings
@ -475,13 +529,15 @@ For example ``pragma solidity >=0.4.0 <0.9.0;``.
Running Documentation Tests
---------------------------
Make sure your contributions pass our documentation tests by running ``./scripts/docs.sh`` that installs dependencies
Make sure your contributions pass our documentation tests by running ``./docs/docs.sh`` that installs dependencies
needed for documentation and checks for any problems such as broken links or syntax issues.
.. _solidity_language_design:
Solidity Language Design
========================
To actively get involved in the language design process and share your ideas concerning the future of Solidity,
To actively get involved in the language design process and to share your ideas concerning the future of Solidity,
please join the `Solidity forum <https://forum.soliditylang.org/>`_.
The Solidity forum serves as the place to propose and discuss new language features and their implementation in
@ -500,7 +556,7 @@ If you want to know where the team is standing in terms or implementing new feat
Issues in the design backlog need further specification and will either be discussed in a language design call or in a regular team call. You can
see the upcoming changes for the next breaking release by changing from the default branch (`develop`) to the `breaking branch <https://github.com/ethereum/solidity/tree/breaking>`_.
For ad-hoc cases and questions you can reach out to us via the `Solidity-dev Gitter channel <https://gitter.im/ethereum/solidity-dev>`_, a
For ad-hoc cases and questions, you can reach out to us via the `Solidity-dev Gitter channel <https://gitter.im/ethereum/solidity-dev>`_ a
dedicated chatroom for conversations around the Solidity compiler and language development.
We are happy to hear your thoughts on how we can improve the language design process to be even more collaborative and transparent.

View File

@ -150,8 +150,8 @@ throws an exception or goes out of gas.
use ``f.value(x).gas(g)()``. This was deprecated in Solidity 0.6.2 and is no
longer possible since Solidity 0.7.0.
Named Calls and Anonymous Function Parameters
---------------------------------------------
Function Calls with Named Parameters
------------------------------------
Function call arguments can be given by name, in any order,
if they are enclosed in ``{ }`` as can be seen in the following
@ -173,14 +173,15 @@ parameters from the function declaration, but can be in arbitrary order.
function set(uint key, uint value) public {
data[key] = value;
}
}
Omitted Function Parameter Names
--------------------------------
Omitted Names in Function Definitions
-------------------------------------
The names of unused parameters (especially return parameters) can be omitted.
Those parameters will still be present on the stack, but they are inaccessible.
The names of parameters and return values in the function declaration can be omitted.
Those items with omitted names will still be present on the stack, but they are
inaccessible by name. An omitted return value name
can still return a value to the caller by use of the ``return`` statement.
.. code-block:: solidity
@ -283,7 +284,7 @@ which only need to be created if there is a dispute.
salt,
keccak256(abi.encodePacked(
type(D).creationCode,
arg
abi.encode(arg)
))
)))));
@ -364,13 +365,13 @@ i.e. the following is not valid: ``(x, uint y) = (1, 2);``
.. warning::
Be careful when assigning to multiple variables at the same time when
reference types are involved, because it could lead to unexpected
copying behaviour.
copying behavior.
Complications for Arrays and Structs
------------------------------------
The semantics of assignments are more complicated for non-value types like arrays and structs,
including ``bytes`` and ``string``, see :ref:`Data location and assignment behaviour <data-location-assignment>` for details.
including ``bytes`` and ``string``, see :ref:`Data location and assignment behavior <data-location-assignment>` for details.
In the example below the call to ``g(x)`` has no effect on ``x`` because it creates
an independent copy of the storage value in memory. However, ``h(x)`` successfully modifies ``x``
@ -509,7 +510,7 @@ additional checks.
Since Solidity 0.8.0, all arithmetic operations revert on over- and underflow by default,
thus making the use of these libraries unnecessary.
To obtain the previous behaviour, an ``unchecked`` block can be used:
To obtain the previous behavior, an ``unchecked`` block can be used:
.. code-block:: solidity
@ -649,7 +650,7 @@ in the following situations:
For the following cases, the error data from the external call
(if provided) is forwarded. This means that it can either cause
an `Error` or a `Panic` (or whatever else was given):
an ``Error`` or a ``Panic`` (or whatever else was given):
#. If a ``.transfer()`` fails.
#. If you call a function via a message call but it does not finish
@ -684,7 +685,7 @@ and ``assert`` for internal error checking.
addr.transfer(msg.value / 2);
// Since transfer throws an exception on failure and
// cannot call back here, there should be no way for us to
// still have half of the money.
// still have half of the Ether.
assert(address(this).balance == balanceBeforeTransfer - msg.value / 2);
return address(this).balance;
}
@ -718,7 +719,7 @@ The ``revert`` statement takes a custom error as direct argument without parenth
revert CustomError(arg1, arg2);
For backwards-compatibility reasons, there is also the ``revert()`` function, which uses parentheses
For backward-compatibility reasons, there is also the ``revert()`` function, which uses parentheses
and accepts a string:
revert();

View File

@ -26,8 +26,10 @@
# (c) 2016 solidity contributors.
#------------------------------------------------------------------------------
set -e
cd docs
set -euo pipefail
script_dir="$(dirname "$0")"
cd "${script_dir}"
pip3 install -r requirements.txt --upgrade --upgrade-strategy eager
sphinx-build -nW -b html -d _build/doctrees . _build/html
cd ..

View File

@ -16,11 +16,11 @@ Simple Open Auction
===================
The general idea of the following simple auction contract is that everyone can
send their bids during a bidding period. The bids already include sending money
/ Ether in order to bind the bidders to their bid. If the highest bid is
raised, the previous highest bidder gets their money back. After the end of
send their bids during a bidding period. The bids already include sending some compensation,
e.g. Ether, in order to bind the bidders to their bid. If the highest bid is
raised, the previous highest bidder gets their Ether back. After the end of
the bidding period, the contract has to be called manually for the beneficiary
to receive their money - contracts cannot activate themselves.
to receive their Ether - contracts cannot activate themselves.
.. code-block:: solidity
@ -92,19 +92,19 @@ to receive their money - contracts cannot activate themselves.
revert AuctionAlreadyEnded();
// If the bid is not higher, send the
// money back (the revert statement
// Ether back (the revert statement
// will revert all changes in this
// function execution including
// it having received the money).
// it having received the Ether).
if (msg.value <= highestBid)
revert BidNotHighEnough(highestBid);
if (highestBid != 0) {
// Sending back the money by simply using
// Sending back the Ether by simply using
// highestBidder.send(highestBid) is a security risk
// because it could execute an untrusted contract.
// It is always safer to let the recipients
// withdraw their money themselves.
// withdraw their Ether themselves.
pendingReturns[highestBidder] += highestBid;
}
highestBidder = msg.sender;
@ -177,19 +177,19 @@ During the **bidding period**, a bidder does not actually send their bid, but
only a hashed version of it. Since it is currently considered practically
impossible to find two (sufficiently long) values whose hash values are equal,
the bidder commits to the bid by that. After the end of the bidding period,
the bidders have to reveal their bids: They send their values unencrypted and
the bidders have to reveal their bids: They send their values unencrypted, and
the contract checks that the hash value is the same as the one provided during
the bidding period.
Another challenge is how to make the auction **binding and blind** at the same
time: The only way to prevent the bidder from just not sending the money after
time: The only way to prevent the bidder from just not sending the Ether after
they won the auction is to make them send it together with the bid. Since value
transfers cannot be blinded in Ethereum, anyone can see the value.
The following contract solves this problem by accepting any value that is
larger than the highest bid. Since this can of course only be checked during
the reveal phase, some bids might be **invalid**, and this is on purpose (it
even provides an explicit flag to place invalid bids with high value
even provides an explicit flag to place invalid bids with high-value
transfers): Bidders can confuse competition by placing several high or low
invalid bids.

View File

@ -2,7 +2,7 @@
Micropayment Channel
********************
In this section we will learn how to build an example implementation
In this section, we will learn how to build an example implementation
of a payment channel. It uses cryptographic signatures to make
repeated transfers of Ether between the same parties secure, instantaneous, and
without transaction fees. For the example, we need to understand how to
@ -17,14 +17,14 @@ Alice is the sender and Bob is the recipient.
Alice only needs to send cryptographically signed messages off-chain
(e.g. via email) to Bob and it is similar to writing checks.
Alice and Bob use signatures to authorise transactions, which is possible with smart contracts on Ethereum.
Alice and Bob use signatures to authorize transactions, which is possible with smart contracts on Ethereum.
Alice will build a simple smart contract that lets her transmit Ether, but instead of calling a function herself
to initiate a payment, she will let Bob do that, and therefore pay the transaction fee.
The contract will work as follows:
1. Alice deploys the ``ReceiverPays`` contract, attaching enough Ether to cover the payments that will be made.
2. Alice authorises a payment by signing a message with her private key.
2. Alice authorizes a payment by signing a message with her private key.
3. Alice sends the cryptographically signed message to Bob. The message does not need to be kept secret
(explained later), and the mechanism for sending it does not matter.
4. Bob claims his payment by presenting the signed message to the smart contract, it verifies the
@ -36,7 +36,7 @@ Creating the signature
Alice does not need to interact with the Ethereum network
to sign the transaction, the process is completely offline.
In this tutorial, we will sign messages in the browser
using `web3.js <https://github.com/ethereum/web3.js>`_ and
using `web3.js <https://github.com/web3/web3.js>`_ and
`MetaMask <https://metamask.io>`_, using the method described in `EIP-712 <https://github.com/ethereum/EIPs/pull/712>`_,
as it provides a number of other security benefits.
@ -86,7 +86,7 @@ Packing arguments
Now that we have identified what information to include in the signed message,
we are ready to put the message together, hash it, and sign it. For simplicity,
we concatenate the data. The `ethereumjs-abi <https://github.com/ethereumjs/ethereumjs-abi>`_
library provides a function called ``soliditySHA3`` that mimics the behaviour of
library provides a function called ``soliditySHA3`` that mimics the behavior of
Solidity's ``keccak256`` function applied to arguments encoded using ``abi.encodePacked``.
Here is a JavaScript function that creates the proper signature for the ``ReceiverPays`` example:
@ -144,6 +144,7 @@ The full contract
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
// This will report a warning due to deprecated selfdestruct
contract ReceiverPays {
address owner = msg.sender;
@ -259,7 +260,7 @@ Messages are cryptographically signed by the sender and then transmitted directl
Each message includes the following information:
* The smart contract's address, used to prevent cross-contract replay attacks.
* The total amount of Ether that is owed the recipient so far.
* The total amount of Ether that is owed to the recipient so far.
A payment channel is closed just once, at the end of a series of transfers.
Because of this, only one of the messages sent is redeemed. This is why
@ -341,6 +342,7 @@ The full contract
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
// This will report a warning due to deprecated selfdestruct
contract SimplePaymentChannel {
address payable public sender; // The account sending payments.
address payable public recipient; // The account receiving the payments.

View File

@ -7,7 +7,7 @@ Modular Contracts
A modular approach to building your contracts helps you reduce the complexity
and improve the readability which will help to identify bugs and vulnerabilities
during development and code review.
If you specify and control the behaviour or each module in isolation, the
If you specify and control the behavior of each module in isolation, the
interactions you have to consider are only those between the module specifications
and not every other moving part of the contract.
In the example below, the contract uses the ``move`` method
@ -34,7 +34,7 @@ and the sum of all balances is an invariant across the lifetime of the contract.
contract Token {
mapping(address => uint256) balances;
using Balances for *;
mapping(address => mapping (address => uint256)) allowed;
mapping(address => mapping(address => uint256)) allowed;
event Transfer(address from, address to, uint amount);
event Approval(address owner, address spender, uint amount);

View File

@ -6,18 +6,18 @@ Safe Remote Purchase
Purchasing goods remotely currently requires multiple parties that need to trust each other.
The simplest configuration involves a seller and a buyer. The buyer would like to receive
an item from the seller and the seller would like to get money (or an equivalent)
an item from the seller and the seller would like to get some compensation, e.g. Ether,
in return. The problematic part is the shipment here: There is no way to determine for
sure that the item arrived at the buyer.
There are multiple ways to solve this problem, but all fall short in one or the other way.
In the following example, both parties have to put twice the value of the item into the
contract as escrow. As soon as this happened, the money will stay locked inside
contract as escrow. As soon as this happened, the Ether will stay locked inside
the contract until the buyer confirms that they received the item. After that,
the buyer is returned the value (half of their deposit) and the seller gets three
times the value (their deposit plus the value). The idea behind
this is that both parties have an incentive to resolve the situation or otherwise
their money is locked forever.
their Ether is locked forever.
This contract of course does not solve the problem, but gives an overview of how
you can use state machine-like constructs inside a contract.

View File

@ -109,6 +109,7 @@ of votes.
function delegate(address to) external {
// assigns reference
Voter storage sender = voters[msg.sender];
require(sender.weight != 0, "You have no right to vote");
require(!sender.voted, "You already voted.");
require(to != msg.sender, "Self-delegation is disallowed.");
@ -128,14 +129,16 @@ of votes.
require(to != msg.sender, "Found loop in delegation.");
}
// Since `sender` is a reference, this
// modifies `voters[msg.sender].voted`
Voter storage delegate_ = voters[to];
// Voters cannot delegate to wallets that cannot vote.
// Voters cannot delegate to accounts that cannot vote.
require(delegate_.weight >= 1);
// Since `sender` is a reference, this
// modifies `voters[msg.sender]`.
sender.voted = true;
sender.delegate = to;
if (delegate_.voted) {
// If the delegate already voted,
// directly add to the number of votes
@ -190,5 +193,8 @@ of votes.
Possible Improvements
=====================
Currently, many transactions are needed to assign the rights
to vote to all participants. Can you think of a better way?
Currently, many transactions are needed to
assign the rights to vote to all participants.
Moreover, if two or more proposals have the same
number of votes, ``winningProposal()`` is not able
to register a tie. Can you think of a way to fix these issues?

View File

@ -22,23 +22,16 @@ def remix_code_url(source_code, language, solidity_version):
# NOTE: base64 encoded data may contain +, = and / characters. Remix seems to handle them just
# fine without any escaping.
base64_encoded_source = base64.b64encode(source_code.encode('utf-8')).decode('ascii')
return f"https://remix.ethereum.org/?language={language}&version={solidity_version}&code={base64_encoded_source}"
return f"https://remix.ethereum.org/?#language={language}&version={solidity_version}&code={base64_encoded_source}"
def build_remix_link_node(url):
link_icon_node = docutils.nodes.inline()
link_icon_node.set_class('link-icon')
link_text_node = docutils.nodes.inline(text="open in Remix")
link_text_node.set_class('link-text')
reference_node = docutils.nodes.reference('', '', internal=False, refuri=url)
reference_node = docutils.nodes.reference('', 'open in Remix', internal=False, refuri=url, target='_blank')
reference_node.set_class('remix-link')
reference_node += [link_icon_node, link_text_node]
paragraph_node = docutils.nodes.paragraph()
paragraph_node.set_class('remix-link-container')
paragraph_node += reference_node
paragraph_node.append(reference_node)
return paragraph_node
@ -49,22 +42,24 @@ def insert_remix_link(app, doctree, solidity_version):
for literal_block_node in doctree.traverse(docutils.nodes.literal_block):
assert 'language' in literal_block_node.attributes
language = literal_block_node.attributes['language'].lower()
if language in ['solidity', 'yul']:
text_nodes = list(literal_block_node.traverse(docutils.nodes.Text))
assert len(text_nodes) == 1
if language not in ['solidity', 'yul']:
continue
remix_url = remix_code_url(text_nodes[0], language, solidity_version)
url_length = len(remix_url.encode('utf-8'))
if url_length > MAX_SAFE_URL_LENGTH:
logger.warning(
"Remix URL generated from the code snippet exceeds the maximum safe URL length "
" (%d > %d bytes).",
url_length,
MAX_SAFE_URL_LENGTH,
location=(literal_block_node.source, literal_block_node.line),
)
text_nodes = list(literal_block_node.traverse(docutils.nodes.Text))
assert len(text_nodes) == 1
insert_node_before(literal_block_node, build_remix_link_node(remix_url))
remix_url = remix_code_url(text_nodes[0], language, solidity_version)
url_length = len(remix_url.encode('utf-8'))
if url_length > MAX_SAFE_URL_LENGTH:
logger.warning(
"Remix URL generated from the code snippet exceeds the maximum safe URL length "
" (%d > %d bytes).",
url_length,
MAX_SAFE_URL_LENGTH,
location=(literal_block_node.source, literal_block_node.line),
)
insert_node_before(literal_block_node, build_remix_link_node(remix_url))
def setup(app):

View File

@ -9,10 +9,9 @@ ReservedKeywords:
| 'partial' | 'promise' | 'reference' | 'relocatable' | 'sealed' | 'sizeof' | 'static'
| 'supports' | 'switch' | 'typedef' | 'typeof' | 'var';
Pragma: 'pragma' -> pushMode(PragmaMode);
Abstract: 'abstract';
Anonymous: 'anonymous';
Address: 'address';
Anonymous: 'anonymous';
As: 'as';
Assembly: 'assembly' -> pushMode(AssemblyBlockMode);
Bool: 'bool';
@ -30,13 +29,11 @@ Else: 'else';
Emit: 'emit';
Enum: 'enum';
Error: 'error'; // not a real keyword
Revert: 'revert'; // not a real keyword
Event: 'event';
External: 'external';
Fallback: 'fallback';
False: 'false';
Fixed: 'fixed' | ('fixed' [1-9][0-9]* 'x' [1-9][0-9]*);
From: 'from'; // not a real keyword
/**
* Bytes types of fixed length.
*/
@ -46,7 +43,9 @@ FixedBytes:
'bytes17' | 'bytes18' | 'bytes19' | 'bytes20' | 'bytes21' | 'bytes22' | 'bytes23' | 'bytes24' |
'bytes25' | 'bytes26' | 'bytes27' | 'bytes28' | 'bytes29' | 'bytes30' | 'bytes31' | 'bytes32';
For: 'for';
From: 'from'; // not a real keyword
Function: 'function';
Global: 'global'; // not a real keyword
Hex: 'hex';
If: 'if';
Immutable: 'immutable';
@ -63,15 +62,17 @@ New: 'new';
/**
* Unit denomination for numbers.
*/
NumberUnit: 'wei' | 'gwei' | 'ether' | 'seconds' | 'minutes' | 'hours' | 'days' | 'weeks' | 'years';
SubDenomination: 'wei' | 'gwei' | 'ether' | 'seconds' | 'minutes' | 'hours' | 'days' | 'weeks' | 'years';
Override: 'override';
Payable: 'payable';
Pragma: 'pragma' -> pushMode(PragmaMode);
Private: 'private';
Public: 'public';
Pure: 'pure';
Receive: 'receive';
Return: 'return';
Returns: 'returns';
Revert: 'revert'; // not a real keyword
/**
* Sized signed integer types.
* int is an alias of int256.
@ -89,6 +90,7 @@ Try: 'try';
Type: 'type';
Ufixed: 'ufixed' | ('ufixed' [1-9][0-9]+ 'x' [1-9][0-9]+);
Unchecked: 'unchecked';
Unicode: 'unicode';
/**
* Sized unsigned integer types.
* uint is an alias of uint256.
@ -197,9 +199,7 @@ fragment EscapeSequence:
/**
* A single quoted string literal allowing arbitrary unicode characters.
*/
UnicodeStringLiteral:
'unicode"' DoubleQuotedUnicodeStringCharacter* '"'
| 'unicode\'' SingleQuotedUnicodeStringCharacter* '\'';
UnicodeStringLiteral: 'unicode' (('"' DoubleQuotedUnicodeStringCharacter* '"') | ('\'' SingleQuotedUnicodeStringCharacter* '\''));
//@doc:inline
fragment DoubleQuotedUnicodeStringCharacter: ~["\r\n\\] | EscapeSequence;
//@doc:inline
@ -221,6 +221,14 @@ fragment EvenHexDigits: HexCharacter HexCharacter ('_'? HexCharacter HexCharacte
//@doc:inline
fragment HexCharacter: [0-9A-Fa-f];
/**
* Scanned but not used by any rule, i.e, disallowed.
* solc parser considers number starting with '0', not immediately followed by '.' or 'x' as
* octal, even if non octal digits '8' and '9' are present.
*/
OctalNumber: '0' DecimalDigits ('.' DecimalDigits)?;
/**
* A decimal number literal consists of decimal digits that may be delimited by underscores and
* an optional positive or negative exponent.
@ -231,6 +239,12 @@ DecimalNumber: (DecimalDigits | (DecimalDigits? '.' DecimalDigits)) ([eE] '-'? D
fragment DecimalDigits: [0-9] ('_'? [0-9])* ;
/**
* This is needed to avoid successfully parsing a number followed by a string with no whitespace between.
*/
DecimalNumberFollowedByIdentifier: DecimalNumber Identifier;
/**
* An identifier in solidity has to start with a letter, a dollar-sign or an underscore and
* may additionally contain numbers after the first symbol.
@ -251,6 +265,12 @@ mode AssemblyBlockMode;
AssemblyDialect: '"evmasm"';
AssemblyLBrace: '{' -> popMode, pushMode(YulMode);
AssemblyFlagString: '"' DoubleQuotedStringCharacter+ '"';
AssemblyBlockLParen: '(';
AssemblyBlockRParen: ')';
AssemblyBlockComma: ',';
AssemblyBlockWS: [ \t\r\n\u000C]+ -> skip ;
AssemblyBlockCOMMENT: '/*' .*? '*/' -> channel(HIDDEN) ;
AssemblyBlockLINE_COMMENT: '//' ~[\r\n]* -> channel(HIDDEN) ;
@ -284,8 +304,8 @@ YulEVMBuiltin:
| 'returndatacopy' | 'extcodehash' | 'create' | 'create2' | 'call' | 'callcode'
| 'delegatecall' | 'staticcall' | 'return' | 'revert' | 'selfdestruct' | 'invalid'
| 'log0' | 'log1' | 'log2' | 'log3' | 'log4' | 'chainid' | 'origin' | 'gasprice'
| 'blockhash' | 'coinbase' | 'timestamp' | 'number' | 'difficulty' | 'gaslimit'
| 'basefee';
| 'blockhash' | 'coinbase' | 'timestamp' | 'number' | 'difficulty' | 'prevrandao'
| 'gaslimit' | 'basefee';
YulLBrace: '{' -> pushMode(YulMode);
YulRBrace: '}' -> popMode;

View File

@ -12,6 +12,7 @@ options { tokenVocab=SolidityLexer; }
sourceUnit: (
pragmaDirective
| importDirective
| usingDirective
| contractDefinition
| interfaceDefinition
| libraryDefinition
@ -21,6 +22,7 @@ sourceUnit: (
| enumDefinition
| userDefinedValueTypeDefinition
| errorDefinition
| eventDefinition
)* EOF;
//@doc: inline
@ -151,7 +153,7 @@ stateMutability: Pure | View | Payable;
*/
overrideSpecifier: Override (LParen overrides+=identifierPath (Comma overrides+=identifierPath)* RParen)?;
/**
* The definition of contract, library and interface functions.
* The definition of contract, library, interface or free functions.
* Depending on the context in which the function is defined, further restrictions may apply,
* e.g. functions in interfaces have to be unimplemented, i.e. may not contain a body block.
*/
@ -160,7 +162,7 @@ locals[
boolean visibilitySet = false,
boolean mutabilitySet = false,
boolean virtualSet = false,
boolean overrideSpecifierSet = false
boolean overrideSpecifierSet = false,
]
:
Function (identifier | Fallback | Receive)
@ -174,6 +176,7 @@ locals[
)*
(Returns LParen returnParameters=parameterList RParen)?
(Semicolon | body=block);
/**
* The definition of a modifier.
* Note that within the body block of a modifier, the underscore cannot be used as identifier,
@ -311,10 +314,30 @@ errorDefinition:
Semicolon;
/**
* Using directive to bind library functions to types.
* Can occur within contracts and libraries.
* Operators that users are allowed to implement for some types with `using for`.
*/
usingDirective: Using identifierPath For (Mul | typeName) Semicolon;
userDefinableOperator:
BitAnd
| BitNot
| BitOr
| BitXor
| Add
| Div
| Mod
| Mul
| Sub
| Equal
| GreaterThan
| GreaterThanOrEqual
| LessThan
| LessThanOrEqual
| NotEqual;
/**
* Using directive to attach library functions and free functions to types.
* Can occur within contracts and libraries and at the file level.
*/
usingDirective: Using (identifierPath | (LBrace identifierPath (As userDefinableOperator)? (Comma identifierPath (As userDefinableOperator)?)* RBrace)) For (Mul | typeName) Global? Semicolon;
/**
* A type name can be an elementary type, a function type, a mapping type, a user-defined type
* (e.g. a contract or struct) or an array type.
@ -346,7 +369,7 @@ dataLocation: Memory | Storage | Calldata;
*/
expression:
expression LBrack index=expression? RBrack # IndexAccess
| expression LBrack start=expression? Colon end=expression? RBrack # IndexRangeAccess
| expression LBrack startIndex=expression? Colon endIndex=expression? RBrack # IndexRangeAccess
| expression Period (identifier | Address) # MemberAccess
| expression LBrace (namedArgument (Comma namedArgument)*)? RBrace # FunctionCallOptions
| expression callArgumentList # FunctionCall
@ -367,12 +390,13 @@ expression:
| expression Or expression # OrOperation
|<assoc=right> expression Conditional expression Colon expression # Conditional
|<assoc=right> expression assignOp expression # Assignment
| New typeName # NewExpression
| New typeName # NewExpr
| tupleExpression # Tuple
| inlineArrayExpression # InlineArray
| (
identifier
| literal
| literalWithSubDenomination
| elementaryTypeName[false]
) # PrimaryExpression
;
@ -388,9 +412,12 @@ inlineArrayExpression: LBrack (expression ( Comma expression)* ) RBrack;
/**
* Besides regular non-keyword Identifiers, some keywords like 'from' and 'error' can also be used as identifiers.
*/
identifier: Identifier | From | Error | Revert;
identifier: Identifier | From | Error | Revert | Global;
literal: stringLiteral | numberLiteral | booleanLiteral | hexStringLiteral | unicodeStringLiteral;
literalWithSubDenomination: numberLiteral SubDenomination;
booleanLiteral: True | False;
/**
* A full string literal consists of either one or several consecutive quoted strings.
@ -408,7 +435,8 @@ unicodeStringLiteral: UnicodeStringLiteral+;
/**
* Number literals can be decimal or hexadecimal numbers with an optional unit.
*/
numberLiteral: (DecimalNumber | HexNumber) NumberUnit?;
numberLiteral: DecimalNumber | HexNumber;
/**
* A curly-braced block of statements. Opens its own scope.
*/
@ -476,7 +504,13 @@ revertStatement: Revert expression callArgumentList Semicolon;
* The contents of an inline assembly block use a separate scanner/lexer, i.e. the set of keywords and
* allowed identifiers is different inside an inline assembly block.
*/
assemblyStatement: Assembly AssemblyDialect? AssemblyLBrace yulStatement* YulRBrace;
assemblyStatement: Assembly AssemblyDialect? assemblyFlags? AssemblyLBrace yulStatement* YulRBrace;
/**
* Assembly flags.
* Comma-separated list of double-quoted strings as flags.
*/
assemblyFlags: AssemblyBlockLParen AssemblyFlagString (AssemblyBlockComma AssemblyFlagString)* AssemblyBlockRParen;
//@doc:inline
variableDeclarationList: variableDeclarations+=variableDeclaration (Comma variableDeclarations+=variableDeclaration)*;
@ -497,7 +531,7 @@ variableDeclarationTuple:
variableDeclarationStatement: ((variableDeclaration (Assign expression)?) | (variableDeclarationTuple Assign expression)) Semicolon;
expressionStatement: expression Semicolon;
mappingType: Mapping LParen key=mappingKeyType DoubleArrow value=typeName RParen;
mappingType: Mapping LParen key=mappingKeyType name=identifier? DoubleArrow value=typeName name=identifier? RParen;
/**
* Only elementary types or user defined types are viable as mapping keys.
*/

View File

@ -1,40 +1,35 @@
Solidity
========
Solidity is an object-oriented, high-level language for implementing smart
contracts. Smart contracts are programs which govern the behaviour of accounts
within the Ethereum state.
Solidity is an object-oriented, high-level language for implementing smart contracts.
Smart contracts are programs that govern the behavior of accounts within the Ethereum state.
Solidity is a `curly-bracket language <https://en.wikipedia.org/wiki/List_of_programming_languages_by_type#Curly-bracket_languages>`_.
It is influenced by C++, Python and JavaScript, and is designed to target the Ethereum Virtual Machine (EVM).
You can find more details about which languages Solidity has been inspired by in
the :doc:`language influences <language-influences>` section.
Solidity is a `curly-bracket language <https://en.wikipedia.org/wiki/List_of_programming_languages_by_type#Curly-bracket_languages>`_ designed to target the Ethereum Virtual Machine (EVM).
It is influenced by C++, Python, and JavaScript.
You can find more details about which languages Solidity has been inspired by in the :doc:`language influences <language-influences>` section.
Solidity is statically typed, supports inheritance, libraries and complex
user-defined types among other features.
Solidity is statically typed, supports inheritance, libraries, and complex user-defined types, among other features.
With Solidity you can create contracts for uses such as voting, crowdfunding, blind auctions,
and multi-signature wallets.
With Solidity, you can create contracts for uses such as voting, crowdfunding, blind auctions, and multi-signature wallets.
When deploying contracts, you should use the latest released
version of Solidity. Apart from exceptional cases, only the latest version receives
When deploying contracts, you should use the latest released version of Solidity.
Apart from exceptional cases, only the latest version receives
`security fixes <https://github.com/ethereum/solidity/security/policy#supported-versions>`_.
Furthermore, breaking changes as well as
new features are introduced regularly. We currently use
a 0.y.z version number `to indicate this fast pace of change <https://semver.org/#spec-item-4>`_.
Furthermore, breaking changes, as well as new features, are introduced regularly.
We currently use a 0.y.z version number `to indicate this fast pace of change <https://semver.org/#spec-item-4>`_.
.. warning::
Solidity recently released the 0.8.x version that introduced a lot of breaking
changes. Make sure you read :doc:`the full list <080-breaking-changes>`.
Solidity recently released the 0.8.x version that introduced a lot of breaking changes.
Make sure you read :doc:`the full list <080-breaking-changes>`.
Ideas for improving Solidity or this documentation are always welcome,
read our :doc:`contributors guide <contributing>` for more details.
.. Hint::
You can download this documentation as PDF, HTML or Epub by clicking on the versions
flyout menu in the bottom-left corner and selecting the preferred download format.
You can download this documentation as PDF, HTML or Epub
by clicking on the versions flyout menu in the bottom-left corner and selecting the preferred download format.
Getting Started
@ -42,8 +37,7 @@ Getting Started
**1. Understand the Smart Contract Basics**
If you are new to the concept of smart contracts we recommend you to get started by digging
into the "Introduction to Smart Contracts" section, which covers:
If you are new to the concept of smart contracts, we recommend you to get started by digging into the "Introduction to Smart Contracts" section, which covers the following:
* :ref:`A simple example smart contract <simple-smart-contract>` written in Solidity.
* :ref:`Blockchain Basics <blockchain-basics>`.
@ -61,53 +55,55 @@ simply choose your preferred option and follow the steps outlined on the :ref:`i
.. hint::
You can try out code examples directly in your browser with the
`Remix IDE <https://remix.ethereum.org>`_. Remix is a web browser based IDE
that allows you to write, deploy and administer Solidity smart contracts, without
the need to install Solidity locally.
`Remix IDE <https://remix.ethereum.org>`_.
Remix is a web browser-based IDE that allows you to write, deploy and administer Solidity smart contracts,
without the need to install Solidity locally.
.. warning::
As humans write software, it can have bugs. You should follow established
software development best-practices when writing your smart contracts. This
includes code review, testing, audits, and correctness proofs. Smart contract
users are sometimes more confident with code than their authors, and
blockchains and smart contracts have their own unique issues to
watch out for, so before working on production code, make sure you read the
:ref:`security_considerations` section.
As humans write software, it can have bugs.
Therefore, you should follow established software development best practices when writing your smart contracts.
This includes code review, testing, audits, and correctness proofs.
Smart contract users are sometimes more confident with code than their authors,
and blockchains and smart contracts have their own unique issues to watch out for,
so before working on production code, make sure you read the :ref:`security_considerations` section.
**4. Learn More**
If you want to learn more about building decentralized applications on Ethereum, the
`Ethereum Developer Resources <https://ethereum.org/en/developers/>`_
can help you with further general documentation around Ethereum, and a wide selection of tutorials,
tools and development frameworks.
If you want to learn more about building decentralized applications on Ethereum,
the `Ethereum Developer Resources <https://ethereum.org/en/developers/>`_ can help you with further general documentation around Ethereum,
and a wide selection of tutorials, tools, and development frameworks.
If you have any questions, you can try searching for answers or asking on the
`Ethereum StackExchange <https://ethereum.stackexchange.com/>`_, or
our `Gitter channel <https://gitter.im/ethereum/solidity/>`_.
`Ethereum StackExchange <https://ethereum.stackexchange.com/>`_,
or our `Gitter channel <https://gitter.im/ethereum/solidity>`_.
.. _translations:
Translations
------------
Community volunteers help translate this documentation into several languages.
They have varying degrees of completeness and up-to-dateness. The English
version stands as a reference.
Community contributors help translate this documentation into several languages.
Note that they have varying degrees of completeness and up-to-dateness.
The English version stands as a reference.
You can switch between languages by clicking on the flyout menu in the bottom-left corner
and selecting the preferred language.
* `Chinese <https://docs.soliditylang.org/zh/latest/>`_
* `French <https://docs.soliditylang.org/fr/latest/>`_
* `Indonesian <https://github.com/solidity-docs/id-indonesian>`_
* `Japanese <https://github.com/solidity-docs/ja-japanese>`_
* `Korean <https://github.com/solidity-docs/ko-korean>`_
* `Persian <https://github.com/solidity-docs/fa-persian>`_
* `Russian <https://github.com/solidity-docs/ru-russian>`_
* `Spanish <https://github.com/solidity-docs/es-spanish>`_
* `Turkish <https://docs.soliditylang.org/tr/latest/>`_
.. note::
We recently set up a new GitHub organization and translation workflow to help streamline the
community efforts. Please refer to the `translation guide <https://github.com/solidity-docs/translation-guide>`_
for information on how to contribute to the community translations moving forward.
* `French <https://solidity-fr.readthedocs.io>`_ (in progress)
* `Italian <https://github.com/damianoazzolini/solidity>`_ (in progress)
* `Japanese <https://solidity-jp.readthedocs.io>`_
* `Korean <https://solidity-kr.readthedocs.io>`_ (in progress)
* `Russian <https://github.com/ethereum/wiki/wiki/%5BRussian%5D-%D0%A0%D1%83%D0%BA%D0%BE%D0%B2%D0%BE%D0%B4%D1%81%D1%82%D0%B2%D0%BE-%D0%BF%D0%BE-Solidity>`_ (rather outdated)
* `Simplified Chinese <https://learnblockchain.cn/docs/solidity/>`_ (in progress)
* `Spanish <https://solidity-es.readthedocs.io>`_
* `Turkish <https://github.com/denizozzgur/Solidity_TR/blob/master/README.md>`_ (partial)
We set up a GitHub organization and translation workflow to help streamline the community efforts.
Please refer to the translation guide in the `solidity-docs org <https://github.com/solidity-docs>`_
for information on how to start a new language or contribute to the community translations.
Contents
========
@ -119,8 +115,8 @@ Contents
:caption: Basics
introduction-to-smart-contracts.rst
installing-solidity.rst
solidity-by-example.rst
installing-solidity.rst
.. toctree::
:maxdepth: 2
@ -159,21 +155,31 @@ Contents
.. toctree::
:maxdepth: 2
:caption: Additional Material
:caption: Advisory content
security-considerations.rst
bugs.rst
050-breaking-changes.rst
060-breaking-changes.rst
070-breaking-changes.rst
080-breaking-changes.rst
.. toctree::
:maxdepth: 2
:caption: Additional Material
natspec-format.rst
security-considerations.rst
smtchecker.rst
resources.rst
path-resolution.rst
yul.rst
path-resolution.rst
.. toctree::
:maxdepth: 2
:caption: Resources
style-guide.rst
common-patterns.rst
bugs.rst
resources.rst
contributing.rst
brand-guide.rst
language-influences.rst
brand-guide.rst

View File

@ -10,12 +10,12 @@ Versioning
==========
Solidity versions follow `Semantic Versioning <https://semver.org>`_. In
addition, patch level releases with major release 0 (i.e. 0.x.y) will not
addition, patch-level releases with major release 0 (i.e. 0.x.y) will not
contain breaking changes. That means code that compiles with version 0.x.y
can be expected to compile with 0.x.z where z > y.
In addition to releases, we provide **nightly development builds** with the
intention of making it easy for developers to try out upcoming features and
In addition to releases, we provide **nightly development builds** to make
it easy for developers to try out upcoming features and
provide early feedback. Note, however, that while the nightly builds are usually
very stable, they contain bleeding-edge code from the development branch and are
not guaranteed to be always working. Despite our best efforts, they might
@ -33,12 +33,12 @@ Remix
`Access Remix online <https://remix.ethereum.org/>`_, you do not need to install anything.
If you want to use it without connection to the Internet, go to
https://github.com/ethereum/remix-live/tree/gh-pages and download the ``.zip`` file as
explained on that page. Remix is also a convenient option for testing nightly builds
https://github.com/ethereum/remix-live/tree/gh-pages#readme and follow the instructions on that page.
Remix is also a convenient option for testing nightly builds
without installing multiple Solidity versions.
Further options on this page detail installing commandline Solidity compiler software
on your computer. Choose a commandline compiler if you are working on a larger contract
Further options on this page detail installing command-line Solidity compiler software
on your computer. Choose a command-line compiler if you are working on a larger contract
or if you require more compilation options.
.. _solcjs:
@ -54,7 +54,7 @@ the full-featured compiler, ``solc``. The usage of ``solcjs`` is documented insi
`repository <https://github.com/ethereum/solc-js>`_.
Note: The solc-js project is derived from the C++
`solc` by using Emscripten which means that both use the same compiler source code.
`solc` by using Emscripten, which means that both use the same compiler source code.
`solc-js` can be used in JavaScript projects directly (such as Remix).
Please refer to the solc-js repository for instructions.
@ -64,18 +64,18 @@ Please refer to the solc-js repository for instructions.
.. note::
The commandline executable is named ``solcjs``.
The command-line executable is named ``solcjs``.
The commandline options of ``solcjs`` are not compatible with ``solc`` and tools (such as ``geth``)
expecting the behaviour of ``solc`` will not work with ``solcjs``.
The command-line options of ``solcjs`` are not compatible with ``solc`` and tools (such as ``geth``)
expecting the behavior of ``solc`` will not work with ``solcjs``.
Docker
======
Docker images of Solidity builds are available using the ``solc`` image from the ``ethereum`` organisation.
Docker images of Solidity builds are available using the ``solc`` image from the ``ethereum`` organization.
Use the ``stable`` tag for the latest released version, and ``nightly`` for potentially unstable changes in the develop branch.
The Docker image runs the compiler executable, so you can pass all compiler arguments to it.
The Docker image runs the compiler executable so that you can pass all compiler arguments to it.
For example, the command below pulls the stable version of the ``solc`` image (if you do not have it already),
and runs it in a new container, passing the ``--help`` argument.
@ -83,13 +83,13 @@ and runs it in a new container, passing the ``--help`` argument.
docker run ethereum/solc:stable --help
You can also specify release build versions in the tag, for example, for the 0.5.4 release.
For example, You can specify release build versions in the tag for the 0.5.4 release.
.. code-block:: bash
docker run ethereum/solc:0.5.4 --help
To use the Docker image to compile Solidity files on the host machine mount a
To use the Docker image to compile Solidity files on the host machine, mount a
local folder for input and output, and specify the contract to compile. For example.
.. code-block:: bash
@ -97,7 +97,7 @@ local folder for input and output, and specify the contract to compile. For exam
docker run -v /local/path:/sources ethereum/solc:stable -o /sources/output --abi --bin /sources/Contract.sol
You can also use the standard JSON interface (which is recommended when using the compiler with tooling).
When using this interface it is not necessary to mount any directories as long as the JSON input is
When using this interface, it is not necessary to mount any directories as long as the JSON input is
self-contained (i.e. it does not refer to any external files that would have to be
:ref:`loaded by the import callback <initial-vfs-content-standard-json-with-import-callback>`).
@ -130,13 +130,15 @@ The nightly version can be installed using these commands:
sudo apt-get install solc
Furthermore, some Linux distributions provide their own packages. These packages are not directly
maintained by us, but usually kept up-to-date by the respective package maintainers.
maintained by us but usually kept up-to-date by the respective package maintainers.
For example, Arch Linux has packages for the latest development version:
For example, Arch Linux has packages for the latest development version as AUR packages: `solidity <https://aur.archlinux.org/packages/solidity>`_
and `solidity-bin <https://aur.archlinux.org/packages/solidity-bin>`_.
.. code-block:: bash
.. note::
pacman -S solidity
Please be aware that `AUR <https://wiki.archlinux.org/title/Arch_User_Repository>`_ packages
are user-produced content and unofficial packages. Exercise caution when using them.
There is also a `snap package <https://snapcraft.io/solc>`_, however, it is **currently unmaintained**.
It is installable in all the `supported Linux distros <https://snapcraft.io/docs/core/install>`_. To
@ -212,12 +214,12 @@ out-of-the-box but it is also meant to be friendly to third-party tools:
HTTPS without any authentication, rate limiting or the need to use git.
- Content is served with correct `Content-Type` headers and lenient CORS configuration so that it
can be directly loaded by tools running in the browser.
- Binaries do not require installation or unpacking (with the exception of older Windows builds
- Binaries do not require installation or unpacking (exception for older Windows builds
bundled with necessary DLLs).
- We strive for a high level of backwards-compatibility. Files, once added, are not removed or moved
- We strive for a high level of backward-compatibility. Files, once added, are not removed or moved
without providing a symlink/redirect at the old location. They are also never modified
in place and should always match the original checksum. The only exception would be broken or
unusable files with a potential to cause more harm than good if left as is.
unusable files with the potential to cause more harm than good if left as is.
- Files are served over both HTTP and HTTPS. As long as you obtain the file list in a secure way
(via git, HTTPS, IPFS or just have it cached locally) and verify hashes of the binaries
after downloading them, you do not have to use HTTPS for the binaries themselves.
@ -228,7 +230,7 @@ that we do not rename them if the naming convention changes and we do not add bu
that were not supported at the time of release. This only happens in ``solc-bin``.
The ``solc-bin`` repository contains several top-level directories, each representing a single platform.
Each one contains a ``list.json`` file listing the available binaries. For example in
Each one includes a ``list.json`` file listing the available binaries. For example in
``emscripten-wasm32/list.json`` you will find the following information about version 0.7.4:
.. code-block:: json
@ -259,7 +261,7 @@ This means that:
- The file might in future be available on Swarm at `16c5f09109c793db99fe35f037c6092b061bd39260ee7a677c8a97f18c955ab1`_.
- You can verify the integrity of the binary by comparing its keccak256 hash to
``0x300330ecd127756b824aa13e843cb1f43c473cb22eaf3750d5fb9c99279af8c3``. The hash can be computed
on the command line using ``keccak256sum`` utility provided by `sha3sum`_ or `keccak256() function
on the command-line using ``keccak256sum`` utility provided by `sha3sum`_ or `keccak256() function
from ethereumjs-util`_ in JavaScript.
- You can also verify the integrity of the binary by comparing its sha256 hash to
``0x2b55ed5fec4d9625b6c7b3ab1abd2b7fb7dd2a9c68543bf0323db2c7e2d55af2``.
@ -310,7 +312,6 @@ This means that:
Building from Source
====================
Prerequisites - All Operating Systems
-------------------------------------
@ -319,14 +320,15 @@ The following are dependencies for all builds of Solidity:
+-----------------------------------+-------------------------------------------------------+
| Software | Notes |
+===================================+=======================================================+
| `CMake`_ (version 3.13+) | Cross-platform build file generator. |
| `CMake`_ (version 3.21.3+ on | Cross-platform build file generator. |
| Windows, 3.13+ otherwise) | |
+-----------------------------------+-------------------------------------------------------+
| `Boost`_ (version 1.77+ on | C++ libraries. |
| Windows, 1.65+ otherwise) | |
+-----------------------------------+-------------------------------------------------------+
| `Git`_ | Command-line tool for retrieving source code. |
+-----------------------------------+-------------------------------------------------------+
| `z3`_ (version 4.8+, Optional) | For use with SMT checker. |
| `z3`_ (version 4.8.16+, Optional) | For use with SMT checker. |
+-----------------------------------+-------------------------------------------------------+
| `cvc4`_ (Optional) | For use with SMT checker. |
+-----------------------------------+-------------------------------------------------------+
@ -340,7 +342,7 @@ The following are dependencies for all builds of Solidity:
.. note::
Solidity versions prior to 0.5.10 can fail to correctly link against Boost versions 1.70+.
A possible workaround is to temporarily rename ``<Boost install path>/lib/cmake/Boost-1.70.0``
prior to running the cmake command to configure solidity.
prior to running the cmake command to configure Solidity.
Starting from 0.5.10 linking against Boost 1.70+ should work without manual intervention.
@ -354,6 +356,17 @@ The following are dependencies for all builds of Solidity:
If you do this, however, please remember to pass the ``--no-smt`` option to ``scripts/tests.sh``
to skip the SMT tests.
.. note::
By default the build is performed in *pedantic mode*, which enables extra warnings and tells the
compiler to treat all warnings as errors.
This forces developers to fix warnings as they arise, so they do not accumulate "to be fixed later".
If you are only interested in creating a release build and do not intend to modify the source code
to deal with such warnings, you can pass ``-DPEDANTIC=OFF`` option to CMake to disable this mode.
Doing this is not recommended for general use but may be necessary when using a toolchain we are
not testing with or trying to build an older version with newer tools.
If you encounter such warnings, please consider
`reporting them <https://github.com/ethereum/solidity/issues/new>`_.
Minimum Compiler Versions
^^^^^^^^^^^^^^^^^^^^^^^^^
@ -367,7 +380,7 @@ Prerequisites - macOS
---------------------
For macOS builds, ensure that you have the latest version of
`Xcode installed <https://developer.apple.com/xcode/download/>`_.
`Xcode installed <https://developer.apple.com/xcode/resources/>`_.
This contains the `Clang C++ compiler <https://en.wikipedia.org/wiki/Clang>`_, the
`Xcode IDE <https://en.wikipedia.org/wiki/Xcode>`_ and other Apple development
tools that are required for building C++ applications on OS X.
@ -417,7 +430,7 @@ in Visual Studio 2019 Build Tools or Visual Studio 2019:
* C++/CLI support
.. _Visual Studio 2019: https://www.visualstudio.com/vs/
.. _Visual Studio 2019 Build Tools: https://www.visualstudio.com/downloads/#build-tools-for-visual-studio-2019
.. _Visual Studio 2019 Build Tools: https://visualstudio.microsoft.com/vs/older-downloads/#visual-studio-2019-and-other-products
We have a helper script which you can use to install all required external dependencies:
@ -437,7 +450,7 @@ To clone the source code, execute the following command:
git clone --recursive https://github.com/ethereum/solidity.git
cd solidity
If you want to help developing Solidity,
If you want to help develop Solidity,
you should fork Solidity and add your personal fork as a second remote:
.. code-block:: bash
@ -445,7 +458,7 @@ you should fork Solidity and add your personal fork as a second remote:
git remote add personal git@github.com:[username]/solidity.git
.. note::
This method will result in a prerelease build leading to e.g. a flag
This method will result in a pre-release build leading to e.g. a flag
being set in each bytecode produced by such a compiler.
If you want to re-build a released Solidity compiler, then
please use the source tarball on the github release page:
@ -515,7 +528,7 @@ If you are interested what CMake options are available run ``cmake .. -LH``.
SMT Solvers
-----------
Solidity can be built against SMT solvers and will do so by default if
they are found in the system. Each solver can be disabled by a `cmake` option.
they are found in the system. Each solver can be disabled by a ``cmake`` option.
*Note: In some cases, this can also be a potential workaround for build failures.*
@ -568,4 +581,4 @@ Example:
4. A breaking change is introduced --> version is bumped to 0.5.0.
5. The 0.5.0 release is made.
This behaviour works well with the :ref:`version pragma <version_pragma>`.
This behavior works well with the :ref:`version pragma <version_pragma>`.

View File

@ -140,8 +140,7 @@ by checking if the lowest bit is set: short (not set) and long (set).
.. note::
Handling invalidly encoded slots is currently not supported but may be added in the future.
If you are compiling via the experimental IR-based compiler pipeline, reading an invalidly encoded
slot results in a ``Panic(0x22)`` error.
If you are compiling via IR, reading an invalidly encoded slot results in a ``Panic(0x22)`` error.
JSON Output
===========
@ -154,7 +153,7 @@ the :ref:`standard JSON interface <compiler-api>`. The output is a JSON object
element has the following form:
.. code::
.. code-block:: json
{
@ -182,7 +181,7 @@ The given ``type``, in this case ``t_uint256`` represents an element in
``types``, which has the form:
.. code::
.. code-block:: json
{
"encoding": "inplace",
@ -209,7 +208,7 @@ of types), arrays have its ``base`` type, and structs list their ``members`` in
the same format as the top-level ``storage`` (see :ref:`above
<storage-layout-top-level>`).
.. note ::
.. note::
The JSON output format of a contract's storage layout is still considered experimental
and is subject to change in non-breaking releases of Solidity.
@ -233,13 +232,13 @@ value and reference types, types that are encoded packed, and nested types.
uint y;
S s;
address addr;
mapping (uint => mapping (address => bool)) map;
mapping(uint => mapping(address => bool)) map;
uint[] array;
string s1;
bytes b1;
}
.. code:: json
.. code-block:: json
{
"storage": [

View File

@ -23,9 +23,13 @@ call completely.
Currently, the parameter ``--optimize`` activates the opcode-based optimizer for the
generated bytecode and the Yul optimizer for the Yul code generated internally, for example for ABI coder v2.
One can use ``solc --ir-optimized --optimize`` to produce an
optimized experimental Yul IR for a Solidity source. Similarly, one can use ``solc --strict-assembly --optimize``
optimized Yul IR for a Solidity source. Similarly, one can use ``solc --strict-assembly --optimize``
for a stand-alone Yul mode.
.. note::
The `peephole optimizer <https://en.wikipedia.org/wiki/Peephole_optimization>`_ is always
enabled by default and can only be turned off via the :ref:`Standard JSON <compiler-api>`.
You can find more details on both optimizer modules and their optimization steps below.
Benefits of Optimizing Solidity Code
@ -277,60 +281,81 @@ The following transformation steps are the main components:
- Redundant Assign Eliminator
- Full Inliner
.. _optimizer-steps:
Optimizer Steps
---------------
This is a list of all steps the Yul-based optimizer sorted alphabetically. You can find more information
on the individual steps and their sequence below.
- :ref:`block-flattener`.
- :ref:`circular-reference-pruner`.
- :ref:`common-subexpression-eliminator`.
- :ref:`conditional-simplifier`.
- :ref:`conditional-unsimplifier`.
- :ref:`control-flow-simplifier`.
- :ref:`dead-code-eliminator`.
- :ref:`equal-store-eliminator`.
- :ref:`equivalent-function-combiner`.
- :ref:`expression-joiner`.
- :ref:`expression-simplifier`.
- :ref:`expression-splitter`.
- :ref:`for-loop-condition-into-body`.
- :ref:`for-loop-condition-out-of-body`.
- :ref:`for-loop-init-rewriter`.
- :ref:`expression-inliner`.
- :ref:`full-inliner`.
- :ref:`function-grouper`.
- :ref:`function-hoister`.
- :ref:`function-specializer`.
- :ref:`literal-rematerialiser`.
- :ref:`load-resolver`.
- :ref:`loop-invariant-code-motion`.
- :ref:`redundant-assign-eliminator`.
- :ref:`reasoning-based-simplifier`.
- :ref:`rematerialiser`.
- :ref:`SSA-reverser`.
- :ref:`SSA-transform`.
- :ref:`structural-simplifier`.
- :ref:`unused-function-parameter-pruner`.
- :ref:`unused-pruner`.
- :ref:`var-decl-initializer`.
============ ===============================
Abbreviation Full name
============ ===============================
``f`` :ref:`block-flattener`
``l`` :ref:`circular-reference-pruner`
``c`` :ref:`common-subexpression-eliminator`
``C`` :ref:`conditional-simplifier`
``U`` :ref:`conditional-unsimplifier`
``n`` :ref:`control-flow-simplifier`
``D`` :ref:`dead-code-eliminator`
``E`` :ref:`equal-store-eliminator`
``v`` :ref:`equivalent-function-combiner`
``e`` :ref:`expression-inliner`
``j`` :ref:`expression-joiner`
``s`` :ref:`expression-simplifier`
``x`` :ref:`expression-splitter`
``I`` :ref:`for-loop-condition-into-body`
``O`` :ref:`for-loop-condition-out-of-body`
``o`` :ref:`for-loop-init-rewriter`
``i`` :ref:`full-inliner`
``g`` :ref:`function-grouper`
``h`` :ref:`function-hoister`
``F`` :ref:`function-specializer`
``T`` :ref:`literal-rematerialiser`
``L`` :ref:`load-resolver`
``M`` :ref:`loop-invariant-code-motion`
``r`` :ref:`redundant-assign-eliminator`
``m`` :ref:`rematerialiser`
``V`` :ref:`SSA-reverser`
``a`` :ref:`SSA-transform`
``t`` :ref:`structural-simplifier`
``p`` :ref:`unused-function-parameter-pruner`
``S`` :ref:`unused-store-eliminator`
``u`` :ref:`unused-pruner`
``d`` :ref:`var-decl-initializer`
============ ===============================
Some steps depend on properties ensured by ``BlockFlattener``, ``FunctionGrouper``, ``ForLoopInitRewriter``.
For this reason the Yul optimizer always applies them before applying any steps supplied by the user.
Selecting Optimizations
-----------------------
By default the optimizer applies its predefined sequence of optimization steps to
the generated assembly. You can override this sequence and supply your own using
the ``--yul-optimizations`` option:
By default the optimizer applies its predefined sequence of optimization steps to the generated assembly.
You can override this sequence and supply your own using the ``--yul-optimizations`` option:
.. code-block:: bash
solc --optimize --ir-optimized --yul-optimizations 'dhfoD[xarrscLMcCTU]uljmul'
solc --optimize --ir-optimized --yul-optimizations 'dhfoD[xarrscLMcCTU]uljmul:fDnTOcmu'
The order of steps is significant and affects the quality of the output.
Moreover, applying a step may uncover new optimization opportunities for others that were already applied,
so repeating steps is often beneficial.
The sequence inside ``[...]`` will be applied multiple times in a loop until the Yul code
remains unchanged or until the maximum number of rounds (currently 12) has been reached.
Brackets (``[]``) may be used multiple times in a sequence, but can not be nested.
Available abbreviations are listed in the `Yul optimizer docs <yul.rst#optimization-step-sequence>`_.
An important thing to note, is that there are some hardcoded steps that are always run before and after the
user-supplied sequence, or the default sequence if one was not supplied by the user.
The cleanup sequence delimiter ``:`` is optional, and is used to supply a custom cleanup sequence
in order to replace the default one. If omitted, the optimizer will simply apply the default cleanup
sequence. In addition, the delimiter may be placed at the beginning of the user-supplied sequence,
which will result in the optimization sequence being empty, whereas conversely, if placed at the end of
the sequence, will be treated as an empty cleanup sequence.
Preprocessing
-------------
@ -545,7 +570,7 @@ It is not applied to loop iteration-condition, because the loop control flow doe
this "outlining" of the inner expressions in all cases. We can sidestep this limitation by applying
:ref:`for-loop-condition-into-body` to move the iteration condition into loop body.
The final program should be in a form such that (with the exception of loop conditions)
The final program should be in an *expression-split form*, where (with the exception of loop conditions)
function calls cannot appear nested inside expressions
and all function call arguments have to be variables.
@ -683,7 +708,7 @@ Conflicting values are resolved in the following way:
- "unused", "undecided" -> "undecided"
- "unused", "used" -> "used"
- "undecided, "used" -> "used"
- "undecided", "used" -> "used"
For for-loops, the condition, body and post-part are visited twice, taking
the joining control-flow at the condition into account.
@ -796,10 +821,10 @@ if the common subexpression eliminator was run right before it.
.. _expression-simplifier:
Expression Simplifier
^^^^^^^^^^^^^^^^^^^^^
ExpressionSimplifier
^^^^^^^^^^^^^^^^^^^^
The Expression Simplifier uses the Dataflow Analyzer and makes use
The ExpressionSimplifier uses the Dataflow Analyzer and makes use
of a list of equivalence transforms on expressions like ``X + 0 -> X``
to simplify the code.
@ -833,22 +858,6 @@ Works best if the code is in SSA form.
Prerequisite: Disambiguator, ForLoopInitRewriter.
.. _reasoning-based-simplifier:
ReasoningBasedSimplifier
^^^^^^^^^^^^^^^^^^^^^^^^
This optimizer uses SMT solvers to check whether ``if`` conditions are constant.
- If ``constraints AND condition`` is UNSAT, the condition is never true and the whole body can be removed.
- If ``constraints AND NOT condition`` is UNSAT, the condition is always true and can be replaced by ``1``.
The simplifications above can only be applied if the condition is movable.
It is only effective on the EVM dialect, but safe to use on other dialects.
Prerequisite: Disambiguator, SSATransform.
Statement-Scale Simplifications
-------------------------------
@ -929,7 +938,7 @@ DeadCodeEliminator
This optimization stage removes unreachable code.
Unreachable code is any code within a block which is preceded by a
leave, return, invalid, break, continue, selfdestruct or revert.
leave, return, invalid, break, continue, selfdestruct, revert or by a call to a user-defined function that recurses infinitely.
Function definitions are retained as they might be called by earlier
code and thus are considered reachable.
@ -1092,6 +1101,52 @@ The step LiteralRematerialiser is not required for correctness. It helps deal wi
``function f(x) -> y { revert(y, y} }`` where the literal ``y`` will be replaced by its value ``0``,
allowing us to rewrite the function.
.. index:: ! unused store eliminator
.. _unused-store-eliminator:
UnusedStoreEliminator
^^^^^^^^^^^^^^^^^^^^^
Optimizer component that removes redundant ``sstore`` and memory store statements.
In case of an ``sstore``, if all outgoing code paths revert (due to an explicit ``revert()``, ``invalid()``, or infinite recursion) or
lead to another ``sstore`` for which the optimizer can tell that it will overwrite the first store, the statement will be removed.
However, if there is a read operation between the initial ``sstore`` and the revert, or the overwriting ``sstore``, the statement
will not be removed.
Such read operations include: external calls, user-defined functions with any storage access, and ``sload`` of a slot that cannot be
proven to differ from the slot written by the initial ``sstore``.
For example, the following code
.. code-block:: yul
{
let c := calldataload(0)
sstore(c, 1)
if c {
sstore(c, 2)
}
sstore(c, 3)
}
will be transformed into the code below after the Unused Store Eliminator step is run
.. code-block:: yul
{
let c := calldataload(0)
if c { }
sstore(c, 3)
}
For memory store operations, things are generally simpler, at least in the outermost yul block as all such
statements will be removed if they are never read from in any code path.
At function analysis level, however, the approach is similar to ``sstore``, as we do not know whether the memory location will
be read once we leave the function's scope, so the statement will be removed only if all code paths lead to a memory overwrite.
Best run in SSA form.
Prerequisites: Disambiguator, ForLoopInitRewriter.
.. _equivalent-function-combiner:
EquivalentFunctionCombiner
@ -1137,7 +1192,7 @@ This component can only be used on sources with unique names.
FullInliner
^^^^^^^^^^^
The Full Inliner replaces certain calls of certain functions
The FullInliner replaces certain calls of certain functions
by the function's body. This is not very helpful in most cases, because
it just increases the code size but does not have a benefit. Furthermore,
code is usually very expensive and we would often rather have shorter
@ -1161,6 +1216,11 @@ we can run the optimizer on this specialized function. If it
results in heavy gains, the specialized function is kept,
otherwise the original function is used instead.
FunctionHoister and ExpressionSplitter are recommended as prerequisites since they make the step
more efficient, but are not required for correctness.
In particular, function calls with other function calls as arguments are not inlined, but running
ExpressionSplitter beforehand ensures that there are no such calls in the input.
Cleanup
-------
@ -1203,8 +1263,8 @@ This is a tiny step that helps in reversing the effects of the SSA transform
if it is combined with the Common Subexpression Eliminator and the
Unused Pruner.
The SSA form we generate is detrimental to code generation on the EVM and
WebAssembly alike because it generates many local variables. It would
The SSA form we generate is detrimental to code generation
because it produces many local variables. It would
be better to just re-use existing variables with assignments instead of
fresh variable declarations.
@ -1322,15 +1382,3 @@ into
}
The LiteralRematerialiser should be run before this step.
WebAssembly specific
--------------------
MainFunction
^^^^^^^^^^^^
Changes the topmost block to be a function with a specific name ("main") which has no
inputs nor outputs.
Depends on the Function Grouper.

View File

@ -26,7 +26,7 @@ that are not part of the original input but are referenced from the source
mappings. These source files together with their identifiers can be
obtained via ``output['contracts'][sourceName][contractName]['evm']['bytecode']['generatedSources']``.
.. note ::
.. note::
In the case of instructions that are not associated with any particular source file,
the source mapping assigns an integer identifier of ``-1``. This may happen for
bytecode sections stemming from compiler-generated inline assembly statements.

View File

@ -4,9 +4,10 @@
Cleaning Up Variables
*********************
When a value is shorter than 256 bit, in some cases the remaining bits
must be cleaned.
The Solidity compiler is designed to clean such remaining bits before any operations
Ultimately, all values in the EVM are stored in 256 bit words.
Thus, in some cases, when the type of a value has less than 256 bits,
it is necessary to clean the remaining bits.
The Solidity compiler is designed to do such cleaning before any operations
that might be adversely affected by the potential garbage in the remaining bits.
For example, before writing a value to memory, the remaining bits need
to be cleared because the memory contents can be used for computing
@ -28,25 +29,83 @@ the boolean values before they are used as the condition for
In addition to the design principle above, the Solidity compiler
cleans input data when it is loaded onto the stack.
Different types have different rules for cleaning up invalid values:
The following table describes the cleaning rules applied to different types,
where ``higher bits`` refers to the remaining bits in case the type has less than 256 bits.
+---------------+---------------+-------------------+
|Type |Valid Values |Invalid Values Mean|
+===============+===============+===================+
|enum of n |0 until n - 1 |exception |
|members | | |
+---------------+---------------+-------------------+
|bool |0 or 1 |1 |
+---------------+---------------+-------------------+
|signed integers|sign-extended |currently silently |
| |word |wraps; in the |
| | |future exceptions |
| | |will be thrown |
| | | |
| | | |
+---------------+---------------+-------------------+
|unsigned |higher bits |currently silently |
|integers |zeroed |wraps; in the |
| | |future exceptions |
| | |will be thrown |
+---------------+---------------+-------------------+
+---------------+---------------+-------------------------+
|Type |Valid Values |Cleanup of Invalid Values|
+===============+===============+=========================+
|enum of n |0 until n - 1 |throws exception |
|members | | |
+---------------+---------------+-------------------------+
|bool |0 or 1 |results in 1 |
+---------------+---------------+-------------------------+
|signed integers|higher bits |currently silently |
| |set to the |signextends to a valid |
| |sign bit |value, i.e. all higher |
| | |bits are set to the sign |
| | |bit; may throw an |
| | |exception in the future |
+---------------+---------------+-------------------------+
|unsigned |higher bits |currently silently masks |
|integers |zeroed |to a valid value, i.e. |
| | |all higher bits are set |
| | |to zero; may throw an |
| | |exception in the future |
+---------------+---------------+-------------------------+
Note that valid and invalid values are dependent on their type size.
Consider ``uint8``, the unsigned 8-bit type, which has the following valid values:
.. code-block:: none
0000...0000 0000 0000
0000...0000 0000 0001
0000...0000 0000 0010
....
0000...0000 1111 1111
Any invalid value will have the higher bits set to zero:
.. code-block:: none
0101...1101 0010 1010 invalid value
0000...0000 0010 1010 cleaned value
For ``int8``, the signed 8-bit type, the valid values are:
Negative
.. code-block:: none
1111...1111 1111 1111
1111...1111 1111 1110
....
1111...1111 1000 0000
Positive
.. code-block:: none
0000...0000 0000 0000
0000...0000 0000 0001
0000...0000 0000 0010
....
0000...0000 1111 1111
The compiler will ``signextend`` the sign bit, which is 1 for negative and 0 for
positive values, overwriting the higher bits:
Negative
.. code-block:: none
0010...1010 1111 1111 invalid value
1111...1111 1111 1111 cleaned value
Positive
.. code-block:: none
1101...0101 0000 0100 invalid value
0000...0000 0000 0100 cleaned value

View File

@ -10,7 +10,7 @@ A Simple Smart Contract
Let us begin with a basic example that sets the value of a variable and exposes
it for other contracts to access. It is fine if you do not understand
everything right now, we will go into more detail later.
everything right now, we will go into more details later.
Storage Example
===============
@ -91,7 +91,7 @@ registering with a username and password, all you need is an Ethereum keypair.
// The keyword "public" makes variables
// accessible from other contracts
address public minter;
mapping (address => uint) public balances;
mapping(address => uint) public balances;
// Events allow clients to react to specific
// contract changes you declare
@ -151,7 +151,7 @@ You do not need to do this, the compiler figures it out for you.
.. index:: mapping
The next line, ``mapping (address => uint) public balances;`` also
The next line, ``mapping(address => uint) public balances;`` also
creates a public state variable, but it is a more complex datatype.
The :ref:`mapping <mapping-types>` type maps addresses to :ref:`unsigned integers <integers>`.
@ -168,8 +168,8 @@ following:
.. code-block:: solidity
function balances(address _account) external view returns (uint) {
return balances[_account];
function balances(address account) external view returns (uint) {
return balances[account];
}
You can use this function to query the balance of a single account.
@ -185,8 +185,10 @@ arguments ``from``, ``to`` and ``amount``, which makes it possible to track
transactions.
To listen for this event, you could use the following
JavaScript code, which uses `web3.js <https://github.com/ethereum/web3.js/>`_ to create the ``Coin`` contract object,
and any user interface calls the automatically generated ``balances`` function from above::
JavaScript code, which uses `web3.js <https://github.com/web3/web3.js/>`_ to create the ``Coin`` contract object,
and any user interface calls the automatically generated ``balances`` function from above:
.. code-block:: javascript
Coin.Sent().watch({}, '', function(error, result) {
if (!error) {
@ -280,7 +282,7 @@ the source account is also not modified.
Furthermore, a transaction is always cryptographically signed by the sender (creator).
This makes it straightforward to guard access to specific modifications of the
database. In the example of the electronic currency, a simple check ensures that
only the person holding the keys to the account can transfer money from it.
only the person holding the keys to the account can transfer some compensation, e.g. Ether, from it.
.. index:: ! block
@ -298,9 +300,9 @@ and then they will be executed and distributed among all participating nodes.
If two transactions contradict each other, the one that ends up being second will
be rejected and not become part of the block.
These blocks form a linear sequence in time and that is where the word "blockchain"
derives from. Blocks are added to the chain in rather regular intervals - for
Ethereum this is roughly every 17 seconds.
These blocks form a linear sequence in time, and that is where the word "blockchain" derives from.
Blocks are added to the chain at regular intervals, although these intervals may be subject to change in the future.
For the most up-to-date information, it is recommended to monitor the network, for example, on `Etherscan <https://etherscan.io/chart/blocktime>`_.
As part of the "order selection mechanism" (which is called "mining") it may happen that
blocks are reverted from time to time, but only at the "tip" of the chain. The more
@ -396,27 +398,34 @@ returns that code when executed.
Gas
===
Upon creation, each transaction is charged with a certain amount of **gas**,
whose purpose is to limit the amount of work that is needed to execute
the transaction and to pay for this execution at the same time. While the EVM executes the
Upon creation, each transaction is charged with a certain amount of **gas**
that has to be paid for by the originator of the transaction (``tx.origin``).
While the EVM executes the
transaction, the gas is gradually depleted according to specific rules.
The **gas price** is a value set by the creator of the transaction, who
has to pay ``gas_price * gas`` up front from the sending account.
If some gas is left after the execution, it is refunded to the creator in the same way.
If the gas is used up at any point (i.e. it would be negative),
an out-of-gas exception is triggered, which reverts all modifications
an out-of-gas exception is triggered, which ends execution and reverts all modifications
made to the state in the current call frame.
This mechanism incentivizes economical use of EVM execution time
and also compensates EVM executors (i.e. miners / stakers) for their work.
Since each block has a maximum amount of gas, it also limits the amount
of work needed to validate a block.
The **gas price** is a value set by the originator of the transaction, who
has to pay ``gas_price * gas`` up front to the EVM executor.
If some gas is left after execution, it is refunded to the transaction originator.
In case of an exception that reverts changes, already used up gas is not refunded.
Since EVM executors can choose to include a transaction or not,
transaction senders cannot abuse the system by setting a low gas price.
.. index:: ! storage, ! memory, ! stack
Storage, Memory and the Stack
=============================
The Ethereum Virtual Machine has three areas where it can store data-
storage, memory and the stack, which are explained in the following
paragraphs.
The Ethereum Virtual Machine has three areas where it can store data:
storage, memory and the stack.
Each account has a data area called **storage**, which is persistent between function calls
and transactions.
@ -497,14 +506,14 @@ operations, loops should be preferred over recursive calls. Furthermore,
only 63/64th of the gas can be forwarded in a message call, which causes a
depth limit of a little less than 1000 in practice.
.. index:: delegatecall, callcode, library
.. index:: delegatecall, library
Delegatecall / Callcode and Libraries
=====================================
Delegatecall and Libraries
==========================
There exists a special variant of a message call, named **delegatecall**
which is identical to a message call apart from the fact that
the code at the target address is executed in the context of the calling
the code at the target address is executed in the context (i.e. at the address) of the calling
contract and ``msg.sender`` and ``msg.value`` do not change their values.
This means that a contract can dynamically load code from a different
@ -541,7 +550,7 @@ these **create calls** and normal message calls is that the payload data is
executed and the result stored as code and the caller / creator
receives the address of the new contract on the stack.
.. index:: selfdestruct, self-destruct, deactivate
.. index:: ! selfdestruct, deactivate
Deactivate and Self-destruct
============================
@ -553,6 +562,11 @@ is removed from the state. Removing the contract in theory sounds like a good
idea, but it is potentially dangerous, as if someone sends Ether to removed
contracts, the Ether is forever lost.
.. warning::
From version 0.8.18 and up, the use of ``selfdestruct`` in both Solidity and Yul will trigger a
deprecation warning, since the ``SELFDESTRUCT`` opcode will eventually undergo breaking changes in behavior
as stated in `EIP-6049 <https://eips.ethereum.org/EIPS/eip-6049>`_.
.. warning::
Even if a contract is removed by ``selfdestruct``, it is still part of the
history of the blockchain and probably retained by most Ethereum nodes.
@ -577,7 +591,7 @@ Precompiled Contracts
There is a small set of contract addresses that are special:
The address range between ``1`` and (including) ``8`` contains
"precompiled contracts" that can be called as any other contract
but their behaviour (and their gas consumption) is not defined
but their behavior (and their gas consumption) is not defined
by EVM code stored at that address (they do not contain code)
but instead is implemented in the EVM execution environment itself.

View File

@ -1,6 +1,8 @@
.. index: ir breaking changes
.. _ir-breaking-changes:
*********************************
Solidity IR-based Codegen Changes
*********************************
@ -13,17 +15,13 @@ The IR-based code generator was introduced with an aim to not only allow
code generation to be more transparent and auditable but also
to enable more powerful optimization passes that span across functions.
Currently, the IR-based code generator is still marked experimental,
but it supports all language features and has received a lot of testing,
so we consider it almost ready for production use.
You can enable it on the command line using ``--experimental-via-ir``
You can enable it on the command-line using ``--via-ir``
or with the option ``{"viaIR": true}`` in standard-json and we
encourage everyone to try it out!
For several reasons, there are tiny semantic differences between the old
and the IR-based code generator, mostly in areas where we would not
expect people to rely on this behaviour anyway.
expect people to rely on this behavior anyway.
This section highlights the main differences between the old and the IR-based codegen.
Semantic Only Changes
@ -32,6 +30,50 @@ Semantic Only Changes
This section lists the changes that are semantic-only, thus potentially
hiding new and different behavior in existing code.
.. _state-variable-initialization-order:
- The order of state variable initialization has changed in case of inheritance.
The order used to be:
- All state variables are zero-initialized at the beginning.
- Evaluate base constructor arguments from most derived to most base contract.
- Initialize all state variables in the whole inheritance hierarchy from most base to most derived.
- Run the constructor, if present, for all contracts in the linearized hierarchy from most base to most derived.
New order:
- All state variables are zero-initialized at the beginning.
- Evaluate base constructor arguments from most derived to most base contract.
- For every contract in order from most base to most derived in the linearized hierarchy:
1. Initialize state variables.
2. Run the constructor (if present).
This causes differences in contracts where the initial value of a state
variable relies on the result of the constructor in another contract:
.. code-block:: solidity
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.1;
contract A {
uint x;
constructor() {
x = 42;
}
function f() public view returns(uint256) {
return x;
}
}
contract B is A {
uint public y = f();
}
Previously, ``y`` would be set to 0. This is due to the fact that we would first initialize state variables: First, ``x`` is set to 0, and when initializing ``y``, ``f()`` would return 0 causing ``y`` to be 0 as well.
With the new rules, ``y`` will be set to 42. We first initialize ``x`` to 0, then call A's constructor which sets ``x`` to 42. Finally, when initializing ``y``, ``f()`` returns 42 causing ``y`` to be 42.
- When storage structs are deleted, every storage slot that contains
a member of the struct is set to zero entirely. Formerly, padding space
was left untouched.
@ -76,14 +118,14 @@ hiding new and different behavior in existing code.
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0;
contract C {
function f(uint _a) public pure mod() returns (uint _r) {
_r = _a++;
function f(uint a) public pure mod() returns (uint r) {
r = a++;
}
modifier mod() { _; _; }
}
If you execute ``f(0)`` in the old code generator, it will return ``2``, while
it will return ``1`` when using the new code generator.
If you execute ``f(0)`` in the old code generator, it will return ``1``, while
it will return ``0`` when using the new code generator.
.. code-block:: solidity
@ -114,78 +156,6 @@ hiding new and different behavior in existing code.
- New code generator: ``0`` as all parameters, including return parameters, will be re-initialized before
each ``_;`` evaluation.
- The order of contract initialization has changed in case of inheritance.
The order used to be:
- All state variables are zero-initialized at the beginning.
- Evaluate base constructor arguments from most derived to most base contract.
- Initialize all state variables in the whole inheritance hierarchy from most base to most derived.
- Run the constructor, if present, for all contracts in the linearized hierarchy from most base to most derived.
New order:
- All state variables are zero-initialized at the beginning.
- Evaluate base constructor arguments from most derived to most base contract.
- For every contract in order from most base to most derived in the linearized hierarchy execute:
1. If present at declaration, initial values are assigned to state variables.
2. Constructor, if present.
This causes differences in some contracts, for example:
.. code-block:: solidity
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.1;
contract A {
uint x;
constructor() {
x = 42;
}
function f() public view returns(uint256) {
return x;
}
}
contract B is A {
uint public y = f();
}
Previously, ``y`` would be set to 0. This is due to the fact that we would first initialize state variables: First, ``x`` is set to 0, and when initializing ``y``, ``f()`` would return 0 causing ``y`` to be 0 as well.
With the new rules, ``y`` will be set to 42. We first initialize ``x`` to 0, then call A's constructor which sets ``x`` to 42. Finally, when initializing ``y``, ``f()`` returns 42 causing ``y`` to be 42.
- Copying ``bytes`` arrays from memory to storage is implemented in a different way.
The old code generator always copies full words, while the new one cuts the byte
array after its end. The old behaviour can lead to dirty data being copied after
the end of the array (but still in the same storage slot).
This causes differences in some contracts, for example:
.. code-block:: solidity
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.1;
contract C {
bytes x;
function f() public returns (uint _r) {
bytes memory m = "tmp";
assembly {
mstore(m, 8)
mstore(add(m, 32), "deadbeef15dead")
}
x = m;
assembly {
_r := sload(x.slot)
}
}
}
Previously ``f()`` would return ``0x6465616462656566313564656164000000000000000000000000000000000010``
(it has correct length, and correct first 8 elements, but then it contains dirty data which was set via assembly).
Now it is returning ``0x6465616462656566000000000000000000000000000000000000000000000010`` (it has
correct length, and correct elements, but does not contain superfluous data).
.. index:: ! evaluation order; expression
- For the old code generator, the evaluation order of expressions is unspecified.
@ -199,15 +169,15 @@ This causes differences in some contracts, for example:
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.1;
contract C {
function preincr_u8(uint8 _a) public pure returns (uint8) {
return ++_a + _a;
function preincr_u8(uint8 a) public pure returns (uint8) {
return ++a + a;
}
}
The function ``preincr_u8(1)`` returns the following values:
- Old code generator: 3 (``1 + 2``) but the return value is unspecified in general
- New code generator: 4 (``2 + 2``) but the return value is not guaranteed
- Old code generator: ``3`` (``1 + 2``) but the return value is unspecified in general
- New code generator: ``4`` (``2 + 2``) but the return value is not guaranteed
.. index:: ! evaluation order; function arguments
@ -220,11 +190,11 @@ This causes differences in some contracts, for example:
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.1;
contract C {
function add(uint8 _a, uint8 _b) public pure returns (uint8) {
return _a + _b;
function add(uint8 a, uint8 b) public pure returns (uint8) {
return a + b;
}
function g(uint8 _a, uint8 _b) public pure returns (uint8) {
return add(++_a + ++_b, _a + _b);
function g(uint8 a, uint8 b) public pure returns (uint8) {
return add(++a + ++b, a + b);
}
}
@ -279,7 +249,7 @@ This causes differences in some contracts, for example:
}
}
The function `f()` behaves as follows:
The function ``f()`` behaves as follows:
- Old code generator: runs out of gas while zeroing the array contents after the large memory allocation
- New code generator: reverts due to free memory pointer overflow (does not run out of gas)
@ -323,13 +293,13 @@ For example:
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.1;
contract C {
function f(uint8 _a) public pure returns (uint _r1, uint _r2)
function f(uint8 a) public pure returns (uint r1, uint r2)
{
_a = ~_a;
a = ~a;
assembly {
_r1 := _a
r1 := a
}
_r2 = _a;
r2 = a;
}
}
@ -338,6 +308,6 @@ The function ``f(1)`` returns the following values:
- Old code generator: (``fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe``, ``00000000000000000000000000000000000000000000000000000000000000fe``)
- New code generator: (``00000000000000000000000000000000000000000000000000000000000000fe``, ``00000000000000000000000000000000000000000000000000000000000000fe``)
Note that, unlike the new code generator, the old code generator does not perform a cleanup after the bit-not assignment (``_a = ~_a``).
This results in different values being assigned (within the inline assembly block) to return value ``_r1`` between the old and new code generators.
However, both code generators perform a cleanup before the new value of ``_a`` is assigned to ``_r2``.
Note that, unlike the new code generator, the old code generator does not perform a cleanup after the bit-not assignment (``a = ~a``).
This results in different values being assigned (within the inline assembly block) to return value ``r1`` between the old and new code generators.
However, both code generators perform a cleanup before the new value of ``a`` is assigned to ``r2``.

View File

@ -3,8 +3,8 @@ Layout of a Solidity Source File
********************************
Source files can contain an arbitrary number of
:ref:`contract definitions<contract_structure>`, import_ directives,
:ref:`pragma directives<pragma>` and
:ref:`contract definitions<contract_structure>`, import_ ,
:ref:`pragma<pragma>` and :ref:`using for<using-for>` directives and
:ref:`struct<structs>`, :ref:`enum<enums>`, :ref:`function<functions>`, :ref:`error<errors>`
and :ref:`constant variable<constants>` definitions.
@ -56,7 +56,7 @@ you have to add the pragma to all your files if you want to enable it
in your whole project. If you :ref:`import<import>` another file, the pragma
from that file does *not* automatically apply to the importing file.
.. index:: ! pragma, version
.. index:: ! pragma;version
.. _version_pragma:
@ -91,6 +91,9 @@ these follow the same syntax used by `npm <https://docs.npmjs.com/cli/v6/using-n
required by the pragma. If it does not match, the compiler issues
an error.
.. index:: ! ABI coder, ! pragma; abicoder, pragma; ABIEncoderV2
.. _abi_coder:
ABI Coder Pragma
----------------
@ -98,12 +101,11 @@ By using ``pragma abicoder v1`` or ``pragma abicoder v2`` you can
select between the two implementations of the ABI encoder and decoder.
The new ABI coder (v2) is able to encode and decode arbitrarily nested
arrays and structs. It might produce less optimal code and has not
received as much testing as the old encoder, but is considered
non-experimental as of Solidity 0.6.0. You still have to explicitly
activate it using ``pragma abicoder v2;``. Since it will be
activated by default starting from Solidity 0.8.0, there is the option to select
the old coder using ``pragma abicoder v1;``.
arrays and structs. Apart from supporting more types, it involves more extensive
validation and safety checks, which may result in higher gas costs, but also heightened
security. It is considered
non-experimental as of Solidity 0.6.0 and it is enabled by default starting
with Solidity 0.8.0. The old ABI coder can still be selected using ``pragma abicoder v1;``.
The set of types supported by the new encoder is a strict superset of
the ones supported by the old one. Contracts that use it can interact with ones
@ -126,8 +128,7 @@ enough to make the error go away.
by using ``pragma experimental ABIEncoderV2``, but it was not possible
to explicitly select coder v1 because it was the default.
.. index:: ! pragma, experimental
.. index:: ! pragma; experimental
.. _experimental_pragma:
Experimental Pragma
@ -137,6 +138,7 @@ The second pragma is the experimental pragma. It can be used to enable
features of the compiler or language that are not yet enabled by default.
The following experimental pragmas are currently supported:
.. index:: ! pragma; ABIEncoderV2
ABIEncoderV2
~~~~~~~~~~~~
@ -145,6 +147,7 @@ Because the ABI coder v2 is not considered experimental anymore,
it can be selected via ``pragma abicoder v2`` (please see above)
since Solidity 0.7.4.
.. index:: ! pragma; SMTChecker
.. _smt_checker:
SMTChecker
@ -179,7 +182,7 @@ Syntax and Semantics
Solidity supports import statements to help modularise your code that
are similar to those available in JavaScript
(from ES6 on). However, Solidity does not support the concept of
a `default export <https://developer.mozilla.org/en-US/docs/web/javascript/reference/statements/export#Description>`_.
a `default export <https://developer.mozilla.org/en-US/docs/web/javascript/reference/statements/export#description>`_.
At a global level, you can use import statements of the following form:

View File

@ -1,27 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1300px" height="1300px"
viewBox="0 0 1300 1300" enable-background="new 0 0 1300 1300" xml:space="preserve">
<title>Vector 1</title>
<desc>Created with Sketch.</desc>
<g id="Page-1" sketch:type="MSPage">
<g id="solidity" transform="translate(402.000000, 118.000000)" sketch:type="MSLayerGroup">
<g id="Group" sketch:type="MSShapeGroup">
<path id="Shape" opacity="0.45" enable-background="new " d="M371.772,135.308L241.068,367.61H-20.158l130.614-232.302
H371.772"/>
<path id="Shape_1_" opacity="0.6" enable-background="new " d="M241.068,367.61h261.318L371.772,135.308H110.456
L241.068,367.61z"/>
<path id="Shape_2_" opacity="0.8" enable-background="new " d="M110.456,599.822L241.068,367.61L110.456,135.308
L-20.158,367.61L110.456,599.822z"/>
<path id="Shape_3_" opacity="0.45" enable-background="new " d="M111.721,948.275l130.704-232.303h261.318L373.038,948.275
H111.721"/>
<path id="Shape_4_" opacity="0.6" enable-background="new " d="M242.424,715.973H-18.893l130.613,232.303h261.317
L242.424,715.973z"/>
<path id="Shape_5_" opacity="0.8" enable-background="new " d="M373.038,483.761L242.424,715.973l130.614,232.303
l130.704-232.303L373.038,483.761z"/>
</g>
</g>
</g>
<svg width="100" height="160" viewBox="0 0 100 160" fill="#2B247C" xmlns="http://www.w3.org/2000/svg">
<path opacity="0.8" d="M50 44.3013L25 1L0 44.3013L25 87.6025L50 44.3013Z" />
<path opacity="0.45" d="M50 44.3091L75 1.00781L25 1.00781L0 44.3091H50Z" />
<path opacity="0.6" d="M75 1.00781L25 1.00781L50 44.3091H100L75 1.00781Z" />
<path opacity="0.8" d="M50 115.699L75 159L100 115.699L75 72.3975L50 115.699Z" />
<path opacity="0.45" d="M50 115.691L25 158.993H75L100 115.691L50 115.691Z" />
<path opacity="0.6" d="M25 158.993H75L50 115.691L0 115.691L25 158.993Z" />
</svg>

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 574 B

Some files were not shown because too many files have changed in this diff Show More